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

Feature Suggestion: Allow to enforce "rename" in git while committing

From
BMBruno Macabeus <bruno.macabeus@gmail.com>
Date
Feb 14, 2020, 21:23 UTC
Message-ID
<CANnkH-ViK9qySZGi=xbcE4YDiskhLxDsH21DMxTEHi6=X0EZuQ@mail.gmail.com>
Hello for all,

initially I posted a question on Stack Overflow asking if is possible to do something using Git, but seems that there is no away to do that, and I think that it could be useful in order to improve the organisation on logs.

My user case is:
- I'm doing a refactor on a project, migrating from JS to TS
- So I need to rename a file from index.js to index.ts (for example)
- Since the TS build steps are different, I also need to change its contents
- Sometimes I need to do so much changes that git thinks that I
removed index.js and created index.ts, but it's wrong, losing its
tracking on logs!

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.

So I think that would be useful explicitly say to git "Hey, you should forgot the minimum similarity threshold on this file and on this commit. I renamed this file from index.js to index.ts. You should bind they".

Is it make sense?
Thank you!
Next: Junio C Hamano
Message 1 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.