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

Re: EasyGit Integration

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Jun 10, 2009, 12:13 UTC
Message-ID
<20090610121349.GA27679@atjola.homenet>
In-Reply-To
<32541b130906091342s7dd6064fud2205bee8af95aab@mail.gmail.com>
On 2009.06.09 16:42:33 -0400, Avery Pennarun wrote:
Show 25 quoted lines
> 2009/6/9 Björn Steinbrink <B.Steinbrink@gmx.de>:
> > On 2009.06.09 15:52:46 -0400, Avery Pennarun wrote:
> >> To be honest, I'm not convinced svn's use of the word "revert" is
> >> really right, though.  Git's isn't *really* right either, since it
> >> actually makes a new commit, it doesn't remove the old one like it
> >> sounds like it does.  Maybe 'reverse' would be a better name for what
> >> git does, and we should just introduce another word for what svn does.
> >>  (With CVS, you just deleted the file and then did a checkout/update
> >> on it again, which made sense to me.  That works in git too.)
> >>
> >> Crazy idea: we could actually make 'git revert' do both: given a
> >> commit, it applies the reverse as it does now.  Given filenames, it
> >> simply brings them back to HEAD.  But maybe that's too crazy.
> >
> > Doesn't seem that crazy to me. But maybe a bit problematic if you want
> > to support both, "git checkout -- ." and "git checkout HEAD -- .". And
> > adding DWIMmery there seems dangerous, as in:
> >
> > git revert == git checkout -- .
> >
> > git revert HEAD ==
> >  no uncommitted changes = revert commit HEAD
> >  uncommitted changes = revert to HEAD
> 
> Well, that's what I meant by "crazy" :)

OK, thinking about it, I really dislike the idea of "revert --since", as that is IMHO better thought of as "get the old version back", and for "get something out of the repo" we have checkout. That would leave us with "revert changes from a commit" and "revert uncommitted/unstaged changes". For that "limited" thing, I could live with:

git revert <commit> # As is git revert --unstaged # git checkout -- git revert --uncommitted # git checkout HEAD -- / git rm --cached

IOW: Mode of operation is chosen by a flag, which has a meaning that is
somewhat similar to --cached for diff/rm, it chooses what to use as the
source for the operation. And as at least "revert --uncommitted" isn't
100% the same as "checkout HEAD --", I think the overlap that we'd have
with a small subset of the checkout functionality might be ok.
Björn
Previous: Avery PennarunNext: Elijah Newren
Message 6 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.