From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Adam Majer <adamm@zombino.com>, git@vger.kernel.org
Subject: Re: [PATCH] setup: recognize bare repositories with packed-refs
Date: Sat, 09 Dec 2023 03:17:13 +0900 [thread overview]
Message-ID: <xmqqfs0c36fq.fsf@gitster.g> (raw)
In-Reply-To: <20231128190446.GA10477@coredump.intra.peff.net> (Jeff King's message of "Tue, 28 Nov 2023 14:04:46 -0500")
Jeff King <peff@peff.net> writes:
> So with regards to the loosening in your patch, my questions would be:
>
> - if we are going to change the rules for repository detection, is
> this where we want to end up? We haven't changed them (yet) for
> reftables. If we are going to do so, should we have a scheme that
> will work for that transition, too? The "refs is an empty file"
> scheme would fix your use case, too (though see below).
>
> - is the rest of Git ready to handle a missing "refs/" directory? It
> looks like making a ref will auto-create it (since we may have to
> make refs/foo/bar/... anyway).
>
> - what about other implementations? Your embedded repos will
> presumably not work with libgit2, jgit, etc, until they also get
> similar patches.
>
> - what about empty repositories? In that case there will be no "refs/"
> file and no "packed-refs" file (such a repository is less likely, of
> course, but it may contain objects but no refs, or the point may be
> to have an empty repo as a test vector). Likewise, it is possible
> for a repository to have an empty "objects" directory (even with a
> non-empty refs directory, if there are only symrefs), and your patch
> doesn't address that.
All good points.
> Getting back to your use case, I'd suggest one of:
>
> - do the usual "touch refs/.gitignore" trick to explicitly track the
> empty directory. It looks like the ref code will ignore this (we
> don't allow ref names to start with "." in a path component)
>
> - whatever is consuming the embedded repos could "mkdir -p refs
> objects" as needed. This is a minor pain, but I think in the long
> term we are moving to a world where you have to explicitly do
> "GIT_DIR=$PWD/embedded.git" to access an embedded bare repo. So
> they're already special and require some setup; adding an extra step
> may not be so bad.
Yeah, it truly is caused by the combination of the fact that we do
not "track" empty directories and that skeleton Git repository
structure does rely on possibly empty directories. The above two
are reasonable workarounds when you are dealing with any medium that
does not allow empty directories, not just working tree managed by
Git.
prev parent reply other threads:[~2023-12-08 18:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 20:25 [PATCH] setup: recognize bare repositories with packed-refs Adam Majer
2023-11-17 20:32 ` Adam Majer
2023-11-17 20:44 ` Adam Majer
2023-11-19 23:24 ` Junio C Hamano
2023-11-20 9:31 ` Glen Choo
2023-11-27 19:42 ` Josh Steadmon
2023-11-20 9:43 ` Adam Majer
2023-11-27 19:44 ` Josh Steadmon
2023-11-28 14:14 ` Adam Majer
2023-11-28 14:28 ` Adam Majer
2023-11-28 18:45 ` Josh Steadmon
2023-11-28 19:04 ` Jeff King
2023-11-29 10:13 ` Patrick Steinhardt
2023-12-06 20:10 ` Jeff King
2023-12-07 7:01 ` Patrick Steinhardt
2023-12-07 7:34 ` Jeff King
2023-12-07 8:37 ` Patrick Steinhardt
2023-11-29 21:30 ` Taylor Blau
2023-12-06 21:08 ` Jeff King
2023-12-07 8:20 ` Adam Majer
2023-12-08 21:09 ` Taylor Blau
2023-12-12 1:22 ` Jeff King
2023-12-08 18:17 ` 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=xmqqfs0c36fq.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=adamm@zombino.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.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).