From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org, stolee@gmail.com, avarab@gmail.com
Subject: Re: [PATCH] sparse-checkout: create leading directory
Date: Thu, 20 Jan 2022 12:26:05 -0800 [thread overview]
Message-ID: <xmqqv8yegnmq.fsf@gitster.g> (raw)
In-Reply-To: <20220120185548.3648549-1-jonathantanmy@google.com> (Jonathan Tan's message of "Thu, 20 Jan 2022 10:55:48 -0800")
Jonathan Tan <jonathantanmy@google.com> writes:
> When creating the sparse-checkout file, Git does not create the leading
> directory, "$GIT_DIR/info", if it does not exist. This causes problems
> if the repository does not have that directory. Therefore, ensure that
> the leading directory is created.
>
> This is the only "open" in builtin/sparse-checkout.c that does not have
> a leading directory check. (The other one in write_patterns_and_update()
> does.)
>
> Note that the test needs to explicitly specify a template when running
> "git init" because the default template used in the tests has the
> "info/" directory included.
>
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
> This problem is being discussed in [1], and we also noticed this problem
> internally at $DAYJOB. Here's a fix.
Interesting, as $GIT_DIR/info is created during "git init".
But it is possible to lose the directory if there is no need for any
of the files---the user may rmdir or rm -fr it, and it is too harsh
to call the repository "corrupted".
Will queue.
next prev parent reply other threads:[~2022-01-20 20:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 18:55 [PATCH] sparse-checkout: create leading directory Jonathan Tan
2022-01-20 20:26 ` Junio C Hamano [this message]
2022-01-20 21:30 ` Ævar Arnfjörð Bjarmason
2022-01-22 7:58 ` SZEDER Gábor
2022-01-21 17:44 ` [PATCH v2] " Jonathan Tan
2022-01-21 18:48 ` Ævar Arnfjörð Bjarmason
2022-01-22 5:21 ` Elijah Newren
2022-01-22 12:06 ` Ævar Arnfjörð Bjarmason
2022-01-22 17:29 ` Elijah Newren
2022-01-24 11:17 ` Ævar Arnfjörð Bjarmason
2022-01-24 18:25 ` Jonathan Tan
2022-01-25 5:37 ` Elijah Newren
2022-01-22 2:33 ` Elijah Newren
2022-01-24 18:22 ` Jonathan Tan
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=xmqqv8yegnmq.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=stolee@gmail.com \
/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).