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

Re: [PATCH v2] checkout: teach --worktree

From
Denton Liu <liu.denton@gmail.com>
Date
Jun 23, 2020, 15:55 UTC
Message-ID
<20200623155538.GA2014954@generichostname>
In-Reply-To
<3c223d33-7f3f-7f4c-df91-3b72271308cd@gmail.com>
Hi Phillip,
Sorry for the late reply.
On Tue, Jun 16, 2020 at 05:01:53PM +0100, Phillip Wood wrote:
> I'm afraid I'm not sure that adding another option to `git checkout` is a
> good idea. The behavior of `git checkout` is already complicated enough
> which is why we ended up with switch and restore separating out branch
> switching from file updating.

I think that since this option clearly applies only for a restore-type action and there are checks in place to ensure that the user is not attempting to use it for a switch-type action, it doesn't introduce much more complexity than the `git restore --worktree` option does.

> Given `git restore` provides a way to update the worktree without touching
> the index I'm not convinced we should be further complicating `git checkout`
> especially as it defaults to --overlay unless -p is given which is confusing
> in itself.

I don't think it'll hurt to provide more than one way of doing it. As a pretty long-time user of git, I've been having trouble picking up the switch/restore commands in favour of good ol' checkout due to muscle memory. I agree that I should try and switch over to these new commands but old habits die hard and I think it would be much easier to just provide this option to checkout.

Thanks,
Denton
Previous: Phillip WoodNext: Phillip Wood
Message 8 of 9 in “checkout: teach --worktree”
  1. checkout: teach --worktreeDenton Liu, Jun 13, 2020
  2. Eric SunshineJun 14, 2020
  3. Denton LiuJun 14, 2020
  4. Denton LiuJun 14, 2020
  5. Junio C HamanoJun 14, 2020
  6. checkout: teach --worktreeDenton Liu, Jun 14, 2020
  7. Phillip WoodJun 16, 2020
  8. Denton LiuJun 23, 2020
  9. Phillip WoodJun 24, 2020

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.