From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] revision.c: add --format option for 'git log'
Date: Sun, 22 Feb 2009 09:53:54 -0800 [thread overview]
Message-ID: <7v63j2z7bh.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <94a0d4530902220918oc6f8ab9vc1fd0b55cad014a2@mail.gmail.com> (Felipe Contreras's message of "Sun, 22 Feb 2009 19:18:12 +0200")
Felipe Contreras <felipe.contreras@gmail.com> writes:
> On Sun, Feb 22, 2009 at 6:49 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>
>>> --format=:foo is a shorthand for --pretty=tformat:foo, otherwise this
>>> new option acts just like --pretty=foo, except it's more intuitive for
>>> users of 'git log'.
>>
>> It's been quite a long time since the earlier discussion, but I wonder why
>> you need the colon before "foo" for this new shorthand. I *think* you are
>> also introducing "--format=short" as a synonym to "--pretty=short", but
>> I do not think it is necessary.
>
> Well, my hope was to replace --pretty=short with --format=short, but
> you said that would break other scripts.
It is not just scripts you break. You also break people's trained
fingers.
You can specify the kind of canned pretty printing with --pretty=short,
and it is not any longer to type than --format. For use in scripts that
you write once and forget, there is no need to even apply this patch.
The only reason why new --format=<fmt> could be an useful addition is
because --pretty=format:<fmt> may be too long to type interactively.
>>> As discussed in the mailing list, this is implemented as an undocumented
>>> option.
>>
>> Maybe somebody wants to document it.
>
> Ah, I would gladly add the documentation, shall I write that it's an
> 'alternative' option similar to --pretty?
I do not think we want to introduce a new way to say the same thing for
the canned short options; "alternative" is not a good word for it.
Putting it in another way...
The output format is controlled by --pretty, which knows a set of canned
output formats. You can specify --format=<fmt> if you want something
different from any of the canned format. If your git does not support
this new notation, you can say --pretty=tformat:<fmt> to get the same
effect. The old --pretty=tformat:<fmt> (and --pretty=format:<fmt>) is not
deprecated in any way.
next prev parent reply other threads:[~2009-02-22 17:55 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 [this message]
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
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=7v63j2z7bh.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
/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).