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

Re: [PATCH] worktree: record creation time and free-form note

From
Chris Torek <chris.torek@gmail.com>
Date
Jun 5, 2026, 16:57 UTC
Message-ID
<CAPx1Gvegc0KvE8zb90n7vLJLKx6EkmBvCWW=NPf+nwiZc+oWdQ@mail.gmail.com>
In-Reply-To
<b1b15a47-0842-4a26-9a95-bfdae12799e0@gmail.com>
On Fri, Jun 5, 2026 at 8:31 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
> Isn't "what is the worktree for" a property of the branch that's checked
> out, not the worktree itself?
I don't think it is.

A lot of things within Git have, shall way say, "less than optimal" names, with "branch" (with at least three different meanings), "HEAD", and "index" being examples of this. (This is just an observation, not a complaint: we know from studies that oddities in names don't matter that much after a bit of usage of some system. They're just minor stumbling blocks when getting started.)

Work-tree or working tree is not one of them, though. It's concise and pointed: a working tree is where you do work.

As such, the *purpose* of a working tree is exactly as general as the purpose of doing work! That's a wide-open set.

Git's internal constraint, of requiring each working tree that is using a branch name to have a unique-to-that-tree branch name, is a property specific to branch names, not to branching in general (an example of the ambiguity of "branch" here). And of course, as you note, any working tree can be on a detached HEAD.

Exactly what properties any given working tree should have, and the weird entanglement Git has between the "primary" working tree (the one created by any non-bare clone) and all "secondary" working trees, is a mere (ahem) matter of implementation. Descriptions, creation times, modification times, etc., are all potentially useful.

I think, had Git initially made all repositories effectively bare, with separate working trees added later, this might all be a little clearer, but of course that ship sailed, crossed *all* the oceans, sank, was refloated and refitted, and sailed for another decade already. :-)

Chris
Previous: Kristoffer HaugsbakkNext: Kiesel, Norbert
Message 11 of 13 in “worktree: record creation time and free-form note”
  1. worktree: record creation time and free-form noteKiesel, Norbert, Jun 2, 2026
  2. Junio C HamanoJun 2, 2026
  3. Junio C HamanoJun 2, 2026
  4. Kiesel, NorbertJun 3, 2026
  5. Kiesel, NorbertJun 3, 2026
  6. Junio C HamanoJun 4, 2026
  7. Junio C HamanoJun 8, 2026
  8. Phillip WoodJun 5, 2026
  9. Kiesel, NorbertJun 5, 2026
  10. Kristoffer HaugsbakkJun 5, 2026
  11. Chris TorekJun 5, 2026
  12. Kiesel, NorbertJun 8, 2026
  13. Phillip WoodJun 9, 2026

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.