{"thread":{"id":"53969","subject":"[PATCH 0/3] [RFC] List all guides in git(1)","startedAt":"2020-08-02T15:20:54Z","lastAt":"2020-08-05T01:19:27Z","messageCount":18,"participants":["Philippe Blain via GitGitGadget","Junio C Hamano","Philippe Blain","Junio C Hamano via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"402654","messageId":"pull.691.git.1596381647.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":null,"subject":"[PATCH 0/3] [RFC] List all guides in git(1)","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-02T15:20:44Z","receivedAt":"2020-08-02T15:20:54Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"This series adds a list of the guides to git(1).\n\nThe first commit adds the misssing guides 'gitcredentials' and\n'gitremote-helpers' to command-list.txt. The only missing guide after this\nchange is 'gitweb.conf', but I think this one is obscure anough, and already\nlinked to in 'gitweb.txt', that it does not matter much.\n\nThe second commit drops the usage of 'common' and 'useful' for guides. This\nwas suggested as one of two ways forward by Duy in [1] but was not commented\non. I'm CC'ing the people that were CC'ed on that message.\n\nThe third commit tweaks 'Documentation/cmd-list.perl' so that it also\ngenerates a list of the guides, which gets included in 'git.txt'. I chose to\nput this list just after the end of the list of commands.\n\n[1] \nhttps://lore.kernel.org/git/CACsJy8ADj-bTMYDHxRNLOMppOEdPbVwL49u3XCfNBCmoLLZo+A@mail.gmail.com/\n\nPhilippe Blain (3):\n  command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'\n  help: drop usage of 'common' and 'useful' for guides\n  git.txt: add list of guides\n\n Documentation/Makefile           |  1 +\n Documentation/cmd-list.perl      | 10 ++++++++--\n Documentation/git-help.txt       |  6 +++---\n Documentation/git.txt            |  7 +++++++\n Documentation/gitcredentials.txt |  2 +-\n builtin/help.c                   |  2 +-\n command-list.txt                 |  2 ++\n help.c                           |  4 ++--\n help.h                           |  2 +-\n 9 files changed, 26 insertions(+), 10 deletions(-)\n\n\nbase-commit: e8ab941b671da6890181aea5b5755d1d9eea24ec\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-691%2Fphil-blain%2Flist-guides-in-git.1-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-691/phil-blain/list-guides-in-git.1-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/691\n-- \ngitgitgadget\n"},{"id":"402655","messageId":"2bd473e0aa963c6e883a6fcaf01f3137c5e6a2e8.1596381647.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.git.1596381647.gitgitgadget@gmail.com","subject":"[PATCH 1/3] command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-02T15:20:45Z","receivedAt":"2020-08-02T15:20:54Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nThe guides 'gitcredentials' and 'gitremote-helpers' do not currently\nappear in command-list.txt.\n\n'gitcredentials' was forgotten back when guides were added to\ncommand-list.txt in 1b81d8cb19 (help: use command-list.txt for the\nsource of guides, 2018-05-20).\n\n'gitremote-helpers' was moved to section 7 in 439cc74632 (docs: move\ngitremote-helpers into section 7, 2019-03-25), but command-list.txt was\nnot updated at the time.\n\nAdd these two guides to the list of guides in 'command-list.txt', so\nthat they appear in the output of 'git help --guides', and capitalize\nthe first word of the description of 'gitcredentials', as was done in\n1b81d8c (help: use command-list.txt for the source of guides,\n2018-05-20) for the other guides.\n\nWhile at it, add a comment in Documentation/Makefile to remind developers\nto update command-list.txt if they add a new guide.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/Makefile           | 1 +\n Documentation/gitcredentials.txt | 2 +-\n command-list.txt                 | 2 ++\n 3 files changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex ecd0b340b1..39f6fc8de7 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -17,6 +17,7 @@ MAN1_TXT += git.txt\n MAN1_TXT += gitk.txt\n MAN1_TXT += gitweb.txt\n \n+# man5 / man7 guides (note: new guides should also be added to command-list.txt)\n MAN5_TXT += gitattributes.txt\n MAN5_TXT += githooks.txt\n MAN5_TXT += gitignore.txt\ndiff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt\nindex 9e481aec85..758bf39ba3 100644\n--- a/Documentation/gitcredentials.txt\n+++ b/Documentation/gitcredentials.txt\n@@ -3,7 +3,7 @@ gitcredentials(7)\n \n NAME\n ----\n-gitcredentials - providing usernames and passwords to Git\n+gitcredentials - Providing usernames and passwords to Git\n \n SYNOPSIS\n --------\ndiff --git a/command-list.txt b/command-list.txt\nindex 89aa60cde7..e5901f2213 100644\n--- a/command-list.txt\n+++ b/command-list.txt\n@@ -195,6 +195,7 @@ git-write-tree                          plumbingmanipulators\n gitattributes                           guide\n gitcli                                  guide\n gitcore-tutorial                        guide\n+gitcredentials                          guide\n gitcvs-migration                        guide\n gitdiffcore                             guide\n giteveryday                             guide\n@@ -204,6 +205,7 @@ githooks                                guide\n gitignore                               guide\n gitmodules                              guide\n gitnamespaces                           guide\n+gitremote-helpers                       guide\n gitrepository-layout                    guide\n gitrevisions                            guide\n gitsubmodules                           guide\n-- \ngitgitgadget\n\n"},{"id":"402656","messageId":"9374d80f0c37a6b6a7f5f76601ee757f89712d0c.1596381647.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.git.1596381647.gitgitgadget@gmail.com","subject":"[PATCH 3/3] git.txt: add list of guides","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-02T15:20:47Z","receivedAt":"2020-08-02T15:20:57Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nNot all guides are mentioned in the 'git(1)' documentation,\nwhich makes the missing ones somewhat hard to find.\n\nAdd a list of the guides to git(1).\n\nTweak `Documentation/cmd-list.perl` so that it also generates\na file `cmds-guide.txt` which gets included in git.txt.\n\nAlso, do not hard-code the manual section '1'. Instead, use a regex so\nthat the manual section is discovered from the first line of each\n`git*.txt` file.\n\nThis addition was hinted at in 1b81d8cb19 (help: use command-list.txt for\nthe source of guides, 2018-05-20).\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/cmd-list.perl | 10 ++++++++--\n Documentation/git.txt       |  7 +++++++\n 2 files changed, 15 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex 5aa73cfe45..99f01a0910 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -6,9 +6,14 @@ sub format_one {\n \tmy ($out, $nameattr) = @_;\n \tmy ($name, $attr) = @$nameattr;\n \tmy ($state, $description);\n+\tmy $mansection;\n \t$state = 0;\n \topen I, '<', \"$name.txt\" or die \"No such file $name.txt\";\n \twhile (<I>) {\n+\t\tif (/^git[a-z0-9-]*\\(([0-9])\\)$/) {\n+\t\t\t$mansection = $1;\n+\t\t\tnext;\n+\t\t}\n \t\tif (/^NAME$/) {\n \t\t\t$state = 1;\n \t\t\tnext;\n@@ -27,7 +32,7 @@ sub format_one {\n \t\tdie \"No description found in $name.txt\";\n \t}\n \tif (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) {\n-\t\tprint $out \"linkgit:$name\\[1\\]::\\n\\t\";\n+\t\tprint $out \"linkgit:$name\\[$mansection\\]::\\n\\t\";\n \t\tif ($attr =~ / deprecated /) {\n \t\t\tprint $out \"(deprecated) \";\n \t\t}\n@@ -60,7 +65,8 @@ sub format_one {\n \t\tsynchingrepositories\n \t\tforeignscminterface\n \t\tpurehelpers\n-\t\tsynchelpers)) {\n+\t\tsynchelpers\n+\t\tguide)) {\n \tmy $out = \"cmds-$cat.txt\";\n \topen O, '>', \"$out+\" or die \"Cannot open output file $out+\";\n \tfor (@{$cmds{$cat}}) {\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 3e50065198..81349a84e7 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -304,6 +304,13 @@ users typically do not use them directly.\n \n include::cmds-purehelpers.txt[]\n \n+Guides\n+------\n+\n+The following documentation pages are guides about Git concepts.\n+\n+include::cmds-guide.txt[]\n+\n \n Configuration Mechanism\n -----------------------\n-- \ngitgitgadget\n"},{"id":"402657","messageId":"f49cf08f4f61d667633465903111675dd33e56e9.1596381647.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.git.1596381647.gitgitgadget@gmail.com","subject":"[PATCH 2/3] help: drop usage of 'common' and 'useful' for guides","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-02T15:20:46Z","receivedAt":"2020-08-02T15:21:00Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nSince 1b81d8cb19 (help: use command-list.txt for the source of guides,\n2018-05-20), all man5/man7 guides listed in command-list.txt appear in\nthe output of 'git help -g'.\n\nHowever, 'git help -g' still prefixes this list with \"The common Git\nguides are:\", which makes one wonder if there are others!\n\nIn the same spirit, the man page for 'git help' describes the '--guides'\noption as listing 'useful' guides, which is not false per se but can\nalso be taken to mean that there are other guides that exist but are not\nuseful.\n\nInstead of 'common' and 'useful', use 'Git concept guides' in both\nplaces. To keep the code in line with this change, rename\nhelp.c::list_common_guides_help to list_guides_help.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/git-help.txt | 6 +++---\n builtin/help.c             | 2 +-\n help.c                     | 4 ++--\n help.h                     | 2 +-\n 4 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-help.txt b/Documentation/git-help.txt\nindex 69c0c5c34e..44fe8860b3 100644\n--- a/Documentation/git-help.txt\n+++ b/Documentation/git-help.txt\n@@ -21,8 +21,8 @@ on the standard output.\n If the option `--all` or `-a` is given, all available commands are\n printed on the standard output.\n \n-If the option `--guides` or `-g` is given, a list of the useful\n-Git guides is also printed on the standard output.\n+If the option `--guides` or `-g` is given, a list of the\n+Git concept guides is also printed on the standard output.\n \n If a command, or a guide, is given, a manual page for that command or\n guide is brought up. The 'man' program is used by default for this\n@@ -58,7 +58,7 @@ OPTIONS\n \n -g::\n --guides::\n-\tPrints a list of useful guides on the standard output. This\n+\tPrints a list of the Git concept guides on the standard output. This\n \toption overrides any given command or guide name.\n \n -i::\ndiff --git a/builtin/help.c b/builtin/help.c\nindex 299206eb57..bb339f0fc8 100644\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -579,7 +579,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (show_guides)\n-\t\tlist_common_guides_help();\n+\t\tlist_guides_help();\n \n \tif (show_all || show_guides) {\n \t\tprintf(\"%s\\n\", _(git_more_info_string));\ndiff --git a/help.c b/help.c\nindex 44cee69c11..d478afb2af 100644\n--- a/help.c\n+++ b/help.c\n@@ -397,10 +397,10 @@ void list_cmds_by_config(struct string_list *list)\n \t}\n }\n \n-void list_common_guides_help(void)\n+void list_guides_help(void)\n {\n \tstruct category_description catdesc[] = {\n-\t\t{ CAT_guide, N_(\"The common Git guides are:\") },\n+\t\t{ CAT_guide, N_(\"The Git concept guides are:\") },\n \t\t{ 0, NULL }\n \t};\n \tprint_cmd_by_category(catdesc, NULL);\ndiff --git a/help.h b/help.h\nindex 500521b908..dc02458855 100644\n--- a/help.h\n+++ b/help.h\n@@ -21,7 +21,7 @@ static inline void mput_char(char c, unsigned int num)\n \n void list_common_cmds_help(void);\n void list_all_cmds_help(void);\n-void list_common_guides_help(void);\n+void list_guides_help(void);\n \n void list_all_main_cmds(struct string_list *list);\n void list_all_other_cmds(struct string_list *list);\n-- \ngitgitgadget\n\n"},{"id":"402671","messageId":"xmqqsgd4rad8.fsf@gitster.c.googlers.com","threadId":"53969","inReplyTo":"9374d80f0c37a6b6a7f5f76601ee757f89712d0c.1596381647.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 3/3] git.txt: add list of guides","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-02T21:44:35Z","receivedAt":"2020-08-02T21:44:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Blain via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Philippe Blain <levraiphilippeblain@gmail.com>\n>\n> Not all guides are mentioned in the 'git(1)' documentation,\n> which makes the missing ones somewhat hard to find.\n>\n> Add a list of the guides to git(1).\n>\n> Tweak `Documentation/cmd-list.perl` so that it also generates\n> a file `cmds-guide.txt` which gets included in git.txt.\n\nWho cleans this?  Do we need a change to Makefile?\n"},{"id":"402672","messageId":"xmqqv9i0wvoz.fsf@gitster.c.googlers.com","threadId":"53969","inReplyTo":"xmqqsgd4rad8.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 3/3] git.txt: add list of guides","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-02T22:05:00Z","receivedAt":"2020-08-02T22:05:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Philippe Blain via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n>> From: Philippe Blain <levraiphilippeblain@gmail.com>\n>>\n>> Not all guides are mentioned in the 'git(1)' documentation,\n>> which makes the missing ones somewhat hard to find.\n>>\n>> Add a list of the guides to git(1).\n>>\n>> Tweak `Documentation/cmd-list.perl` so that it also generates\n>> a file `cmds-guide.txt` which gets included in git.txt.\n>\n> Who cleans this?  Do we need a change to Makefile?\n\nA band-aid patch would look like this, BUT.\n\n    diff --git a/Documentation/Makefile b/Documentation/Makefile\n    index 39f6fc8de7..616449da88 100644\n    --- a/Documentation/Makefile\n    +++ b/Documentation/Makefile\n    @@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \\\n            cmds-plumbingmanipulators.txt \\\n            cmds-synchingrepositories.txt \\\n            cmds-synchelpers.txt \\\n    +       cmds-guide.txt \\\n            cmds-purehelpers.txt \\\n            cmds-foreignscminterface.txt\n\nI think with a bit more work, we can be at a lot better place.  How\nabout something along the following line (untested)?\n\n Documentation/Makefile      |  3 ++-\n Documentation/cmd-list.perl | 21 ++++++++-------------\n 2 files changed, 10 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 39f6fc8de7..80d1908a44 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \\\n \tcmds-plumbingmanipulators.txt \\\n \tcmds-synchingrepositories.txt \\\n \tcmds-synchelpers.txt \\\n+\tcmds-guide.txt \\\n \tcmds-purehelpers.txt \\\n \tcmds-foreignscminterface.txt\n \n@@ -302,7 +303,7 @@ $(cmds_txt): cmd-list.made\n \n cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n \t$(QUIET_GEN)$(RM) $@ && \\\n-\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \\\n+\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \\\n \tdate >$@\n \n mergetools_txt = mergetools-diff.txt mergetools-merge.txt\ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex 99f01a0910..af5da45d28 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -43,12 +43,15 @@ sub format_one {\n \t}\n }\n \n-while (<>) {\n+my ($input, @categories) = @ARGV;\n+\n+open IN, \"<$input\";\n+while (<IN>) {\n \tlast if /^### command list/;\n }\n \n my %cmds = ();\n-for (sort <>) {\n+for (sort <IN>) {\n \tnext if /^#/;\n \n \tchomp;\n@@ -56,18 +59,10 @@ sub format_one {\n \t$attr = '' unless defined $attr;\n \tpush @{$cmds{$cat}}, [$name, \" $attr \"];\n }\n+close IN;\n \n-for my $cat (qw(ancillaryinterrogators\n-\t\tancillarymanipulators\n-\t\tmainporcelain\n-\t\tplumbinginterrogators\n-\t\tplumbingmanipulators\n-\t\tsynchingrepositories\n-\t\tforeignscminterface\n-\t\tpurehelpers\n-\t\tsynchelpers\n-\t\tguide)) {\n-\tmy $out = \"cmds-$cat.txt\";\n+for my $out (@categories) {\n+\tmy ($cat) = $out =~ /^cmds-(.*)\\.txt$/;\n \topen O, '>', \"$out+\" or die \"Cannot open output file $out+\";\n \tfor (@{$cmds{$cat}}) {\n \t\tformat_one(\\*O, $_);\n"},{"id":"402681","messageId":"6C571F33-0ACE-4C1C-805C-7E8ADE50D18D@gmail.com","threadId":"53969","inReplyTo":"xmqqv9i0wvoz.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 3/3] git.txt: add list of guides","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2020-08-03T14:16:20Z","receivedAt":"2020-08-03T14:16:27Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Junio, \n\n> Le 2 août 2020 à 18:05, Junio C Hamano <gitster@pobox.com> a écrit :\n> \n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> \"Philippe Blain via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>> \n>>> From: Philippe Blain <levraiphilippeblain@gmail.com>\n>>> \n>>> Not all guides are mentioned in the 'git(1)' documentation,\n>>> which makes the missing ones somewhat hard to find.\n>>> \n>>> Add a list of the guides to git(1).\n>>> \n>>> Tweak `Documentation/cmd-list.perl` so that it also generates\n>>> a file `cmds-guide.txt` which gets included in git.txt.\n>> \n>> Who cleans this?  Do we need a change to Makefile?\n\nOups! I checked /.gitignore, but forgot to thoroughly check the Makefile.\n\n> \n> A band-aid patch would look like this, BUT.\n> \n>    diff --git a/Documentation/Makefile b/Documentation/Makefile\n>    index 39f6fc8de7..616449da88 100644\n>    --- a/Documentation/Makefile\n>    +++ b/Documentation/Makefile\n>    @@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \\\n>            cmds-plumbingmanipulators.txt \\\n>            cmds-synchingrepositories.txt \\\n>            cmds-synchelpers.txt \\\n>    +       cmds-guide.txt \\\n>            cmds-purehelpers.txt \\\n>            cmds-foreignscminterface.txt\n> \n> I think with a bit more work, we can be at a lot better place.  How\n> about something along the following line (untested)?\n> \n> Documentation/Makefile      |  3 ++-\n> Documentation/cmd-list.perl | 21 ++++++++-------------\n> 2 files changed, 10 insertions(+), 14 deletions(-)\n> \n> diff --git a/Documentation/Makefile b/Documentation/Makefile\n> index 39f6fc8de7..80d1908a44 100644\n> --- a/Documentation/Makefile\n> +++ b/Documentation/Makefile\n> @@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \\\n> \tcmds-plumbingmanipulators.txt \\\n> \tcmds-synchingrepositories.txt \\\n> \tcmds-synchelpers.txt \\\n> +\tcmds-guide.txt \\\n> \tcmds-purehelpers.txt \\\n> \tcmds-foreignscminterface.txt\n> \n> @@ -302,7 +303,7 @@ $(cmds_txt): cmd-list.made\n> \n> cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n> \t$(QUIET_GEN)$(RM) $@ && \\\n> -\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \\\n> +\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \\\n> \tdate >$@\n> \n> mergetools_txt = mergetools-diff.txt mergetools-merge.txt\n> diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\n> index 99f01a0910..af5da45d28 100755\n> --- a/Documentation/cmd-list.perl\n> +++ b/Documentation/cmd-list.perl\n> @@ -43,12 +43,15 @@ sub format_one {\n> \t}\n> }\n> \n> -while (<>) {\n> +my ($input, @categories) = @ARGV;\n> +\n> +open IN, \"<$input\";\n> +while (<IN>) {\n> \tlast if /^### command list/;\n> }\n> \n> my %cmds = ();\n> -for (sort <>) {\n> +for (sort <IN>) {\n> \tnext if /^#/;\n> \n> \tchomp;\n> @@ -56,18 +59,10 @@ sub format_one {\n> \t$attr = '' unless defined $attr;\n> \tpush @{$cmds{$cat}}, [$name, \" $attr \"];\n> }\n> +close IN;\n> \n> -for my $cat (qw(ancillaryinterrogators\n> -\t\tancillarymanipulators\n> -\t\tmainporcelain\n> -\t\tplumbinginterrogators\n> -\t\tplumbingmanipulators\n> -\t\tsynchingrepositories\n> -\t\tforeignscminterface\n> -\t\tpurehelpers\n> -\t\tsynchelpers\n> -\t\tguide)) {\n> -\tmy $out = \"cmds-$cat.txt\";\n> +for my $out (@categories) {\n> +\tmy ($cat) = $out =~ /^cmds-(.*)\\.txt$/;\n> \topen O, '>', \"$out+\" or die \"Cannot open output file $out+\";\n> \tfor (@{$cmds{$cat}}) {\n> \t\tformat_one(\\*O, $_);\n\nThanks for the suggestion. I tested it and it works correctly. \nI've incorporated it to v2.\n\n\nPhilippe.\n\n"},{"id":"402773","messageId":"pull.691.v2.git.1596500459.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.git.1596381647.gitgitgadget@gmail.com","subject":"[PATCH v2 0/3] List all guides in git(1)","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-04T00:20:56Z","receivedAt":"2020-08-04T00:21:04Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Changes since v1:\n\n * Incorporated Junio's suggestion to reduce duplication.\n\nv1: This series adds a list of the guides to git(1).\n\nThe first commit adds the misssing guides 'gitcredentials' and\n'gitremote-helpers' to command-list.txt. The only missing guide after this\nchange is 'gitweb.conf', but I think this one is obscure anough, and already\nlinked to in 'gitweb.txt', that it does not matter much.\n\nThe second commit drops the usage of 'common' and 'useful' for guides. This\nwas suggested as one of two ways forward by Duy in [1] but was not commented\non. I'm CC'ing the people that were CC'ed on that message.\n\nThe third commit tweaks 'Documentation/cmd-list.perl' so that it also\ngenerates a list of the guides, which gets included in 'git.txt'. I chose to\nput this list just after the end of the list of commands.\n\n[1] \nhttps://lore.kernel.org/git/CACsJy8ADj-bTMYDHxRNLOMppOEdPbVwL49u3XCfNBCmoLLZo+A@mail.gmail.com/\n\nPhilippe Blain (3):\n  command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'\n  help: drop usage of 'common' and 'useful' for guides\n  git.txt: add list of guides\n\n Documentation/Makefile           |  4 +++-\n Documentation/cmd-list.perl      | 27 ++++++++++++++-------------\n Documentation/git-help.txt       |  6 +++---\n Documentation/git.txt            |  7 +++++++\n Documentation/gitcredentials.txt |  2 +-\n builtin/help.c                   |  2 +-\n command-list.txt                 |  2 ++\n help.c                           |  4 ++--\n help.h                           |  2 +-\n 9 files changed, 34 insertions(+), 22 deletions(-)\n\n\nbase-commit: e8ab941b671da6890181aea5b5755d1d9eea24ec\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-691%2Fphil-blain%2Flist-guides-in-git.1-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-691/phil-blain/list-guides-in-git.1-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/691\n\nRange-diff vs v1:\n\n 1:  2bd473e0aa = 1:  2bd473e0aa command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'\n 2:  f49cf08f4f = 2:  f49cf08f4f help: drop usage of 'common' and 'useful' for guides\n 3:  9374d80f0c ! 3:  4394bb357b git.txt: add list of guides\n     @@ Metadata\n       ## Commit message ##\n          git.txt: add list of guides\n      \n     -    Not all guides are mentioned in the 'git(1)' documentation,\n     +    Not all man5/man7 guides are mentioned in the 'git(1)' documentation,\n          which makes the missing ones somewhat hard to find.\n      \n     -    Add a list of the guides to git(1).\n     +    Add a list of the guides to git(1) by leveraging the existing\n     +    `Documentation/cmd-list.perl` script to generate a file `cmds-guide.txt`\n     +    which gets included in git.txt.\n      \n     -    Tweak `Documentation/cmd-list.perl` so that it also generates\n     -    a file `cmds-guide.txt` which gets included in git.txt.\n     +    Instead of hard-coding the list of command categories in both\n     +    `Documentation/Makefile` and `Documentation/cmd-list.perl`, make the\n     +    Makefile the authoritative source and tweak `cmd-list.perl` so that it\n     +    receives the list of command categories as argument.\n      \n          Also, do not hard-code the manual section '1'. Instead, use a regex so\n          that the manual section is discovered from the first line of each\n     @@ Commit message\n          This addition was hinted at in 1b81d8cb19 (help: use command-list.txt for\n          the source of guides, 2018-05-20).\n      \n     +    Helped-by: Junio C Hamano <gitster@pobox.com>\n          Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n      \n     + ## Documentation/Makefile ##\n     +@@ Documentation/Makefile: cmds_txt = cmds-ancillaryinterrogators.txt \\\n     + \tcmds-plumbingmanipulators.txt \\\n     + \tcmds-synchingrepositories.txt \\\n     + \tcmds-synchelpers.txt \\\n     ++\tcmds-guide.txt \\\n     + \tcmds-purehelpers.txt \\\n     + \tcmds-foreignscminterface.txt\n     + \n     +@@ Documentation/Makefile: $(cmds_txt): cmd-list.made\n     + \n     + cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n     + \t$(QUIET_GEN)$(RM) $@ && \\\n     +-\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \\\n     ++\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \\\n     + \tdate >$@\n     + \n     + mergetools_txt = mergetools-diff.txt mergetools-merge.txt\n     +\n       ## Documentation/cmd-list.perl ##\n      @@ Documentation/cmd-list.perl: sub format_one {\n       \tmy ($out, $nameattr) = @_;\n     @@ Documentation/cmd-list.perl: sub format_one {\n       \t\t\tprint $out \"(deprecated) \";\n       \t\t}\n      @@ Documentation/cmd-list.perl: sub format_one {\n     - \t\tsynchingrepositories\n     - \t\tforeignscminterface\n     - \t\tpurehelpers\n     + \t}\n     + }\n     + \n     +-while (<>) {\n     ++my ($input, @categories) = @ARGV;\n     ++\n     ++open IN, \"<$input\";\n     ++while (<IN>) {\n     + \tlast if /^### command list/;\n     + }\n     + \n     + my %cmds = ();\n     +-for (sort <>) {\n     ++for (sort <IN>) {\n     + \tnext if /^#/;\n     + \n     + \tchomp;\n     +@@ Documentation/cmd-list.perl: sub format_one {\n     + \t$attr = '' unless defined $attr;\n     + \tpush @{$cmds{$cat}}, [$name, \" $attr \"];\n     + }\n     ++close IN;\n     + \n     +-for my $cat (qw(ancillaryinterrogators\n     +-\t\tancillarymanipulators\n     +-\t\tmainporcelain\n     +-\t\tplumbinginterrogators\n     +-\t\tplumbingmanipulators\n     +-\t\tsynchingrepositories\n     +-\t\tforeignscminterface\n     +-\t\tpurehelpers\n      -\t\tsynchelpers)) {\n     -+\t\tsynchelpers\n     -+\t\tguide)) {\n     - \tmy $out = \"cmds-$cat.txt\";\n     +-\tmy $out = \"cmds-$cat.txt\";\n     ++for my $out (@categories) {\n     ++\tmy ($cat) = $out =~ /^cmds-(.*)\\.txt$/;\n       \topen O, '>', \"$out+\" or die \"Cannot open output file $out+\";\n       \tfor (@{$cmds{$cat}}) {\n     + \t\tformat_one(\\*O, $_);\n      \n       ## Documentation/git.txt ##\n      @@ Documentation/git.txt: users typically do not use them directly.\n\n-- \ngitgitgadget\n"},{"id":"402774","messageId":"2bd473e0aa963c6e883a6fcaf01f3137c5e6a2e8.1596500459.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v2.git.1596500459.gitgitgadget@gmail.com","subject":"[PATCH v2 1/3] command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-04T00:20:57Z","receivedAt":"2020-08-04T00:21:05Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nThe guides 'gitcredentials' and 'gitremote-helpers' do not currently\nappear in command-list.txt.\n\n'gitcredentials' was forgotten back when guides were added to\ncommand-list.txt in 1b81d8cb19 (help: use command-list.txt for the\nsource of guides, 2018-05-20).\n\n'gitremote-helpers' was moved to section 7 in 439cc74632 (docs: move\ngitremote-helpers into section 7, 2019-03-25), but command-list.txt was\nnot updated at the time.\n\nAdd these two guides to the list of guides in 'command-list.txt', so\nthat they appear in the output of 'git help --guides', and capitalize\nthe first word of the description of 'gitcredentials', as was done in\n1b81d8c (help: use command-list.txt for the source of guides,\n2018-05-20) for the other guides.\n\nWhile at it, add a comment in Documentation/Makefile to remind developers\nto update command-list.txt if they add a new guide.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/Makefile           | 1 +\n Documentation/gitcredentials.txt | 2 +-\n command-list.txt                 | 2 ++\n 3 files changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex ecd0b340b1..39f6fc8de7 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -17,6 +17,7 @@ MAN1_TXT += git.txt\n MAN1_TXT += gitk.txt\n MAN1_TXT += gitweb.txt\n \n+# man5 / man7 guides (note: new guides should also be added to command-list.txt)\n MAN5_TXT += gitattributes.txt\n MAN5_TXT += githooks.txt\n MAN5_TXT += gitignore.txt\ndiff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt\nindex 9e481aec85..758bf39ba3 100644\n--- a/Documentation/gitcredentials.txt\n+++ b/Documentation/gitcredentials.txt\n@@ -3,7 +3,7 @@ gitcredentials(7)\n \n NAME\n ----\n-gitcredentials - providing usernames and passwords to Git\n+gitcredentials - Providing usernames and passwords to Git\n \n SYNOPSIS\n --------\ndiff --git a/command-list.txt b/command-list.txt\nindex 89aa60cde7..e5901f2213 100644\n--- a/command-list.txt\n+++ b/command-list.txt\n@@ -195,6 +195,7 @@ git-write-tree                          plumbingmanipulators\n gitattributes                           guide\n gitcli                                  guide\n gitcore-tutorial                        guide\n+gitcredentials                          guide\n gitcvs-migration                        guide\n gitdiffcore                             guide\n giteveryday                             guide\n@@ -204,6 +205,7 @@ githooks                                guide\n gitignore                               guide\n gitmodules                              guide\n gitnamespaces                           guide\n+gitremote-helpers                       guide\n gitrepository-layout                    guide\n gitrevisions                            guide\n gitsubmodules                           guide\n-- \ngitgitgadget\n\n"},{"id":"402775","messageId":"f49cf08f4f61d667633465903111675dd33e56e9.1596500460.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v2.git.1596500459.gitgitgadget@gmail.com","subject":"[PATCH v2 2/3] help: drop usage of 'common' and 'useful' for guides","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-04T00:20:58Z","receivedAt":"2020-08-04T00:21:06Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nSince 1b81d8cb19 (help: use command-list.txt for the source of guides,\n2018-05-20), all man5/man7 guides listed in command-list.txt appear in\nthe output of 'git help -g'.\n\nHowever, 'git help -g' still prefixes this list with \"The common Git\nguides are:\", which makes one wonder if there are others!\n\nIn the same spirit, the man page for 'git help' describes the '--guides'\noption as listing 'useful' guides, which is not false per se but can\nalso be taken to mean that there are other guides that exist but are not\nuseful.\n\nInstead of 'common' and 'useful', use 'Git concept guides' in both\nplaces. To keep the code in line with this change, rename\nhelp.c::list_common_guides_help to list_guides_help.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/git-help.txt | 6 +++---\n builtin/help.c             | 2 +-\n help.c                     | 4 ++--\n help.h                     | 2 +-\n 4 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-help.txt b/Documentation/git-help.txt\nindex 69c0c5c34e..44fe8860b3 100644\n--- a/Documentation/git-help.txt\n+++ b/Documentation/git-help.txt\n@@ -21,8 +21,8 @@ on the standard output.\n If the option `--all` or `-a` is given, all available commands are\n printed on the standard output.\n \n-If the option `--guides` or `-g` is given, a list of the useful\n-Git guides is also printed on the standard output.\n+If the option `--guides` or `-g` is given, a list of the\n+Git concept guides is also printed on the standard output.\n \n If a command, or a guide, is given, a manual page for that command or\n guide is brought up. The 'man' program is used by default for this\n@@ -58,7 +58,7 @@ OPTIONS\n \n -g::\n --guides::\n-\tPrints a list of useful guides on the standard output. This\n+\tPrints a list of the Git concept guides on the standard output. This\n \toption overrides any given command or guide name.\n \n -i::\ndiff --git a/builtin/help.c b/builtin/help.c\nindex 299206eb57..bb339f0fc8 100644\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -579,7 +579,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (show_guides)\n-\t\tlist_common_guides_help();\n+\t\tlist_guides_help();\n \n \tif (show_all || show_guides) {\n \t\tprintf(\"%s\\n\", _(git_more_info_string));\ndiff --git a/help.c b/help.c\nindex 44cee69c11..d478afb2af 100644\n--- a/help.c\n+++ b/help.c\n@@ -397,10 +397,10 @@ void list_cmds_by_config(struct string_list *list)\n \t}\n }\n \n-void list_common_guides_help(void)\n+void list_guides_help(void)\n {\n \tstruct category_description catdesc[] = {\n-\t\t{ CAT_guide, N_(\"The common Git guides are:\") },\n+\t\t{ CAT_guide, N_(\"The Git concept guides are:\") },\n \t\t{ 0, NULL }\n \t};\n \tprint_cmd_by_category(catdesc, NULL);\ndiff --git a/help.h b/help.h\nindex 500521b908..dc02458855 100644\n--- a/help.h\n+++ b/help.h\n@@ -21,7 +21,7 @@ static inline void mput_char(char c, unsigned int num)\n \n void list_common_cmds_help(void);\n void list_all_cmds_help(void);\n-void list_common_guides_help(void);\n+void list_guides_help(void);\n \n void list_all_main_cmds(struct string_list *list);\n void list_all_other_cmds(struct string_list *list);\n-- \ngitgitgadget\n\n"},{"id":"402776","messageId":"4394bb357b5e7025618665c4f7b387d4d37f3a84.1596500460.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v2.git.1596500459.gitgitgadget@gmail.com","subject":"[PATCH v2 3/3] git.txt: add list of guides","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-04T00:20:59Z","receivedAt":"2020-08-04T00:21:08Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nNot all man5/man7 guides are mentioned in the 'git(1)' documentation,\nwhich makes the missing ones somewhat hard to find.\n\nAdd a list of the guides to git(1) by leveraging the existing\n`Documentation/cmd-list.perl` script to generate a file `cmds-guide.txt`\nwhich gets included in git.txt.\n\nInstead of hard-coding the list of command categories in both\n`Documentation/Makefile` and `Documentation/cmd-list.perl`, make the\nMakefile the authoritative source and tweak `cmd-list.perl` so that it\nreceives the list of command categories as argument.\n\nAlso, do not hard-code the manual section '1'. Instead, use a regex so\nthat the manual section is discovered from the first line of each\n`git*.txt` file.\n\nThis addition was hinted at in 1b81d8cb19 (help: use command-list.txt for\nthe source of guides, 2018-05-20).\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/Makefile      |  3 ++-\n Documentation/cmd-list.perl | 27 ++++++++++++++-------------\n Documentation/git.txt       |  7 +++++++\n 3 files changed, 23 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 39f6fc8de7..80d1908a44 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \\\n \tcmds-plumbingmanipulators.txt \\\n \tcmds-synchingrepositories.txt \\\n \tcmds-synchelpers.txt \\\n+\tcmds-guide.txt \\\n \tcmds-purehelpers.txt \\\n \tcmds-foreignscminterface.txt\n \n@@ -302,7 +303,7 @@ $(cmds_txt): cmd-list.made\n \n cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n \t$(QUIET_GEN)$(RM) $@ && \\\n-\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \\\n+\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \\\n \tdate >$@\n \n mergetools_txt = mergetools-diff.txt mergetools-merge.txt\ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex 5aa73cfe45..af5da45d28 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -6,9 +6,14 @@ sub format_one {\n \tmy ($out, $nameattr) = @_;\n \tmy ($name, $attr) = @$nameattr;\n \tmy ($state, $description);\n+\tmy $mansection;\n \t$state = 0;\n \topen I, '<', \"$name.txt\" or die \"No such file $name.txt\";\n \twhile (<I>) {\n+\t\tif (/^git[a-z0-9-]*\\(([0-9])\\)$/) {\n+\t\t\t$mansection = $1;\n+\t\t\tnext;\n+\t\t}\n \t\tif (/^NAME$/) {\n \t\t\t$state = 1;\n \t\t\tnext;\n@@ -27,7 +32,7 @@ sub format_one {\n \t\tdie \"No description found in $name.txt\";\n \t}\n \tif (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) {\n-\t\tprint $out \"linkgit:$name\\[1\\]::\\n\\t\";\n+\t\tprint $out \"linkgit:$name\\[$mansection\\]::\\n\\t\";\n \t\tif ($attr =~ / deprecated /) {\n \t\t\tprint $out \"(deprecated) \";\n \t\t}\n@@ -38,12 +43,15 @@ sub format_one {\n \t}\n }\n \n-while (<>) {\n+my ($input, @categories) = @ARGV;\n+\n+open IN, \"<$input\";\n+while (<IN>) {\n \tlast if /^### command list/;\n }\n \n my %cmds = ();\n-for (sort <>) {\n+for (sort <IN>) {\n \tnext if /^#/;\n \n \tchomp;\n@@ -51,17 +59,10 @@ sub format_one {\n \t$attr = '' unless defined $attr;\n \tpush @{$cmds{$cat}}, [$name, \" $attr \"];\n }\n+close IN;\n \n-for my $cat (qw(ancillaryinterrogators\n-\t\tancillarymanipulators\n-\t\tmainporcelain\n-\t\tplumbinginterrogators\n-\t\tplumbingmanipulators\n-\t\tsynchingrepositories\n-\t\tforeignscminterface\n-\t\tpurehelpers\n-\t\tsynchelpers)) {\n-\tmy $out = \"cmds-$cat.txt\";\n+for my $out (@categories) {\n+\tmy ($cat) = $out =~ /^cmds-(.*)\\.txt$/;\n \topen O, '>', \"$out+\" or die \"Cannot open output file $out+\";\n \tfor (@{$cmds{$cat}}) {\n \t\tformat_one(\\*O, $_);\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 3e50065198..81349a84e7 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -304,6 +304,13 @@ users typically do not use them directly.\n \n include::cmds-purehelpers.txt[]\n \n+Guides\n+------\n+\n+The following documentation pages are guides about Git concepts.\n+\n+include::cmds-guide.txt[]\n+\n \n Configuration Mechanism\n -----------------------\n-- \ngitgitgadget\n"},{"id":"402777","messageId":"xmqqh7tjtfx6.fsf@gitster.c.googlers.com","threadId":"53969","inReplyTo":"pull.691.v2.git.1596500459.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 0/3] List all guides in git(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-04T00:26:13Z","receivedAt":"2020-08-04T00:26:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philippe Blain via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Changes since v1:\n>\n>  * Incorporated Junio's suggestion to reduce duplication.\n>\n> v1: This series adds a list of the guides to git(1).\n>\n> The first commit adds the misssing guides 'gitcredentials' and\n> 'gitremote-helpers' to command-list.txt. The only missing guide after this\n> change is 'gitweb.conf', but I think this one is obscure anough, and already\n> linked to in 'gitweb.txt', that it does not matter much.\n>\n> The second commit drops the usage of 'common' and 'useful' for guides. This\n> was suggested as one of two ways forward by Duy in [1] but was not commented\n> on. I'm CC'ing the people that were CC'ed on that message.\n>\n> The third commit tweaks 'Documentation/cmd-list.perl' so that it also\n> generates a list of the guides, which gets included in 'git.txt'. I chose to\n> put this list just after the end of the list of commands.\n>\n> [1] \n> https://lore.kernel.org/git/CACsJy8ADj-bTMYDHxRNLOMppOEdPbVwL49u3XCfNBCmoLLZo+A@mail.gmail.com/\n>\n> Philippe Blain (3):\n>   command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'\n>   help: drop usage of 'common' and 'useful' for guides\n>   git.txt: add list of guides\n\nI think the \"dedup the list of cmds-$category.txt\" is logically a\nseparate step from \"we forgot to add guide category so add it\", so\neither (1) \"add guide twice, and then refactor\" or (2) \"refactor\nbefore adding guide, and then add guide only in one place\" would be\nmore appropriate than (3) \"add guide while refactoring\".  IMHO, (2)\nwould make the most sense.\n\nThanks.\n"},{"id":"402814","messageId":"4174B93F-AE21-4F63-A847-06EBF28199DD@gmail.com","threadId":"53969","inReplyTo":"xmqqh7tjtfx6.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v2 0/3] List all guides in git(1)","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2020-08-04T13:44:39Z","receivedAt":"2020-08-04T13:44:47Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"\n> Le 3 août 2020 à 20:26, Junio C Hamano <gitster@pobox.com> a écrit :\n> \n> \"Philippe Blain via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n> \n>> Changes since v1:\n>> \n>> * Incorporated Junio's suggestion to reduce duplication.\n>> \n>> v1: This series adds a list of the guides to git(1).\n>> \n>> The first commit adds the misssing guides 'gitcredentials' and\n>> 'gitremote-helpers' to command-list.txt. The only missing guide after this\n>> change is 'gitweb.conf', but I think this one is obscure anough, and already\n>> linked to in 'gitweb.txt', that it does not matter much.\n>> \n>> The second commit drops the usage of 'common' and 'useful' for guides. This\n>> was suggested as one of two ways forward by Duy in [1] but was not commented\n>> on. I'm CC'ing the people that were CC'ed on that message.\n>> \n>> The third commit tweaks 'Documentation/cmd-list.perl' so that it also\n>> generates a list of the guides, which gets included in 'git.txt'. I chose to\n>> put this list just after the end of the list of commands.\n>> \n>> [1] \n>> https://lore.kernel.org/git/CACsJy8ADj-bTMYDHxRNLOMppOEdPbVwL49u3XCfNBCmoLLZo+A@mail.gmail.com/\n>> \n>> Philippe Blain (3):\n>>  command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'\n>>  help: drop usage of 'common' and 'useful' for guides\n>>  git.txt: add list of guides\n> \n> I think the \"dedup the list of cmds-$category.txt\" is logically a\n> separate step from \"we forgot to add guide category so add it\", so\n> either (1) \"add guide twice, and then refactor\" or (2) \"refactor\n> before adding guide, and then add guide only in one place\" would be\n> more appropriate than (3) \"add guide while refactoring\".  IMHO, (2)\n> would make the most sense.\n> \n\nI agree that (2) makes the most sense, I've split it for v3. (Your \"SQUASH???\" message on pb/guide-docs \nmay have mislead me :)\n\nPhilippe.\n\n"},{"id":"402877","messageId":"pull.691.v3.git.1596590347.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v2.git.1596500459.gitgitgadget@gmail.com","subject":"[PATCH v3 0/4] List all guides in git(1)","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-05T01:19:03Z","receivedAt":"2020-08-05T01:19:15Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Changes since v2:\n\n * Split the third commit following Junio's suggestion\n\nQuestion for Junio: Since the new commit 3/4 comes entirely from your\nsuggestion, I've attributed authorship to you, but I've added my own\nsign-off because Gitgitgadget requires sign-off on each commit. Please let\nme know if I should have proceeded differently.\n\nv2:\n\n * Incorporated Junio's suggestion to reduce duplication.\n\nv1: This series adds a list of the guides to git(1).\n\nThe first commit adds the misssing guides 'gitcredentials' and\n'gitremote-helpers' to command-list.txt. The only missing guide after this\nchange is 'gitweb.conf', but I think this one is obscure anough, and already\nlinked to in 'gitweb.txt', that it does not matter much.\n\nThe second commit drops the usage of 'common' and 'useful' for guides. This\nwas suggested as one of two ways forward by Duy in [1] but was not commented\non. I'm CC'ing the people that were CC'ed on that message.\n\nThe third commit tweaks 'Documentation/cmd-list.perl' so that it also\ngenerates a list of the guides, which gets included in 'git.txt'. I chose to\nput this list just after the end of the list of commands.\n\n[1] \nhttps://lore.kernel.org/git/CACsJy8ADj-bTMYDHxRNLOMppOEdPbVwL49u3XCfNBCmoLLZo+A@mail.gmail.com/\n\nJunio C Hamano (1):\n  Documentation: don't hardcode command categories twice\n\nPhilippe Blain (3):\n  command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'\n  help: drop usage of 'common' and 'useful' for guides\n  git.txt: add list of guides\n\n Documentation/Makefile           |  4 +++-\n Documentation/cmd-list.perl      | 27 ++++++++++++++-------------\n Documentation/git-help.txt       |  6 +++---\n Documentation/git.txt            |  7 +++++++\n Documentation/gitcredentials.txt |  2 +-\n builtin/help.c                   |  2 +-\n command-list.txt                 |  2 ++\n help.c                           |  4 ++--\n help.h                           |  2 +-\n 9 files changed, 34 insertions(+), 22 deletions(-)\n\n\nbase-commit: e8ab941b671da6890181aea5b5755d1d9eea24ec\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-691%2Fphil-blain%2Flist-guides-in-git.1-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-691/phil-blain/list-guides-in-git.1-v3\nPull-Request: https://github.com/gitgitgadget/git/pull/691\n\nRange-diff vs v2:\n\n 1:  2bd473e0aa = 1:  2bd473e0aa command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'\n 2:  f49cf08f4f = 2:  f49cf08f4f help: drop usage of 'common' and 'useful' for guides\n -:  ---------- > 3:  552444a842 Documentation: don't hardcode command categories twice\n 3:  4394bb357b ! 4:  840371fb4b git.txt: add list of guides\n     @@ Commit message\n          `Documentation/cmd-list.perl` script to generate a file `cmds-guide.txt`\n          which gets included in git.txt.\n      \n     -    Instead of hard-coding the list of command categories in both\n     -    `Documentation/Makefile` and `Documentation/cmd-list.perl`, make the\n     -    Makefile the authoritative source and tweak `cmd-list.perl` so that it\n     -    receives the list of command categories as argument.\n     -\n          Also, do not hard-code the manual section '1'. Instead, use a regex so\n          that the manual section is discovered from the first line of each\n          `git*.txt` file.\n      \n     -    This addition was hinted at in 1b81d8cb19 (help: use command-list.txt for\n     -    the source of guides, 2018-05-20).\n     +    This addition was hinted at in 1b81d8cb19 (help: use command-list.txt\n     +    for the source of guides, 2018-05-20).\n      \n          Helped-by: Junio C Hamano <gitster@pobox.com>\n          Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n     @@ Documentation/Makefile: cmds_txt = cmds-ancillaryinterrogators.txt \\\n       \tcmds-purehelpers.txt \\\n       \tcmds-foreignscminterface.txt\n       \n     -@@ Documentation/Makefile: $(cmds_txt): cmd-list.made\n     - \n     - cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n     - \t$(QUIET_GEN)$(RM) $@ && \\\n     --\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \\\n     -+\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \\\n     - \tdate >$@\n     - \n     - mergetools_txt = mergetools-diff.txt mergetools-merge.txt\n      \n       ## Documentation/cmd-list.perl ##\n      @@ Documentation/cmd-list.perl: sub format_one {\n     @@ Documentation/cmd-list.perl: sub format_one {\n       \t\tif ($attr =~ / deprecated /) {\n       \t\t\tprint $out \"(deprecated) \";\n       \t\t}\n     -@@ Documentation/cmd-list.perl: sub format_one {\n     - \t}\n     - }\n     - \n     --while (<>) {\n     -+my ($input, @categories) = @ARGV;\n     -+\n     -+open IN, \"<$input\";\n     -+while (<IN>) {\n     - \tlast if /^### command list/;\n     - }\n     - \n     - my %cmds = ();\n     --for (sort <>) {\n     -+for (sort <IN>) {\n     - \tnext if /^#/;\n     - \n     - \tchomp;\n     -@@ Documentation/cmd-list.perl: sub format_one {\n     - \t$attr = '' unless defined $attr;\n     - \tpush @{$cmds{$cat}}, [$name, \" $attr \"];\n     - }\n     -+close IN;\n     - \n     --for my $cat (qw(ancillaryinterrogators\n     --\t\tancillarymanipulators\n     --\t\tmainporcelain\n     --\t\tplumbinginterrogators\n     --\t\tplumbingmanipulators\n     --\t\tsynchingrepositories\n     --\t\tforeignscminterface\n     --\t\tpurehelpers\n     --\t\tsynchelpers)) {\n     --\tmy $out = \"cmds-$cat.txt\";\n     -+for my $out (@categories) {\n     -+\tmy ($cat) = $out =~ /^cmds-(.*)\\.txt$/;\n     - \topen O, '>', \"$out+\" or die \"Cannot open output file $out+\";\n     - \tfor (@{$cmds{$cat}}) {\n     - \t\tformat_one(\\*O, $_);\n      \n       ## Documentation/git.txt ##\n      @@ Documentation/git.txt: users typically do not use them directly.\n\n-- \ngitgitgadget\n"},{"id":"402878","messageId":"2bd473e0aa963c6e883a6fcaf01f3137c5e6a2e8.1596590347.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v3.git.1596590347.gitgitgadget@gmail.com","subject":"[PATCH v3 1/4] command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-05T01:19:04Z","receivedAt":"2020-08-05T01:19:17Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nThe guides 'gitcredentials' and 'gitremote-helpers' do not currently\nappear in command-list.txt.\n\n'gitcredentials' was forgotten back when guides were added to\ncommand-list.txt in 1b81d8cb19 (help: use command-list.txt for the\nsource of guides, 2018-05-20).\n\n'gitremote-helpers' was moved to section 7 in 439cc74632 (docs: move\ngitremote-helpers into section 7, 2019-03-25), but command-list.txt was\nnot updated at the time.\n\nAdd these two guides to the list of guides in 'command-list.txt', so\nthat they appear in the output of 'git help --guides', and capitalize\nthe first word of the description of 'gitcredentials', as was done in\n1b81d8c (help: use command-list.txt for the source of guides,\n2018-05-20) for the other guides.\n\nWhile at it, add a comment in Documentation/Makefile to remind developers\nto update command-list.txt if they add a new guide.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/Makefile           | 1 +\n Documentation/gitcredentials.txt | 2 +-\n command-list.txt                 | 2 ++\n 3 files changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex ecd0b340b1..39f6fc8de7 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -17,6 +17,7 @@ MAN1_TXT += git.txt\n MAN1_TXT += gitk.txt\n MAN1_TXT += gitweb.txt\n \n+# man5 / man7 guides (note: new guides should also be added to command-list.txt)\n MAN5_TXT += gitattributes.txt\n MAN5_TXT += githooks.txt\n MAN5_TXT += gitignore.txt\ndiff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt\nindex 9e481aec85..758bf39ba3 100644\n--- a/Documentation/gitcredentials.txt\n+++ b/Documentation/gitcredentials.txt\n@@ -3,7 +3,7 @@ gitcredentials(7)\n \n NAME\n ----\n-gitcredentials - providing usernames and passwords to Git\n+gitcredentials - Providing usernames and passwords to Git\n \n SYNOPSIS\n --------\ndiff --git a/command-list.txt b/command-list.txt\nindex 89aa60cde7..e5901f2213 100644\n--- a/command-list.txt\n+++ b/command-list.txt\n@@ -195,6 +195,7 @@ git-write-tree                          plumbingmanipulators\n gitattributes                           guide\n gitcli                                  guide\n gitcore-tutorial                        guide\n+gitcredentials                          guide\n gitcvs-migration                        guide\n gitdiffcore                             guide\n giteveryday                             guide\n@@ -204,6 +205,7 @@ githooks                                guide\n gitignore                               guide\n gitmodules                              guide\n gitnamespaces                           guide\n+gitremote-helpers                       guide\n gitrepository-layout                    guide\n gitrevisions                            guide\n gitsubmodules                           guide\n-- \ngitgitgadget\n\n"},{"id":"402879","messageId":"f49cf08f4f61d667633465903111675dd33e56e9.1596590347.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v3.git.1596590347.gitgitgadget@gmail.com","subject":"[PATCH v3 2/4] help: drop usage of 'common' and 'useful' for guides","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-05T01:19:05Z","receivedAt":"2020-08-05T01:19:18Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nSince 1b81d8cb19 (help: use command-list.txt for the source of guides,\n2018-05-20), all man5/man7 guides listed in command-list.txt appear in\nthe output of 'git help -g'.\n\nHowever, 'git help -g' still prefixes this list with \"The common Git\nguides are:\", which makes one wonder if there are others!\n\nIn the same spirit, the man page for 'git help' describes the '--guides'\noption as listing 'useful' guides, which is not false per se but can\nalso be taken to mean that there are other guides that exist but are not\nuseful.\n\nInstead of 'common' and 'useful', use 'Git concept guides' in both\nplaces. To keep the code in line with this change, rename\nhelp.c::list_common_guides_help to list_guides_help.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/git-help.txt | 6 +++---\n builtin/help.c             | 2 +-\n help.c                     | 4 ++--\n help.h                     | 2 +-\n 4 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-help.txt b/Documentation/git-help.txt\nindex 69c0c5c34e..44fe8860b3 100644\n--- a/Documentation/git-help.txt\n+++ b/Documentation/git-help.txt\n@@ -21,8 +21,8 @@ on the standard output.\n If the option `--all` or `-a` is given, all available commands are\n printed on the standard output.\n \n-If the option `--guides` or `-g` is given, a list of the useful\n-Git guides is also printed on the standard output.\n+If the option `--guides` or `-g` is given, a list of the\n+Git concept guides is also printed on the standard output.\n \n If a command, or a guide, is given, a manual page for that command or\n guide is brought up. The 'man' program is used by default for this\n@@ -58,7 +58,7 @@ OPTIONS\n \n -g::\n --guides::\n-\tPrints a list of useful guides on the standard output. This\n+\tPrints a list of the Git concept guides on the standard output. This\n \toption overrides any given command or guide name.\n \n -i::\ndiff --git a/builtin/help.c b/builtin/help.c\nindex 299206eb57..bb339f0fc8 100644\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -579,7 +579,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (show_guides)\n-\t\tlist_common_guides_help();\n+\t\tlist_guides_help();\n \n \tif (show_all || show_guides) {\n \t\tprintf(\"%s\\n\", _(git_more_info_string));\ndiff --git a/help.c b/help.c\nindex 44cee69c11..d478afb2af 100644\n--- a/help.c\n+++ b/help.c\n@@ -397,10 +397,10 @@ void list_cmds_by_config(struct string_list *list)\n \t}\n }\n \n-void list_common_guides_help(void)\n+void list_guides_help(void)\n {\n \tstruct category_description catdesc[] = {\n-\t\t{ CAT_guide, N_(\"The common Git guides are:\") },\n+\t\t{ CAT_guide, N_(\"The Git concept guides are:\") },\n \t\t{ 0, NULL }\n \t};\n \tprint_cmd_by_category(catdesc, NULL);\ndiff --git a/help.h b/help.h\nindex 500521b908..dc02458855 100644\n--- a/help.h\n+++ b/help.h\n@@ -21,7 +21,7 @@ static inline void mput_char(char c, unsigned int num)\n \n void list_common_cmds_help(void);\n void list_all_cmds_help(void);\n-void list_common_guides_help(void);\n+void list_guides_help(void);\n \n void list_all_main_cmds(struct string_list *list);\n void list_all_other_cmds(struct string_list *list);\n-- \ngitgitgadget\n\n"},{"id":"402880","messageId":"840371fb4b7ec5ae5c5876be25f27008359dab9e.1596590347.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v3.git.1596590347.gitgitgadget@gmail.com","subject":"[PATCH v3 4/4] git.txt: add list of guides","fromName":"Philippe Blain via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-05T01:19:07Z","receivedAt":"2020-08-05T01:19:22Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"From: Philippe Blain <levraiphilippeblain@gmail.com>\n\nNot all man5/man7 guides are mentioned in the 'git(1)' documentation,\nwhich makes the missing ones somewhat hard to find.\n\nAdd a list of the guides to git(1) by leveraging the existing\n`Documentation/cmd-list.perl` script to generate a file `cmds-guide.txt`\nwhich gets included in git.txt.\n\nAlso, do not hard-code the manual section '1'. Instead, use a regex so\nthat the manual section is discovered from the first line of each\n`git*.txt` file.\n\nThis addition was hinted at in 1b81d8cb19 (help: use command-list.txt\nfor the source of guides, 2018-05-20).\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/Makefile      | 1 +\n Documentation/cmd-list.perl | 7 ++++++-\n Documentation/git.txt       | 7 +++++++\n 3 files changed, 14 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex eb9c7e2b0e..80d1908a44 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \\\n \tcmds-plumbingmanipulators.txt \\\n \tcmds-synchingrepositories.txt \\\n \tcmds-synchelpers.txt \\\n+\tcmds-guide.txt \\\n \tcmds-purehelpers.txt \\\n \tcmds-foreignscminterface.txt\n \ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex ee96de53db..af5da45d28 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -6,9 +6,14 @@ sub format_one {\n \tmy ($out, $nameattr) = @_;\n \tmy ($name, $attr) = @$nameattr;\n \tmy ($state, $description);\n+\tmy $mansection;\n \t$state = 0;\n \topen I, '<', \"$name.txt\" or die \"No such file $name.txt\";\n \twhile (<I>) {\n+\t\tif (/^git[a-z0-9-]*\\(([0-9])\\)$/) {\n+\t\t\t$mansection = $1;\n+\t\t\tnext;\n+\t\t}\n \t\tif (/^NAME$/) {\n \t\t\t$state = 1;\n \t\t\tnext;\n@@ -27,7 +32,7 @@ sub format_one {\n \t\tdie \"No description found in $name.txt\";\n \t}\n \tif (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) {\n-\t\tprint $out \"linkgit:$name\\[1\\]::\\n\\t\";\n+\t\tprint $out \"linkgit:$name\\[$mansection\\]::\\n\\t\";\n \t\tif ($attr =~ / deprecated /) {\n \t\t\tprint $out \"(deprecated) \";\n \t\t}\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 3e50065198..81349a84e7 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -304,6 +304,13 @@ users typically do not use them directly.\n \n include::cmds-purehelpers.txt[]\n \n+Guides\n+------\n+\n+The following documentation pages are guides about Git concepts.\n+\n+include::cmds-guide.txt[]\n+\n \n Configuration Mechanism\n -----------------------\n-- \ngitgitgadget\n"},{"id":"402881","messageId":"552444a84241d280640c4700f17477a9c297fb73.1596590347.git.gitgitgadget@gmail.com","threadId":"53969","inReplyTo":"pull.691.v3.git.1596590347.gitgitgadget@gmail.com","subject":"[PATCH v3 3/4] Documentation: don't hardcode command categories twice","fromName":"Junio C Hamano via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-05T01:19:06Z","receivedAt":"2020-08-05T01:19:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nInstead of hard-coding the list of command categories in both\n`Documentation/Makefile` and `Documentation/cmd-list.perl`, make the\nMakefile the authoritative source and tweak `cmd-list.perl` so that it\nreceives the list of command categories as argument.\n\nSigned-off-by: Philippe Blain <levraiphilippeblain@gmail.com>\n---\n Documentation/Makefile      |  2 +-\n Documentation/cmd-list.perl | 20 ++++++++------------\n 2 files changed, 9 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 39f6fc8de7..eb9c7e2b0e 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -302,7 +302,7 @@ $(cmds_txt): cmd-list.made\n \n cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)\n \t$(QUIET_GEN)$(RM) $@ && \\\n-\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \\\n+\t$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \\\n \tdate >$@\n \n mergetools_txt = mergetools-diff.txt mergetools-merge.txt\ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex 5aa73cfe45..ee96de53db 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -38,12 +38,15 @@ sub format_one {\n \t}\n }\n \n-while (<>) {\n+my ($input, @categories) = @ARGV;\n+\n+open IN, \"<$input\";\n+while (<IN>) {\n \tlast if /^### command list/;\n }\n \n my %cmds = ();\n-for (sort <>) {\n+for (sort <IN>) {\n \tnext if /^#/;\n \n \tchomp;\n@@ -51,17 +54,10 @@ sub format_one {\n \t$attr = '' unless defined $attr;\n \tpush @{$cmds{$cat}}, [$name, \" $attr \"];\n }\n+close IN;\n \n-for my $cat (qw(ancillaryinterrogators\n-\t\tancillarymanipulators\n-\t\tmainporcelain\n-\t\tplumbinginterrogators\n-\t\tplumbingmanipulators\n-\t\tsynchingrepositories\n-\t\tforeignscminterface\n-\t\tpurehelpers\n-\t\tsynchelpers)) {\n-\tmy $out = \"cmds-$cat.txt\";\n+for my $out (@categories) {\n+\tmy ($cat) = $out =~ /^cmds-(.*)\\.txt$/;\n \topen O, '>', \"$out+\" or die \"Cannot open output file $out+\";\n \tfor (@{$cmds{$cat}}) {\n \t\tformat_one(\\*O, $_);\n-- \ngitgitgadget\n\n"}]}