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

Re: Is "bare"ness in the context of multiple worktrees weird? Bitmap error in git gc.

From
Kristoffer Haugsbakk <code@khaugsbakk.name>
Date
Sep 7, 2023, 20:11 UTC
Message-ID
<d65e5407-df82-4a86-8050-854caf0f8058@app.fastmail.com>
In-Reply-To
<CAPMMpojTLswqubRk0Ly3RQqkrnpx_9Hiu_TRK1=ASPbPNz4ApQ@mail.gmail.com>
Hi again Tao
On Thu, Sep 7, 2023, at 06:53, Tao Klerks wrote:
> I've definitely changed my mind about "inline", I agree "main" is
> better. I'm not convinced it's the best word we could come up with,
> but if it's well-established, I'm happy with it.
Note that the conversation was forked:
1. New nomenclature to describe things more precisely
2. How good those words in themselves are at describing these things

I liked “inline” since it helped to clarify the case of a bare repository with linked worktrees. Sure, emphasizing that it has no “inline worktree” might be redundant (it can be inferred, perhaps), it's nice to be able to emphasize things for pedagogical purposes.

(I'm less sure if “attached” is needed.)
This is what we can say for certain about a repository:
• There definitely is a repository somewhere (maybe not in whatever
  worktree you are in right now though)
• It has zero or more worktrees

So “main worktree” is optional. And that optionality makes things awkward since it also used to describe where the repository lives—even when the repository has no *inline worktree* (it is bare).

The bottom line is that it's nice if one can avoid having to get into situations like this made-up conversation:

A: — I'm in the deployment worktree now. Where's the main
  worktree in our workflow? [I don't know how to use `git worktree`]
B: — That's `repository.git`.
A: — Okay nice. Is that worktree used for the mainline development?
B: — No, it has no worktree. It's bare.
A: — What? But didn't you say that it was the main worktree?
B: — Yes, in the sense that it's where the repository is. But it has no
    worktree itself.
Show 25 quoted lines
>> We can read that (1) a non-bare repository itself is considered
>> its "main worktree", (2) a bare repository, by inference, has no
>> main worktree (otherwise we wouldn't have said "if it's not"), and
>> (3) both bare and non-bare repositories can have linked worktrees
>> (again, otherwise we wouldn't have brought up a bare repository in
>> the description).
>>
>> Perhaps we should borrow it to update the glossary, like so?
>>
>
> Looks good to me, but that leaves me with a different nitpick: we say
> 'One "worktree" consists of a "working tree" and repository metadata,
> most of which are shared among other worktrees of a single repository,
> and some of which are maintained separately per worktree'
>
> This claims that the *shared metadata* (presumably the refs, the
> branch reflogs, the objects, the config, etc) are *part of the
> worktree* (a worktree "consists of" them and other things). That seems
> like a very strange way to conceive of things, to me.
>
> I would find it reasonable to state that the main worktree is part of
> the repo - certainly that's now most everyday users would think of it,
> if they were made to think of the worktree concept at all - but not
> that the shared repo metadata is part of the worktree, and especially
> not that the shared repo metadata is part of the attached worktrees.

Without getting into the subtle distinctions between is-a and has-a: I think it could make sense to think of this in terms of which one needs the other one. A worktree needs a repository, so one could say that a worktree “consists of” that. A repository on the other hand doesn't need to have any worktrees.

(But the vice-versa also makes sense.)
Show 5 quoted lines
> I imagine that this weird phrasing intends to allude to the fact that
> a worktree is "broken" without the repository metadata folder that
> contains both its worktree-specific metadata and the shared metadata
> that it depends just as much on... but can we come up with better
> "relationship words here?

I don't see why one needs to phrase or define things in terms of what would make it corrupted or not-that-thing any more. Like, a “working tree” without a Git repository is just a directory tree—it's got nothing to do with Git whatsoever.

> Sorry to continue nitpicking - I would love to see a clear
> nomenclature and description of these parts and their relationships
> for people (with less git experience) to "get it" more easily.
As a Git user I think this is a very productive topic.
Cheers
-- 
Kristoffer Haugsbakk
Previous: Sergey OrganovNext: Kristoffer Haugsbakk
Message 17 of 31 in “Is "bare"ness in the context of multiple worktrees weird? Bitmap error in git gc.”
  1. Tao KlerksSep 4, 2023
  2. Tao KlerksSep 4, 2023
  3. Tao KlerksSep 4, 2023
  4. Kristoffer HaugsbakkSep 4, 2023
  5. Kristoffer HaugsbakkSep 4, 2023
  6. Eric SunshineSep 5, 2023
  7. Kristoffer HaugsbakkSep 6, 2023
  8. Sergey OrganovSep 6, 2023
  9. Kristoffer HaugsbakkSep 6, 2023
  10. Tao KlerksSep 6, 2023
  11. Junio C HamanoSep 6, 2023
  12. Sergey OrganovSep 6, 2023
  13. Junio C HamanoSep 6, 2023
  14. Sergey OrganovSep 6, 2023
  15. Tao KlerksSep 7, 2023
  16. Sergey OrganovSep 7, 2023
  17. Kristoffer HaugsbakkSep 7, 2023
  18. Kristoffer HaugsbakkSep 7, 2023
  19. Junio C HamanoSep 7, 2023
  20. Junio C HamanoSep 6, 2023
  21. Kristoffer HaugsbakkSep 6, 2023
  22. Junio C HamanoSep 6, 2023
  23. Sergey OrganovSep 6, 2023
  24. Tao KlerksSep 5, 2023
  25. Eric SunshineSep 5, 2023
  26. Junio C HamanoSep 5, 2023
  27. Eric SunshineSep 5, 2023
  28. Junio C HamanoSep 5, 2023
  29. Tao KlerksSep 5, 2023
  30. Kristoffer HaugsbakkSep 6, 2023
  31. Tao KlerksSep 5, 2023

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.