From: Phillip Wood <phillip.wood123@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>, git@vger.kernel.org
Subject: Re: [PATCH] Add a test about broken notes handling on rebase
Date: Tue, 16 Jun 2026 14:12:22 +0100 [thread overview]
Message-ID: <27938b0e-d131-4a44-95bc-c06f4513e542@gmail.com> (raw)
In-Reply-To: <20260612143952.3281115-2-u.kleine-koenig@baylibre.com>
On 12/06/2026 15:39, Uwe Kleine-König wrote:
> 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
> 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
prev parent reply other threads:[~2026-06-16 13:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 14:39 [PATCH] Add a test about broken notes handling on rebase Uwe Kleine-König
2026-06-16 13:12 ` Phillip Wood [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27938b0e-d131-4a44-95bc-c06f4513e542@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=git@vger.kernel.org \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox