Re: [PATCH] Allow pickaxe to be used via git log.
- From
Sean <seanlkml@sympatico.ca>
- Date
- May 19, 2006, 03:38 UTC
- Message-ID
- <BAYC1-PASMTP10904A6D8E8EC08830C8F3AEA70@CEZ.ICE>
- In-Reply-To
- <7vk68ilnoi.fsf@assigned-by-dhcp.cox.net>
On Thu, 18 May 2006 20:05:01 -0700 Junio C Hamano <junkio@cox.net> wrote:
> User's scripts. The point is the set of arguments rev-list as > the lowest level machinery should not be modified by an > arbitrary policy decision that happens to suit "git log" usage. >
Okay, thanks.
This moves the policy up a level and into the log/show/whatchanged code and makes the code match the commit message better. However, it will still "disobey" user options if the user tries to combine both pickaxe and --always for these commands; but hopefully that's okay at this level.
Sean
diff --git a/builtin-log.c b/builtin-log.c index d5bbc1c..d2c3df0 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -23,6 +23,11 @@ static int cmd_log_wc(int argc, const ch rev->commit_format = CMIT_FMT_DEFAULT; rev->verbose_header = 1; argc = setup_revisions(argc, argv, rev, "HEAD"); + if (rev->diffopt.pickaxe && rev->always_show_header) { + rev->always_show_header = 0; + if (rev->diffopt.output_format == DIFF_FORMAT_RAW) + rev->diffopt.output_format = DIFF_FORMAT_NO_OUTPUT; + } if (argc > 1) die("unrecognized argument: %s", argv[1]);