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

Re: [PATCH v5 2/2] revision: implement `git log --merge` also for rebase/cherry-pick/revert

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2024, 04:35 UTC
Message-ID
<xmqqa5nnj10v.fsf@gitster.g>
In-Reply-To
<20240225-ml-log-merge-with-cherry-pick-and-other-pseudo-heads-v5-2-af1ef2d9e44d@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
Show 11 quoted lines
> +	for (i = 0; i < ARRAY_SIZE(other_head); i++)
> +		if (!read_ref_full(other_head[i],
> +				RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
> +				oid, NULL)) {
> +			if (is_null_oid(oid))
> +				die(_("%s is a symbolic ref?"), other_head[i]);
> +			return other_head[i];
> +		}
> +
> +	die(_("--merge requires one of the pseudorefs MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD or REBASE_HEAD"));
> +}

Just a minor nit, but reacting to recent "passive-aggressive" message change in another thread, perhaps we should stop asking a rhetorical question like the new message and instead state what we detected and what we consider is an error condition as a fact in them.

The last die() in the above helper function used to be such a rhetorical question "--merge without HEAD?" but now it reads much better. The one about symbolic ref is new in this series, and we can avoid making it rhetorical from the get go. Perhaps "%s exists but it is a symbolic ref" or something?

Previous: Philippe BlainNext: Philippe Blain
Message 18 of 26 in “Implement `git log --merge` also for rebase/cherry-pick/revert”
  1. 0/2 Implement `git log --merge` also for rebase/cherry-pick/revertPhilippe Blain, Feb 10, 2024
  2. 1/2 revision: ensure MERGE_HEAD is a ref in prepare_show_mergePhilippe Blain, Feb 10, 2024
  3. 2/2 revision: implement `git log --merge` also for rebase/cherry-pick/revertPhilippe Blain, Feb 10, 2024
  4. Johannes SixtFeb 11, 2024
  5. Philippe BlainFeb 11, 2024
  6. Johannes SixtFeb 11, 2024
  7. Junio C HamanoFeb 12, 2024
  8. Phillip WoodFeb 12, 2024
  9. Philippe BlainFeb 13, 2024
  10. Phillip WoodFeb 14, 2024
  11. Jean-Noël AvilaFeb 13, 2024
  12. Philippe BlainFeb 13, 2024
  13. 0/2 Implement `git log --merge` also for rebase/cherry-pick/revertPhilippe Blain, Feb 25, 2024
  14. 1/2 revision: ensure MERGE_HEAD is a ref in prepare_show_mergePhilippe Blain, Feb 25, 2024
  15. Jean-Noël AvilaFeb 26, 2024
  16. Philippe BlainFeb 26, 2024
  17. 2/2 revision: implement `git log --merge` also for rebase/cherry-pick/revertPhilippe Blain, Feb 25, 2024
  18. Junio C HamanoFeb 26, 2024
  19. Philippe BlainFeb 26, 2024
  20. Phillip WoodFeb 27, 2024
  21. Junio C HamanoFeb 27, 2024
  22. 0/2 Implement `git log --merge` also for rebase/cherry-pick/revertPhilippe Blain, Feb 28, 2024
  23. 1/2 revision: ensure MERGE_HEAD is a ref in prepare_show_mergePhilippe Blain, Feb 28, 2024
  24. 2/2 revision: implement `git log --merge` also for rebase/cherry-pick/revertPhilippe Blain, Feb 28, 2024
  25. phillip.wood123@gmail.comFeb 28, 2024
  26. Philippe BlainMar 2, 2024

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.