Skip to content

Conversation

@christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Dec 1, 2021

Catch and warn when git pushing working branch to mirror is rejected because the remote branch already exists with different commits. Also, pipe through --force flag to allow git pushing past this.

Fixes #94479

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Dec 1, 2021
@google-cla google-cla bot added the cla: yes label Dec 1, 2021
@christopherfujino christopherfujino changed the title [flutter_conductor] update engine and framework [flutter_conductor] catch and warn when pushing working branch to mirror Dec 2, 2021
@christopherfujino
Copy link
Contributor Author

friendly ping @godofredoc

}
}

static final RegExp _pushRejectedPattern = RegExp(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to detect this error by exit code instead of message? using something like exit code can make this code more deterministic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately not. This particular error is exit 1, as are almost all errors, per: https://stackoverflow.com/questions/4917871/does-git-return-specific-return-error-codes

Copy link
Contributor

@godofredoc godofredoc left a comment

Choose a reason for hiding this comment

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

LGTM with one question.

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

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt.

3 participants