git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:24 UTC

Re: [PATCH] Add a test about broken notes handling on rebase

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jun 16, 2026, 13:12 UTC
Message-ID
<27938b0e-d131-4a44-95bc-c06f4513e542@gmail.com>
In-Reply-To
<20260612143952.3281115-2-u.kleine-koenig@baylibre.com>
On 12/06/2026 15:39, Uwe Kleine-König wrote:
Show 25 quoted lines
> When a commit disappears during rebase because the patch content is
> already there (but not by the same patch in which case the commit would
> be skipped) the notes of that disappearing commit still survives and is
> added to the (rebased) parent of the disappearing commit.
> 
> So with the commit graph
> 
>   A -- B -- C
>    `
>     `-BD
> 
> where BD includes the changes done in B, when rebasing C on top of BD,
> the note for B should disappear and not be added to BD.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> Hello,
> 
> this is a behaviour of git that really bothers me when working on big
> patch series. I use notes to track the Message-Id of the patches when I
> send them out. Then when rebasing to a newer upstream version, the
> tracking gets confused because the Message-Id notes end up on commits
> that were not sent out yet (or I got two Message-Ids in them).
> 
> I reported that already back in 2023[1],

That thread includes a suggestion on how to fix it if anyone reading this is interesting in working on it.

> but obviously not in a way that
> resulted in a fix. So I'm trying again with a patch that adds a failing
> test.

I'm not sure carrying this test makes it any more likely that it will be fixed, though your mail might get someone interested in fixing it. Don't we already have some relevant tests t3400 rather than adding a whole new file for a single test?

Thanks
Phillip
Show 65 quoted lines
> Best regards
> Uwe
> 
> [1] https://lore.kernel.org/git/20230530092155.3zbb5uxa7eisdzxb@pengutronix.de/
> 
>   t/meson.build           |  1 +
>   t/t3322-notes-rebase.sh | 35 +++++++++++++++++++++++++++++++++++
>   2 files changed, 36 insertions(+)
>   create mode 100644 t/t3322-notes-rebase.sh
> 
> diff --git a/t/meson.build b/t/meson.build
> index c5832fee0535..6927bd9c794f 100644
> --- a/t/meson.build
> +++ b/t/meson.build
> @@ -358,6 +358,7 @@ integration_tests = [
>     't3311-notes-merge-fanout.sh',
>     't3320-notes-merge-worktrees.sh',
>     't3321-notes-stripspace.sh',
> +  't3322-notes-rebase.sh',
>     't3400-rebase.sh',
>     't3401-rebase-and-am-rename.sh',
>     't3402-rebase-merge.sh',
> diff --git a/t/t3322-notes-rebase.sh b/t/t3322-notes-rebase.sh
> new file mode 100644
> index 000000000000..64c40a523b50
> --- /dev/null
> +++ b/t/t3322-notes-rebase.sh
> @@ -0,0 +1,35 @@
> +#!/bin/sh
> +
> +test_description='Test notes on rebase'
> +
> +. ./test-lib.sh
> +
> +test_expect_success setup '
> +	git init &&
> +	echo A > A &&
> +	git add A &&
> +	git commit -m A &&
> +	git branch branch &&
> +	echo B > B &&
> +	git add B &&
> +	git commit -m B &&
> +	git notes add -m "This is B" @ &&
> +	echo C > C &&
> +	git add C &&
> +	git commit -m C &&
> +	git checkout branch &&
> +	echo B > B &&
> +	echo D > D &&
> +	git add B D &&
> +	git commit -m BD
> +'
> +
> +test_expect_success 'rebase B + C on top of BD' '
> +	git rebase @ master
> +'
> +
> +test_expect_failure 'assert there is no note on BD' '
> +	git notes show branch
> +'
> +
> +test_done
> 
> base-commit: 3e65291872de10c3f0bf05ea8c24187e7a71ebf0
Previous: Uwe Kleine-König
Message 2 of 2 in “Add a test about broken notes handling on rebase”
  1. Add a test about broken notes handling on rebaseUwe Kleine-König, Jun 12, 2026
  2. Phillip WoodJun 16, 2026

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.