Tom Lane wrote:
> Alvaro Herrera <alvhe...@2ndquadrant.com> writes:

> > I believe it's possible to mechanically rebase a patch over an indent
> > run of the underlying branch with half a dozen commands or less.  +1 for
> > reindenting all branches before each minor release, FWIW.
> 
> Yeah?  Can you show an example?

So we have this:

     ---P----I----C'
        |
         \---C----I'

where P is the parent commit; I is the pgindent commit; C is your
change (applied to the unindented tree).  What you need is to obtain C'
which is a copy of C that applies to I.  You can do this by creating I'
which is a pgindent run over your patch, then diff that one to I.
I *think* this should work:

git checkout C
pgindent tree
git commit      # yields I'
git diff I I' > C'
git checkout I
git apply C'

I spent a few minutes looking for a nontrivial patch to test this on,
couldn't find one; but the key is that you must be able to run pgindent
on your own using the same rules that Bruce's run would.

This shouldn't need human intervention at all, so should even be
possible to write a script for it and use it for 
  git rebase -i -x this_script origin/master
for when you have a branch with several commits that you want to rebase
over an upstream pgindent.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to