git init --separate-git-dir doesn't play nice with linked working trees

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have identified two potential problems when using git init
--separate-git-dir with a repo that has linked working trees (created
using git worktree add).
1. Moving the gitdir of a main working tree doesn't inform linked
working trees that their gitdir has moved. It seems to me that if I do
cd main-worktree && git init --separate-git-dir=.git_repo, the git
init command should go to all the linked working trees and change
their Git links to point at main-worktree/.git_repo. But perhaps
there's some use case I'm not aware of where you'd want to change only
the gitdir path of the main working tree, and not those of linked
working trees.
2. Attempting to move the gitdir of a linked working tree breaks the
linked working tree entirely.
It seems to me that if I do cd linked-worktree && git init
--separate-git-dir=.git_repo, it should fail, or warn, or do something
other than break the linked working tree. (I note that
linked-worktree/{.git,.git_repo/commondir,.git_repo/gitdir} all point
at the wrong thing after this operation; manually fixing them restores
functionality, though it loses the link to the main working tree.)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux