Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-25

Re: [PATCH] builtin/worktree.c: add option for setting worktree name

From: Barret Rennie <hidden>
Date: 2016-06-25 07:29:56

What is "the name for the worktree"? Is it the directory where it lives in?
Is it how it is listed with 'git worktree list'?
The name of the worktree is the name of the created directory in
`.git/worktrees`.
How is --name different from the <path> argument?
Currently, if you run:
	
	git worktree add /my/worktree/checkout <branch>

you get a worktree "named" checkout, i.e., `.git/worktrees/checkout`. The
idea with this patch is to allow you use a more specific name when you would
otherwise have mulitiple worktrees of the form `checkout`, `checkout1`, etc.

That is, you could do

	git worktree add --name branch1 /worktrees/branch1/src branch1
	git worktree add --name branch2 /worktrees/branch2/src branch2
	git worktree add --name branch3 /worktrees/branch3/src branch3

and have `.git/worktrees/branch1`, `.git/worktrees/branch2` and
`.git/worktrees/branch3` instead of `.git/worktrees/src`,
`.git/worktrees/src1`, `.git/worktrees/src2`. That way, it becomes more clear
when poking inside `.git/worktrees` which directory points to which checkout.

Perhaps "worktree name" isn't the most clear nomenclature for this feature.
Would "worktree directory name" be better?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help