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

Add post-worktree-add hook?

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 22, 2016, 09:45 UTC
Message-ID
<CACsJy8C9OELrkHZLzwoRx26AtzVvgouRA2+m0VH7GrJGSA8PCQ@mail.gmail.com>

I started moving my git work space to multi-worktree and found it annoying that every time I add a new worktree, my first step must be copy my config.mak over. Room for improvement. I see three options:

1) add an option in 'worktree add' to copy all untracked files from
current worktree over

Only fits when you keep your .gitignore uptodate or we may copy a lot of rubbish. Good for the lazies who don't want to write hooks though.

2) improve post-checkout hook, pass something else to indicate the
worktree add operation

We also pass the current working directory where 'worktree add' is executed, so the user can copy selected files from the "source" worktree if they want.

3) add a new post-worktree-add hook

Pretty much like 2 except that we separate the two. But I don't see much point in adding this after reading that post-checkout hook is also executed in git-clone.

Comments?
-- 
Duy
Next: Junio C Hamano
Message 1 of 2 in “Add post-worktree-add hook?”
  1. Duy NguyenJan 22, 2016
  2. Junio C HamanoJan 22, 2016

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.