From: FMorschel <git@fmorschel.dev>
To: git@vger.kernel.org
Subject: Re: Feature Request: git mv --after (new flag)
Date: Mon, 04 Aug 2025 15:53:03 +0000 [thread overview]
Message-ID: <917aa62f-5f2a-40d7-8fa5-f19a14926241@fmorschel.dev> (raw)
In-Reply-To: <hi7t3qk7difgzip7syscarnf5ui5avnhmjxil4vzurwcfo7a6x@drccf7gibn72>
Wow, this seems to me a really weird design choice.
Do you have any insight on to why is this?
And do you have any idea if this behaviour is tracked to change
somewhere? Maybe by project config? Like, one project could opt-in for
an actual "rename" history.
On 04/08/2025 12:02, Konstantin Khomoutov wrote:
> On Mon, Aug 04, 2025 at 02:05:32PM +0000, FMorschel wrote:
>
>> This is a request to add an –after mode to git mv command to explicitly
>> mark a filesystem rename after it has occurred (analogous to mercurial
>> => hg mv –after).
>>
>> This would allow IDE/Language refactor renames/moves and would make sure
>> git still detects the moves correctly for keeping the correct commit
>> history.
> Git does not track renames in the commits in creates, so, basically, if you
> have a file foo.txt under the Git's control, and do
>
> $ git mv foo.txt bar.txt
> $ git commit
>
> The recorded commit will reference a tree object which will - compared
> to the tree object of the preceding commit - have an entry for bar.txt
> and not have an entry for foo.txt.
>
> Hence a command like "git mv --after", if implemented, would be a pure
> syntactic sugar for "git rm <old_name> && git add <new_name>".
>
next prev parent reply other threads:[~2025-08-04 15:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1fa7a8d8-3ae5-4913-b3b5-21d8f67e567d@fmorschel.dev>
[not found] ` <0afc01b2-11a2-4f77-a858-7a444e8bb1d4@fmorschel.dev>
2025-08-04 14:05 ` Feature Request: git mv --after (new flag) FMorschel
2025-08-04 15:02 ` Konstantin Khomoutov
2025-08-04 15:53 ` FMorschel [this message]
2025-08-04 16:04 ` Kristoffer Haugsbakk
2025-08-04 16:28 ` Junio C Hamano
2025-08-05 9:36 ` Konstantin Khomoutov
2025-08-05 11:47 ` FMorschel
2025-08-06 5:17 ` Junio C Hamano
2025-08-05 6:03 ` Johannes Sixt
2025-08-05 15:42 ` Junio C Hamano
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=917aa62f-5f2a-40d7-8fa5-f19a14926241@fmorschel.dev \
--to=git@fmorschel.dev \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).