Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

2015-11-03 Thread Junio C Hamano
Duy Nguyen writes: > The whole prune strategy is a bit messy trying to cover all cases > while still keeping out of the user's way. Perhaps if we implement > "git worktree mv", or even "worktree fixup" so the user can do it > manually (back when the prune strategy commit was

Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

2015-11-02 Thread Jeff King
On Mon, Nov 02, 2015 at 08:08:26PM +0100, Nguyễn Thái Ngọc Duy wrote: > $X/gitdir is created, or refreshed, in order to keep a linked worktree > from being pruned. But while git file is used as the foundation for > linked worktrees, it's used for other purposes as well and we should > not create

Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

2015-11-02 Thread Eric Sunshine
On Mon, Nov 2, 2015 at 2:08 PM, Nguyễn Thái Ngọc Duy wrote: > $X/gitdir is created, or refreshed, in order to keep a linked worktree > from being pruned. But while git file is used as the foundation for > linked worktrees, it's used for other purposes as well and we should >

Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

2015-11-02 Thread Duy Nguyen
(resend) On Mon, Nov 2, 2015 at 9:51 PM, Junio C Hamano wrote: > Jeff King writes: > >> [2] I suspect this code should use write_file_gently(). What happens if >> I have a read-only linked checkout? I can't hide anything from you guys can I? :) My first

Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

2015-11-02 Thread Junio C Hamano
Jeff King writes: > [2] I suspect this code should use write_file_gently(). What happens if > I have a read-only linked checkout? Or you may not be the owner of the repository, you think you are doing a read-only operation, and you silently end up creating a file that cannot

Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

2015-11-02 Thread Jeff King
On Mon, Nov 02, 2015 at 12:51:16PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > [2] I suspect this code should use write_file_gently(). What happens if > > I have a read-only linked checkout? > > Or you may not be the owner of the repository, you think you are >