Skip to contentSkip to conversation

Git help option to list user guides

PATCH Superseded Philip Oakley 2 participants 15 messages Jun 15, 2016 Documentation

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Git help option to list user guides

This is the much truncated (was 0/13] and updated series for noting that 'git help' can display the existing guides that are formatted as man pages, and providing a 'git help' option to list a few of the most useful guides.

The series is rebased on top of V1.8.2-rc1

Differences relative to V1 numbering
Patch 1: Use 'Git' in help messages
Dropped.
a. the 'git version' string is used in the wild for version checking, in particular Git Gui checks the string is 'git version'.
b. a recent patch series fixed on lower case messages for 'usage:', respect that.
c. many consider that the 'git' reference was to the 'git <cmd>' format rather than (the system) Git's commands.

Patch 2 (now 1/5): Show 'git help <guide>' usage, with examples Correct elipsis dots for unterminated list of examples.

Patch 2 (now 2/5): Help.c use OPT_COUNTUP
Unchanged.

Patch 4 (now 3/5): Help.c add --guide option Update commit message to explain the -g|--guide logic.

Patch 5 (now 4/5): Help.c: add list_common_guides_help() function Removed the 'build artefact' /* */ comment line.
Note that these are just the common guides and used in a usage message. The data was generated by a script variant of generate-cmdlist.sh

Patch (new 5/5): Help doc: Include --guide option description Update the documentation/git-help.txt - I had been caught out by the same 'focus on the code' mistake made by many and forgot the documenation ;-)

Patch 6 - 13:
All dropped.
Drop the separate guide list.txt and extraction script, which was copied from the common command list and script. If the guide usage list is useful, extend the command-list.txt and generate-cmdlist.sh at a later date.

Drop the rename of user-manual and everyday because they are not formatted as manuals. They can't be started by help's call to 'man' (and possibly other paths) anyway.

Philip Oakley (5):
Show 'git help <guide>' usage, with examples
Help.c use OPT_COUNTUP
Help.c add --guide option
Help.c: add list_common_guides_help() function
Help doc: Include --guide option description

 Documentation/git-help.txt | 28 +++++++++++++++++++++-------
 builtin/help.c             | 11 ++++++++---
 common-guides.h            | 11 +++++++++++
 git.c                      |  4 +++-
 help.c                     | 18 ++++++++++++++++++
 help.h                     |  1 +
 6 files changed, 62 insertions(+), 11 deletions(-)
 create mode 100644 common-guides.h
Signature · 1 line
1.8.1.msysgit.1
#1 lore raw

PATCH v2 1/5 Show 'git help <guide>' usage, with examples

The git(1) man page must be accessed via 'git help git' on Git for Windows as it has no 'man' command. And it prompts users to read the git(1) page, rather than hoping they follow a subsidiary link within another documentation page. The 'tutorial' is an obvious guide to suggest.

---
 git.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
git.c +3 -1
index b10c18b..d9b71c1 100644
@@ -13,7 +13,9 @@ const char git_usage_string[] =
 	"           <command> [<args>]";
 
 const char git_more_info_string[] =
-	N_("See 'git help <command>' for more information on a specific command.");
+	N_("See 'git help <command>' for more information on a specific command.\n"
+	   "While 'git help <guide>', will show the selected Git concept guide.\n"
+	   "Examples: 'git help git', 'git help branch', 'git help tutorial'...");
 
 static struct startup_info git_startup_info;
 static int use_pager = -1;
Signature · 1 line
1.8.1.msysgit.1
#2 lore raw

Re: [PATCH v2 1/5] Show 'git help <guide>' usage, with examples

Quoted 15 lines · Philip Oakley

The git(1) man page must be accessed via 'git help git' on Git for Windows as it has no 'man' command. And it prompts users to read the git(1) page, rather than hoping they follow a subsidiary link within another documentation page. The 'tutorial' is an obvious guide to suggest.

---
 git.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
git.c +0 -0
index b10c18b..d9b71c1 100644

