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

Re: Bug report - Can create worktrees from bare repo / such worktrees can fool is_bare_repository()

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 20, 2021, 21:58 UTC
Message-ID
<CAPig+cTzshfTeNDEbGTaCvZCAjnH-mmzi0i67Wu169wXG2XN2w@mail.gmail.com>
In-Reply-To
<0f98d3e5-f2c2-526a-0476-a89778e5b2b5@gmail.com>
On Mon, Dec 20, 2021 at 12:29 PM Derrick Stolee <stolee@gmail.com> wrote:
Show 18 quoted lines
> On 12/20/2021 10:58 AM, Eric Sunshine wrote:
> > `On Mon, Dec 20, 2021 at 9:11 AM Derrick Stolee <stolee@gmail.com> wrote:
> >> So, we are manually specifying "put this in the config.worktree file"
> >> and not going through some "initialize worktree config" helper. Such
> >> a helper would be useful to avoid this issue in the future.
> >
> > Yes, I was planning to suggest this in a follow-up message.
> > Specifically, I think top-level worktree.[hc] (not builtin/worktree.c)
> > should publish a function which enables worktree-specific
> > configuration _and_ does all the necessary bookkeeping, such as moving
> > `core.bare` and `core.worktree` from .git/config to
> > .git/worktree.config. That way, not only can git-sparse-checkout take
> > advantage of it, but so can any command which needs the functionality
> > in the future, as well as the fictitious "git worktree manage" command
> > I mentioned earlier if it ever materializes.
>
> Ah. I put my change in config.[hc], but let's discuss that in the
> patch series [1].

My concern and sole reason for bringing it up is that this new function (which should be generally useful) should not end up in builtin/sparse-checkout.c. I had suggested worktree.c because its functionality is closely related to worktrees, however, since config.c has intimate knowledge of the location of worktree configuration, that also is a reasonable home for the new function. Either location should be fine; I don't feel strongly either way and don't think it needs a lot (or any) discussion.

Previous: Derrick StoleeNext: Junio C Hamano
Message 18 of 19 in “Bug report - Can create worktrees from bare repo / such worktrees can fool is_bare_repository()”
  1. Sean AllredDec 18, 2021
  2. rsbecker@nexbridge.comDec 18, 2021
  3. Sean AllredDec 18, 2021
  4. rsbecker@nexbridge.comDec 18, 2021
  5. Eric SunshineDec 19, 2021
  6. Sean AllredDec 19, 2021
  7. rsbecker@nexbridge.comDec 19, 2021
  8. Sean AllredDec 19, 2021
  9. rsbecker@nexbridge.comDec 19, 2021
  10. Eric SunshineDec 19, 2021
  11. Eric SunshineDec 19, 2021
  12. rsbecker@nexbridge.comDec 19, 2021
  13. Eric SunshineDec 20, 2021
  14. Eric SunshineDec 20, 2021
  15. Derrick StoleeDec 20, 2021
  16. Eric SunshineDec 20, 2021
  17. Derrick StoleeDec 20, 2021
  18. Eric SunshineDec 20, 2021
  19. Junio C HamanoDec 20, 2021

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.