git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Bruno Macabeus
Message 2 of 2 in “Feature Suggestion: Allow to enforce "rename" in git while committing”
  1. Bruno MacabeusFeb 14, 2020
  2. Junio C HamanoFeb 14, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.