On Tue, May 26, 2020 at 12:42:41PM +0200, Thomas Koenig wrote:
> Am 26.05.20 um 11:04 schrieb Thomas Koenig via Gcc:
> > Am 26.05.20 um 00:48 schrieb Jakub Jelinek via Gcc:
> > 
> > > I've turned the strict mode of Martin Liška's hook changes,
> > 
> > This means that it is no longer possible to do a git gcc-backport
> 
> [CC'ing fortran to warn other people against currently trying
> backports]
> 
> ... and now I've tried to revert the ChangeLog files manually,
> pulled again, tried to push again, and got
> 
> remote: *** ChangeLog format failed:
> remote: ERR: ChangeLog, DATESTAMP, BASE-VER and DEV-PHASE updates should be
> done separately from normal commits
> remote:
> remote: Please see: https://gcc.gnu.org/codingconventions.html#ChangeLogs
> remote:
> remote: error: hook declined to update refs/heads/releases/gcc-10
> To git+ssh://gcc.gnu.org/git/gcc.git
>  ! [remote rejected]         releases/gcc-10 -> releases/gcc-10 (hook
> declined)
> error: Fehler beim Versenden einiger Referenzen nach
> 'git+ssh://tkoe...@gcc.gnu.org/git/gcc.git'
> 
> So, I am in the quite familiar situation of a somehow inconsistent
> state of git that I have no idea how to get out of.
> 
> So, two questions:
> 
> - How do I get my gcc-10 branch back into a consistent state?

git reset --hard origin/releases/gcc-10
should do it (if you want to throw all your local changes).

> - How are backports supposed to be handled using the new scripts?

When cherry-picking or otherwise backporting a change which changed the
ChangeLog files, one needs to remove the ChangeLog changes from that commit,
e.g.
git diff > /tmp/P
for i in `lsdiff /tmp/P | grep ChangeLog`; do filterdiff -i $i /tmp/P; done | 
patch -p1 -R
git commit -a --amend
or
git checkout HEAD^ -- `git diff | lsdiff | sed -n -e 
's,^[ab]/\(.*/ChangeLog\)$,\1,p'`
git commit -a --amend
could do that.  If it is cherry-pick of an even older commit that doesn't have 
the
commit message with properly formatted ChangeLog entry the scripts will
understand, one needs to change the commit message too.

Note, this obstackle will go away once you start backporting patches
committed today or later, as those will not have the ChangeLog changes and
will have properly formatted commit message.

        Jakub

Reply via email to