git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Strain, Roger L" <roger.strain@swri.org>
To: <git@vger.kernel.org>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Stephen R Guglielmo <srguglielmo@gmail.com>,
	"David A . Greene" <greened@obbligato.org>,
	Matthieu Moy <Matthieu.Moy@imag.fr>,
	Stephen R Guglielmo <srg@guglielmo.us>,
	Dave Ware <davidw@realtimegenomics.com>,
	David Aguilar <davvid@gmail.com>
Subject: [PATCH 0/4] Multiple subtree split fixes regarding complex repos
Date: Fri, 28 Sep 2018 13:56:39 -0500	[thread overview]
Message-ID: <20180928183540.48968-1-roger.strain@swri.org> (raw)

We recently (about eight months ago) transitioned to git source control systems for several very large, very complex systems. We brought over several active versions requiring maintenance updates, and also set up several subtree repos to manage code shared between the systems. Recently, we attempted to push updates back to those subtrees and encountered errors. I believe I have identified and corrected the errors we found in our repos, and would like to contribute those fixes back.

Commands to demonstrate both failures using the current version of the subtree script are here:
https://gist.github.com/FoxFireX/1b794384612b7fd5e7cd157cff96269e

Short summary of three problems involved:
1. Split using rejoins fails in some cases where a commit has a parent which was a parent commit further upstream from a rejoin, causing a new initial commit to be created, which is not related to the original subtree commits.
2. Split using rejoins fails to generate a merge commit which may have triaged the previous problem, but instead elected to use only the parent which is not connected to the original subtree commits. (This may occur when the commit and both parents all share the same subtree hash.)
3. Split ignoring joins also ignores the original add commit, which causes content prior to the add to be considered part of the subtree graph, changing the commit hashes so it is not connected to the original subtree commits.

The following commits address each problem individually, along with a single commit that makes no functional change but performs a small refactor of the existing code. Hopefully that will make reviewing it a simpler task. This is my first attempt at submitting a patch back, so apologies if I've made any errors in the process.

Strain, Roger L (4):
  subtree: refactor split of a commit into standalone method
  subtree: make --ignore-joins pay attention to adds
  subtree: use commits before rejoins for splits
  subtree: improve decision on merges kept in split

 contrib/subtree/git-subtree.sh | 129 +++++++++++++++++++++------------
 1 file changed, 83 insertions(+), 46 deletions(-)

-- 
2.19.0.windows.1


             reply	other threads:[~2018-09-28 18:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28 18:56 Strain, Roger L [this message]
2018-09-28 18:35 ` [PATCH 1/4] subtree: refactor split of a commit into standalone method Strain, Roger L
2018-09-28 18:35 ` [PATCH 2/4] subtree: make --ignore-joins pay attention to adds Strain, Roger L
2018-09-28 18:35 ` [PATCH 3/4] subtree: use commits before rejoins for splits Strain, Roger L
2018-09-28 18:35 ` [PATCH 4/4] subtree: improve decision on merges kept in split Strain, Roger L
2018-10-11 19:46 ` [PATCH v2 0/4] Multiple subtree split fixes regarding complex repos Roger Strain
2018-10-12  7:35   ` Junio C Hamano
2018-10-11 19:46 ` [PATCH v2 1/4] subtree: refactor split of a commit into standalone method Roger Strain
2018-10-11 19:46 ` [PATCH v2 2/4] subtree: make --ignore-joins pay attention to adds Roger Strain
2018-10-11 19:46 ` [PATCH v2 3/4] subtree: use commits before rejoins for splits Roger Strain
2018-10-11 19:46 ` [PATCH v2 4/4] subtree: improve decision on merges kept in split Roger Strain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180928183540.48968-1-roger.strain@swri.org \
    --to=roger.strain@swri.org \
    --cc=Matthieu.Moy@imag.fr \
    --cc=davidw@realtimegenomics.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=greened@obbligato.org \
    --cc=jrnieder@gmail.com \
    --cc=srg@guglielmo.us \
    --cc=srguglielmo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).