]> git.ipfire.org Git - thirdparty/git.git/commit - branch.c
Improve "git branch --tracking" output
authorJunio C Hamano <gitster@pobox.com>
Tue, 10 Mar 2009 08:20:42 +0000 (01:20 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Mar 2009 05:21:12 +0000 (22:21 -0700)
commit72f600832f75db626fd9290a21d02d49c92ca9ca
tree8bbc7f17b7aa06a61ffb1f71b86ff038a534f687
parenta9f2c13685ae9040d52d53cd719a18040f1dd123
Improve "git branch --tracking" output

An earlier patch always spelled the full name of the ref that we track
(e.g. "refs/heads/frotz" instead of just "frotz" when we mean the branch
whose name is "frotz").  Worse yet, because we now use the true name of
the ref at the original repository when talk about a tracking branch that
copies from a remote, such a full name alone still does not give enough
information.

This reorganizes the verbose codepath to:

 - differentiate "refs/heads/something" and everything else; we say that
   the branch tracks "branch <something>" if it begins with "refs/heads/",
   and otherwise the branch tracks "ref refs/<someother>/<something>";

 - report the name of the remote when we talk about a tracking branch, by
   saying "branch frotz from origin";

 - not say "by merging" at the end; it is the default and is not worth
   reporting.

Signed-off-by: Junio C Hamano <junio@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c