author | Jeff King <peff@peff.net> | |
Tue, 7 Apr 2009 07:09:39 +0000 (03:09 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 8 Apr 2009 06:22:15 +0000 (23:22 -0700) | ||
commit | 8cae19d987b1bbd43258558f591e39d9d216dcb3 | |
tree | 79e914df66245e75991c066cd3b1c7b59274a88a | tree | snapshot |
parent | 8db9a4b85d6b0d7424c8a19b77a5baa8529ab64c | commit | diff |
for-each-ref: add "upstream" format field
The logic for determining the upstream ref of a branch is
somewhat complex to perform in a shell script. This patch
provides a plumbing mechanism for scripts to access the C
logic used internally by git-status, git-branch, etc.
For example:
$ git for-each-ref \
--format='%(refname:short) %(upstream:short)' \
refs/heads/
master origin/master
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The logic for determining the upstream ref of a branch is
somewhat complex to perform in a shell script. This patch
provides a plumbing mechanism for scripts to access the C
logic used internally by git-status, git-branch, etc.
For example:
$ git for-each-ref \
--format='%(refname:short) %(upstream:short)' \
refs/heads/
master origin/master
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-for-each-ref.txt | diff | blob | history | |
builtin-for-each-ref.c | diff | blob | history | |
t/t6300-for-each-ref.sh | diff | blob | history |