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

Re: [PATCH v2 3/3] worktree prune: improve prune logic when worktree is moved

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 18, 2018, 22:59 UTC
Message-ID
<CAPig+cTwFCtNNJomC-8RHNYErkbZ821hm3mWGBXATedEcy44Jg@mail.gmail.com>
In-Reply-To
<20180315164412.14697-4-pclouds@gmail.com>

On Thu, Mar 15, 2018 at 12:44 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:

Show 7 quoted lines
> Automatic detection of worktree relocation by a user (via 'mv', for
> instance) was removed by 618244e160 (worktree: stop supporting moving
> worktrees manually - 2016-01-22). Prior to that,
> .git/worktrees/<tag>/gitdir was updated whenever the worktree was
> accessed in order to let the pruning logic know that the worktree was
> "active" even if it disappeared for a while (due to being located on
> removable media, for instance).

This is my fault since I suggested this rewrite[1], but other documentation calls this <id>, not <tag>, so: s/tag/id/

(Again, not worth a re-roll; perhaps Junio can tweak it when queuing.)
Show 10 quoted lines
> "git worktree move" has come so we don't really need this, but since
> it's easy to do, perhaps we could keep supporting manual worktree move
> a bit longer. Notice that when a worktree is active, the "index" file
> should be updated pretty often in common case. The logic is updated to
> check for index mtime to see if the worktree is alive.
>
> The old logic of checking gitdir's mtime is dropped because nobody
> updates it anyway. The new corner case is, if the index file does not
> exist, we immediately remove the stale worktree. But if the "index"
> file does not exist, you may have a bigger problem.
Makes sense.
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
[1]: https://public-inbox.org/git/CAPig+cQG8yEqunNUjoEAPY-W9+TtzWADhgjdL6udnyrG0YEOVg@mail.gmail.com/
Previous: Nguyễn Thái Ngọc DuyNext: Eric Sunshine
Message 14 of 15 in “git worktree prune improvements”
  1. 0/3 git worktree prune improvementsNguyễn Thái Ngọc Duy, Mar 3, 2018
  2. 1/3 gc.txt: more details about what gc doesNguyễn Thái Ngọc Duy, Mar 3, 2018
  3. Eric SunshineMar 3, 2018
  4. 2/3 worktree: delete dead codeNguyễn Thái Ngọc Duy, Mar 3, 2018
  5. 3/3 worktree prune: improve prune logic when worktree is movedNguyễn Thái Ngọc Duy, Mar 3, 2018
  6. Eric SunshineMar 3, 2018
  7. Randall S. BeckerMar 3, 2018
  8. Duy NguyenMar 5, 2018
  9. 0/3 git worktree prune improvementsNguyễn Thái Ngọc Duy, Mar 15, 2018
  10. 1/3 gc.txt: more details about what gc doesNguyễn Thái Ngọc Duy, Mar 15, 2018
  11. 2/3 worktree: delete dead codeNguyễn Thái Ngọc Duy, Mar 15, 2018
  12. Eric SunshineMar 18, 2018
  13. 3/3 worktree prune: improve prune logic when worktree is movedNguyễn Thái Ngọc Duy, Mar 15, 2018
  14. Eric SunshineMar 18, 2018
  15. Eric SunshineMar 18, 2018

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.