From 25fa26693587f923061cc4d144297dee29eb4892 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 8 Jun 2018 23:46:41 +0100 Subject: git-debrebase: Some notes on anchor parent ordering This is the result of some playing around with gitk. Notably, for example, git-branch -f t dgit/stretch-security && ~/things/Dgit/play/swap-pseudomerges -f RELEASE-4.8.0..t where dgit/stretch-security is c9517ee45383271e90f40b7a9773d1e6fefaeca7 and swap-pseudomerges is something like this #!/bin/sh # # runs # git-filter-branch --some-filters "$@" set -e git-filter-branch --parent-filter ' case "$(git cat-file commit $GIT_COMMIT)" in *"git-debrebase new-upstream breakwater"*|*"git-debrebase anchor"*) perl -ne '\'' chomp; print join " ", reverse split / +(?=-p )/; print "\n"; '\'' ;; *) cat esac ' "$@" or .... *"git-debrebase new-upstream breakwater"*|*"git-debrebase anchor"*) .... and then runes like gitk --first-parent dgit/stretch-security & gitk dgit/stretch-security -- ':/' ':!/debian' & etc. Signed-off-by: Ian Jackson --- git-debrebase | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'git-debrebase') diff --git a/git-debrebase b/git-debrebase index f6d379a..d174fe6 100755 --- a/git-debrebase +++ b/git-debrebase @@ -427,6 +427,23 @@ sub classify ($) { # way also there's also an easy rune to look for the upstream # patches (--topo-order). + # Also this makes --first-parent be slightly more likely to + # be useful - it makes it provide a linearised breakwater history. + + # Of course one can say somthing like + # gitk -- ':/' ':!/debian' + # to get _just_ the commits touching upstream files, and by + # the TREESAME logic in git-rev-list this will leave the + # breakwater into upstream at the first anchor. But that + # doesn't report debian/ changes at all. + + # Other observations about gitk: by default, gitk seems to + # produce output in a different order to git-rev-list. I + # can't seem to find this documented anywhere. gitk + # --date-order DTRT. But, gitk always seems to put the + # parents from left to right, in order, so it's easy to see + # which way round a pseudomerge is. + $p[0]{IsOrigin} and $badanchor->("is an origin commit"); $p[1]{Differs} & ~DS_DEB and $badanchor->("upstream files differ from left parent"); -- cgit v1.2.3