Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/review/git-codereview: add merge command #26201

Closed
FiloSottile opened this issue Jul 3, 2018 · 4 comments
Closed

x/review/git-codereview: add merge command #26201

FiloSottile opened this issue Jul 3, 2018 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@FiloSottile
Copy link
Contributor

Manual merge commits are dangerous (#26199, and it seems to have happened before with a merge from release-branch.go1.10).

We use merges for two reasons:

  1. to merge master into another branch to keep it up to date
  2. to merge dev branches into master at the end of their cycle

The first case is much more frequent, while the second case is what we don't want to happen most of the times, so the tooling should only support the first.

@FiloSottile FiloSottile added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 3, 2018
@FiloSottile FiloSottile self-assigned this Jul 3, 2018
@gopherbot gopherbot added this to the Unreleased milestone Jul 3, 2018
@mvdan
Copy link
Member

mvdan commented Jul 3, 2018

Perhaps it would also be useful to restrict who can push directly to master? Or perhaps pushes to it should require a "yes I really am trying to push master" confirmation or flag.

@FiloSottile
Copy link
Contributor Author

Pushing to master is already strictly limited (and I plan to make it opt in also for the people who can). This mistaken merge happened via a regular Gerrit review.

@aclements
Copy link
Member

For #43147, our attempted merge actually wound up like a cherry-pick of all changes from master on to dev.regabi, with just a single parent (so it wasn't even a merge commit). We believe this is what happened:

$ git change dev.regabi
$ git merge master
# Fix merge conflicts, add files
$ git commit
git-codereview: cannot commit on dev.regabi branch
$ git merge --continue
git-codereview: cannot commit on dev.regabi branch
$ git change m
$ git mail

We believe the git change m at the end got confused by the in-progress uncommitted merge state and wound up creating a cherry-pick-like commit on branch m with that state.

At a minimum, git change X should refuse to do anything if you're in a pending merge state.

Maybe even allowing the git change dev.regabi was a problem, since it wasn't going to allow commits on that. Perhaps it should either just allow committing to that name (personally I find it really annoying that it restricts what branch names you can use), or it should disallow changing to names that can't be committed to. The latter would probably require a flag to git change to say "make branch X that's for upstream branch Y", which may be a good thing to have anyway.

@gopherbot
Copy link

Change https://golang.org/cl/279772 mentions this issue: git-codereview: new sync-branch and related fixes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants