summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorIssac Trotts <issactrotts@google.com>2019-01-11 06:30:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-11 18:28:11 (GMT)
commitad6f028f067673cadadbc2219fcb0bb864300a6c (patch)
treea96a40f373ac72a0a3ea7abe19e32e32b470988f /log-tree.c
parentecbdaf0899161c067986e9d9d564586d4b045d62 (diff)
downloadgit-ad6f028f067673cadadbc2219fcb0bb864300a6c.zip
git-ad6f028f067673cadadbc2219fcb0bb864300a6c.tar.gz
git-ad6f028f067673cadadbc2219fcb0bb864300a6c.tar.bz2
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 'log-tree.c')
-rw-r--r--log-tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/log-tree.c b/log-tree.c
index 10680c1..3cb1425 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -700,6 +700,7 @@ void show_log(struct rev_info *opt)
ctx.color = opt->diffopt.use_color;
ctx.expand_tabs_in_log = opt->expand_tabs_in_log;
ctx.output_encoding = get_log_output_encoding();
+ ctx.rev = opt;
if (opt->from_ident.mail_begin && opt->from_ident.name_begin)
ctx.from_ident = &opt->from_ident;
if (opt->graph)