From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 24757398B884; Thu, 17 Sep 2020 17:04:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24757398B884 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600362277; bh=gTFkKzu5S212pVQ7faZ8r6T5efgXTJW5WuT6wMZQj5U=; h=From:To:Subject:Date:From; b=ROvumvooZa+U3cZnVJbqALJhXnuB2UVfJHr9NEocjax1Aoq8Hvmr305bK19iAyV6L 1D59cYMCYZgK/GFvEetVi/lxlFjnAQeUaWV8KMkfPYoO64HGFYEzyJqhvznqP+cNQ6 UPJ44+KS2ksuCBTXrhK+E6GmpPV+5TpbB778IDpY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] Fix various limitations of git-backport.py. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/vendors/redhat/heads/gcc-8-branch X-Git-Oldrev: 59068444b2b64a9046c9528a2a88737c4376406a X-Git-Newrev: ad37325f42d79e6e09a3cd91592bbd0083aa0c4a Message-Id: <20200917170437.24757398B884@sourceware.org> Date: Thu, 17 Sep 2020 17:04:37 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:04:37 -0000 https://gcc.gnu.org/g:ad37325f42d79e6e09a3cd91592bbd0083aa0c4a commit ad37325f42d79e6e09a3cd91592bbd0083aa0c4a Author: Martin Liska Date: Fri May 29 11:29:25 2020 +0200 Fix various limitations of git-backport.py. I've just tested the script and I'm going to install the patch to all active branches. contrib/ChangeLog: * git-backport.py: The script did 'git co HEAD~' when there was no modified ChangeLog file in a successful git cherry pick. Run cherry-pick --continue without editor. (cherry picked from commit 24663f1f6d709daf8913484914ed01af9f7a480a) Diff: --- contrib/git-backport.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/git-backport.py b/contrib/git-backport.py index 6a115c34d40..3a9413dcd27 100755 --- a/contrib/git-backport.py +++ b/contrib/git-backport.py @@ -30,9 +30,13 @@ if __name__ == '__main__': r = subprocess.run('git cherry-pick -x %s' % args.revision, shell=True) if r.returncode == 0: - cmd = 'git show --name-only --pretty="" -- "*ChangeLog" |' \ - 'xargs git checkout HEAD~' - subprocess.check_output(cmd, shell=True) + cmd = 'git show --name-only --pretty="" -- "*ChangeLog"' + changelogs = subprocess.check_output(cmd, shell=True, encoding='utf8') + changelogs = changelogs.strip() + if changelogs: + for changelog in changelogs.split('\n'): + subprocess.check_output('git checkout HEAD~ %s' % changelog, + shell=True) subprocess.check_output('git commit --amend --no-edit', shell=True) else: # 1) remove all ChangeLog files from conflicts @@ -55,6 +59,7 @@ if __name__ == '__main__': # try to continue if len(conflicts) == len(changelogs): - subprocess.check_output('git cherry-pick --continue', shell=True) + cmd = 'git -c core.editor=true cherry-pick --continue' + subprocess.check_output(cmd, shell=True) else: print('Please resolve all remaining file conflicts.')