git.c const char git_usage_string[] = · line 18

Quoted 7 lines
git.c +3 -1
@@ -13,7 +13,9 @@ const char git_usage_string[] =
 	"           <command> [<args>]";
 
 const char git_more_info_string[] =
-	N_("See 'git help <command>' for more information on a specific command.");
+	N_("See 'git help <command>' for more information on a specific command.\n"
+	   "While 'git help <guide>', will show the selected Git concept guide.\n"
+	   "Examples: 'git help git', 'git help branch', 'git help tutorial'...");

While I think it is a good idea to mention that the argument to "help" does not have to be the name of a subcommand, I have two issues with this patch.

* A free-standing "While" looks strange. I would expect a sentence that begins with "While 'git help <guide>' shows X" to end with something negative like "it is not recommended". Perhaps it is just me.

* It took me two readings to realize that "selected" in "selected Git concept guide" refers to "what the user chose to see by naming the <guide>". It looked as if the command will give users only a selected few among 47 available ones, chosen by the implementors.

How about doing it this way if you are adding two lines anyway?

'git help -a' and 'git help -g' lists available subcommands and concept guides. See 'git help <command>' or 'git help <concept>' to read about a specific subcommand or concept.

Replacing "Examples:" that has to stay incomplete for brevity with the way to get the list of subcommands and concepts would a better approach, I think. Teach them how to fish, instead of giving them fish.

#3 lore raw

PATCH v2 2/5 Help.c use OPT_COUNTUP

In reply to Philip Oakley

rename deprecated option in preparation for 'git help --guides'.

---
 builtin/help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/help.c +1 -1
