summaryrefslogtreecommitdiff
path: root/builtin-shortlog.c
diff options
context:
space:
mode:
authorLibravatar Will Palmer <wmpalmer@gmail.com>2010-05-03 22:18:57 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-05-04 15:38:58 -0700
commitc197702156e2164074327f5e870ab0d3021977fc (patch)
tree072768fbbd361d76448e90d508f7914afc8071d7 /builtin-shortlog.c
parentshortlog: Document and test --format option (diff)
downloadtgif-c197702156e2164074327f5e870ab0d3021977fc.tar.xz
pretty: Respect --abbrev option
Prior to this, the output of git log -1 --format=%h was always 7 characters long, without regard to whether --abbrev had been passed. Signed-off-by: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-shortlog.c')
-rw-r--r--builtin-shortlog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index ecd2d45a00..6f36362818 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -162,7 +162,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
sha1_to_hex(commit->object.sha1));
if (log->user_format) {
struct pretty_print_context ctx = {0};
- ctx.abbrev = DEFAULT_ABBREV;
+ ctx.abbrev = log->abbrev;
ctx.subject = "";
ctx.after_subject = "";
ctx.date_mode = DATE_NORMAL;
@@ -290,6 +290,7 @@ parse_done:
}
log.user_format = rev.commit_format == CMIT_FMT_USERFORMAT;
+ log.abbrev = rev.abbrev;
/* assume HEAD if from a tty */
if (!nongit && !rev.pending.nr && isatty(0))