branch doc: Change `git branch <pattern>` to use `<branchname>`
PATCH 1/1 branch doc: Change `git branch <pattern>` to use `<branchname>`
Change an example for git branch <pattern> to say git branch <branchname> to be consistent with the synopsis. This changes documentation added in d8d33736b5 ("branch: allow pattern arguments", 2011-08-28).
--- Documentation/git-branch.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/git-branch.txt +1 -1
@@ -142,7 +142,7 @@ This option is only applicable in non-verbose mode. List both remote-tracking branches and local branches. --list:: - Activate the list mode. `git branch <pattern>` would try to create a branch, + Activate the list mode. `git branch <branchname>` would try to create a branch, use `git branch --list <pattern>` to list matching branches. -v::
Signature · 1 line
2.11.0
Quoted 15 lines · Ævar Arnfjörð Bjarmason
Change an example for
git branch <pattern>to saygit branch <branchname>to be consistent with the synopsis. This changes documentation added ind8d33736b5("branch: allow pattern arguments", 2011-08-28).Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>--- Documentation/git-branch.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/git-branch.txt +0
-0
Documentation/git-branch.txt This option is only applicable in non-verbose mode. · line 146
Quoted 6 lines
Documentation/git-branch.txt +1
-1@@ -142,7 +142,7 @@ This option is only applicable in non-verbose mode. List both remote-tracking branches and local branches. --list:: - Activate the list mode. `git branch <pattern>` would try to create a branch, + Activate the list mode. `git branch <branchname>` would try to create a branch, use `git branch --list <pattern>` to list matching branches.
This makes the description more correct.
I am not sure if it makes that much sense to have that sentence here in the first place (after all, it is describing a behaviour of a mode that is *not* the list mode), but I guess that it may be a common mistake to forget to specify "-l" while asking for branches that match the pattern? If we were writing this today from scratch, I would perhaps write something entirely different, e.g.
--list::
List branches. With optional <pattern>... at the end of the command line, list only the branches that match any of the given patterns. Do not forget '-l' and say "git branch <pattern>", as it will instead try to create a new branch whose name is <pattern>, which is a common mistake.
though.
Thanks.
Quoted 33 lines · Junio C Hamano
Quoted 15 lines · Ævar Arnfjörð Bjarmason
Change an example for
git branch <pattern>to saygit branch <branchname>to be consistent with the synopsis. This changes documentation added ind8d33736b5("branch: allow pattern arguments", 2011-08-28).Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>--- Documentation/git-branch.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/git-branch.txt +0
-0Documentation/git-branch.txt This option is only applicable in non-verbose mode. · line 146
Quoted 6 lines
Documentation/git-branch.txt +1
-1@@ -142,7 +142,7 @@ This option is only applicable in non-verbose mode. List both remote-tracking branches and local branches. --list:: - Activate the list mode. `git branch <pattern>` would try to create a branch, + Activate the list mode. `git branch <branchname>` would try to create a branch, use `git branch --list <pattern>` to list matching branches.This makes the description more correct.
I am not sure if it makes that much sense to have that sentence here in the first place (after all, it is describing a behaviour of a mode that is *not* the list mode), but I guess that it may be a common mistake to forget to specify "-l" while asking for branches that match the pattern? If we were writing this today from scratch, I would perhaps write something entirely different, e.g.
Quoted 7 lines
--list::
List branches. With optional <pattern>... at the end of the command line, list only the branches that match any of the given patterns. Do not forget '-l' and say "git branch <pattern>", as it will instead try to create a new branch whose name is <pattern>, which is a common mistake.
Hmm, but with git-branch -l means --create-reflog not --list.
I have make the mistake of using -l rather than --list several times ... :D
ATB,
Ramsay Jones
Quoted 15 lines · Ramsay Jones
Quoted 7 lines
I am not sure if it makes that much sense to have that sentence here in the first place (after all, it is describing a behaviour of a mode that is *not* the list mode), but I guess that it may be a common mistake to forget to specify "-l" while asking for branches that match the pattern? If we were writing this today from scratch, I would perhaps write something entirely different, e.g.
Quoted 7 lines
--list::
List branches. With optional <pattern>... at the end of the command line, list only the branches that match any of the given patterns. Do not forget '-l' and say "git branch <pattern>", as it will instead try to create a new branch whose name is <pattern>, which is a common mistake.
Quoted 4 lines
Hmm, but with git-branch -l means --create-reflog not --list.
I have make the mistake of using -l rather than --list several times ... :D
That too. With "Do not forget '--list'..." and it will make it correct again ;-).
Quoted 26 lines · Junio C Hamano
Quoted 15 lines · Ævar Arnfjörð Bjarmason
Change an example for
git branch <pattern>to saygit branch <branchname>to be consistent with the synopsis. This changes documentation added ind8d33736b5("branch: allow pattern arguments", 2011-08-28).Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>--- Documentation/git-branch.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/git-branch.txt +0
-0Documentation/git-branch.txt This option is only applicable in non-verbose mode. · line 146
Quoted 6 lines
Documentation/git-branch.txt +1
-1@@ -142,7 +142,7 @@ This option is only applicable in non-verbose mode. List both remote-tracking branches and local branches. --list:: - Activate the list mode. `git branch <pattern>` would try to create a branch, + Activate the list mode. `git branch <branchname>` would try to create a branch, use `git branch --list <pattern>` to list matching branches.This makes the description more correct.
Quoted 6 lines
I am not sure if it makes that much sense to have that sentence here in the first place (after all, it is describing a behaviour of a mode that is *not* the list mode), but I guess that it may be a common mistake to forget to specify "-l" while asking for branches that match the pattern? If we were writing this today from scratch, I would perhaps write something entirely different, e.g.
I'm just doing s/pattern/branchname/ on the existing documentation. If you'd like to entirely reword this to make that unnecessary that sounds good, but makes sense that you then submit that patch & just drop this one, rather than me copy/pasting your proposal, sending that as my own patch etc...
Quoted 7 lines
--list::
List branches. With optional <pattern>... at the end of the command line, list only the branches that match any of the given patterns. Do not forget '-l' and say "git branch <pattern>", as it will instead try to create a new branch whose name is <pattern>, which is a common mistake.
I like the old one better. It has 3 actual command examples you can readily see. This turns that into more prose that requires the reader to mentally parse most of it and mentally insert the mentioned command line switches into the equivalent of those 3 examples we just provided before.
Quoted 3 lines
though.
Thanks.
Quoted 14 lines · Ævar Arnfjörð Bjarmason
Quoted 5 lines
Documentation/git-branch.txt This option is only applicable in non-verbose mode. · line 146
Quoted 4 lines
--list::
Documentation/git-branch.txt +1
-1- Activate the list mode. `git branch <pattern>` would try to create a branch, + Activate the list mode. `git branch <branchname>` would try to create a branch, use `git branch --list <pattern>` to list matching branches.Quoted 8 lines
This makes the description more correct.
I am not sure if it makes that much sense to have that sentence here in the first place (after all, it is describing a behaviour of a mode that is *not* the list mode), but I guess that it may be a common mistake to forget to specify "-l" while asking for branches that match the pattern? If we were writing this today from scratch, I would perhaps write something entirely different, e.g.
Quoted 5 lines
I'm just doing s/pattern/branchname/ on the existing documentation. If you'd like to entirely reword this to make that unnecessary that sounds good, but makes sense that you then submit that patch & just drop this one, rather than me copy/pasting your proposal, sending that as my own patch etc...
That is sensible. I've already queued yours as-is a few hours ago, and the remainder of this message is in preparation for a follow-up patch that is a separate topic.
Quoted 10 lines
Quoted 7 lines
--list::
List branches. With optional <pattern>... at the end of the command line, list only the branches that match any of the given patterns. Do not forget '-l' and say "git branch <pattern>", as it will instead try to create a new branch whose name is <pattern>, which is a common mistake.I like the old one better. It has 3 actual command examples you can readily see.
Having the _wrong_ example git branch <branchname> that is readily available for cutting and pasting is the worst of the three reasons why I think the current text is bad (the other two being "it does not even help in explaining the --list option" and "The argument to the other mode is not <pattern> but is <branchname>").
I can go without "Do not forget ..." and everything that follows, though, and if we are going to do so, then
--list:: List branches. With optional <pattern>..., e.g. `git branch --list 'maint-*`, list only the branches that match the pattern(s).
would be fine. I am not opposed to having an visually distinctive example--I just do not want to have one that is wrong without clearly marking it as such.
Quoted 11 lines · Junio C Hamano
I can go without "Do not forget ..." and everything that follows, though, and if we are going to do so, then
--list:: List branches. With optional <pattern>..., e.g. `git branch --list 'maint-*`, list only the branches that match the pattern(s).would be fine. I am not opposed to having an visually distinctive example--I just do not want to have one that is wrong without clearly marking it as such.
I like this one. I haven't witnessed "git branch maint-*" being a common mistake.
For comparison, "git branch -l maint-*" does seem to be a common mistake. It's a shame that the short-and-sweet "-l" was taken for that purpose. Perhaps it's worth calling that out here?
--list::
--list <pattern>::
List branches. If <pattern> is specified (e.g., "git branch --list 'maint-*'), list only the branches that match the pattern.
+
This should not be confused with git branch -l <branchname>, which creates a branch named <branchname> with a reflog. See --create-reflog above for details.
Thanks,
Jonathan
PATCH 1/1 branch doc: update description for `--list`
The paragraph begins with a sample command line git branch <name> that has nothing to do with the option being described. Remove it, but use the space to instead show that multiple patterns can be given.
Also mention the unfortunate -l that can be easily confused with it.
--- Documentation/git-branch.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Documentation/git-branch.txt +7 -2
@@ -142,8 +142,13 @@ This option is only applicable in non-verbose mode. List both remote-tracking branches and local branches. --list:: - Activate the list mode. `git branch <branchname>` would try to create a branch, - use `git branch --list <pattern>` to list matching branches. + List branches. With optional `<pattern>...`, e.g. `git + branch --list 'maint-*'`, list only the branches that match + the pattern(s). ++ +This should not be confused with `git branch -l <branchname>`, +which creates a branch named `<branchname>` with a reflog. +See `--create-reflog` above for details. -v:: -vv::
Signature · 1 line
2.12.1-432-gf364f02724
Re: [PATCH] branch doc: update description for `--list`
Quoted 4 lines · Junio C Hamano
Signed-off-by Junio C Hamano <[email protected]>--- Documentation/git-branch.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Thanks.
Re: [PATCH] branch doc: update description for `--list`
In reply to Junio C HamanoQuoted 21 lines · Junio C Hamano
The paragraph begins with a sample command line
git branch <name>that has nothing to do with the option being described. Remove it, but use the space to instead show that multiple patterns can be given.Also mention the unfortunate
-lthat can be easily confused with it.Helped-by Jonathan Nieder <[email protected]>Signed-off-by Junio C Hamano <[email protected]>--- Documentation/git-branch.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)Documentation/git-branch.txt +0
-0@@ -142,8 +142,13 @@ This option is only applicable in non-verbose mode. List both remote-tracking branches and local branches.
Documentation/git-branch.txt This option is only applicable in non-verbose mode. · line 151
Quoted 10 lines
Documentation/git-branch.txt +7
-2--list:: - Activate the list mode. `git branch <branchname>` would try to create a branch, - use `git branch --list <pattern>` to list matching branches. + List branches. With optional `<pattern>...`, e.g. `git + branch --list 'maint-*'`, list only the branches that match + the pattern(s). ++ +This should not be confused with `git branch -l <branchname>`, +which creates a branch named `<branchname>` with a reflog. +See `--create-reflog` above for details.
Looks good to me.
Quoted 5 lines
Documentation/git-branch.txt +0
-1-v:: -vv:: --2.12.1-432-gf364f02724