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

Re: EasyGit Integration

From
Elijah Newren <newren@gmail.com>
Date
Jun 10, 2009, 04:20 UTC
Message-ID
<51419b2c0906092120o56db640cg2fcf77c11e7b7f42@mail.gmail.com>
In-Reply-To
<20090610033211.GA7411@mit.edu>
On Tue, Jun 9, 2009 at 9:32 PM, Theodore Tso<tytso@mit.edu> wrote:
Show 6 quoted lines
> My personal opinion is this kind of overloading is actually more
> confusing than simply adding a new name, such as "git revert-file".
> Of course, you can do that already using a git alias....  So IMHO the
> best way of handling this issue is to have git tutorials use this as a
> teachable moment, so people can create their own git alias for "git
> checkout HEAD --".
So I have a few problems with such an alias:
* It fails to work during an initial commit ("git revert-files
new-file" -> "fatal: invalid reference: HEAD")
* When not working on the initial commit, it will silently do nothing
when given a newly added file rather than undoing the add
* As a side effect of the above, trying to undo all changes via "git
revert-files ." does not actually work; any newly added files will
still remain staged.
* It makes no sense during an incomplete merge (why is HEAD more
special than other refs in $git_dir/MERGE_HEAD?  Shouldn't the user
need to specify which ref to revert relative to in such a case?)
* It can't be used to revert a file back to a revision prior to HEAD
(and 'git checkout OLDER_COMMIT -- FILE' in such a case isn't always
the right match either as it can leave the file in the working copy
when it should be removed).
* It provides no option to make the changes to just the index or just
the working copy; it always affects both (which is the right default,
but sometimes I like making changes to just one of those two places).

"git checkout <commit> -- <paths>..." really is a different command than the "revert" of svn, bzr, darcs, or mercurial. There's clearly a lot of overlap, but they're not the same. I fear that claiming they are equivalent will at some point just cause extra confusion for new git users.

Elijah
Previous: Felipe ContrerasNext: Matthieu Moy
Message 37 of 49 in “EasyGit Integration”
  1. Scott ChaconJun 9, 2009
  2. Nicolas PitreJun 9, 2009
  3. Avery PennarunJun 9, 2009
  4. Björn SteinbrinkJun 9, 2009
  5. Avery PennarunJun 9, 2009
  6. Björn SteinbrinkJun 10, 2009
  7. Elijah NewrenJun 9, 2009
  8. Miles BaderJun 10, 2009
  9. Björn SteinbrinkJun 9, 2009
  10. Elijah NewrenJun 9, 2009
  11. Björn SteinbrinkJun 9, 2009
  12. Björn SteinbrinkJun 9, 2009
  13. Junio C HamanoJun 9, 2009
  14. Elijah NewrenJun 9, 2009
  15. Elijah NewrenJun 9, 2009
  16. Matthieu MoyJun 10, 2009
  17. Linus TorvaldsJun 9, 2009
  18. Elijah NewrenJun 9, 2009
  19. Linus TorvaldsJun 9, 2009
  20. Mark LodatoJun 10, 2009
  21. Miles BaderJun 10, 2009
  22. Theodore TsoJun 10, 2009
  23. Linus TorvaldsJun 10, 2009
  24. Felipe ContrerasJun 10, 2009
  25. Linus TorvaldsJun 10, 2009
  26. Scott ChaconJun 10, 2009
  27. Jakub NarebskiJun 11, 2009
  28. Felipe ContrerasJun 11, 2009
  29. Jakub NarebskiJun 11, 2009
  30. Felipe ContrerasJun 12, 2009
  31. Jakub NarebskiJun 12, 2009
  32. Felipe ContrerasJun 12, 2009
  33. Jakub NarebskiJun 12, 2009
  34. Felipe ContrerasJun 12, 2009
  35. Björn SteinbrinkJun 13, 2009
  36. Felipe ContrerasJun 11, 2009
  37. Elijah NewrenJun 10, 2009
  38. Matthieu MoyJun 10, 2009
  39. Sam VilainJun 10, 2009
  40. Linus TorvaldsJun 10, 2009
  41. Junio C HamanoJun 10, 2009
  42. Sam VilainJun 10, 2009
  43. Jakub NarebskiJun 10, 2009
  44. Nicolas PitreJun 10, 2009
  45. Junio C HamanoJun 10, 2009
  46. Elijah NewrenJun 10, 2009
  47. Scott ChaconJun 10, 2009
  48. Felipe ContrerasJun 10, 2009
  49. Felipe ContrerasJun 10, 2009

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.