git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC/PATCH] revision.c: add --format option for 'git log'
Date: Sun, 22 Feb 2009 12:34:08 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0902221225080.3111@localhost.localdomain> (raw)
In-Reply-To: <94a0d4530902221014i46e52542j2380386405b559e2@mail.gmail.com>



On Sun, 22 Feb 2009, Felipe Contreras wrote:
>
> 'git log --pretty=foo' is very unintuitive, no one would ever find
> that option by intuition. Are there different kinds of pretties? Is
> the default behavior --ugly?

Historically, the default behaviour _was_ indeed --ugly.

There was no native "git log" command per se, it was literally a script 
that did something like

	git-rev-list <rev-opts> |
		git-diff-tree --stdin --pretty |
		$(PAGER)

and the "--pretty" option was to tell git to give human-readable output 
from git-diff-tree rather than the harsh raw stuff.

So yes, the default for git used to be "low-level plumbing commands for 
scripting", with some options to turn them pretty for the fleshies.

Then we started having more options, so "--pretty" became "--pretty=xyz".

But I do realize that without the historical background, none of this 
makes sense. And quite frankly, I do hate "--pretty=xyz" myself. I find 
myself wishing I could just write

	git log --oneline

instead of "--pretty=oneline", and I wish "shortlog" was a pretty format 
instead of a command of its own.

So at least personally, I would not object AT ALL to

 - leave the "--pretty=xyz" parsing for historical reasons

 - support "--format=xyz" too, because it does make sense (and it's 
   unambiguous: a format without a '%' sign in it makes no sense, so there 
   is no reason to have "--format=format:%s"

 - if we see an unrecognized "--<option>", and the <option> is a format 
   name, just assume the user was lazy and couldn't be bothered to write 
   out "format="

and then for extra bonus points, make "shortlog" work as a format too.

			Linus

  parent reply	other threads:[~2009-02-22 20:36 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-21 15:26 [RFC/PATCH] revision.c: add --format option for 'git log' Felipe Contreras
2009-02-22 16:49 ` Junio C Hamano
2009-02-22 17:18   ` Felipe Contreras
2009-02-22 17:53     ` Junio C Hamano
2009-02-22 18:06       ` Junio C Hamano
2009-02-22 18:14       ` Felipe Contreras
2009-02-22 18:37         ` Junio C Hamano
2009-02-22 18:55           ` Felipe Contreras
2009-02-23  6:39             ` Junio C Hamano
2009-02-24  0:56               ` Felipe Contreras
2009-02-24  1:03                 ` Felipe Contreras
2009-02-24  1:33                   ` Junio C Hamano
2009-02-24  1:55                     ` Nanako Shiraishi
2009-02-24  8:00                       ` Junio C Hamano
2009-02-24  9:34                         ` Felipe Contreras
2009-02-24  4:06                     ` [PATCH] Add --format that is a synonym to --pretty Nanako Shiraishi
2009-02-24  4:50                       ` Jeff King
2009-02-24  5:33                         ` Junio C Hamano
2009-02-24  5:45                           ` Jeff King
2009-02-24  9:59                             ` [PATCH 0/3] --format, --pretty and --oneline Nanako Shiraishi
2009-02-24  9:59                               ` [PATCH 1/3] Add --format that is a synonym to --pretty Nanako Shiraishi
2009-02-24  9:59                               ` [PATCH 2/3] Give short-hands to --pretty=tformat:%formatstring Nanako Shiraishi
2009-02-24  9:59                               ` [PATCH 3/3] Add --oneline that is a synonym to "--pretty=oneline --abbrev-commit" Nanako Shiraishi
2009-02-24 17:38                                 ` Junio C Hamano
2009-02-24 21:06                                   ` [PATCH] Add tests for git log --pretty, --format and --oneline Felipe Contreras
2009-02-25  9:54                                     ` Junio C Hamano
2009-02-25  9:57                                       ` Jeff King
2009-02-25 10:16                                         ` Junio C Hamano
2009-02-25 10:20                                           ` Jeff King
2009-02-24 11:02                               ` [PATCH] bash completion: add --format= and --oneline options for "git log" Teemu Likonen
2009-02-24 13:33                                 ` [PATCH v2] " Teemu Likonen
2009-02-24 15:39                                   ` Shawn O. Pearce
2009-02-24 15:47                                     ` Teemu Likonen
2009-02-24 15:57                                       ` Shawn O. Pearce
2009-02-24 16:14                                         ` Teemu Likonen
2009-02-27 18:53                                   ` Teemu Likonen
2009-02-24  8:35                     ` [RFC/PATCH] revision.c: add --format option for 'git log' Felipe Contreras
2009-02-22 20:34         ` Linus Torvalds [this message]
2009-02-22 22:12           ` Jakub Narebski
2009-02-23  9:55           ` Wincent Colaiuta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0902221225080.3111@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).