From owner-freebsd-git@freebsd.org Wed Jun 17 16:00:05 2020 Return-Path: Delivered-To: freebsd-git@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09F2C35232B for ; Wed, 17 Jun 2020 16:00:05 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49n8sc5919z3yPf; Wed, 17 Jun 2020 16:00:04 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by mail-ot1-f67.google.com with SMTP id 97so2027412otg.3; Wed, 17 Jun 2020 09:00:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=epQsimTAzy5djDS3wC7P4f2MgXMQFgC0AkyNRgVx670=; b=cTqc9lE3p+ZiVz/BkyZd1I9+Epu+XfJBb4mccS8r9C12N8K/rT0zWb6wICPTUYHOct jIL4ZvHavY0kYOQrzwh99P22i/h8B8GRqJwKKbJlK4JamDy74/j+Pg9hmcodxKIACL7n rW4YtokCjakz8iq6hLG563KYqLfxixHW2l5hlUlkITVQsG1o50CpREBdNZ13/PeZvdOC hCwqvmhmpM3NhE5/n/Tb0NPu3MCVVJSI0yDx+tiiT7G/Ctk2WSBu206SAe0rHa68l1xh o//9cF78vuT3NSQdoItg1AXoYZx2SxU6MQMbICcaCNN6A4YPknoX8RjBbZFqj+cZYI8O U7rA== X-Gm-Message-State: AOAM530f2ehFtL0qTUJ/etpMU7FN2pQRZA25BqOzgT3GZi1kf+GwSVq7 k4IOdkjsMDYoE75nhAJPu1M5p2gWc/ffGwLsMOsWIH6U X-Google-Smtp-Source: ABdhPJxyrHgJ041ko4YvhcTDIqYbqT1A8Dww0/Sbx8V4RDYcsTgbBE4wAwSTa27iuiCctNJUh8DJr8qu20sR8Eqnx9M= X-Received: by 2002:a9d:6e03:: with SMTP id e3mr6857904otr.71.1592409602384; Wed, 17 Jun 2020 09:00:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= Date: Wed, 17 Jun 2020 17:59:51 +0200 Message-ID: Subject: Re: Next odd commit affecting `git subtree split` experiments with contrib/elftoolchain To: Ed Maste Cc: freebsd-git@freebsd.org X-Rspamd-Queue-Id: 49n8sc5919z3yPf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 16:00:05 -0000 On Wed, Jun 17, 2020 at 4:25 AM Ed Maste wrote: > On Tue, 16 Jun 2020 at 14:41, Ed Maste 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 built a repo w/o the MFHead commits going into project branches. That is, projects will merge into head, but head will *not* merge into projects. Running the subtree split, I get a history with about 437 commits. I see in your https://github.com/emaste/elftoolchain/tree/split-from-cgit-beta that you only end up with 277 commits (if that display is to be trusted). For this repo, it now looks like so (r265044 is from 2014-04-28) * | | | | | | | 52046640c377 - Merge from head (Baptiste Daroussin, 4 years, 9 months ago, 2015-10-01) * | | | | | | | 7d76ac023498 - Finish merging from head, messed up in previous attempt (Baptiste Daroussin, 4 years, 9 months ago, 2015-09-12) * | | | | | | | 184614fff731 - Merge from head (Baptiste Daroussin, 4 years, 9 months ago, 2015-09-12) * | | | | | | | 06d2968292d4 - Merge from head@274131 (Baptiste Daroussin, 5 years ago, 2015-06-16) |\| | | | | | | | * | | | | | | a8f362c5fe90 - Add META_MODE support. (Simon J. Gerraty, 5 years ago, 2015-06-13) | |\ \ \ \ \ \ \ | | * | | | | | | 670c2113728e - Merge sync of head (Simon J. Gerraty, 5 years ago, 2015-05-27) | | * | | | | | | 045693fbc721 - Merge from head@274682 (Simon J. Gerraty, 6 years ago, 2014-11-19) | | * | | | | | | d3282ab267a8 - Merge head (Simon J. Gerraty, 6 years ago, 2014-04-28) | | / / / / / / | * | | / / / / 0233f02a35bc - elfcopy: Handle objects without a ".shstrtab" section string table (Ed Maste, 5 years ago, 2015-06-13) | | |_|/ / / / | |/| | | | | | * | | | | | 01a7e6868f7a - Update to ELF Tool Chain r3223 (Ed Maste, 5 years ago, 2015-05-27) | | |/ / / / | |/| | | | | * | | | | 356943f64b09 - Update to ELF Tool Chain r3197 (Ed Maste, 5 years ago, 2015-05-14) | * | | | | 2dae10c39647 - Merge ^/projects/release-arm-redux into ^/head. (Glen Barber, 5 years ago, 2015-05-09) | |\ \ \ \ \ | | * | | | | bb93d386e833 - MFH: r280643-r281852 (Glen Barber, 5 years ago, 2015-04-22) | | * | | | | fad1f163a320 - MFH: r278968-r280640 (Glen Barber, 5 years ago, 2015-03-25) | | * | | | | d2f00e64668a - MFH: r278593-r278966 (Glen Barber, 5 years ago, 2015-02-18) | | * | | | | 0a8b1fb8842b - MFH: r278202,r278205-r278590 (Glen Barber, 5 years ago, 2015-02-11) | | | |/ / / | | |/| | | | * | | | | cd6104d28a5c - Update elftoolchain to upstream revision 3179 (Ed Maste, 5 years ago, 2015-04-01) | | |_|_|/ | |/| | | | * | | | 14a1bbced50b - Merge ^/head r279163 through r279308. (Dimitry Andric, 5 years ago, 2015-02-26) So this is clearly not ideal yet. All MFH are there as cherrypicks and the merges to head from unrelated branches still gets pulled in. A potential post-processing step could be to squash subsequent commits with the same tree hash. Here, the 2nd hash is the tree hash: * 9b32ed0c66ef 74ab27147825 - elftoolchain nm(1): Initialize allocated memory before use (Conrad Meyer, 2 years, 3 months ago, 2018-03-16) * 5c976b8c4811 1d39238f5607 - Merge ^/head r327886 through r327930. (Dimitry Andric, 2 years, 5 months ago, 2018-01-13) |\ | * 344ba1731347 1d39238f5607 - elfcopy: copy raw (untranslated) contents to binary output (Ed Maste, 2 years, 5 months ago, 2018-01-02) * | 3714d762a9e0 1d39238f5607 - Merge ^/head r327341 through r327623. (Dimitry Andric, 2 years, 5 months ago, 2018-01-06) |/ * db9ffaaa5457 c3635117b95c - readelf: report byte size for DT_PREINIT_ARRAYSZ (Ed Maste, 2 years, 6 months ago, 2017-12-26) * a616bc1dbec6 c1e10d6f9540 - Merge ^/head r326132 through r326161. (Hans Petter Selasky, 2 years, 7 months ago, 2017-11-24) |\ | * 899122e1d197 c1e10d6f9540 - MFhead@r323646 (Enji Cooper, 2 years, 9 months ago, 2017-09-16) | |\ | | * 09fe4662fc65 c1e10d6f9540 - Add missing newline after unknown MIPS-specific dynamic entries. (John Baldwin, 2 years, 9 months ago, 2017-09-15) | | * a27ad9741c63 2bdfff10c1e6 - Recognize NT_PTLWPINFO and NT_ARM_VFP in FreeBSD ELF cores. (John Baldwin, 2 years, 9 months ago, 2017-09-14) | * | 1e46d0a611f7 c1e10d6f9540 - MFhead@r323635 (Enji Cooper, 2 years, 9 months ago, 2017-09-16) | * | 8caa235148b3 2200cd80945d - MFhead@r322515 (Enji Cooper, 2 years, 10 months ago, 2017-08-14) | |\| | | * 81c051e299b3 2200cd80945d - o Replace __riscv__ with __riscv o Replace __riscv64 with (__riscv && __riscv_xlen == 64) (Ruslan Bukin, 2 years, 10 months ago, 2017-08-07) | * | da88e12ed370 2200cd80945d - MFhead@r322451 (Enji Cooper, 2 years, 10 months ago, 2017-08-13) | * | 48461537238e b6e4a7671e42 - MFhead@r321431 (Enji Cooper, 2 years, 11 months ago, 2017-07-24) | |\| I'm not sure whether it would be straightforward to squash the right commits and keep the ones with the proper commit message. Your repo still has a view MFH commits that one might want to remove. Using git `filter-repo` might do the trick ... > 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 > Date: Wed Jan 15 22:30:48 2014 +0000 > > Copy libelf, libdwarf and common files from vendor/ to contrib/. > Just to make sure, you know that you can get this like so: % git log --reverse --format=%h master -- contrib/elftoolchain/ | head -1 37429c2aa7e7 (note sure why using -n1 instead of head(1) will result in the latest, not the oldest. Seems that it ignores --reverse) Would be good if you could run a script against all contrib prefixes and later count the number of commits that a contrib-tree produces to see if something weird happens. > > 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 > Date: Wed Jan 15 08:43:20 2014 +0000 > > Initial import of elftoolchain r2974. > > Obtained from: elftoolchain.org > > You can test both parents whether they are reachable from vendor/elftoolchain/dist, or look at their notes: % git log -n1 --format=%P 37429c2aa7e7 | xargs -n1 -I@ git log -n1 --format="%h %N" @ 8a7f75c8fcc5 svn path=/head/; revision=260666 5265ace0e440 svn path=/vendor/elftoolchain/dist/; revision=260684 svn path=/vendor/elftoolchain/elftoolchain-r2974/; revision=260685; tag=vendor/elftoolchain/elftoolchain-r2974 > 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 For my own understanding, all the issues around subtree splitting are actually not blocking the conversion in any way, right? All they do is make the lives miserable for contrib-software maintainers and they might delay new code drops under contrib/ yes? Cheers Uli