[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple checkout copies
From: |
David Kastrup |
Subject: |
Re: Multiple checkout copies |
Date: |
Tue, 03 Feb 2015 11:22:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Achim Gratz <address@hidden> writes:
> Richard Stallman writes:
>> > $ git clone --shared emacs-1 emacs-2
>>
>> sounded like just the right thing until you posted
>> the caveat. After this, I hesitate to use it:
>>
>> > Using --shared may be risky, as Git may choose to GC the
>> > dangling objects away from emacs-1, not taking into account the
>> > possibility of them being used in some other trees. In my case,
>> > the source directory is often a “bare” Git repository used only
>> > to mirror the upstream one, and thus it has no “local” commits,
>> > which are somewhat likely to become dangling after rebases and
>> > such.
>
> That's mostly a red herring. The objects shared are hard-linked,
No, they aren't.
--shared, -s
When the repository to clone is on the local machine, instead of
using hard links, automatically setup .git/objects/info/alternates
to share the objects with the source repository. The resulting
repository starts out without any object of its own.
And that's what makes this operation potentially dangerous. --shared
has the advantage of never needing additional object space (the hard
links used otherwise will start out with just requiring additional
inodes, but as soon as objects get repacked, their contents are present
twice as well), and being effective even when the repository is not on
the same file system.
The manual explicitly states with regard to --shared
NOTE: this is a possibly dangerous operation; do not use it
unless you understand what it does.
And a corollary to "not not use it unless you understand what it does"
is "do not publish any recipes or workflows containing --shared" because
recipes or workflows are intended for the benefit of people not
understanding every step.
> so even if the GC removes objects in a repository that doesn't
> reference them anymore they continue to exist in the repository that
> still needs them. As long as you do not delete that other repository
> you cannot lose anything.
Apparently you confuse --shared with _not_ using --shared.
--
David Kastrup
- Re: Multiple checkout copies, (continued)
- Re: Multiple checkout copies, Ivan Shmakov, 2015/02/02
- Re: Multiple checkout copies, Ivan Shmakov, 2015/02/02
- Re: Multiple checkout copies, Richard Stallman, 2015/02/02
- Re: Multiple checkout copies, Ivan Shmakov, 2015/02/03
- Re: Multiple checkout copies, Achim Gratz, 2015/02/03
- Re: Multiple checkout copies,
David Kastrup <=
- Re: Multiple checkout copies, Achim Gratz, 2015/02/03
- Re: Multiple checkout copies, David Kastrup, 2015/02/03
- Re: Multiple checkout copies, Ivan Shmakov, 2015/02/03
- Re: Multiple checkout copies, David Kastrup, 2015/02/03
- Re: Multiple checkout copies, Ivan Shmakov, 2015/02/03
- Re: Multiple checkout copies, David Kastrup, 2015/02/03
- Re: Multiple checkout copies, Ivan Shmakov, 2015/02/03
- Re: Multiple checkout copies, David Kastrup, 2015/02/03
- Re: Multiple checkout copies, Ivan Shmakov, 2015/02/03
- Re: Multiple checkout copies, Richard Stallman, 2015/02/04