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

Re: [PATCH v2] git-checkout.txt: Document "git checkout <pathspec>" better

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 17, 2015, 12:17 UTC
Message-ID
<vpqtwu6sf4r.fsf@anie.imag.fr>
In-Reply-To
<mlrn9r$9ho$1@ger.gmane.org>
"Andres G. Aragoneses" <knocte@gmail.com> writes:
Show 32 quoted lines
> On 17/06/15 13:54, Matthieu Moy wrote:
>> "Andres G. Aragoneses" <knocte@gmail.com> writes:
>>
>>> On 17/06/15 12:54, Matthieu Moy wrote:
>>>> Duy Nguyen <pclouds@gmail.com> writes:
>>>>
>>>>> On Wed, Jun 17, 2015 at 2:54 PM, Torsten Bögershausen <tboegi@web.de> wrote:
>>>>>> -git-checkout - Checkout a branch or paths to the working tree
>>>>>> +git-checkout - Switch branches or restore changes
>>>>>
>>>>> I didn't follow closely the previous discussion.
>>>>
>>>> (Neither did I)
>>>>
>>>>> Forgive me if this is already discussed, but I would keep the "in the
>>>>> working tree". "Restore changes" alone seems vague.
>>>>
>>>> "Restore previous version" would be better than "Restore changes" to me.
>>>
>>> "previous version" sounds ambiguous.
>>
>> Yes, but "git checkout" can do many things. It can restore an old
>> commited state, restore from the index, ... so we need to either be
>> vague, or use a long enumeration.
>>
>>> How about "discard local changes"?
>>
>> To me this describes "git checkout HEAD", but neither "git checkout --
>> file" nor "git checkout HEAD^^^".
>
> I didn't mean to use just "discard local changes". I was proposing
> that as a replacement to the "restore changes" substring.

Yes, but "Switch branchs or discard local changes" still does not describe "git checkout HEAD^^^ -- file.txt" (restore to an old state, but does not switch branch) or "git checkout -- file.txt" (get from the index).

To me, "discard local changes" imply that there will be no uncommited changes on the files implied in the command after the operation.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Andres G. AragonesesNext: Junio C Hamano
Message 7 of 20 in “git-checkout.txt: Document "git checkout <pathspec>" better”
  1. git-checkout.txt: Document "git checkout <pathspec>" betterTorsten Bögershausen, Jun 17, 2015
  2. Duy NguyenJun 17, 2015
  3. Matthieu MoyJun 17, 2015
  4. Andres G. AragonesesJun 17, 2015
  5. Matthieu MoyJun 17, 2015
  6. Andres G. AragonesesJun 17, 2015
  7. Matthieu MoyJun 17, 2015
  8. Junio C HamanoJun 17, 2015
  9. Torsten BögershausenJun 17, 2015
  10. Junio C HamanoJun 17, 2015
  11. Torsten BögershausenJun 17, 2015
  12. Matthieu MoyJun 17, 2015
  13. Andres G. AragonesesJun 17, 2015
  14. Junio C HamanoJun 17, 2015
  15. Junio C HamanoJun 17, 2015
  16. Torsten BögershausenJun 17, 2015
  17. Junio C HamanoJun 17, 2015
  18. Duy NguyenJun 18, 2015
  19. Junio C HamanoJun 18, 2015
  20. Matthieu MoyJun 18, 2015

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.