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

[PATCH] Allow pickaxe and diff-filter options to be used by git log.

From
Sean <seanlkml@sympatico.ca>
Date
May 19, 2006, 04:19 UTC
Message-ID
<BAYC1-PASMTP096010F052E9BF78B5FD4AAEA70@CEZ.ICE>
In-Reply-To
<7vac9elm2p.fsf@assigned-by-dhcp.cox.net>

Handle the -S option when passed to git log such that only the appropriate commits are displayed. Also per Junio's comments, do the same for "--diff-filter", so that it too can be used as an option to git log. By default no patch or diff information is displayed.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
---
Show 6 quoted lines
> If your goal is to make whatchanged less necessary, I think you
> would need to special case --diff-filter as well for "git log",
> although nobody on #git channel seems to have noticed.  I often
> run --diff-filter=A when I am trying to see when I added a
> particular file, to avoid getting distracted by other types of
> changes; log would be still shown if do not disable --always.
Makes sense.  This patch should cover that case too.
Sean
a2221c07a94bc378ef40182fa6b260ac88804073
 builtin-log.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
a2221c07a94bc378ef40182fa6b260ac88804073
diff --git a/builtin-log.c b/builtin-log.c
index d5bbc1c..12a6d19 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -23,6 +23,13 @@ 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->always_show_header) {
+		if (rev->diffopt.pickaxe || rev->diffopt.filter) {
+			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]);
-- 
1.3.GIT
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 10 in “Allow pickaxe to be used via git log.”
  1. Allow pickaxe to be used via git log.Sean, May 19, 2006
  2. Junio C HamanoMay 19, 2006
  3. SeanMay 19, 2006
  4. Junio C HamanoMay 19, 2006
  5. SeanMay 19, 2006
  6. Junio C HamanoMay 19, 2006
  7. Allow pickaxe and diff-filter options to be used by git log.Sean, May 19, 2006
  8. Junio C HamanoMay 19, 2006
  9. SeanMay 19, 2006
  10. Junio C HamanoMay 19, 2006

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.