index d1d7181..d10cbed 100644
@@ -39,7 +39,7 @@ static int show_all = 0;
 static unsigned int colopts;
 static enum help_format help_format = HELP_FORMAT_NONE;
 static struct option builtin_help_options[] = {
-	OPT_BOOLEAN('a', "all", &show_all, N_("print all available commands")),
+	OPT_COUNTUP('a', "all", &show_all, N_("print all available commands")),
 	OPT_SET_INT('m', "man", &help_format, N_("show man page"), HELP_FORMAT_MAN),
 	OPT_SET_INT('w', "web", &help_format, N_("show manual in web browser"),
 			HELP_FORMAT_WEB),
Signature · 1 line
1.8.1.msysgit.1
#4 lore raw

Re: [PATCH v2 2/5] Help.c use OPT_COUNTUP

Quoted 1 line · Philip Oakley

rename deprecated option in preparation for 'git help --guides'.

s/rename/Rename/;

Quoted 3 lines

---

Hrm, I do not recall anybody ever declared that "--all" is deprecated.

I do not think we want --all and --all --all to be different, and we certainly do not want --all --no-all to be not-all, so I cannot tell what you want to achieve with this change at all, either from the patch or the proposed log message.

Quoted 16 lines
 builtin/help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/help.c +1 -1
index d1d7181..d10cbed 100644
@@ -39,7 +39,7 @@ static int show_all = 0;
 static unsigned int colopts;
 static enum help_format help_format = HELP_FORMAT_NONE;
 static struct option builtin_help_options[] = {
-	OPT_BOOLEAN('a', "all", &show_all, N_("print all available commands")),
+	OPT_COUNTUP('a', "all", &show_all, N_("print all available commands")),
 	OPT_SET_INT('m', "man", &help_format, N_("show man page"), HELP_FORMAT_MAN),
 	OPT_SET_INT('w', "web", &help_format, N_("show manual in web browser"),
 			HELP_FORMAT_WEB),
#5 lore raw

Re: [PATCH v2 2/5] Help.c use OPT_COUNTUP

[Sorry if the resend with Cc: crossed over]
From: "Junio C Hamano" <[email protected]>
Sent: Sunday, March 03, 2013 11:38 PM
Subject: Re: [PATCH v2 2/5] Help.c use OPT_COUNTUP

Quoted 5 lines
Quoted 1 line · Philip Oakley

rename deprecated option in preparation for 'git help --guides'.

s/rename/Rename/;

OK.

Quoted 6 lines
Quoted 4 lines

---

Hrm, I do not recall anybody ever declared that "--all" is deprecated.

No, it was the use OPT_COUNTUP rather than OPT_BOOLEAN that the 'deprecated' was refering to. Maybe be I should have extended what option was being refered to.

Quoted 26 lines

I do not think we want --all and --all --all to be different, and we certainly do not want --all --no-all to be not-all, so I cannot tell what you want to achieve with this change at all, either from the patch or the proposed log message.

Quoted 20 lines
 builtin/help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/help.c +1 -1
index d1d7181..d10cbed 100644
@@ -39,7 +39,7 @@ static int show_all = 0;
 static unsigned int colopts;
 static enum help_format help_format = HELP_FORMAT_NONE;
 static struct option builtin_help_options[] = {
- OPT_BOOLEAN('a', "all", &show_all, N_("print all available 
 commands")),
+ OPT_COUNTUP('a', "all", &show_all, N_("print all available 
 commands")),
 OPT_SET_INT('m', "man", &help_format, N_("show man page"), 

HELP_FORMAT_MAN),
OPT_SET_INT('w', "web", &help_format, N_("show manual in web
browser"),
HELP_FORMAT_WEB),

#6 lore raw

Re: [PATCH v2 2/5] Help.c use OPT_COUNTUP

Quoted 4 lines · Philip Oakley
Quoted 1 line

Hrm, I do not recall anybody ever declared that "--all" is deprecated.

No, it was the use OPT_COUNTUP rather than OPT_BOOLEAN that the deprecated' was refering to.

Oh, no OPT_BOOLEAN was deprecated because too many people rightfully thought it was about 0/1 choice and got burned by its count-up behaviour. When you want to count-up, OPT_COUNTUP is the right thing to do and replacing deprecated BOOLEAN with it is a correct thing to do. But for this optoin, I do not think you want to count up in the first place. You want a 0/1 choice, which is written as OPT_BOOL these days.

#7 lore raw

Re: [PATCH v2 2/5] Help.c use OPT_COUNTUP

From: "Junio C Hamano" <[email protected]>
Sent: Monday, March 04, 2013 12:05 AM

Quoted 7 lines
Quoted 4 lines · Philip Oakley
Quoted 1 line

Hrm, I do not recall anybody ever declared that "--all" is deprecated.

No, it was the use OPT_COUNTUP rather than OPT_BOOLEAN that the deprecated' was refering to.

Quoted 7 lines

Oh, no OPT_BOOLEAN was deprecated because too many people rightfully thought it was about 0/1 choice and got burned by its count-up behaviour. When you want to count-up, OPT_COUNTUP is the right thing to do and replacing deprecated BOOLEAN with it is a correct thing to do. But for this optoin, I do not think you want to count up in the first place. You want a 0/1 choice, which is written as OPT_BOOL these days.

Ah, I missed that.

Though, for the longer term --guides usage, I'd envisaged that having it a second time could be used to invoke some extra search code that would list all guides, rather than just the short list of common guides. But I'm not sure how best to determine what are valid guides, including Msysgit/Git4Windows which only uses the html versions (no man command), so I'll use OPT_BOOL initially.

Philip

#8 lore raw

PATCH v2 3/5 Help.c add --guide option

In reply to Philip Oakley

Logic, but no actions, included.

The --all commands option, if given, will display first. The --guide option's list will then be displayed.

The common commands list is only displayed if neither option, nor a command or guide name, is given.

---
 builtin/help.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
builtin/help.c +6 -2
index d10cbed..6089d72 100644
@@ -36,10 +36,12 @@ enum help_format {
 static const char *html_path;
 
 static int show_all = 0;
+static int show_guides = 0;
 static unsigned int colopts;
 static enum help_format help_format = HELP_FORMAT_NONE;
 static struct option builtin_help_options[] = {
 	OPT_COUNTUP('a', "all", &show_all, N_("print all available commands")),
+	OPT_COUNTUP('g', "guides", &show_guides, N_("print list of useful guides")),
 	OPT_SET_INT('m', "man", &help_format, N_("show man page"), HELP_FORMAT_MAN),
 	OPT_SET_INT('w', "web", &help_format, N_("show manual in web browser"),
 			HELP_FORMAT_WEB),
@@ -49,7 +51,7 @@ static struct option builtin_help_options[] = {
 };
 
 static const char * const builtin_help_usage[] = {
-	N_("git help [--all] [--man|--web|--info] [command]"),
+	N_("git help [--all] [--guides] [--man|--web|--info] [command]"),
 	NULL
 };
 
@@ -429,9 +431,11 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 		printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
 		list_commands(colopts, &main_cmds, &other_cmds);
 		printf("%s\n", _(git_more_info_string));
+		if (!show_guides) return 0;
+	}
+	if (show_guides) {
 		return 0;
 	}
-
 	if (!argv[0]) {
 		printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
 		list_common_cmds_help();
Signature · 1 line
1.8.1.msysgit.1
#9 lore raw

Re: [PATCH v2 3/5] Help.c add --guide option

Quoted 1 line · Philip Oakley

Logic, but no actions, included.

I am not sure what you mean. Is that to break "bisect"?

Ahh, you meant "command line is parsed but we do not actually show guides yet, which is done by later patches in this series". OK.

Quoted 38 lines

The --all commands option, if given, will display first. The --guide option's list will then be displayed.

The common commands list is only displayed if neither option, nor a command or guide name, is given.

---
 builtin/help.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
builtin/help.c +3 -1
index d10cbed..6089d72 100644
@@ -36,10 +36,12 @@ enum help_format {
 static const char *html_path;
 
 static int show_all = 0;
+static int show_guides = 0;
 static unsigned int colopts;
 static enum help_format help_format = HELP_FORMAT_NONE;
 static struct option builtin_help_options[] = {
 	OPT_COUNTUP('a', "all", &show_all, N_("print all available commands")),
+	OPT_COUNTUP('g', "guides", &show_guides, N_("print list of useful guides")),
 	OPT_SET_INT('m', "man", &help_format, N_("show man page"), HELP_FORMAT_MAN),
 	OPT_SET_INT('w', "web", &help_format, N_("show manual in web browser"),
 			HELP_FORMAT_WEB),
@@ -49,7 +51,7 @@ static struct option builtin_help_options[] = {
 };
 
 static const char * const builtin_help_usage[] = {
-	N_("git help [--all] [--man|--web|--info] [command]"),
+	N_("git help [--all] [--guides] [--man|--web|--info] [command]"),
 	NULL
 };
 

builtin/help.c int cmd_help(int argc, const char **argv, const char *prefix) · line 434

Quoted 9 lines
builtin/help.c +3 -1
@@ -429,9 +431,11 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 		printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
 		list_commands(colopts, &main_cmds, &other_cmds);
 		printf("%s\n", _(git_more_info_string));
+		if (!show_guides) return 0;
+	}
+	if (show_guides) {
 		return 0;
 	}
-

Ugly.

	if (show_all) {
        	... do not touch anything here ...
		... but remove "return 0;" ...
	}

	if (show_guides) {
        	... show guides but do not "return 0" ...
	}

	if (show_all || show_guides) {
		... we were asked to do either/or --all/--guides ...
                ... and have done what we were asked to do ...
		return 0;
	}

This is a tangent, but before all of the above, cmd_help() should verify that it got no arguments (when show_all/show_guides is in effect) or it got one argument (otherwise), I think.

Quoted 3 lines
builtin/help.c +0 -0
 	if (!argv[0]) {
 		printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
 		list_common_cmds_help();
#10 lore raw

Re: [PATCH v2 3/5] Help.c add --guide option

From: "Junio C Hamano" <[email protected]>
Sent: Sunday, March 03, 2013 11:38 PM

Quoted 8 lines
Quoted 1 line · Philip Oakley

Logic, but no actions, included.

I am not sure what you mean. Is that to break "bisect"?

Ahh, you meant "command line is parsed but we do not actually show guides yet, which is done by later patches in this series". OK.

True. I can add to the commit message.

Quoted 42 lines
Quoted 42 lines

The --all commands option, if given, will display first. The --guide option's list will then be displayed.

The common commands list is only displayed if neither option, nor a command or guide name, is given.

---
 builtin/help.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
builtin/help.c +2 -0
index d10cbed..6089d72 100644
@@ -36,10 +36,12 @@ enum help_format {
 static const char *html_path;
 
 static int show_all = 0;
+static int show_guides = 0;
 static unsigned int colopts;
 static enum help_format help_format = HELP_FORMAT_NONE;
 static struct option builtin_help_options[] = {
 OPT_COUNTUP('a', "all", &show_all, N_("print all available 
 commands")),
+ OPT_COUNTUP('g', "guides", &show_guides, N_("print list of useful 
 guides")),
 OPT_SET_INT('m', "man", &help_format, N_("show man page"), 

HELP_FORMAT_MAN),
OPT_SET_INT('w', "web", &help_format, N_("show manual in web
browser"),
HELP_FORMAT_WEB),

builtin/help.c +1 -1
@@ -49,7 +51,7 @@ static struct option builtin_help_options[] = {
 };
 
 static const char * const builtin_help_usage[] = {
- N_("git help [--all] [--man|--web|--info] [command]"),
+ N_("git help [--all] [--guides] [--man|--web|--info] [command]"),
 NULL
 };
 
Quoted 13 lines

builtin/help.c int cmd_help(int argc, const char **argv, const · line 435

Quoted 11 lines
builtin/help.c +3 -1
@@ -429,9 +431,11 @@ int cmd_help(int argc, const char **argv, const 
 char *prefix)
 printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
 list_commands(colopts, &main_cmds, &other_cmds);
 printf("%s\n", _(git_more_info_string));
+ if (!show_guides) return 0;
+ }
+ if (show_guides) {
 return 0;
 }
-

Ugly.

I was trying to minimise the apparent changes, but like you say...

Quoted 10 lines

if (show_all) {
... do not touch anything here ...
... but remove "return 0;" ...
}

if (show_guides) {
... show guides but do not "return 0" ...
}

Quoted 5 lines

if (show_all || show_guides) {
... we were asked to do either/or --all/--guides ...
... and have done what we were asked to do ...
return 0;
}

Neater.

Quoted 8 lines

This is a tangent, but before all of the above, cmd_help() should verify that it got no arguments (when show_all/show_guides is in effect) or it got one argument (otherwise), I think.

Quoted 3 lines
builtin/help.c +0 -0
 if (!argv[0]) {
 printf(_("usage: %s%s"), _(git_usage_string), "\n\n");

list_common_cmds_help();

Seems reasonable. Should that be a separate preparatory patch (likely), or joined in with the rest?

Philip

#11 lore raw

PATCH v2 4/5 Help.c: add list_common_guides_help() function

In reply to Philip Oakley

Re-use list_common_cmds_help but simply change the array name. Candidate for future refactoring to pass a pointer to the array.

The common-guides.h list was generated with a simple variant of the generate-cmdlist.sh and command-list.txt.

Do not list User-manual and Everday Git which not follow the naming convention, nor gitrepository-layout which doesn't fit within the name field size.

---
 builtin/help.c  |  1 +
 common-guides.h | 11 +++++++++++
 help.c          | 18 ++++++++++++++++++
 help.h          |  1 +
 4 files changed, 31 insertions(+)
 create mode 100644 common-guides.h
builtin/help.c +1 -0
index 6089d72..e21ffa5 100644
@@ -434,6 +434,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 		if (!show_guides) return 0;
 	}
 	if (show_guides) {
+		list_common_guides_help();
 		return 0;
 	}
 	if (!argv[0]) {
common-guides.h new file +11 -0
new file mode 100644
index 0000000..0e94fdc
@@ -0,0 +1,11 @@
+/* re-use struct cmdname_help in common-commands.h */
+
+static struct cmdname_help common_guides[] = {
+  {"attributes", "defining attributes per path"},
+  {"glossary", "A GIT Glossary"},
+  {"ignore", "Specifies intentionally untracked files to ignore"},
+  {"modules", "defining submodule properties"},
+  {"revisions", "specifying revisions and ranges for git"},
+  {"tutorial", "A tutorial introduction to git (for version 1.5.1 or newer)"},
+  {"workflows", "An overview of recommended workflows with git"},
+};
help.c +18 -0
index 1dfa0b0..f4de407 100644
@@ -4,6 +4,7 @@
 #include "levenshtein.h"
 #include "help.h"
 #include "common-cmds.h"
+#include "common-guides.h"
 #include "string-list.h"
 #include "column.h"
 #include "version.h"
@@ -240,6 +241,23 @@ void list_common_cmds_help(void)
 	}
 }
 
+void list_common_guides_help(void)
+{
+	int i, longest = 0;
+
+	for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
+		if (longest < strlen(common_guides[i].name))
+			longest = strlen(common_guides[i].name);
+	}
+
+	puts(_("The common Git guides are:"));
+	for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
+		printf("   %s   ", common_guides[i].name);
+		mput_char(' ', longest - strlen(common_guides[i].name));
+		puts(_(common_guides[i].help));
+	}
+}
+
 int is_in_cmdlist(struct cmdnames *c, const char *s)
 {
 	int i;
help.h +1 -0
index 0ae5a12..4ae1fd7 100644
@@ -17,6 +17,7 @@ static inline void mput_char(char c, unsigned int num)
 }
 
 extern void list_common_cmds_help(void);
+extern void list_common_guides_help(void);
 extern const char *help_unknown_cmd(const char *cmd);
 extern void load_command_list(const char *prefix,
 			      struct cmdnames *main_cmds,
Signature · 1 line
1.8.1.msysgit.1
#12 lore raw

PATCH v2 5/5 Help doc: Include --guide option description

In reply to Philip Oakley

Note that the ability to display an individual guide was always possible. Include this in the update.

Also tell readers how git(1) can be accessed, especially for Git for Windows users who do not have the 'man' command. Likewise include a commentary on how to access this page (Catch 22).

---
 Documentation/git-help.txt | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
Documentation/git-help.txt +21 -7
index e07b6dc..498a94e 100644
@@ -8,31 +8,45 @@ git-help - Display help information about Git
 SYNOPSIS
 --------
 [verse]
-'git help' [-a|--all|-i|--info|-m|--man|-w|--web] [COMMAND]
+'git help' [-a|--all] [-g|--guide]
+	   [-i|--info|-m|--man|-w|--web] [COMMAND|GUIDE]
 
 DESCRIPTION
 -----------
 
-With no options and no COMMAND given, the synopsis of the 'git'
+With no options and no COMMAND|GUIDE given, the synopsis of the 'git'
 command and a list of the most commonly used Git commands are printed
 on the standard output.
 
 If the option '--all' or '-a' is given, then all available commands are
 printed on the standard output.
 
-If a Git subcommand is named, a manual page for that subcommand is brought
-up. The 'man' program is used by default for this purpose, but this
-can be overridden by other options or configuration variables.
+If the option '--guide' or '-g' is given then, a list of the useful
+Git guides is also printed on the standard output.
 
-Note that `git --help ...` is identical to `git help ...` because the
+If a Git subcommand, or a Git guide, is given, a manual page for that
+subcommand is brought up. The 'man' program is used by default for this
+purpose, but this can be overridden by other options or configuration
+variables.
+
+Note that 'git --help ...' is identical to 'git help ...' because the
 former is internally converted into the latter.
 
+To display the linkgit:git[1] man page use 'git help git'.
+
+This page can be displayed with 'git help help' or 'git help --help'
+
 OPTIONS
 -------
 -a::
 --all::
 	Prints all the available commands on the standard output. This
-	option supersedes any other option.
+	option overides any given command or guide name.
+
+-g::
+--guides::
+	Prints a list of useful guides on the standard output. This
+	option overides any given command or guide name.
 
 -i::
 --info::
Signature · 1 line
1.8.1.msysgit.1
#13 lore raw

Re: [PATCH v2 5/5] Help doc: Include --guide option description

Quoted 19 lines · Philip Oakley

Note that the ability to display an individual guide was always possible. Include this in the update.

Also tell readers how git(1) can be accessed, especially for Git for Windows users who do not have the 'man' command. Likewise include a commentary on how to access this page (Catch 22).

---
 Documentation/git-help.txt | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
Documentation/git-help.txt +0 -0
index e07b6dc..498a94e 100644
@@ -8,31 +8,45 @@ git-help - Display help information about Git
 SYNOPSIS
 --------

Documentation/git-help.txt git-help - Display help information about Git · line 17

Quoted 10 lines
Documentation/git-help.txt +3 -2
 [verse]
-'git help' [-a|--all|-i|--info|-m|--man|-w|--web] [COMMAND]
+'git help' [-a|--all] [-g|--guide]
+	   [-i|--info|-m|--man|-w|--web] [COMMAND|GUIDE]
 
 DESCRIPTION
 -----------
 
-With no options and no COMMAND given, the synopsis of the 'git'
+With no options and no COMMAND|GUIDE given, the synopsis of the 'git'

Please avoid BNF in the prose meant for human consumption unless necessary. I think you can just say " or " here.

Documentation/git-help.txt git-help - Display help information about Git · line 25

Quoted 11 lines
Documentation/git-help.txt +2 -3
 command and a list of the most commonly used Git commands are printed
 on the standard output.
 
 If the option '--all' or '-a' is given, then all available commands are
 printed on the standard output.
 
-If a Git subcommand is named, a manual page for that subcommand is brought
-up. The 'man' program is used by default for this purpose, but this
-can be overridden by other options or configuration variables.
+If the option '--guide' or '-g' is given then, a list of the useful
+Git guides is also printed on the standard output.

s/given then,/given, then/ or just s/ then// make it easier to follow? I personally would vote for doing s/given, then/given, / for the previous paragraph on "--all" as well.

Documentation/git-help.txt git-help - Display help information about Git · line 27

Quoted 2 lines
Documentation/git-help.txt +1 -1
-Note that `git --help ...` is identical to `git help ...` because the
+If a Git subcommand, or a Git guide, is given, a manual page for that

"If the name of a command or a guide is given" without "Git/git" would be much easier to read, especially when the first paragraph talks about "COMMAND or GUIDE". I also think s/command/subcommand/ in the synopsis and in the first paragraph may be good for consistency with this part.

Documentation/git-help.txt git-help - Display help information about Git · line 35

Quoted 8 lines
Documentation/git-help.txt +6 -0
+subcommand is brought up. The 'man' program is used by default for this
+purpose, but this can be overridden by other options or configuration
+variables.
+
+Note that 'git --help ...' is identical to 'git help ...' because the
 former is internally converted into the latter.
 
+To display the linkgit:git[1] man page use 'git help git'.

s/man page use/man page, use/;

Quoted 5 lines
Documentation/git-help.txt +3 -0
+
+This page can be displayed with 'git help help' or 'git help --help'
+
 OPTIONS
 -------

Documentation/git-help.txt git-help - Display help information about Git · line 49

Quoted 10 lines
Documentation/git-help.txt +6 -1
 -a::
 --all::
 	Prints all the available commands on the standard output. This
-	option supersedes any other option.
+	option overides any given command or guide name.
+
+-g::
+--guides::
+	Prints a list of useful guides on the standard output. This
+	option overides any given command or guide name.

Thanks. Overall this round looks a lot more manageable than the previous one.

#14 lore raw

Re: [PATCH v2 5/5] Help doc: Include --guide option description

From: "Junio C Hamano" <[email protected]>
Sent: Sunday, March 03, 2013 11:39 PM

Quoted 29 lines
Quoted 27 lines · Philip Oakley

Note that the ability to display an individual guide was always possible. Include this in the update.

Also tell readers how git(1) can be accessed, especially for Git for Windows users who do not have the 'man' command. Likewise include a commentary on how to access this page (Catch 22).

---
 Documentation/git-help.txt | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
Documentation/git-help.txt +2 -1
index e07b6dc..498a94e 100644
@@ -8,31 +8,45 @@ git-help - Display help information about Git
 SYNOPSIS
 --------
 [verse]
-'git help' [-a|--all|-i|--info|-m|--man|-w|--web] [COMMAND]
+'git help' [-a|--all] [-g|--guide]
+    [-i|--info|-m|--man|-w|--web] [COMMAND|GUIDE]
 
 DESCRIPTION
 -----------
 
Quoted 6 lines
Quoted 3 lines
Documentation/git-help.txt +1 -1
-With no options and no COMMAND given, the synopsis of the 'git'
+With no options and no COMMAND|GUIDE given, the synopsis of the 

'git'

Please avoid BNF in the prose meant for human consumption unless necessary. I think you can just say " or " here.

OK

Quoted 9 lines
Quoted 9 lines

command and a list of the most commonly used Git commands are
printed
on the standard output.

If the option '--all' or '-a' is given, then all available commands
are
printed on the standard output.

Quoted 10 lines

Documentation/git-help.txt git-help - Display help information about Git · line 25

Quoted 6 lines

-If a Git subcommand is named, a manual page for that subcommand is brought

Documentation/git-help.txt +2 -2
-up. The 'man' program is used by default for this purpose, but this
-can be overridden by other options or configuration variables.
+If the option '--guide' or '-g' is given then, a list of the useful
+Git guides is also printed on the standard output.

s/given then,/given, then/ or just s/ then// make it easier to follow? I personally would vote for doing s/given, then/given, / for the previous paragraph on "--all" as well.

Agreed.

Quoted 11 lines
Quoted 5 lines

-Note that git --help ... is identical to git help ... because the
+If a Git subcommand, or a Git guide, is given, a manual page for that

"If the name of a command or a guide is given" without "Git/git" would be much easier to read, especially when the first paragraph talks about "COMMAND or GUIDE". I also think s/command/subcommand/ in the synopsis and in the first paragraph may be good for consistency with this part.

OK

Quoted 11 lines
Quoted 11 lines

+subcommand is brought up. The 'man' program is used by default for this
+purpose, but this can be overridden by other options or configuration

Documentation/git-help.txt +3 -0
+variables.
+
+Note that 'git --help ...' is identical to 'git help ...' because 

the
former is internally converted into the latter.

Quoted 3 lines
Quoted 1 line

+To display the linkgit:git[1] man page use 'git help git'.

s/man page use/man page, use/;

Yes.

Quoted 11 lines
Quoted 11 lines
Documentation/git-help.txt +4 -1
+
+This page can be displayed with 'git help help' or 'git help --help'
+
 OPTIONS
 -------
 -a::
 --all::
 Prints all the available commands on the standard output. This
- option supersedes any other option.
+ option overides any given command or guide name.
Quoted 9 lines
Quoted 5 lines

+

+-g::
+--guides::

+ Prints a list of useful guides on the standard output. This
+ option overides any given command or guide name.

Thanks. Overall this round looks a lot more manageable than the previous one.

Thanks. It'll be a few days (or maybe more) for the update.

[My Linux laptop (for checking everything) was just pressed into service for my son's university studies while his regular one is in repair]

Philip