How to avoid git push --force to a pull request(PR)?

David Holmes david.holmes at oracle.com
Thu Nov 26 22:54:14 UTC 2020


On 26/11/2020 6:51 am, Liu, Xin wrote:
> cc hotspot-dev.
> I found that skara-dev is mainly for skara developers. my question is for general hotspot developers.
> 
> thanks,
> --lx
> 
> 
> ________________________________________
> From: Liu, Xin
> Sent: Tuesday, November 24, 2020 5:59 PM
> To: skara-dev at openjdk.java.net
> Cc: Tobias Hartmann
> Subject: How to avoid git push --force to a pull request(PR)?
> 
> Hi, Skara developers,
> 
> 
> Tobias suggested not to use force push here
> https://github.com/openjdk/jdk/pull/1073#issuecomment-726549523

Right. There is generally no need for "force push" on an active PR 
because you can just merge and do a normal push. The skara tooling will 
flatten the set of commits into one single clean commit when you 
integrate, so none of the merges are evident.

> Sometimes, I use git push --force to a private branch, which maps to an ongoing PR.
> What I do is to update my branch to TIP, rebase my changes to it and then "git push --force" to my branch remotely.  Skara remarks the PR “force pushed ” eg. https://github.com/openjdk/jdk/pull/1179
> 
> 
> Yes, I admit that it would ruin the "incremental webrev".  I do it for the following two reasons.
> 1) the reviewing process lasts too long. I have to update the base of my private branch, or it isn't mergeable.

Not sure what you mean by the "base" of your "private branch. You should 
have a personal fork on Github. You clone your personal fork locally and 
create as many branches as you like, merging as you desire, and push 
them to your PF when you need to create a PR. You can update your local 
master to branch with upstream any time you like without affecting your 
working branches. If you need to update a working branch then just merge 
with master and push to your PF.

Cheers,
David
-----

> Other developers may have changed the common code when you are working on your PRs, right?  /integrate will fail because of conflicts.
> 
> 2) I have to update the base because of testing.
> Openjdk now contains the sanity check workflow. https://github.com/openjdk/jdk/blob/master/.github/workflows/submit.yml
> I'd like to pass them all before integrating.  Sometimes, I run into failures but my PR is not the culprit. The build breakage and regression are usually rapidly fixed in the master branch.
> 
> I understand I can always ditch the old PR and start over, but all comments in the old PR will lose in this way.  On the side, I also feel guilty to use force push frequently.
> May I know if Skara has other option to help me out?
> 
> 
> I read this blog (https://julien.danjou.info/rant-about-github-pull-request-workflow-implementation/), it declares the dilemma comes from github PR mechanism.
> but that blog was 7-year-old, I am not sure that if github has sorted it out or not. Even github hasn't, is that possible to be solved by Skara?
> 
> thanks,
> --lx
> 
> 
> 
> 
> 


More information about the skara-dev mailing list