git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jens Lindström" <jl@opera.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, johan@herland.net
Subject: Re: [PATCH] clone: Skip pack-*.keep files when cloning locally
Date: Wed, 3 Jul 2013 20:31:24 +0200	[thread overview]
Message-ID: <CAEef6WyMVEM0Rj5Fj7BWeP72au9ynnP20Go3FhSzJKSkdcb-aA@mail.gmail.com> (raw)
In-Reply-To: <7vzju3ftbo.fsf@alter.siamese.dyndns.org>

On Wed, Jul 3, 2013 at 7:26 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Jens Lindström <jl@opera.com> writes:
>
>> Not always.  The Linux kernel can at least be configured not to allow
>> it.  It seems this is enabled by default in at least Debian.
>
> You learn a new thing every day, I guess.  I am on Debian, I do not
> think I did any customization in that area, and I can hardlink just
> fine.

To configure it, write "1" (on) or "0" (off) to
/proc/sys/fs/protected_{hard,sym}links.  I can't remember (or imagine)
that I enabled it on any of my systems.  One of my systems is Debian
Squeeze with a 2.6.32 kernel, and it doesn't have those files, so I
guess it might have been added in some more recent kernel version.

>> This restriction had me a bit confused when I was testing variations
>> here; I expected all "access denied" failures to be because of .keep
>> files, but in fact creating hardlinks to other files (.idx and .pack)
>> failed too, even though they were readable.
>
> Is it possible that you are tripping cross-device link?  The reason
> why we have "attempt to hardlink but fall back to copy" is exactly
> because it is fairly common that people try local-cheap clone without
> realizing the source and the destination may be on separate filesystems.

No, I was certainly cloning within a single file system, and I can
confirm that a plain "ln src dest" command fails unless the user can
both read and write the source file.  So if the cloning user has
read-only access to the repository, copying will work and linking
won't (depending on the kernel,) in which case it of course is
excellent that git falls back to copying instead of linking.

      reply	other threads:[~2013-07-03 18:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 14:42 [PATCH] clone: Skip pack-*.keep files when cloning locally Jens Lindstrom
2013-06-28 18:38 ` Junio C Hamano
2013-06-28 20:38   ` Junio C Hamano
2013-07-01 10:24   ` Jens Lindström
2013-07-01 16:20     ` Junio C Hamano
2013-07-03 10:02       ` Jens Lindström
2013-07-03 17:26         ` Junio C Hamano
2013-07-03 18:31           ` Jens Lindström [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=CAEef6WyMVEM0Rj5Fj7BWeP72au9ynnP20Go3FhSzJKSkdcb-aA@mail.gmail.com \
    --to=jl@opera.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johan@herland.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).