chiark / gitweb /
git-debrebase: Some notes on anchor parent ordering
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 8 Jun 2018 22:46:41 +0000 (23:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 21:40:14 +0000 (22:40 +0100)
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>
git-debrebase

index f6d379ac81b036e4be6682e1a25b9c24a9b867ef..d174fe60fbe2ba71b75c6d3e077d2d47b156b233 100755 (executable)
@@ -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");