Re: Feature Suggestion: Allow to enforce "rename" in git while committing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 14, 2020, 21:38 UTC
- Message-ID
- <xmqqa75konnj.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CANnkH-ViK9qySZGi=xbcE4YDiskhLxDsH21DMxTEHi6=X0EZuQ@mail.gmail.com>
Bruno Macabeus <bruno.macabeus@gmail.com> writes:
> I should not create one commit just renaming the file and on another > commit updating its content, because the project won't build on the > first commit (since the build steps is different on a .ts file). And I > don't want to create a commit that the project can't be built on.
Even if you did the two-step renaming, comparing the end result (i.e. HEAD) with the state before these two commits (i.e. HEAD~2, before renaming and before editing) with "git diff HEAD~2 HEAD" will not behave any differently if you did the renaming and modifying in a single commit. So it does not make much sense to split it into two artificial steps at all.