Re: [PATCHv2 4/5] branch: introduce --list option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 26, 2011, 17:43 UTC
- Message-ID
- <7vfwkodq5s.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <0785cac235c3b45537cf161c86dde8e798c4ff3e.1314367414.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> Currently, there is no way to invoke the list mode explicitly.
..., without giving -v to force verbose output.
Show 6 quoted lines
> Introduce a --list option which invokes the list mode. This will be > beneficial for invoking list mode with pattern matching, which otherwise > would be interpreted as branch creation. > > Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> > ---
Show 7 quoted lines
> @@ -20,7 +20,8 @@ DESCRIPTION > > With no arguments, existing branches are listed and the current branch will > be highlighted with an asterisk. Option `-r` causes the remote-tracking > -branches to be listed, and option `-a` shows both. > +branches to be listed, and option `-a` shows both. This list mode is also > +activated by the `--list` and `-v` options (see below).
Very good to mention "and -v" here ;-)
Show 22 quoted lines
> diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh > index 6b7c118..61e095c 100755 > --- a/t/t3203-branch-output.sh > +++ b/t/t3203-branch-output.sh > @@ -32,6 +32,20 @@ test_expect_success 'git branch shows local branches' ' > test_cmp expect actual > ' > > +test_expect_success 'git branch --list shows local branches' ' > + git branch --list >actual && > + test_cmp expect actual > +' > + > +cat >expect <<'EOF' > + branch-one > + branch-two > +EOF > +test_expect_success 'git branch --list pattern shows matching local branches' ' > + git branch --list branch* >actual && > + test_cmp expect actual > +' > +
Could we have a test to check the code you updated to sanity check the combination of options as well? I suspect the reason your initial round botched the "branch -v -m foo" without realizing may be because we do not cover the error checking.