]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
contrib: run fetch before pushing Daily bump
authorMartin Liska <mliska@suse.cz>
Wed, 5 Oct 2022 18:39:19 +0000 (20:39 +0200)
committerMartin Liska <mliska@suse.cz>
Wed, 5 Oct 2022 18:42:43 +0000 (20:42 +0200)
As seen from recent days, the script fails when it pushes
a branch while another revision was pushed by a user.
Prevent that by doing fetch right before the pull.

The error message example:

cmdline: git push origin releases/gcc-11
stderr: 'fatal: unable to parse object: 4249a65c814287af667aa78789436d3fc618e80a
error: remote unpack failed: eof before pack header was fully read

contrib/ChangeLog:

* gcc-changelog/git_update_version.py: Do fetch before a push.

contrib/gcc-changelog/git_update_version.py

index 05a9f7e402d6be6d11de8f599bd6c10d87e0180e..8462179b5ab917088a1a1f04355b73ba37b15d20 100755 (executable)
@@ -127,6 +127,7 @@ def update_current_branch(ref_name):
             repo.git.add(datestamp_path)
             if not args.current:
                 repo.index.commit('Daily bump.')
+                origin.fetch()
                 if args.push:
                     repo.git.push('origin', branch)
                     print('branch is pushed')
@@ -149,7 +150,7 @@ else:
             print('=== Working on: %s ===' % branch, flush=True)
             branch.checkout()
             origin.pull(rebase=True)
-            print('branch pulled and checked out')
+            print('branch pulled and checked out', flush=True)
             update_current_branch(name)
             assert not repo.index.diff(None)
             print('branch is done\n', flush=True)