git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Nanako Shiraishi <nanako3@lavabit.com>,
	felipe.contreras@gmail.com, git@vger.kernel.org
Subject: Re: [PATCH] Add --format that is a synonym to --pretty
Date: Mon, 23 Feb 2009 21:33:59 -0800	[thread overview]
Message-ID: <7vprh8mm9k.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20090224045041.GA4615@coredump.intra.peff.net> (Jeff King's message of "Mon, 23 Feb 2009 23:50:41 -0500")

Jeff King <peff@peff.net> writes:

> On Tue, Feb 24, 2009 at 01:06:26PM +0900, Nanako Shiraishi wrote:
>
>> Some people prefer to call the pretty-print styles "format", and get
>> annoyed to see "git log --format=short" fail.  Introduce it as a synonym
>> to --pretty so that both can be used interchangeably without breaking
>> examples in existing web pages or ppeople's expectations.
>
> Thinking about this in context of the proposal to support --oneline (et
> al), I think this part by itself gives confusing behavior. That is,
> --pretty=oneline can be shortened to --oneline, but --pretty=format:$x
> cannot be shortened to --format=$x.
>
> But that is modified by what happens next:
>
>> Having to say --format="format:%h %s" is redundant because none of the
>> predefined pretty-print styles have per-cent sign in it, so this patch
>> also makes it possible to say --pretty="%h %s" (and --format="%h %s").
>
> This implies that --format=$x is equivalent to --pretty=format:$x, but
> the patch actually implements the equivalent of --pretty=tformat:$x.
>
> So that raises two concerns:
>
>   1. We have to pick one as the "most common" for this shorthand; are we
>      sure tformat is it? (Personally, I think it is, but I think it is a
>      subtle point which we should be sure of).
>
>   2. This _almost_ fixes the point I raised above. That is, --format=$x
>      would match its longer --pretty=format:$x counterpart. Except that
>      --format does _tformat_, which I would have expected to get via
>      --tformat under such a proposal.

I think the patch suffers from the same problem Felipe's patch had, by
conflating two issues.  Because it had the ":some string with %" shorthand
support in addition to "--format is another way to spell --pretty", and it
did that only to "--format" side, I initially misunderstood Felipe's patch
as primarily addressing "Why do we have to say '--pretty=format:%h %s'
when it is obvious from the context that '%h %s' is a format".  It turns
out that he did not like "pretty" and wanted to be able to say "format"
even for the predefined pretty-print styles.

If we split this round into two patches, one that makes --format a synonym
to --pretty, and then another one that allows --{format,pretty}='%h %s',
and *stop there*, then we wouldn't have difficulties.

I do not think --oneline is a bad idea, but I do not think we should
explain it as "You can write anything that you can write after '--pretty='
without 'pretty=' and they mean the same thing".  That's where your
concern arises from.  You just say "'--pretty=oneline --abbrev-commit' is
so often used, so we have a shorthand for the whole thing: --oneline",
without implying anything about other things such as --short or --tformat.

  reply	other threads:[~2009-02-24  5:35 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 [this message]
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
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=7vprh8mm9k.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=nanako3@lavabit.com \
    --cc=peff@peff.net \
    /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).