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

Re: [PATCH v2 3/3] commit::print_summary(): set rev_info.always_show_header to 1

From
Junio C Hamano <gitster@pobox.com>
Date
May 29, 2010, 01:10 UTC
Message-ID
<7vd3wf5x7n.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1274974492-4692-4-git-send-email-rctay89@gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
Show 9 quoted lines
> This attempts to fix a regression in git-commit, where non-abbreviated
> SHA-1s were printed in the summary.
>
> One possible fix would be to set ctx.abbrev to DEFAULT_ABBREV in the
> `if` block. However, we remove this codeblock altogether, and set
> rev.always_show_header.
>
> This way, we use back the same show_log() mechanism (instead of
> format_commit_message()).
I like the removal of the handcrafted call to f-c-m.  Thanks.
Show 11 quoted lines
> Quoting log-tree.c:560:
>
> 	shown = log_tree_diff(opt, commit, &log);
> 	if (!shown && opt->loginfo && opt->always_show_header) {
> 		log.parent = NULL;
> 		show_log(opt);
> 		shown = 1;
> 	}
>
> This is the only area that always_show_header is checked, so the
> setting of this flag should only affect this area.

Hmm, but also setting this flag would affect anything that changes behaviour depending on the value of log.parent, no?

> +	if (!log_tree_commit(&rev, commit))
> +		die("unable to print summary");

When always_show_header is set, what are the situations where log_tree_commit() might return false? I think your fix depends on the fact that it will never return false (which I think is a correct thing to assume---after all that is what "always_show" means ;-).

Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 14 of 17 in “commit: fix abbrev-sha regression”
  1. 0/3 commit: fix abbrev-sha regressionTay Ray Chuan, May 24, 2010
  2. 1/3 t7502-commit: add tests for summary outputTay Ray Chuan, May 24, 2010
  3. 2/3 t7502-commit: add summary output tests for empty and merge commitsTay Ray Chuan, May 24, 2010
  4. 3/3 commit: show abbreviated sha for commits with empty diffsTay Ray Chuan, May 24, 2010
  5. Junio C HamanoMay 26, 2010
  6. Tay Ray ChuanMay 26, 2010
  7. Tay Ray ChuanMay 26, 2010
  8. Junio C HamanoMay 26, 2010
  9. Tay Ray ChuanMay 26, 2010
  10. 0/3 commit: fix abbrev-sha regressionTay Ray Chuan, May 27, 2010
  11. 1/3 t7502-commit: add tests for summary outputTay Ray Chuan, May 27, 2010
  12. 2/3 t7502-commit: add summary output tests for empty and merge commitsTay Ray Chuan, May 27, 2010
  13. 3/3 commit::print_summary(): set rev_info.always_show_header to 1Tay Ray Chuan, May 27, 2010
  14. Junio C HamanoMay 29, 2010
  15. Tay Ray ChuanMay 29, 2010
  16. 3/3 commit::print_summary(): don't use format_commit_message()Tay Ray Chuan, Jun 12, 2010
  17. Will PalmerMay 27, 2010

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.