[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Move shorthands.el to lisp/emacs-lisp/?

From: Yuri Khan
Subject: Re: Move shorthands.el to lisp/emacs-lisp/?
Date: Fri, 29 Oct 2021 17:31:07 +0700

On Fri, 29 Oct 2021 at 17:10, Eli Zaretskii <eliz@gnu.org> wrote:

> > “git mv” is not magical though; it does not do anything that a manual
> > move + staging both the deletion and the addition of the moved file
> > does not do.
> You misunderstood what I meant by "manual".  I meant "git rm" followed
> by "git add".
> And if you want to say that the latter also does the same as "git mv",
> then that's not my experience.

In my understanding and experience, that should have the same effect,
provided that the file content hash does not change.

> P.S. And I don't actually understand why you decided to chime in:
> would something I said cause sub-optimal results?

Just trying to dispel myths. There are a lot of those around Git, and
I find that suboptimal. Nothing personal and I’m sorry if you perceive
it as nitpicking on you.

People may acquire an anxiety like “if you meant to ‘git mv’ a file
but you just did an F6 Enter in a file manager, you have to move it
back and do it correctly”. That is not the case; one just needs to
stage both the deletion and the addition.

Alternatively, they may get an idea that “as long as you use ‘git mv’,
Git will track the rename”. This is also not the case; if one modifies
the moved file before committing the move, exact move detection will
not work and Git will fall back to heuristic-based move detection.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]