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

Re: [Query] Separate hooks for Git worktrees

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 10, 2017, 05:00 UTC
Message-ID
<xmqq60aihgod.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79ka9VnzYTYgtWgGAhvgn2LRpP_BCQyVvQ8iC1w9XJnRxEw@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 13 quoted lines
> We have no worktree specific config yet, though patches for
> this were floated on the mailing list.
>
> Though recent versions of git learned to conditionally include
> config files. (look for includeIf in man git-config), which I think
> could be used to set the option gerrit.createChangeId  depending
> on the worktree you are in.
>
>> Any idea how I can get around this problem without having separate
>> repositories for kernel and android ?
>
> The proposed approach above might be hacky but sounds as if
> it should work?

If you meant "conditional include" by "proposed approach above", I do not see which part you found possibly hacky. It is to allow different set of configurations to apply depending on where you are working at, which I think was invented exactly for something like this.

It certainly is not any hackier than using the same repository to house separately manged projects even if they may be related projects.

Where does the aversion of "having separate repositories" primarily come from? Is it bad due to disk consumption? Is it bad because you cannot do "git diff android-branch kernel-branch"? Something else?

If it is purely disk consumption that is an issue, perhaps the real solution is to make it easier to maintain separate repositories while sharing as much disk space as possible. GC may have to be made a lot more robust in the presense of alternate object stores, for example.

Previous: Viresh KumarNext: Stefan Beller
Message 4 of 6 in “[Query] Separate hooks for Git worktrees”
  1. Viresh KumarNov 9, 2017
  2. Stefan BellerNov 9, 2017
  3. Viresh KumarNov 10, 2017
  4. Junio C HamanoNov 10, 2017
  5. Stefan BellerNov 10, 2017
  6. Viresh KumarNov 13, 2017

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.