Re: [PATCH v3 2/5] pretty: make %H/%h/etc respect --abbrev[-commit]
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 2, 2010, 05:33 UTC
- Message-ID
- <7v39yazx4i.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20100502044506.GA14776@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> On Sat, May 01, 2010 at 08:13:00PM -0700, Junio C Hamano wrote: > >> Will Palmer <wmpalmer@gmail.com> writes: >> ... >> > Here we make "git log --pretty=%H --abbrev-commit" synonymous with >> > "git log --pretty=%h", and make %h/abbreviated-%H respect the length >> > specified for --abbrev. >> >> I think it is a good change to make %h follow --abbrev, but %H should stay >> the full length no matter what (otherwise why would anybody use %H not %h?). > > But I thought the point of %h was to be abbreviated? If it follows > --abbrev, then "git log --format=%h" would show the full sha1, no?
Sorry, but I meant that the point of %h was to be abbreviated and the point of %H was not to be abbreviated. So no matter whaqt --abbrev-commit says on the command line, --format=%H should show the full commit object name.
By the way, we should update Documentation/pretty-format.txt to use the proper terminology. Colloquial use "commit hash", "tree hash", etc. are Ok but in a formal documentation we should consistently say "object name".