From: Ian Jackson Date: Mon, 6 Feb 2012 13:59:28 +0000 (+0000) Subject: Unwanted dep removal search - difficulties X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topbloke.git;a=commitdiff_plain;h=6101b61b9a5639758f88a198d1493c0dce0b799f;ds=sidebyside Unwanted dep removal search - difficulties --- diff --git a/DESIGN b/DESIGN index a5c7ee6..83465d9 100644 --- a/DESIGN +++ b/DESIGN @@ -22,7 +22,7 @@ Basic update algorithm: Find the (latest) common ancestor. - Check for unwanted dependency removals. + Check for unwanted dependency removals. An unwanted dependency removal is A branch in the desired included deps Which exists in the common ancestor's actual included deps @@ -112,7 +112,7 @@ Basic update algorithm: The "best order" for merges is in order of recency of common ancestor, most recent first, and if that does not distinguish, merging from local branches first. - + "Recency" refers to the order from git-rev-list --date-order. Actual included deps: @@ -225,7 +225,7 @@ OK so here is a plan: Check for merge success in the index and compare to exit status from git-merge (which is 1 if the merge failed). Adjust the metadata. - Print appropriate big fat warnings if we have merge conflicts in our + Print appropriate big fat warnings if we have merge conflicts in our metadata. Commit, adjusting the parents of the new commit to the original parents if we made the merge with special massaged parents. @@ -259,7 +259,7 @@ Unwanted removal search subgraphs: inc inc.. / ??? \ - rm + rm inc.. rm.. merge of a removal, search down the rm path / [inc] \ @@ -273,7 +273,35 @@ inc.. rm.. inc ??? call it an inclusion, terminate search rm.. rm.. / ??? \ - + rm inc inc rm irrelevant rm inc inc inc.. rm rm.. + + + + proposed + / \ | + /`---------- \ -----<--------.| + / | | + | | | + RE-INCLUDE inc rm REMOVAL | + \ | / / | + * REMOVAL rm / / | + | inc * | + rm / | + | / | + rm / | + | /`--------<-----------.| + inc / | + | / | + RE-INCLUDE inc / | + \ | / | + * REMOVAL rm / | + | / | + inc | + \ | + `------------<-------------.| + | + | + IT diff --git a/tb-update.pl b/tb-update.pl index d5eed35..58e7d60 100755 --- a/tb-update.pl +++ b/tb-update.pl @@ -145,6 +145,16 @@ sub update_base ($) { next if $source_inc{$dep}; unless unless $anc_inc{$dep}; my $unw_dr = { Name => $dep }; + + + # Algorithm + # We do a history graph walk. + # In each iteration we get git-rev-list to find us + # one commit. + + # We get git-rev-list to find us + send us a series of commits + # We look up each one. my @prune; my $pruned = sub { my ($commit) = @_;