Re: [PATCH v2 3/5] worktree: add upgrade_to_worktree_config()
From: Derrick Stolee <hidden>
Date: 2021-12-28 17:04:05
On 12/28/2021 11:58 AM, Eric Sunshine wrote:
On Tue, Dec 28, 2021 at 10:03 AM Derrick Stolee [off-list ref] wrote:quoted
On 12/21/2021 7:45 PM, Eric Sunshine wrote:quoted
It would be a good idea to drop the final sentence since there is no such thing as a bare worktree (either conceptually or practically), and end the first sentence at "case": i.e. "... stops that special case."Bare worktrees don't exist, that is correct. But if one existed it would be a directory where you could operate as if it is a bare repo, but it has its own HEAD different from the base repo's HEAD. Not sure why one would want it.I'm not following. I also still don't know what "base repo" is or where two HEADs would arise.quoted
quoted
quoted
+ char *base_config_file = xstrfmt("%s/config", r->commondir); + char *base_worktree_file = xstrfmt("%s/config.worktree", r->commondir);Per path.c:strbuf_worktree_gitdir(), this use of `r->commondir` is correct. Good. Can we use more meaningful variable names? It's not at all clear what "base" means in this context (I don't think it has any analog in Git terminology). Perhaps name these `shared_config` and `repo_config`, respectively.'repo_config' is too generic, because I want the worktree config for the "original" repo. I chose to call that the "base" repo and its worktree config. Shared_config is a good name, though.There seems to be some terminology confusion or conflict at play here. We're dealing with only a single repository and zero or more worktrees, so I'm still having trouble understanding your references to "original repo" and "base repo", which seem to indicate multiple repositories.
Your use of "main worktree" is what I am meaning. I will adopt your terminology. Thanks, -Stolee