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 9, 2009, 21:18 UTC
Message-ID
<20090609211806.GC13781@atjola.homenet>
In-Reply-To
<51419b2c0906091340i11965efcr5cf5bb4a71108fa6@mail.gmail.com>
On 2009.06.09 14:40:33 -0600, Elijah Newren wrote:
Show 15 quoted lines
> Hi,
> 
> 2009/6/9 Björn Steinbrink <B.Steinbrink@gmx.de>:
> > On 2009.06.09 11:59:08 -0700, Scott Chacon wrote:
> >> * breaks the various things that 'checkout' does into separate
> >> commands - moves 'revert' to doing what 'checkout -- path' does
> >
> > Looking through the "eg revert" docs [1], I can't seem to find how you can
> > do "checkout -- path" with it at all. "eg revert foo" seems to be "git
> > checkout HEAD -- foo".
> 
> If you want to revert only the unstaged changes to path:
>   "checkout -- path" OR "revert --unstaged path"
> If you want to revert both staged and unstaged changes to foo:
>   "checkout HEAD -- foo" OR "revert foo"

OK, so --unstaged doesn't just select the destination, but also the source, unless you explicitly override it, right?

eg revert [--since HEAD] path
  ==> source: HEAD, destination: working tree, index
eg revert --unstaged path
  ==> source: index, destination: working tree
eg revert --unstaged --since HEAD path
  ==> source: HEAD, destination: working tree
Show 14 quoted lines
> 
> > The "eg revert" looks really confusing to me.
> > "eg revert --unstaged --in HEAD~8". Hu? Revert unstaged changes in
> > HEAD~8? Am I missing something?
> 
> Hmm.  Bad ordering, I guess -- it's revert changes in HEAD~8 to the
> working copy only (by default, revert tries to apply changes to both
> the working copy and the index).  Yeah, it doesn't read very well.
> 
> I'm not sure I like having "--in" as part of revert, partially because
> of this confusion (and partially because I don't think it's
> implementation is correct anyway).  However, I do occasionally really
> like being able to revert the change _to a single file_ made in some
> previous commit, so I haven't removed it from eg (yet?).  *shrug*

I'm not sure that "--in" is the worst thing here. To me, --unstaged is worse, because I apply the attribute "unstaged" to the changes to be reverted. And that makes no sense when I supply a commit, a commit cannot have unstaged changes. I guess that if --unstaged wasn't used to select the destination, I might have come up with "eg revert --unstaged" myself, just from seeing the options. But seeing that --unstaged can be used with a commit confused me.

Björn
Previous: Elijah NewrenNext: Björn Steinbrink
Message 11 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.