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

Re: git-switch history and checkout compatibility

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 1, 2023, 18:28 UTC
Message-ID
<xmqqleeubork.fsf@gitster.g>
In-Reply-To
<CACmJb3wTsWdqDGrkYC0p+eB-XYBotVcFAKcXJF3ftYdiiRvEdw@mail.gmail.com>
Namikaze Minato <LLoydsensei+git@gmail.com> writes:
> Isn't checkout supposed to become deprecated at some point?

Deprecating "checkout" hurts those who are confused by what the split "switch/restore" pair of commands do (cf. this very discussion we are having), and folks who are happily using "checkout". On the other hand, those who are happy with "switch/restore" would not be affected by the existence of "checkout". So, no, I do not think it is part of the map to deprecate the command. At least not until the split "switch/restore" pair of commands become less confusing and lose their "experimental" state, that is.

> ... And as you said you were
> not among the primary advocates to add it, I guess we should wait for
> someone else to reply about this?

There are things "switch/restore" pair do differently relative to "checkout". Some of them (like "restore" allowing checking out paths from tree only to the working tree files while not touching the index, which is not possible with "checkout") are very much welcome improvement, but some others (cf. this very discussion we are having on "switch") may simply not make any sense. Those who advocated and pushed the split "switch/restore" pair should be able to explain why they chose to do things differently much better than I would be (some differences may simply be bugs waiting to be fixed by them).

Previous: Namikaze Minato
Message 4 of 4 in “git-switch history and checkout compatibility”
  1. Namikaze MinatoJun 28, 2023
  2. Junio C HamanoJun 28, 2023
  3. Namikaze MinatoAug 1, 2023
  4. Junio C HamanoAug 1, 2023

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.