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

[PATCH] whatchanged: always show the header

From
Carlos Martín Nieto <cmn@elego.de>
Date
Apr 13, 2011, 12:10 UTC
Message-ID
<1302696644-21809-1-git-send-email-cmn@elego.de>
In-Reply-To
<20110413092620.GA3649@bee.lab.cmartin.tk>

If --quiet is passed and there is no patch output, log_tree_commit will not print the log which is certainly not wanted.

Set the always_show_header option to fix this.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---

With this, "--quiet" just means the same as "-s" by telling log_tree_commit to output it. I still haven't completely understood what the relationship between log_tree_commit, log_tree_diff and log_tree_diff_flush is but AFAICS sometimes one function shows the log and sometimes the other one shows it, which I guess has to do with the QUICK option to diff.

I'm sending this now because it's a one-liner and is probably the correct behaviour anyway, but a more general solution would be to convert cmd_log_init to use the option parser and catch --quiet there, maybe even making it mean the same as -s.

 builtin/log.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 1ce00ba..b24ca8a 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -322,6 +322,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)
 	init_revisions(&rev, prefix);
 	rev.diff = 1;
 	rev.simplify_history = 0;
+	rev.always_show_header = 1;
 	memset(&opt, 0, sizeof(opt));
 	opt.def = "HEAD";
 	cmd_log_init(argc, argv, prefix, &rev, &opt);
-- 
1.7.4.2.437.g4fc7e.dirty
Previous: Carlos Martín NietoNext: Junio C Hamano
Message 10 of 17 in “Bug in "git diff --quiet" handling.”
  1. Paul GortmakerApr 11, 2011
  2. Junio C HamanoApr 11, 2011
  3. format-patch: don't pass on the --quiet flagCarlos Martín Nieto, Apr 12, 2011
  4. format-patch: document --quiet optionCarlos Martín Nieto, Apr 12, 2011
  5. Junio C HamanoApr 12, 2011
  6. Junio C HamanoApr 12, 2011
  7. Carlos Martín NietoApr 13, 2011
  8. Junio C HamanoApr 12, 2011
  9. Carlos Martín NietoApr 13, 2011
  10. whatchanged: always show the headerCarlos Martín Nieto, Apr 13, 2011
  11. Junio C HamanoApr 13, 2011
  12. Carlos Martín NietoApr 13, 2011
  13. log: convert to parse-optionsCarlos Martín Nieto, Apr 14, 2011
  14. Junio C HamanoApr 14, 2011
  15. log: convert to parse-options=?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?=, Apr 19, 2011
  16. Jeff KingApr 20, 2011
  17. Carlos Martín NietoApr 20, 2011

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.