git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "rae l" <crquan@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "Junio C Hamano" <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] pretty format now configurable
Date: Sat, 1 Mar 2008 14:07:23 +0800	[thread overview]
Message-ID: <91b13c310802292207j1b130077we11859bd20187226@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.1.00.0802291155550.17889@woody.linux-foundation.org>

On Sat, Mar 1, 2008 at 4:00 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
>  On Sat, 1 Mar 2008, Denis Cheng wrote:
>  >
>  >       rev->abbrev = DEFAULT_ABBREV;
>  > -     rev->commit_format = CMIT_FMT_DEFAULT;
>  > +     if (fmt_pretty)
>  > +             rev->commit_format = get_commit_format(fmt_pretty);
>
>  Umm. Now it looks like commit_format isn't initialized at all if
>  fmt_pretty hasn't been set.
>
>  Now, it looks like it will have been initialized properly in
>  "init_revisions()", but your commit log doesn't mention that, so it was
>  harder to review this patch than necessary.
>
>  Also, can you describe what the background for this is? The reason I ask
>  is that if anybody ever sets that default commit format to anythign else,
>  it will now *seriously* confuse not just users but potentially other git
>  tools too (at least gitk uses "--pretty=raw", but who knows what other
>  tools/scripts are around that just expected the default format).
yes, rev->commit_format has been initialized to CMIT_FMT_DEFAULT in
"init_revisions()", so the code of this patch has been working well in
my local repo,

the "format.pretty" configuration's background is that I often use
"--pretty=fuller" on my command line, and different "format:..." on my
different local repos, I hope there is a configuration to store this
to gitconfig.

now git log/show/whathappened accept pretty format in the following sort:
1. rev->commit_format set to CMIT_FMT_DEFAULT in init_revisions;
2. call to gitconfig will set fmt_pretty properly;
3. set rev->commit_format according to fmt_pretty;
4. setup_revisions will accept "--pretty=" from the command line;

so the "--pretty=" precedence is:
1. the command line "--pretty=";
2. "format.pretty" from the gitconfig;
3. default CMIT_FMT_DEFAULT;

and indeed I need to  generate a new patch including comments of this
in the source and in Documentation/*.txt; I will soon send a new
patch.

>
>                 Linus
>

--
Denis Cheng

  reply	other threads:[~2008-03-01  6:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-29 19:44 [PATCH] pretty format now configurable Denis Cheng
2008-02-29 20:00 ` Linus Torvalds
2008-03-01  6:07   ` rae l [this message]
2008-03-01 17:15   ` [PATCH] add pretty format configuration to git log/show/whatchanged Denis Cheng
2008-03-01 18:22     ` Johannes Schindelin
2008-03-01 19:50       ` Denis Cheng
2008-03-02  3:44         ` Junio C Hamano
2008-03-02  6:20           ` Junio C Hamano
2008-03-02  9:05           ` [PATCH 1/3] whatchanged documentation: share description of --pretty with others Denis Cheng
2008-03-02  9:05             ` [PATCH 2/3] specify explicit "--pretty=medium" with `git log/show/whatchanged` Denis Cheng
2008-03-02  9:05               ` [PATCH 3/3] log/show/whatchanged: introduce format.pretty configuration Denis Cheng
2008-03-02 17:00                 ` Junio C Hamano
2008-03-02 17:12                   ` rae l
2008-03-02 17:00               ` [PATCH 2/3] specify explicit "--pretty=medium" with `git log/show/whatchanged` Junio C Hamano
2008-02-29 21:51 ` [PATCH] pretty format now configurable Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=91b13c310802292207j1b130077we11859bd20187226@mail.gmail.com \
    --to=crquan@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).