Next odd commit affecting `git subtree split` experiments with contrib/elftoolchain

Ed Maste emaste at freebsd.org
Wed Jun 17 02:25:18 UTC 2020


On Tue, 16 Jun 2020 at 14:41, Ed Maste <emaste at 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 at 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 at 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


More information about the freebsd-git mailing list