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

Re: [RFC PATCH 0/2] teach `worktree list` to mark locked worktrees

From
Rafael Silva <rafaeloliveira.cs@gmail.com>
Date
Oct 10, 2020, 19:06 UTC
Message-ID
<20201010190610.GA23099@contrib-buster.localdomain>
In-Reply-To
<CAPig+cR8D13cM8OewRVYfg7wNjVC05tVQw80-dm4B5XPmjHJWw@mail.gmail.com>
On Fri, Oct 09, 2020 at 06:50:02PM -0400, Eric Sunshine wrote:
Show 23 quoted lines
> >
> > Sorry for the bit late response.
> 
> Likewise.
> 
> >
> > Doing a little investigation on the code, it seems the machinery for checking
> > whether a worktree is prunable it seems is already there implemented
> > on the `should_prune_worktree()`.
> 
> Yes, when I mentioned that in [1], I envisioned
> should_prune_worktree() being moved from builtin/worktree.c to
> top-level worktree.c and possibly generalized a bit if necessary.
> 
> One thing to note is that should_prune_worktree() is somewhat
> expensive, so we'd probably want to make determination of "prunable
> reason" lazy, much like the lock reason is retrieved lazily rather
> than doing it when get_worktrees() is called. Thus, like the lock
> reason, the prunable reason would be accessed indirectly via a
> function, say worktree_prunable_reason(), rather than directly from
> 'struct worktree'.
> 
> [1]: https://lore.kernel.org/git/CAPig+cTTrv2C7JLu1dr4+N8xo+7YQ+deiwLDA835wBGD6fhS1g@mail.gmail.com/

Appreciate the tip, I will be working on the prunable annotations, verbose and other information that was proposed previously for the "worktree list" command.

Show 14 quoted lines
> > Additionally, having the ability to see the annotation and the reason in
> > case you see the annotation seems like more complete work for the intention
> > of the patch.
> >
> > Unless you think that is better to start with the annotation, and some time
> > later addressing the other changes specified by [2].
> 
> Whatever you feel comfortable tackling is fine. The simple "locked"
> annotation is nicely standalone, so it could be resubmitted with the
> changes suggested by reviewers, and graduate without waiting for the
> more complex tasks which could be done as follow-up series. Or, expand
> the current series to tackle verbose mode and/or prunable status or
> both or any combination.
> 

Thanks. I've just resubmitted the "locked" annotation patch, as you said, it's nice standalone and can be integrated and hopefully will be already useful for other git users and soon (hopefully :) ) will submit new patches for the other changes as proposed by [1].

[1]: https://lore.kernel.org/git/CAPig+cTTrv2C7JLu1dr4+N8xo+7YQ+deiwLDA835wBGD6fhS1g@mail.gmail.com/
Previous: Eric SunshineNext: Rafael Silva
Message 15 of 23 in “teach `worktree list` to mark locked worktrees”
  1. 0/2 teach `worktree list` to mark locked worktreesRafael Silva, Sep 28, 2020
  2. 1/2 worktree: teach `list` to mark locked worktreeRafael Silva, Sep 28, 2020
  3. Junio C HamanoSep 28, 2020
  4. Rafael SilvaSep 29, 2020
  5. Eric SunshineSep 30, 2020
  6. 2/2 t2402: add test to locked linked worktree markerRafael Silva, Sep 28, 2020
  7. Junio C HamanoSep 28, 2020
  8. Rafael SilvaSep 29, 2020
  9. Eric SunshineSep 30, 2020
  10. Junio C HamanoSep 28, 2020
  11. Rafael SilvaSep 29, 2020
  12. Eric SunshineSep 30, 2020
  13. Rafael SilvaOct 2, 2020
  14. Eric SunshineOct 9, 2020
  15. Rafael SilvaOct 10, 2020
  16. 0/1 Teach "worktree list" to annotate locked worktreesRafael Silva, Oct 10, 2020
  17. 1/1 worktree: teach `list` to annotate locked worktreeRafael Silva, Oct 10, 2020
  18. Eric SunshineOct 11, 2020
  19. Eric SunshineOct 11, 2020
  20. Rafael SilvaOct 11, 2020
  21. 0/1 Teach "worktree list" to annotate locked worktreesRafael Silva, Oct 11, 2020
  22. worktree: teach `list` to annotate locked worktreeRafael Silva, Oct 11, 2020
  23. Eric SunshineOct 12, 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.