All of lore.kernel.org
 help / color / mirror / Atom feed
From: Toon Claes <toon@iotcl.com>
To: Patrick Steinhardt <ps@pks.im>, git@vger.kernel.org
Subject: git-history(1) fixup broken with worktrees?
Date: Fri, 17 Jul 2026 20:54:47 +0200	[thread overview]
Message-ID: <87jyqt1m6g.fsf@emacs.iotcl.com> (raw)

Hi,

Imagine this repoducer:

    $ git init
    $ echo Hello > README
    $ git add .
    $ git commit -m'initial commit'
    $ git worktree add ../feature
    $ echo world >> README
    $ git add .
    $ git history fixup HEAD
    $ cd ../feature

Now running git-status(1) in that other worktree gives me:

    $ git status

    On branch feature
    Changes to be committed:
      (use "git restore --staged <file>..." to unstage)
            modified:   README

And:

    $ git diff --staged

    diff --git a/README b/README
    index 65a56c3..e965047 100644
    --- a/README
    +++ b/README
    @@ -1,2 +1 @@
     Hello
    -world


So suddenly my other worktree is dirty? With staged changes?
And I didn't even touch it.

Now the commit history is correct:

    $ git log --graph --oneline --all

    * 16ef548 (HEAD -> feature, main) initial commit



-- 
Cheers,
Toon

                 reply	other threads:[~2026-07-17 18:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87jyqt1m6g.fsf@emacs.iotcl.com \
    --to=toon@iotcl.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.