From c197702156e2164074327f5e870ab0d3021977fc Mon Sep 17 00:00:00 2001 From: Will Palmer Date: Mon, 3 May 2010 22:18:57 -0500 Subject: 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 Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin-shortlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'builtin-shortlog.c') 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)) -- cgit v1.2.3