From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Run pgindent now? |
Date: | 2015-05-22 15:48:18 |
Message-ID: | 20150522154818.GX5885@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-05-22 16:02:11 | Re: Run pgindent now? |
Previous Message | Tom Lane | 2015-05-22 15:21:50 | Re: Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on' |