summaryrefslogtreecommitdiffstats
path: root/t/t6006-rev-list-format.sh
diff options
context:
space:
mode:
authorIssac Trotts <issactrotts@google.com>2019-01-11 07:30:46 +0100
committerJunio C Hamano <gitster@pobox.com>2019-01-11 19:28:11 +0100
commitad6f028f067673cadadbc2219fcb0bb864300a6c (patch)
treea96a40f373ac72a0a3ea7abe19e32e32b470988f /t/t6006-rev-list-format.sh
parentFirst batch after 2.20.1 (diff)
downloadgit-ad6f028f067673cadadbc2219fcb0bb864300a6c.tar.xz
git-ad6f028f067673cadadbc2219fcb0bb864300a6c.zip
log: add %S option (like --source) to log --format
Make it possible to write for example git log --format="%H,%S" where the %S at the end is a new placeholder that prints out the ref (tag/branch) for each commit. Using %d might seem like an alternative but it only shows the ref for the last commit in the branch. Signed-off-by: Issac Trotts <issactrotts@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6006-rev-list-format.sh')
-rwxr-xr-xt/t6006-rev-list-format.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index ec42c2f779..da113d975b 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -185,6 +185,10 @@ test_expect_success 'basic colors' '
test_cmp expect actual
'
+test_expect_success '%S is not a placeholder for rev-list yet' '
+ git rev-list --format="%S" -1 master | grep "%S"
+'
+
test_expect_success 'advanced colors' '
cat >expect <<-EOF &&
commit $head2