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

[Query] Separate hooks for Git worktrees

From
Viresh Kumar <viresh.kumar@linaro.org>
Date
Nov 9, 2017, 10:58 UTC
Message-ID
<CAKohponsPQC6qTw99+xh1RSu0bZNDSo5TbbZZcYmup3NOW6QmA@mail.gmail.com>
Hi,

I have a typical use case, where I am using the same repository for both Android and Linux kernel branches.

Android needs us to keep a special hook "commit-msg" which adds a "Change-Id" to every commit we create.

While this works fine with Android, the behavior doesn't change by simply changing to a upstream kernel branch and eventually by mistake I may end up sending patch with Change-Id to upstream kernel as well. And I want to avoid that.

I am looking at ways to make this configuration work for me by applying the hook only for Android branches.

I tried using the "git worktrees" command to create a separate linked tree for my android branch, but it doesn't have a .git directory but just a file linking to the main repository.

Any idea how I can get around this problem without having separate repositories for kernel and android ?

Thanks in advance.

-- viresh

Next: Stefan Beller
Message 1 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.