for-each-ref: introduce %(upstream:track[short])
authorRamkumar Ramachandra <artagnon@gmail.com>
Mon, 18 Nov 2013 17:39:11 +0000 (23:09 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Nov 2013 18:14:15 +0000 (10:14 -0800)
commitb28061ce0d2e31d390fee5a5724b8a061d0492a7
treeffd06a2811065c442744dee721f0646fb0592092
parent7a48b8321934384098a8392b3c4c814ec5058d00
for-each-ref: introduce %(upstream:track[short])

Introduce %(upstream:track) to display "[ahead M, behind N]" and
%(upstream:trackshort) to display "=", ">", "<", or "<>"
appropriately (inspired by contrib/completion/git-prompt.sh).

Now you can use the following format in for-each-ref:

  %(refname:short)%(upstream:trackshort)

to display refs with terse tracking information.

Note that :track and :trackshort only work with "upstream", and error
out when used with anything else.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-for-each-ref.txt
builtin/for-each-ref.c
t/t6300-for-each-ref.sh