-
Notifications
You must be signed in to change notification settings - Fork 140
List all guides in git(1) #691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The guides 'gitcredentials' and 'gitremote-helpers' do not currently appear in command-list.txt. 'gitcredentials' was forgotten back when guides were added to command-list.txt in 1b81d8c (help: use command-list.txt for the source of guides, 2018-05-20). 'gitremote-helpers' was moved to section 7 in 439cc74 (docs: move gitremote-helpers into section 7, 2019-03-25), but command-list.txt was not updated at the time. Add these two guides to the list of guides in 'command-list.txt', so that they appear in the output of 'git help --guides', and capitalize the first word of the description of 'gitcredentials', as was done in 1b81d8c (help: use command-list.txt for the source of guides, 2018-05-20) for the other guides. While at it, add a comment in Documentation/Makefile to remind developers to update command-list.txt if they add a new guide. Signed-off-by: Philippe Blain <[email protected]>
Since 1b81d8c (help: use command-list.txt for the source of guides, 2018-05-20), all man5/man7 guides listed in command-list.txt appear in the output of 'git help -g'. However, 'git help -g' still prefixes this list with "The common Git guides are:", which makes one wonder if there are others! In the same spirit, the man page for 'git help' describes the '--guides' option as listing 'useful' guides, which is not false per se but can also be taken to mean that there are other guides that exist but are not useful. Instead of 'common' and 'useful', use 'Git concept guides' in both places. To keep the code in line with this change, rename help.c::list_common_guides_help to list_guides_help. Signed-off-by: Philippe Blain <[email protected]>
/submit |
Submitted as [email protected] |
This branch is now known as |
This patch series was integrated into seen via git@e01a34b. |
@@ -6,9 +6,14 @@ sub format_one { | |||
my ($out, $nameattr) = @_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):
"Philippe Blain via GitGitGadget" <[email protected]> writes:
> From: Philippe Blain <[email protected]>
>
> Not all guides are mentioned in the 'git(1)' documentation,
> which makes the missing ones somewhat hard to find.
>
> Add a list of the guides to git(1).
>
> Tweak `Documentation/cmd-list.perl` so that it also generates
> a file `cmds-guide.txt` which gets included in git.txt.
Who cleans this? Do we need a change to Makefile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):
Junio C Hamano <[email protected]> writes:
> "Philippe Blain via GitGitGadget" <[email protected]> writes:
>
>> From: Philippe Blain <[email protected]>
>>
>> Not all guides are mentioned in the 'git(1)' documentation,
>> which makes the missing ones somewhat hard to find.
>>
>> Add a list of the guides to git(1).
>>
>> Tweak `Documentation/cmd-list.perl` so that it also generates
>> a file `cmds-guide.txt` which gets included in git.txt.
>
> Who cleans this? Do we need a change to Makefile?
A band-aid patch would look like this, BUT.
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 39f6fc8de7..616449da88 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
cmds-plumbingmanipulators.txt \
cmds-synchingrepositories.txt \
cmds-synchelpers.txt \
+ cmds-guide.txt \
cmds-purehelpers.txt \
cmds-foreignscminterface.txt
I think with a bit more work, we can be at a lot better place. How
about something along the following line (untested)?
Documentation/Makefile | 3 ++-
Documentation/cmd-list.perl | 21 ++++++++-------------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 39f6fc8de7..80d1908a44 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
cmds-plumbingmanipulators.txt \
cmds-synchingrepositories.txt \
cmds-synchelpers.txt \
+ cmds-guide.txt \
cmds-purehelpers.txt \
cmds-foreignscminterface.txt
@@ -302,7 +303,7 @@ $(cmds_txt): cmd-list.made
cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
$(QUIET_GEN)$(RM) $@ && \
- $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
+ $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \
date >$@
mergetools_txt = mergetools-diff.txt mergetools-merge.txt
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 99f01a0910..af5da45d28 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -43,12 +43,15 @@ sub format_one {
}
}
-while (<>) {
+my ($input, @categories) = @ARGV;
+
+open IN, "<$input";
+while (<IN>) {
last if /^### command list/;
}
my %cmds = ();
-for (sort <>) {
+for (sort <IN>) {
next if /^#/;
chomp;
@@ -56,18 +59,10 @@ sub format_one {
$attr = '' unless defined $attr;
push @{$cmds{$cat}}, [$name, " $attr "];
}
+close IN;
-for my $cat (qw(ancillaryinterrogators
- ancillarymanipulators
- mainporcelain
- plumbinginterrogators
- plumbingmanipulators
- synchingrepositories
- foreignscminterface
- purehelpers
- synchelpers
- guide)) {
- my $out = "cmds-$cat.txt";
+for my $out (@categories) {
+ my ($cat) = $out =~ /^cmds-(.*)\.txt$/;
open O, '>', "$out+" or die "Cannot open output file $out+";
for (@{$cmds{$cat}}) {
format_one(\*O, $_);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Philippe Blain wrote (reply to this):
Hi Junio,
> Le 2 août 2020 à 18:05, Junio C Hamano <[email protected]> a écrit :
>
> Junio C Hamano <[email protected]> writes:
>
>> "Philippe Blain via GitGitGadget" <[email protected]> writes:
>>
>>> From: Philippe Blain <[email protected]>
>>>
>>> Not all guides are mentioned in the 'git(1)' documentation,
>>> which makes the missing ones somewhat hard to find.
>>>
>>> Add a list of the guides to git(1).
>>>
>>> Tweak `Documentation/cmd-list.perl` so that it also generates
>>> a file `cmds-guide.txt` which gets included in git.txt.
>>
>> Who cleans this? Do we need a change to Makefile?
Oups! I checked /.gitignore, but forgot to thoroughly check the Makefile.
>
> A band-aid patch would look like this, BUT.
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 39f6fc8de7..616449da88 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
> cmds-plumbingmanipulators.txt \
> cmds-synchingrepositories.txt \
> cmds-synchelpers.txt \
> + cmds-guide.txt \
> cmds-purehelpers.txt \
> cmds-foreignscminterface.txt
>
> I think with a bit more work, we can be at a lot better place. How
> about something along the following line (untested)?
>
> Documentation/Makefile | 3 ++-
> Documentation/cmd-list.perl | 21 ++++++++-------------
> 2 files changed, 10 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 39f6fc8de7..80d1908a44 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -295,6 +295,7 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
> cmds-plumbingmanipulators.txt \
> cmds-synchingrepositories.txt \
> cmds-synchelpers.txt \
> + cmds-guide.txt \
> cmds-purehelpers.txt \
> cmds-foreignscminterface.txt
>
> @@ -302,7 +303,7 @@ $(cmds_txt): cmd-list.made
>
> cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
> $(QUIET_GEN)$(RM) $@ && \
> - $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
> + $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \
> date >$@
>
> mergetools_txt = mergetools-diff.txt mergetools-merge.txt
> diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
> index 99f01a0910..af5da45d28 100755
> --- a/Documentation/cmd-list.perl
> +++ b/Documentation/cmd-list.perl
> @@ -43,12 +43,15 @@ sub format_one {
> }
> }
>
> -while (<>) {
> +my ($input, @categories) = @ARGV;
> +
> +open IN, "<$input";
> +while (<IN>) {
> last if /^### command list/;
> }
>
> my %cmds = ();
> -for (sort <>) {
> +for (sort <IN>) {
> next if /^#/;
>
> chomp;
> @@ -56,18 +59,10 @@ sub format_one {
> $attr = '' unless defined $attr;
> push @{$cmds{$cat}}, [$name, " $attr "];
> }
> +close IN;
>
> -for my $cat (qw(ancillaryinterrogators
> - ancillarymanipulators
> - mainporcelain
> - plumbinginterrogators
> - plumbingmanipulators
> - synchingrepositories
> - foreignscminterface
> - purehelpers
> - synchelpers
> - guide)) {
> - my $out = "cmds-$cat.txt";
> +for my $out (@categories) {
> + my ($cat) = $out =~ /^cmds-(.*)\.txt$/;
> open O, '>', "$out+" or die "Cannot open output file $out+";
> for (@{$cmds{$cat}}) {
> format_one(\*O, $_);
Thanks for the suggestion. I tested it and it works correctly.
I've incorporated it to v2.
Philippe.
This patch series was integrated into seen via git@a4f4416. |
9374d80
to
4394bb3
Compare
This patch series was integrated into seen via git@fd968a1. |
This patch series was integrated into seen via git@eca3567. |
/submit |
Submitted as [email protected] |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This patch series was integrated into seen via git@0a0169b. |
Instead of hard-coding the list of command categories in both `Documentation/Makefile` and `Documentation/cmd-list.perl`, make the Makefile the authoritative source and tweak `cmd-list.perl` so that it receives the list of command categories as argument. Signed-off-by: Philippe Blain <[email protected]>
Not all man5/man7 guides are mentioned in the 'git(1)' documentation, which makes the missing ones somewhat hard to find. Add a list of the guides to git(1) by leveraging the existing `Documentation/cmd-list.perl` script to generate a file `cmds-guide.txt` which gets included in git.txt. Also, do not hard-code the manual section '1'. Instead, use a regex so that the manual section is discovered from the first line of each `git*.txt` file. This addition was hinted at in 1b81d8c (help: use command-list.txt for the source of guides, 2018-05-20). Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Philippe Blain <[email protected]>
4394bb3
to
840371f
Compare
On the Git mailing list, Philippe Blain wrote (reply to this):
|
This patch series was integrated into seen via git@1359fd8. |
This patch series was integrated into seen via git@4afb47c. |
/submit |
Submitted as [email protected] |
Hi @dscho, since GitHub actions were introduced in git.git I'm really confused with all the CI jobs (especially all the Windows ones)... is there somewhere where the purpose of the different jobs is documented ? Also I find it weird that most Azure jobs succeed but in under a minute, it seems unlikely the whole test suite runs in such a short time :P Also, I'm having failures in the Windows job, related to downloading artifacts it seems, I have the feeling this part of the CI scripts is not very robust.. is there a way that could be improved ? |
This patch series was integrated into seen via git@f64fdc9. |
This patch series was integrated into seen via git@d281bad. |
This patch series was integrated into next via git@031cab2. |
This patch series was integrated into seen via git@7ca906b. |
This patch series was integrated into seen via git@995c719. |
This patch series was integrated into next via git@995c719. |
This patch series was integrated into master via git@995c719. |
Closed via 995c719. |
Unfortunately not.
The problem is that I cannot disable the Azure Pipeline just for branches containing
Yes, I noticed that, too. There is unfortunately nothing on our side that we can do about it, I don't think. I did notice that it has become more robust, though, in the last couple weeks (with occasional hiccups). |
Thanks for getting back to me. So the Azure pipelines are kept for people submitting PRs based on old versions of the repo, before the Github actions were introduced? |
Yes. |
Changes since v2:
Question for Junio:
Since the new commit 3/4 comes entirely from your suggestion,
I've attributed authorship to you, but I've added my own sign-off because
Gitgitgadget requires sign-off on each commit. Please let me know
if I should have proceeded differently.
v2:
v1:
This series adds a list of the guides to git(1).
The first commit adds the misssing guides 'gitcredentials' and
'gitremote-helpers' to command-list.txt. The only missing guide after this
change is 'gitweb.conf', but I think this one is obscure anough, and already
linked to in 'gitweb.txt', that it does not matter much.
The second commit drops the usage of 'common' and 'useful' for guides. This was
suggested as one of two ways forward by Duy in [1] but was not commented on.
I'm CC'ing the people that were CC'ed on that message.
The third commit tweaks 'Documentation/cmd-list.perl' so that it also generates
a list of the guides, which gets included in 'git.txt'. I chose to put this
list just after the end of the list of commands.
[1] https://lore.kernel.org/git/CACsJy8ADj-bTMYDHxRNLOMppOEdPbVwL49u3XCfNBCmoLLZo+A@mail.gmail.com/
CC: Nguyễn Thái Ngọc Duy [email protected], Philip Oakley [email protected], "Eric Sunshine" [email protected], "SZEDER Gábor" [email protected]