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

Re: EasyGit Integration

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 12, 2009, 20:57 UTC
Message-ID
<94a0d4530906121357h63723278i7663c25707d3c754@mail.gmail.com>
In-Reply-To
<200906110242.57475.jnareb@gmail.com>
On Thu, Jun 11, 2009 at 3:42 AM, Jakub Narebski<jnareb@gmail.com> wrote:
Show 38 quoted lines
> On Thu, 11 June 2009, Felipe Contreras wrote:
>> On Thu, Jun 11, 2009 at 3:15 AM, Jakub Narebski<jnareb@gmail.com> wrote:
>>> Scott Chacon <schacon@gmail.com> writes:
>>>> On Wed, Jun 10, 2009 at 4:04 PM, Linus
>>>> Torvalds<torvalds@linux-foundation.org> wrote:
>>>>>
>>>>> IOW, both would be "if you give it a commit, it acts at a commit level",
>>>>> and "if you give it pathnames, it acts on a pathname level".
>>>>>
>>>>> That is totally obvious, and not in the least confusing. They are two
>>>>> different things, but at the same time, there is no question about which
>>>>> is which.
>>>>>
>>>>>> In my mind these are 2 completely different commands.
>>>>>
>>>>> They are two different things, but they both make sense within the
>>>>> _context_.
>>>>>
>>>>> Only earthworms and FOX news have no concept of "in context". So it does
>>>>> make sense to say "git checkout filename" (and expect it to check out that
>>>>> _filename_ - surprise surprise), and also say "git checkout branch" (and
>>>>> expect it to check out that branch - again, big surprise).
>>>>
>>>> The problem here is that you're using 'check out' in your descriptions
>>>> of the expectations to mean two different things.  One means 'switch
>>>> branches' and the other means 'extract content'.
>>>
>>> In both cases it means getting something out of repository (checking
>>> out) and into working area.
>>
>> 'git reset' also gets something out of the repository and into the
>> working area, that's not reason enough to put them under the same
>> 'checkout' command, is it?
>
> Nope. 'git reset' resets something to the state in repository (to given
> commit).  The fact that some combination of options for 'git reset' gives
> the same result as some specific combination of options of 'git checkout'
> means only that one can arrive at some destination in two different ways.

You can describe what 'git reset' does in many ways, but in the process it's still getting something out of the repository and into the working directory, does it not? 'git checkout <commitish>' and 'git checkout <commitish> -- <path>' also do that.

Is that relevant? No. What is relevant is the final action the user is expecting to achieve.

Therefore, the fact that 'git checkout <commitish>' modifies the working directory is irrelevant, it's still doing an extra step; update HEAD, and that final action is what is important for this particular command; it switches to another commitish.

-- 
Felipe Contreras
Previous: Jakub NarebskiNext: Jakub Narebski
Message 30 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.