git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: log --pretty accepts incomplete pre-defined formats

From
EWEric Wong <normalperson@yhbt.net>
Date
Apr 6, 2016, 21:03 UTC
Message-ID
<20160406210339.GA18799@dcvr.yhbt.net>
In-Reply-To
<xmqqinzuzs3d.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> 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?
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “log --pretty accepts incomplete pre-defined formats”
  1. Sidhant SharmaApr 6, 2016
  2. Junio C HamanoApr 6, 2016
  3. Eric WongApr 6, 2016
  4. Junio C HamanoApr 6, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.