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

Re: Proposed git mv behavioral change

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 20, 2007, 06:36 UTC
Message-ID
<20071020063628.GV14735@spearce.org>
In-Reply-To
<20071020062400.GA30388@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
> No, I meant more that the state you have staged will never have actually
> existed in your working tree, so you could not possibly have tested it.
> However, it may be that the changes you are trying to avoid staging are
> trivial, and you're willing to accept that. And git shouldn't stand in
> your way.
> 
> And it sounds like you don't necessarily want to make a _commit_ out of
> this, you just want to keep working and not have git-mv munge your
> staged state.
Yea, I want the same thing.  :-)

And not because I commit things that weren't tested. Its because I do mini code reviews for small hunks at a time. I stage things I have looked at, and keep things I'm still unsure about unstaged. But before I commit I make sure my `git diff` output is empty, so I know that any tests I do now will match what I have when I run git-commit.

So lets say I make a change in my Makefile that changes the name of a source file to be more descriptive of that file's contents. I've reviewed the Makefile change *and* done the file rename, but I'm still not done reviewing the stuff in the file. (Yea, maybe that should be two different commits, but maybe not, lets not get into that as it depends very much on context.)

Today I move the file, then unstage the hunks I'm not sure about, then go back and restage them. Annoying. It really disrupts my workflow.

The killer feature in Git for me is the index.  That sucker saves
me on a daily basis as it lets me organize "this i'm happy with,
this i'm not" while I'm in the middle of making a single new commit.
Today git-mv robs me of it.
 
-- 
Shawn.
Previous: Jeff KingNext: Jeff King
Message 24 of 34 in “Proposed git mv behavioral change”
  1. lmage11@twcny.rr.comOct 18, 2007
  2. Michael WittenOct 19, 2007
  3. Shawn O. PearceOct 19, 2007
  4. Michael WittenOct 19, 2007
  5. Shawn O. PearceOct 19, 2007
  6. Jeff KingOct 19, 2007
  7. Michael WittenOct 19, 2007
  8. Wincent ColaiutaOct 19, 2007
  9. Michael WittenOct 19, 2007
  10. Shawn O. PearceOct 19, 2007
  11. Michael WittenOct 19, 2007
  12. Shawn O. PearceOct 19, 2007
  13. Jeff KingOct 19, 2007
  14. Michael WittenOct 19, 2007
  15. Jeff KingOct 19, 2007
  16. Michael WittenOct 19, 2007
  17. Jeff KingOct 19, 2007
  18. Michael WittenOct 19, 2007
  19. Jeff KingOct 19, 2007
  20. Ari EntlichOct 20, 2007
  21. Jeff KingOct 20, 2007
  22. Michael WittenOct 20, 2007
  23. Jeff KingOct 20, 2007
  24. Shawn O. PearceOct 20, 2007
  25. Jeff KingOct 20, 2007
  26. Karl HasselströmOct 22, 2007
  27. Michael WittenOct 20, 2007
  28. Shawn O. PearceOct 20, 2007
  29. Wincent ColaiutaOct 20, 2007
  30. Karl HasselströmOct 22, 2007
  31. Ari EntlichOct 20, 2007
  32. Shawn O. PearceOct 20, 2007
  33. Mike HommeyOct 20, 2007
  34. Jeff KingOct 20, 2007

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.