@@ -183,8 +183,8 @@ This option is only applicable in non-verbose mode.
--verbose::
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 path of the linked worktree (if any) and the name of the upstream
+ the upstream branch (if any). If given twice, print
+ the path of the linked worktree (if any) and the relationship to the upstream
branch, as well (see also `git remote show <remote>`). Note that the
current worktree's HEAD will not have its path printed (it will always
be your current directory).
@@ -210,7 +210,7 @@ This option is only applicable in non-verbose mode.
`branch.<name>.merge` configuration entries to mark the
start-point branch as "upstream" from the new branch. This
configuration will tell git to show the relationship between the
- two branches in `git status` and `git branch -v`. Furthermore,
+ two branches in `git status` and `git branch -vv`. Furthermore,
it directs `git pull` without arguments to pull from the
upstream when the new branch is checked out.
+
@@ -384,7 +384,8 @@ static char *build_format(struct ref_filter *filter, int maxwidth, const char *r
branch_get_color(BRANCH_COLOR_UPSTREAM), branch_get_color(BRANCH_COLOR_RESET));
}
else
- strbuf_addf(&local, "%%(if)%%(upstream:track)%%(then)%%(upstream:track) %%(end)%%(contents:subject)");
+ strbuf_addf(&local, "%%(if)%%(upstream)%%(then)[%s%%(upstream:short)%s] %%(end)%%(contents:subject)",
+ branch_get_color(BRANCH_COLOR_UPSTREAM), branch_get_color(BRANCH_COLOR_RESET));
strbuf_addf(&remote, "%%(align:%d,left)%s%%(refname:lstrip=2)%%(end)%s"
"%%(if)%%(symref)%%(then) -> %%(symref:short)"
@@ -261,7 +261,7 @@ test_expect_success 'branch --merged with --verbose' '
git branch --verbose --merged topic >actual &&
cat >expect <<-EOF &&
main $(git rev-parse --short main) second on main
- * topic $(git rev-parse --short topic ) [ahead 1] foo
+ * topic $(git rev-parse --short topic ) [main] foo
zzz $(git rev-parse --short zzz ) second on main
EOF
test_cmp expect actual
@@ -43,12 +43,12 @@ test_expect_success setup '
t6040_script='s/^..\(b.\) *[0-9a-f]* \(.*\)$/\1 \2/p'
cat >expect <<\EOF
-b1 [ahead 1, behind 1] d
-b2 [ahead 1, behind 1] d
-b3 [behind 1] b
-b4 [ahead 2] f
-b5 [gone] g
-b6 c
+b1 [origin/main] d
+b2 [origin/main] d
+b3 [origin/main] b
+b4 [origin/main] f
+b5 [brokenbase] g
+b6 [origin/main] c
EOF
test_expect_success 'branch -v' '