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

Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 3, 2015, 19:54 UTC
Message-ID
<xmqqmvuudfk6.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CACsJy8Csjgcv_L+TW9YPTs5V=T2XD+eqo1w1PO4jpfDoHLQKpQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 7 quoted lines
> The whole prune strategy is a bit messy trying to cover all cases
> while still keeping out of the user's way. Perhaps if we implement
> "git worktree mv", or even "worktree fixup" so the user can do it
> manually (back when the prune strategy commit was implemented, there
> was no git-worktree), then we don't need this magic any more.
>
> So, which way to go?

I'd prefer to see "conservative and minimal first and carefully build up" instead of "snapping something together quickly and having to patch it up in rapid succession before people get hurt." and that is not limited to the "worktree" topic.

I think "if you move, you are on your own, do not do it." would be a good starting point. The user education material would say: if you create worktree B out of the primary A, and if you do not like the location B, you "rm -fr B" and then create a new C out of the primary A at a desired place, and do not reuse location B for any other purpose. The list of worktrees kept somewhere in A would then name the old location B, and it is OK to notice the staleness and remove it, but we do not have to. At that point, the magic can and should go.

After setting the user expectation that way, it is fine to design how we would give "worktree rm" and "worktree mv". As long as users' initial expectation is set to "you do not mv, ever", these can be introduced without hurting their established use pattern that would involve no 'mv'.

Previous: Duy NguyenNext: Nguyễn Thái Ngọc Duy
Message 14 of 18 in “What's the ".git/gitdir" file?”
  1. Kyle MeyerOct 27, 2015
  2. Stefan BellerOct 27, 2015
  3. Randall S. BeckerOct 27, 2015
  4. Stefan BellerOct 27, 2015
  5. Junio C HamanoOct 27, 2015
  6. Mike RappazzoOct 27, 2015
  7. Junio C HamanoOct 28, 2015
  8. setup: do not create $X/gitdir unnecessarily when accessing git file $XNguyễn Thái Ngọc Duy, Nov 2, 2015
  9. Eric SunshineNov 2, 2015
  10. Jeff KingNov 2, 2015
  11. Junio C HamanoNov 2, 2015
  12. Jeff KingNov 2, 2015
  13. Duy NguyenNov 3, 2015
  14. Junio C HamanoNov 3, 2015
  15. worktree: stop supporting moving worktrees manuallyNguyễn Thái Ngọc Duy, Dec 27, 2015
  16. Eric SunshineDec 28, 2015
  17. Duy NguyenDec 29, 2015
  18. Eric SunshineDec 31, 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.