diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-08 23:46:41 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-16 22:40:14 +0100 |
commit | 25fa26693587f923061cc4d144297dee29eb4892 (patch) | |
tree | ac640ffdab8e6c635fe3b0b91087b1458f696b9d | |
parent | 236890b58b8255d8d540b5cbd326228489bd0363 (diff) |
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 <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | git-debrebase | 17 |
1 files changed, 17 insertions, 0 deletions
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"); |