Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2020 22:25:02 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        freebsd-git@freebsd.org
Subject:   Re: Next odd commit affecting `git subtree split` experiments with contrib/elftoolchain
Message-ID:  <CAPyFy2BLM4=n4gbmfy19Vbo4c7c1JUYhB6MDTsJeU%2BLMEsfEmw@mail.gmail.com>
In-Reply-To: <CAPyFy2DR6R4S7kgkRtrWzPBuD_6QR=A_hU=sP%2BLm==Y61AKhsA@mail.gmail.com>
References:  <CAPyFy2DR6R4S7kgkRtrWzPBuD_6QR=A_hU=sP%2BLm==Y61AKhsA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Jun 2020 at 14:41, Ed Maste <emaste@freebsd.org> wrote:
>
> I've found one new class of strange commit - r265044, which I've
> excluded from mergeinfo parsing (in the above list). However, svnweb
> highlights an issue:

I've now successfully used Tom Clarkson's patched git subtree[1] to
split elftoolchain out of cgit-beta, keeping the vendor branch history
intact, and avoiding the extraneous and bogus commits.

I used https://cgit-beta.freebsd.org/src.git at
4c09cab462f2d27794d51a4dcb06df806dc9f3a6, and performed the following
steps:

% git log contrib/elftoolchain

1. Observe that the initial commit under that prefix is:

commit f4b5186d24f3e1969c32a49f126c8ad29ece63e9
Merge: 8b06418614b0 5265ace0e440
Author: Kai Wang <kaiw@FreeBSD.org>
Date:   Wed Jan 15 22:30:48 2014 +0000

    Copy libelf, libdwarf and common files from vendor/ to contrib/.

2. Inspect the two merge parents and determine that the second
(5265ace0e440) is the initial elftoolchain import:

it 5265ace0e440a23fb522c516f4ee20f43eaed2b3
(origin/vendor/elftoolchain/elftoolchain-r2974)
Author: Kai Wang <kaiw@FreeBSD.org>
Date:   Wed Jan 15 08:43:20 2014 +0000

    Initial import of elftoolchain r2974.

    Obtained from:  elftoolchain.org

3. Split the subtree, using patched git:

~/src/git/contrib/subtree/git-subtree.sh split \
    --prefix=contrib/elftoolchain \
    --onto=5265ace0e440a23fb522c516f4ee20f43eaed2b3

The "onto" revision is the initial hash in the subtree. With the
patched git subtree this is needed, because we don't have metadata
about the subtree (as would be created if `git subtree add` was used
to initially create the subtree).

After some time the hash of the split tree is printed:
5f7e5a9dbe67c06fb6baf08f26745e537fcfe9dd

At this point I can do what I like with the subtree. I could create a
branch for it, or push it to a GitHub repo:

% git push github-elftoolchain \
5f7e5a9dbe67c06fb6baf08f26745e537fcfe9dd:refs/heads/split-from-cgit-beta

Which is now available here:
https://github.com/emaste/elftoolchain/tree/split-from-cgit-beta



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2BLM4=n4gbmfy19Vbo4c7c1JUYhB6MDTsJeU%2BLMEsfEmw>