Re: log --pretty accepts incomplete pre-defined formats
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 6, 2016, 15:15 UTC
- Message-ID
- <xmqqinzuzs3d.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <5704A925.9030506@gmail.com>
Sidhant Sharma <tigerkid001@gmail.com> writes:
Show 6 quoted lines
> Recently while playing around with git log, I realized that it is possible to > pass incomplete (pre-defined) format names. For example, it is possible to use > `git log --pretty=one` instead of oneline and it would still output the logs in > oneline formatting. Same goes for other formats such as 'raw', 'short' and others. > I looked at the code and it seems that it is intentionally kept so. It this so? > I'm curious to know the reason behind keeping this so.
I actually am curious why somebody wants to know, as more modern parts of the system allow option names abbreviated to unique prefixes. "Why can't I say 'log --pret=oneline' when I can say 'commit --ame'?" might be a more plausible puzzlement (and the answer is "hysterical raisins"). Anyway, this seems to come from 6cdfd179 (commit: allow --pretty= args to be abbreviated, 2006-05-14), which was slightly tightend by aacd404e (Fix some documentation typos and grammar, 2007-02-02).