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: detect when there is more than one pending change #9291

Closed
rsc opened this issue Dec 12, 2014 · 6 comments
Closed

Comments

@rsc
Copy link
Contributor

rsc commented Dec 12, 2014

Rick got burned by running 'git commit' instead of 'git change' and ending up in a branch with two commits. Then git mail helpfully pushed them both to Gerrit, which helpfully created two changes.

Something in the review tool should detect multiple commits and print an error and die.
Maybe git mail, or maybe something earlier.

Note that I am NOT saying people can't use the multiple commit mode of Gerrit, I'm just saying that the review tool isn't going to help them do that, at least not by default.

@adg

@rsc
Copy link
Contributor Author

rsc commented Dec 12, 2014

Another option is to put this in a commit hook to catch at git commit time (again, unless explicitly disabled somehow).

@minux
Copy link
Member

minux commented Dec 12, 2014

Could Gerrit be configured so that it creates the CL but doesn't send the
email when something get pushed? Then one has the opportunity to check the
CL before sending it out.

That will also make it easier to experience and test the review command.
Right now I can't test the mail part because that will unnecessarily spam
golang-codereviews mailing list.

Or could we set up a dummy go repo for testing purposes (even on a separate
testing gerrit instance)? We can configure that to not send emails to the
mailing list and only to the author of the change. It will definitely help
people to get familiar with the tools and file feature requests and bug
reports.

@bradfitz
Copy link
Contributor

I'd like to preserve the ability of git mail (or a later git upload) to push a branch with multiple commits. I'm fine with it being prohibited by default. Perhaps we could add a --series or --multiple flag to mail/upload which then permits more than 1?

@adg
Copy link
Contributor

adg commented Dec 14, 2014

mail already has a -f flag. Maybe it could be used to force this too. Or is
it better to have an explicit flag?

On 13 December 2014 at 07:46, Brad Fitzpatrick notifications@github.com
wrote:

I'd like to preserve the ability of git mail (or a later git upload) to
push a branch with multiple commits. I'm fine with it being prohibited by
default. Perhaps we could add a --series or --multiple flag to
mail/upload which then permits more than 1?


Reply to this email directly or view it on GitHub
#9291 (comment).

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title review: detect when there is more than one pending change x/review: detect when there is more than one pending change Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-review label Apr 14, 2015
@mikioh mikioh changed the title x/review: detect when there is more than one pending change x/review/git-codereview: detect when there is more than one pending change Aug 17, 2015
@cmarcelo
Copy link
Contributor

After c3e5818 "git mail" complains if there are multiple pending CLs, and the user needs to explicitly pass the change to mail. It seems to cover the original issue (mail would ask which change, and the user could notice there are two), and permits pushing multiple commits (just pass the tip of the branch).

Should we close this?

@cmarcelo
Copy link
Contributor

@rsc @adg ^

@adg adg closed this as completed Feb 22, 2016
@golang golang locked and limited conversation to collaborators Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants