git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jin, Di" <di_jin@brown.edu>
To: git@vger.kernel.org
Cc: Nikos Vasilakis <nikos_vasilakis@brown.edu>, michael@greenberg.science
Subject: EXDEV when re-init with --separate-git-dir option
Date: Tue, 23 Jul 2024 22:47:19 -0400	[thread overview]
Message-ID: <CAKOkDnMGRfQoNygYLiAxPZB2q=VMYvw8kyu1dM=pM843-FH41Q@mail.gmail.com> (raw)

Dear maintainers,

We discovered that re-init with option --separate-git-dir will throw
an EXDEV when the target directory is not on the same file system as
the original directory.

An example is shown below:

$ mkdir -p fs1/gitdir fs2
$ ls
fs1  fs2
$ sudo mount -t tmpfs tmpfs fs2
$ cd fs1/gitdir
$ git init
Initialized empty Git repository in /home/user/fs1/gitdir/.git/
$ git init --separate-git-dir ../../fs2/surrealgitdir
fatal: unable to move /home/user/fs1/gitdir/.git to
/home/user/fs2/surrealgitdir: Invalid cross-device link

We tested this on version v2.45.2 and after reading the code a bit we
believe the issue still exist in the master branch on github
(https://github.com/git/git/blob/d19b6cd2dd72dc811f19df4b32c7ed223256c3ee/setup.c#L2280).

Best regards,
Di

             reply	other threads:[~2024-07-24  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24  2:47 Jin, Di [this message]
2024-07-24 15:39 ` EXDEV when re-init with --separate-git-dir option Junio C Hamano
2024-07-24 17:14   ` Eric Sunshine

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='CAKOkDnMGRfQoNygYLiAxPZB2q=VMYvw8kyu1dM=pM843-FH41Q@mail.gmail.com' \
    --to=di_jin@brown.edu \
    --cc=git@vger.kernel.org \
    --cc=michael@greenberg.science \
    --cc=nikos_vasilakis@brown.edu \
    /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).