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

Re: [PATCH] pretty format now configurable

From
rae l <crquan@gmail.com>
Date
Mar 1, 2008, 06:07 UTC
Message-ID
<91b13c310802292207j1b130077we11859bd20187226@mail.gmail.com>
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:

Show 20 quoted lines
>
>  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

Previous: Linus TorvaldsNext: Denis Cheng
Message 3 of 15 in “pretty format now configurable”
  1. pretty format now configurableDenis Cheng, Feb 29, 2008
  2. Linus TorvaldsFeb 29, 2008
  3. rae lMar 1, 2008
  4. add pretty format configuration to git log/show/whatchangedDenis Cheng, Mar 1, 2008
  5. Johannes SchindelinMar 1, 2008
  6. add pretty format configuration to git log/show/whatchangedDenis Cheng, Mar 1, 2008
  7. Junio C HamanoMar 2, 2008
  8. Junio C HamanoMar 2, 2008
  9. 1/3 whatchanged documentation: share description of --pretty with othersDenis Cheng, Mar 2, 2008
  10. 2/3 specify explicit "--pretty=medium" with `git log/show/whatchanged`Denis Cheng, Mar 2, 2008
  11. 3/3 log/show/whatchanged: introduce format.pretty configurationDenis Cheng, Mar 2, 2008
  12. Junio C HamanoMar 2, 2008
  13. rae lMar 2, 2008
  14. Junio C HamanoMar 2, 2008
  15. Johannes SchindelinFeb 29, 2008

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.