summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d8d3373)
raw | patch | inline | side by side (parent: d8d3373)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Thu, 8 Sep 2011 21:09:50 +0000 (14:09 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 8 Sep 2011 21:11:35 +0000 (14:11 -0700) |
"branch -v" without other options or parameters still works in the list
mode, but that is not because there is "-v" but because there is no
parameter nor option.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mode, but that is not because there is "-v" but because there is no
parameter nor option.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-branch.txt | patch | blob | history | |
builtin/branch.c | patch | blob | history | |
t/t3203-branch-output.sh | patch | blob | history |
index 2b8bc84ae0b076ddecf13a2ef4c5ab6c16b6df1b..f46013c91fcbbe4eecffe09d9b43c132daea093f 100644 (file)
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. This list mode is also
-activated by the `--list` and `-v` options (see below).
+activated by the `--list` option (see below).
<pattern> restricts the output to matching branches, the pattern is a shell
wildcard (i.e., matched using fnmatch(3))
Multiple patterns may be given; if any of them matches, the tag is shown.
-v::
--verbose::
- Show sha1 and commit subject line for each head, along with
+ When in list mode,
+ show sha1 and commit subject line for each head, along with
relationship to upstream branch (if any). If given twice, print
the name of the upstream branch, as well.
- `--list` is implied by all verbosity options.
--abbrev=<length>::
Alter the sha1's minimum display length in the output listing.
diff --git a/builtin/branch.c b/builtin/branch.c
index 98a420f11aba851a3587e5a50e9e903f84d64a3d..099c75c2287913834dea2f6d54e3cd8e97032f7b 100644 (file)
--- a/builtin/branch.c
+++ b/builtin/branch.c
argc = parse_options(argc, argv, prefix, options, builtin_branch_usage,
0);
- if (!delete && !rename && !force_create &&
- (argc == 0 || (verbose && argc)))
+ if (!delete && !rename && !force_create && argc == 0)
list = 1;
if (!!delete + !!rename + !!force_create + !!list > 1)
index f2b294b144a27917f495b434bfa66534527e9c7d..76fe7e0060c20507cb6eb317451b69a2a0c9146d 100755 (executable)
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
two
one
EOF
-test_expect_success 'git branch -v pattern shows branch summaries' '
- git branch -v branch* >tmp &&
+test_expect_success 'git branch --list -v pattern shows branch summaries' '
+ git branch --list -v branch* >tmp &&
awk "{print \$NF}" <tmp >actual &&
test_cmp expect actual
'
+test_expect_success 'git branch -v pattern does not show branch summaries' '
+ test_must_fail git branch -v branch*
+'
+
cat >expect <<'EOF'
* (no branch)
branch-one