git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Taylor Blau <me@ttaylorr.com>,
	Adina Wagner <a.wagner@fz-juelich.de>,
	git@vger.kernel.org
Subject: Re: suspected race between packing and fetch (single case study)
Date: Mon, 11 Jan 2021 14:25:10 -0500	[thread overview]
Message-ID: <X/ymFuUPn2POWA/p@nand.local> (raw)
In-Reply-To: <xmqq35z9g3pw.fsf@gitster.c.googlers.com>

On Sat, Jan 09, 2021 at 02:11:55PM -0800, Junio C Hamano wrote:
> So, we probalby should document "git clone --local" that the user
> should expect fallout similar to what may happen when they copy a
> directory hierarchy with "cp -r src dst" and muck with what is in
> "src" while the copy is ongoing.

Mm, good idea. Below the cut line is a patch to do just that. I thought
briefly about documenting it in the pack-protocol page, but it only
mentions the local transport in passing, so it seemed inappropriate to
add that much more detail there.

--- 8< ---

Subject: [PATCH] Documentation/git-clone.txt: document race with --local

When running 'git clone --local', the operation may fail if another
process is modifying the source repository. Document that this race
condition is known to hopefully help anyone who may run into it.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 Documentation/git-clone.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 876aedcd47..02d9c19cec 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -57,6 +57,10 @@ repository is specified as a URL, then this flag is ignored (and we
 never use the local optimizations).  Specifying `--no-local` will
 override the default when `/path/to/repo` is given, using the regular
 Git transport instead.
++
+*NOTE*: this operation can race with concurrent modification to the
+source repository, similar to running `cp -r src dst` while modifying
+`src`.

 --no-hardlinks::
 	Force the cloning process from a repository on a local
--
2.30.0.138.g6d7191ea01


  reply	other threads:[~2021-01-11 19:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fe9babc8-a3ee-6be4-e4f8-9690cb7c79bd@fz-juelich.de>
2021-01-08 16:39 ` suspected race between packing and fetch (single case study) Adina Wagner
2021-01-08 18:48   ` Taylor Blau
2021-01-09 22:11     ` Junio C Hamano
2021-01-11 19:25       ` Taylor Blau [this message]
2021-01-12 17:46         ` yoh
2021-01-12 18:47           ` Taylor Blau
2021-01-13 14:55             ` yoh

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=X/ymFuUPn2POWA/p@nand.local \
    --to=me@ttaylorr.com \
    --cc=a.wagner@fz-juelich.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).