diff options
author | Will Palmer <wmpalmer@gmail.com> | 2010-05-03 22:18:57 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-04 15:38:58 -0700 |
commit | c197702156e2164074327f5e870ab0d3021977fc (patch) | |
tree | 072768fbbd361d76448e90d508f7914afc8071d7 /builtin-shortlog.c | |
parent | 600372497c668045a365b9eab76987ee19405f7a (diff) | |
download | git-c197702156e2164074327f5e870ab0d3021977fc.tar.gz git-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c index ecd2d45a0..6f3636281 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)) |