Skip to content

Commit 498af60

Browse files
committed
rn-20: add article about the help system
1 parent b38427f commit 498af60

File tree

1 file changed

+62
-2
lines changed

1 file changed

+62
-2
lines changed

rev_news/drafts/edition-20.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,69 @@ satisfying to see that they are the result of building on top of
125125
previous work over the years by GSoC students, mentors and reviewers.
126126

127127

128-
<!---
129128
### Support
130-
-->
129+
130+
* [Why are there multiple ways to get the manual in Git?](https://public-inbox.org/git/CAM_5GX48gDAZSvAWnxO5n8uhYf8vmfAJ88_31_ewsQxyPfF7iA@mail.gmail.com/)
131+
132+
Andrew Johnson asked on the mailing list:
133+
134+
> While reading Pro Git 2nd Ed. I came across these three methods:
135+
>
136+
> $ git help <verb>
137+
> $ git <verb> --help
138+
> $ man git-<verb>
139+
>
140+
> I tested all three to confirm they were equivalent.
141+
>
142+
> What was the motivation behind the complication, if any? I presume
143+
> most developers would not provide multiple commands that do the same
144+
> thing for absolutely no reason, so I led myself to ask this question.
145+
146+
Fredrik Gustafsson was the first to answer. He first said that the
147+
three commands are not actually equivalent on Windows as:
148+
149+
> $ man git-<verb>
150+
>
151+
> does not work and
152+
>
153+
> $ git help <verb>
154+
>
155+
> opens a webbrowser instead of a man page.
156+
157+
Philip Oakley then answered that the three different methods were
158+
added at different times for different reasons. The man methods was
159+
first added because "historically git was a set of shell scripts named
160+
git-*, so each stood alone".
161+
162+
The --help was the result from "the modern `git <cmd>' approach, with
163+
every command normally having -h and --help options for short form
164+
usage and long form man pages". Meanwhile "a `git help <cmd>` command
165+
was created" which "allowed selection of display type, so that on
166+
Unix/Linux man was the norm, while an --html (or --web) option is
167+
available for those who like the pretty browser view".
168+
169+
Your own Christian Couder chimed in saying that `git help` makes it
170+
possible to teach people one command that will do something sensible
171+
on every system, and that it also "provides more configurability and
172+
more features like its -a and -g options".
173+
174+
Jakub Narębski added that there are also help pages that are about
175+
"concepts (gitcli, gitrevisions, githooks, gitrepository-layout,
176+
gitglossary), or about files (gitignore, gitattributes, to some extent
177+
githooks)" and they are "only accessible with `git help <concept>` or,
178+
on OS with installed 'man', also `man <gitconcept>`".
179+
180+
Philip replied to the above saying that "`git revisions --help` does
181+
work", but Junio Hamano clarified things by saying that this was a bug
182+
that had been recently fixed.
183+
184+
It would indeed seem wrong to have `git <concept> --help` working, as
185+
concepts are not the same things as commands.
186+
187+
Anyway this shows that it is not so simple to design a good help
188+
system, especially one that is both full featured on different
189+
platforms and looking simple to users.
190+
131191

132192
## Releases
133193

0 commit comments

Comments
 (0)