From: "brian m. carlson" <sandals@crustytoothpaste•net>
To: git@vger•kernel.org
Subject: Acceptability of replacing .git internals with symlinks
Date: Thu, 24 Apr 2025 22:32:31 +0000 [thread overview]
Message-ID: <aAq7_7pFTToMPX48@tapette.crustytoothpaste.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]
Git LFS has gotten a couple of bug reports[0][1] about it failing when
some of the innards of the `.git` directory are replaced with symlinks.
This happens because the Android `repo` tool creates repositories this
way; why that is, I don't know.
I know _part_ of the problem for Git LFS is due to the fact that some
operations are run under, say, `.git/objects`, and if that's a symlink
then the path canonicalization puts the directory elsewhere and the
`.git` directory detection fails. I don't know if that's all of the
problem, or just part of it.
My inquiry here is whether we consider it acceptable for tools to create
symlinks from Git internals in this way and whether this is a thing that
should be fixed or not. I haven't tested with alternate Git
implementations, such as JGit, Game of Trees, dulwich, libgit2, or
others, so I don't know how gracefully they handle this. I will assume
for the sake of discussion that the symlinks can be created successfully
without elevated permissions and the OS and file system are fully
functional in this regard.
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`.
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.
[0] https://github.com/git-lfs/git-lfs/issues/5426
[1] https://github.com/git-lfs/git-lfs/issues/603
--
brian m. carlson (they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]
next reply other threads:[~2025-04-24 22:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 22:32 brian m. carlson [this message]
2025-04-24 23:05 ` Acceptability of replacing .git internals with symlinks Junio C Hamano
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=aAq7_7pFTToMPX48@tapette.crustytoothpaste.net \
--to=sandals@crustytoothpaste$(echo .)net \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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