Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 2020 22:31:45 +0100
From:      Ulrich =?utf-8?B?U3DDtnJsZWlu?= <uqs@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Cy Schubert <Cy.Schubert@cschubert.com>, freebsd-git@freebsd.org
Subject:   Re: Vendor Imports
Message-ID:  <X9p8wS5TdjL7/2Fl@acme.spoerlein.net>
In-Reply-To: <CANCZdfo7gf9Hmqcw9r_Y%2BPeo0wJwmuCOUhAeYTWz8w600LwZHA@mail.gmail.com>
References:  <202012160812.0BG8C7iT006176@slippy.cwsent.com> <CANCZdfpbZeiPamfX%2Bz-85WWAo7TA5P36T_qEUCQ-VoQdjh%2ByOw@mail.gmail.com> <202012161609.0BGG910P018294@slippy.cwsent.com> <CANCZdfo7gf9Hmqcw9r_Y%2BPeo0wJwmuCOUhAeYTWz8w600LwZHA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2020-12-16 at 12:49:02 -0700, Warner Losh wrote:
>On Wed, Dec 16, 2020 at 9:09 AM Cy Schubert <Cy.Schubert@cschubert.com>
>wrote:
>
>> In message
>> <CANCZdfpbZeiPamfX+z-85WWAo7TA5P36T_qEUCQ-VoQdjh+yOw@mail.gmail.c
>> om>
>> , Warner Losh writes:
>> > --0000000000002f35bf05b6945830
>> > Content-Type: text/plain; charset="UTF-8"
>> >
>> > On Wed, Dec 16, 2020 at 1:12 AM Cy Schubert <Cy.Schubert@cschubert.com>
>> > wrote:
>> >
>> > > Can we extrapolate that multilevel vendor trees, those with
>> > > subdirectories,
>> > > would need a cp -R or rsync?
>> > >
>> >
>> > It would.
>> >
>> >
>> > > The example shown says:
>> > >
>> > > % cd ../mtree
>> > > % cp ~/git/NetBSD/usr.sbin/mtree/* .
>> > > %
>> > >
>> > > cp -R would be appropriate for more complex software like openssl,
>> > > unbound,
>> > > and the like. Is this correct?
>> > >
>> >
>> > Yes. You're right. rsync with delete has been suggested, but I've not had
>> > time to update the example.
>>
>> Except that rsync duplicates hard link relationships whereas cp -R copies
>> them as if they are independent files in their own right. An rsync without
>> the -a or -H options should be suggested. Or does git treat hard links to
>> the same file as different files? (Meaning I'm talking through my hat?)
>>
>
>I'm unsure. An experiment is in order.

Git only knows soft links, hard links are handled implicitly, as they 
have the same content hash, so the blob is the same and you end up with 
2 tree entries pointing to the same blob. (To my knowledge a checkout 
will *not* hard link files, think about supporting Windows and all that, 
even though NTFS supposedly has links too?)

To handle deletes, you either need to:
- rm -rf * && cp -R ~/some/src/ .
- rsync -a --del ~/some/src/ .

or anything in between. Just make sure that file deletions are also 
being done :)

Cheers
Uli



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X9p8wS5TdjL7/2Fl>