From: Johannes Sixt <j6t@kdbg.org>
To: phillip.wood@dunelm.org.uk
Cc: Git Mailing List <git@vger.kernel.org>,
"sebastien.stettler" <sebastien.stettler@proton.me>
Subject: Re: git rename/moved status unreliable in ruby
Date: Sat, 2 May 2026 09:25:16 +0200 [thread overview]
Message-ID: <157dd2e5-ce64-4654-a66a-86a552c7c9f1@kdbg.org> (raw)
In-Reply-To: <026b84f4-7052-4d5b-a9ae-c2487569d1ee@gmail.com>
Am 01.05.26 um 17:30 schrieb Phillip Wood:
> Rename detection is based on how similar the two files are. Looking at
> the example you linked to below you're changing a file that looks like
>
> ...
>
> Which means that git sees that every line has changed because the
> indentation has changed.
That's correct, of course, but...
> If you want git to realize that the file has
> been renamed you could move it in one commit and then add modify it in
> the next commit.
... this is a fallacy. Splitting into two commits helps only certain
cases, in particular, when the commit that moves the files is compared
to an earlier commit, such as `git log` does. However, if a commit after
the change is compared to a commit before the move, the rename is still
not detected.
-- Hannes
next prev parent reply other threads:[~2026-05-02 7:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 5:05 git rename/moved status unreliable in ruby sebastien.stettler
2026-05-01 15:30 ` Phillip Wood
2026-05-02 7:25 ` Johannes Sixt [this message]
2026-05-03 21:59 ` Junio C Hamano
2026-05-02 8:06 ` Chris Torek
2026-05-02 9:34 ` sebastien.stettler
2026-05-04 10:00 ` Jeff King
2026-05-05 0:09 ` Junio C Hamano
2026-05-05 0:46 ` Chris Torek
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=157dd2e5-ce64-4654-a66a-86a552c7c9f1@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=phillip.wood@dunelm.org.uk \
--cc=sebastien.stettler@proton.me \
/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