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
Add support for Gerrit review system #38
Conversation
327ed8f
to
ab23e3b
Compare
Thanks for working on this! Other than a few long lines, it looks ok to me, but I'll defer to others with more experience on modulesync internals. |
} | ||
else | ||
opts = {:amend => true} | ||
message = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines are extremely problematic and unnecessary. They cause the script to amend the latest commit rather than making a new commit, when the previous commit is likely to be a change already in master and not owned by the committer.
I'm a little frustrated that gerrit must be treated so differently...but looking at your changes and playing with git-review a bit, I think perhaps it doesn't have to be treated so differently. I propose that instead of a 'git_provider' parameter, we instead just need a 'pre_commit_script' parameter. We can maybe have a 'contrib/' or 'scripts/' directory that contains something to check for the existence of and install the commit-msg hook. Right before What do you think? |
ab23e3b
to
bfe01ae
Compare
@cmurphy this PR has been reworked with the following changes :
I hope all the point abode have been addressed |
c7b58df
to
df5c72f
Compare
Would it make sense to just remove the --amend option entirely and have the pre-commit script check if the change already includes a Change-ID and add it (amend) if it's not there? If someone is using Gerrit, then that's very likely the behavior they want, and they can modify the pre-commit script if not. |
d1baf7d
to
d82602e
Compare
* git_base : The default URL to git clone from (Default: 'git@github.com:') | ||
* namespace : Namespace of the projects to manage (Default: 'puppetlabs') | ||
* branch : Branch to push to (Default: 'master') | ||
* branch_prefix : Branch prefix if necessary (ie. HEAD:refs/publish/master/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of branch
and branch_prefix
could we have branch
(which would be the local branch) and remote_branch
(which would default to the value of branch
)? That way the push looks like git push origin localbranchname:remotebranchname
, so they could potentially have different names and we don't need to refer to HEAD:
.
@Spredzy looking good! A couple more notes. @Dvorak I'd prefer not to have --amend be implicit, as it has the potential to be destructive. Moreover, as much as possible, I'd like to not have to treat gerrit or any other git providers as special. Adding the --amend and --force options make them available to github/gitlab/gitolite users. In any case, if you were doing it by hand you would use --amend anyway, so I don't think it's a big deal to require it here. |
opts_push = {} | ||
if amend | ||
opts_commit = {:amend => true} | ||
message = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to set this to nil? I've had a lot of cases where amending the commit also means changing the commit message.
d82602e
to
26b6ec0
Compare
This commits add supports gerrit system and will submit a review everytime a change is made on the same branch.
26b6ec0
to
4b35265
Compare
Add support for Gerrit review system
This commits add supports gerrit system and will submit a review
everytime a change is made on the same branch.
The
modulesync.yml
file looks likeWhen a user receive a -1, the user can simply re-run
msync update --amend
and a new patchset will be submited