git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org
Subject: Re: Acceptability of replacing .git internals with symlinks
Date: Thu, 24 Apr 2025 16:05:46 -0700	[thread overview]
Message-ID: <xmqqwmb9rwhh.fsf@gitster.g> (raw)
In-Reply-To: <aAq7_7pFTToMPX48@tapette.crustytoothpaste.net> (brian m. carlson's message of "Thu, 24 Apr 2025 22:32:31 +0000")

"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> I know symlinking the `hooks` directory is common and semi-suppported,
> but I don't know how we feel about other directories, such as `objects`.

I do not know how widely it is used, but the git-new-workdir script
we ship in contrib/workdir/ does make symlinks from a new directory
whose name is ".git" into subdirectories of an existing $GIT_DIR/ to
pretend as if the "new-workdir" is a separate Git repository, that
happens to share many files and directories like config, refs,
objects, etc.

I do not think we ever intended to support ".git" itself being a
symbolic link to ".git" directory owned by another repository.  We
do have ".git" that is a regular file for multiple worktree support,
but that is totally different from "just making a symlink for the
whole hierarchy".

> If we _do_ want to support this, then we should probably add some tests
> for it, and if we don't, then we may want to add advice or diagnostics
> to discourage this behaviour.

100% agreed.

      reply	other threads:[~2025-04-24 23:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24 22:32 Acceptability of replacing .git internals with symlinks brian m. carlson
2025-04-24 23:05 ` Junio C Hamano [this message]

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

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

  git send-email \
    --in-reply-to=xmqqwmb9rwhh.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /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.
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 NNTP newsgroup(s).