Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [PATCH] pretty format now configurable

From: rae l <hidden>
Date: 2016-06-15 22:44:19

On Sat, Mar 1, 2008 at 4:00 AM, Linus Torvalds
[off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help