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

Re: man page for "git-worktree" is a bit confusing WRT "prune"

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Nov 13, 2017, 21:06 UTC
Message-ID
<alpine.LFD.2.21.1711131603340.6299@localhost.localdomain>
In-Reply-To
<CAPig+cRLcJ2a=QKyKAkaNiewoWMQvKr_AWePKYVpGS5S9g-i1Q@mail.gmail.com>
On Mon, 13 Nov 2017, Eric Sunshine wrote:
> On Mon, Nov 13, 2017 at 9:48 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
... snip ...
Show 19 quoted lines
> >   finally, the prune "--expire" option is truly confusing:
> >
> >     --expire <time>
> >         With prune, only expire unused working trees older than <time>.
> >
> > suddenly, we encounter the verb "expire", which means ... what?
> > how does "expiring" a worktree differ from "pruning" a worktree?
> > and what makes a worktree "unused"? the normal meaning of "unused"
> > is that you haven't, you know, *used* it lately. in this context,
> > though, does it mean deleted? and if it means deleted, what does
> > it mean for it to be older than some time if it's already gone?
>
> This dates back to the original behavior of automatically pruning
> administrative information for deleted worktrees. As discussed
> elsewhere in the document, a worktree may be placed on some
> removable device (USB drive, memory stick, etc.) or network share
> which isn't always mounted. The "expire time" provides such
> not-necessarily-mounted worktrees a grace period before being pruned
> automatically.
  how is this "expire time" measured? relative to what? i've looked
under .git/worktrees/<wtname>, and i see a bunch of files defining
that worktree, but it's not clear how a worktree stores the relevant
time to be used for the determination of when a worktree "expires".
  oh, and is it fair to assume that if a worktree is temporaily
missing, and is subsequently restored, the expire time counter is
reset? otherwise, it would get kind of weird.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Eric SunshineNext: Eric Sunshine
Message 3 of 5 in “man page for "git-worktree" is a bit confusing WRT "prune"”
  1. Robert P. J. DayNov 13, 2017
  2. Eric SunshineNov 13, 2017
  3. Robert P. J. DayNov 13, 2017
  4. Eric SunshineNov 14, 2017
  5. Robert P. J. DayNov 14, 2017

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.