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

Re: [PATCH] revision: fix --left/right-only use with unrelated histories

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Mar 30, 2025, 10:11 UTC
Message-ID
<f8a7d089-3150-4212-8ad0-c9bbb3858776@gmail.com>
In-Reply-To
<20250330055809.1019090-1-m@lfurio.us>
Hi Matt
On 30/03/2025 06:49, Matt Hunter wrote:
Show 10 quoted lines
> +test_expect_success 'rev-list one-sided unrelated symmetric diff' '
> +	test_tick &&
> +	git commit --allow-empty -m xyz &&
> +	git branch cmp &&
> +	git rebase --force-rebase --root &&
> +
> +	git rev-list --left-only  HEAD...cmp >head &&
> +	git rev-list --right-only HEAD...cmp >cmp  &&
> +
> +	test $(comm -12 <(sort head) <(sort cmp) | wc -l) = "0"

Thank you for adding a test. We have a helper function test_line_count which provides a helpful debugging message if the comparison fails. Using that and avoiding process substitutions we'd write

	sort head >sorted_head &&
	sort cmp >sorted_cmp &&
	comm -12 sorted_head sorted_cmp >actual &&
	test_line_count = 0 actual
Thanks
Phillip
> +
>   test_done
> 
> base-commit: 683c54c999c301c2cd6f715c411407c413b1d84e
Previous: Junio C HamanoNext: Matt Hunter
Message 4 of 9 in “revision: fix --left/right-only use with unrelated histories”
  1. revision: fix --left/right-only use with unrelated historiesMatt Hunter, Mar 30, 2025
  2. Johannes SixtMar 30, 2025
  3. Junio C HamanoApr 1, 2025
  4. Phillip WoodMar 30, 2025
  5. Matt HunterMar 30, 2025
  6. phillip.wood123@gmail.comApr 2, 2025
  7. Matt HunterApr 4, 2025
  8. revision: fix --left/right-only use with unrelated historiesMatt Hunter, Mar 30, 2025
  9. Junio C HamanoApr 11, 2025

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.