* log --pretty accepts incomplete pre-defined formats
@ 2016-04-06 6:13 Sidhant Sharma
2016-04-06 15:15 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Sidhant Sharma @ 2016-04-06 6:13 UTC (permalink / raw)
To: Git Mailing List
Hi,
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.
Thanks and regards,
Sidhant Sharma
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: log --pretty accepts incomplete pre-defined formats
2016-04-06 6:13 log --pretty accepts incomplete pre-defined formats Sidhant Sharma
@ 2016-04-06 15:15 ` Junio C Hamano
2016-04-06 21:03 ` Eric Wong
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2016-04-06 15:15 UTC (permalink / raw)
To: Sidhant Sharma; +Cc: Git Mailing List, Eric Wong
Sidhant Sharma <tigerkid001@gmail.com> writes:
> 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).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: log --pretty accepts incomplete pre-defined formats
2016-04-06 15:15 ` Junio C Hamano
@ 2016-04-06 21:03 ` Eric Wong
2016-04-06 21:07 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2016-04-06 21:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Sidhant Sharma, git
Junio C Hamano <gitster@pobox.com> wrote:
> Sidhant Sharma <tigerkid001@gmail.com> writes:
>
> > 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),
Yes, being able to abbreviate 'raw', 'short', etc is intentional
to save keystrokes since I was suffering from RSI at the time.
Being able to do "--pret=r" would be nice nowadays if the
parsing in revision.c were modernized. However, the completions
in contrib/ also expands "--pretty=" nowadays, so now I care
less about shorthand options.
> which was slightly tightend by aacd404e (Fix some
> documentation typos and grammar, 2007-02-02).
Huh?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-06 21:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 6:13 log --pretty accepts incomplete pre-defined formats Sidhant Sharma
2016-04-06 15:15 ` Junio C Hamano
2016-04-06 21:03 ` Eric Wong
2016-04-06 21:07 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).