git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Henré Botha" <henrebotha@gmail.com>
To: git@vger.kernel.org
Subject: git init --separate-git-dir doesn't play nice with linked working trees
Date: Thu, 18 Jun 2020 18:48:08 +0200	[thread overview]
Message-ID: <CAHbriek39i9NSHRw6DZm0dftk-GkeAYR74c0xyss0vbeDHu1Hw@mail.gmail.com> (raw)

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.)

             reply	other threads:[~2020-06-18 16:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 16:48 Henré Botha [this message]
2020-06-25  6:16 ` git init --separate-git-dir doesn't play nice with linked working trees Eric Sunshine
2020-08-27  8:26 ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHbriek39i9NSHRw6DZm0dftk-GkeAYR74c0xyss0vbeDHu1Hw@mail.gmail.com \
    --to=henrebotha@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).