git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Kristoffer Haugsbakk" <code@khaugsbakk.name>
To: "Tao Klerks" <tao@klerks.biz>
Cc: "Sergey Organov" <sorganov@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Taylor Blau" <me@ttaylorr.com>, "Patrick Steinhardt" <ps@pks.im>,
	git <git@vger.kernel.org>, "Junio C Hamano" <gitster@pobox.com>
Subject: Re: Is "bare"ness in the context of multiple worktrees weird? Bitmap error in git gc.
Date: Thu, 07 Sep 2023 22:11:48 +0200	[thread overview]
Message-ID: <d65e5407-df82-4a86-8050-854caf0f8058@app.fastmail.com> (raw)
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.

>> 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.)

> 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

  parent reply	other threads:[~2023-09-07 20:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 14:41 Is "bare"ness in the context of multiple worktrees weird? Bitmap error in git gc Tao Klerks
2023-09-04 14:59 ` Tao Klerks
2023-09-04 15:29   ` Tao Klerks
2023-09-04 17:42     ` Kristoffer Haugsbakk
2023-09-04 17:56 ` Kristoffer Haugsbakk
2023-09-05  0:38   ` Eric Sunshine
2023-09-06 16:00     ` Kristoffer Haugsbakk
2023-09-06 16:39       ` Sergey Organov
2023-09-06 17:59         ` Kristoffer Haugsbakk
2023-09-06 18:04           ` Tao Klerks
2023-09-06 20:26             ` Junio C Hamano
2023-09-06 22:00               ` Sergey Organov
2023-09-06 22:15                 ` Junio C Hamano
2023-09-06 22:34                   ` Sergey Organov
2023-09-07  4:53               ` Tao Klerks
2023-09-07  6:33                 ` Sergey Organov
2023-09-07 20:11                 ` Kristoffer Haugsbakk [this message]
2023-09-07 15:07               ` Kristoffer Haugsbakk
2023-09-07 18:23                 ` Junio C Hamano
2023-09-06 17:52       ` Junio C Hamano
2023-09-06 18:08         ` Kristoffer Haugsbakk
2023-09-06 19:10         ` Junio C Hamano
2023-09-06 22:11           ` Sergey Organov
2023-09-05 15:48   ` Tao Klerks
2023-09-05  0:26 ` Eric Sunshine
2023-09-05  1:09   ` Junio C Hamano
2023-09-05  5:43     ` Eric Sunshine
2023-09-05 15:13       ` Junio C Hamano
2023-09-05 16:25         ` Tao Klerks
2023-09-06 17:29           ` Kristoffer Haugsbakk
2023-09-05 16:10   ` Tao Klerks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d65e5407-df82-4a86-8050-854caf0f8058@app.fastmail.com \
    --to=code@khaugsbakk.name \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=ps@pks.im \
    --cc=sorganov@gmail.com \
    --cc=sunshine@sunshineco.com \
    --cc=tao@klerks.biz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).