Skip to content

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Aug 2, 2021

This solves issues with stale remote branches without having to keep track of
them explicitly.

This solves issues with stale remote branches without having to keep track of
them explicitly.
Copy link
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I added a nit, feel free to ignore

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@ambv ambv merged commit 7122a15 into main Aug 2, 2021
@ambv ambv deleted the git-push-f-into-backport-branches branch August 2, 2021 15:22
cmd = ["git", "push"]
if head_branch.startswith("backport-"):
# Overwrite potential stale backport branches with extreme prejudice.
cmd.append("--force-with-lease")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, --force-with-lease can be flaky when there's a race with multiple pushes to the remote. It's not very well documented, but I've hit this issue elsewhere. I'll just leave this link for the future explorers in case somebody hits similar issues: sanitizers/patchback-github-app#18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants