--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi allWe have a workmode here that we have a branch which people can use to "backup" their changes or do whatever they want. To be more precise, it's all branches under namespace tmp/* where developers can push without a review.Now we face the following problem. People create e.g. 3 commits on tmp/mybranch. After a while they want to push those changes to refs/for/master. Gerrit says "no new changes" since it knows all SHAs already.Now I told the developers they should use a rebase which only makes sense here with "--force" to really get new SHAs (without --force the commits could just be fast-forwards).Until now, no developer could work around the review system for our master branch, but with the following use case you can bypass the system:Let's assume we have the 3 mentioned commits on tmp/mybranch and do a "rebase -i" to squash the latest 2 commits. When you push this to refs/for/master now, the first commit on "tmp/mybranch" is just a fast-forward commit which now slips into master without being reviewed.A-B master\C-D-E tmp/mybranchrebase -i origin/master with squashing D+EA-B-C-'DE'C doesn't get a review!
So my question is, how would you change our workmode?
Or in general I thought that a review is tied to the branch, isn't it? Or is there a way to not "track" certain branches like "tmp/*" ? Or is it "just" a bug?I tried this with 2.5 and 2.6-rc3Matthias
On Tue, Jun 18, 2013 at 4:37 PM, Matthias Günther <matgnt@gmail.com> wrote:
Hi allWe have a workmode here that we have a branch which people can use to "backup" their changes or do whatever they want. To be more precise, it's all branches under namespace tmp/* where developers can push without a review.Now we face the following problem. People create e.g. 3 commits on tmp/mybranch. After a while they want to push those changes to refs/for/master. Gerrit says "no new changes" since it knows all SHAs already.Now I told the developers they should use a rebase which only makes sense here with "--force" to really get new SHAs (without --force the commits could just be fast-forwards).Until now, no developer could work around the review system for our master branch, but with the following use case you can bypass the system:Let's assume we have the 3 mentioned commits on tmp/mybranch and do a "rebase -i" to squash the latest 2 commits. When you push this to refs/for/master now, the first commit on "tmp/mybranch" is just a fast-forward commit which now slips into master without being reviewed.A-B master\C-D-E tmp/mybranchrebase -i origin/master with squashing D+EA-B-C-'DE'C doesn't get a review!The official way to achieve what you want is to use the %base argument for the targetbranch when pushing for review, see [1].In this case you would need to specify the B as the base:$ git push origin HEAD:refs/for/master%base=B
So my question is, how would you change our workmode?Another possibility would be to create an additional project which would only be used for backups.Then, your developers can create another remote called "backup" that would push all (or a subset)of their local branches to that backup project. Each developer could get own branch namespaceinto the backup project:[remote "backup"]pushurl = url-of-the-backup-projectpush = refs/heads/*:refs/heads/zivkov/*to backup my local branches I only need to:$ git push backup
Hi Saša
On Wednesday, June 19, 2013 11:03:10 AM UTC+2, zivkov wrote:On Tue, Jun 18, 2013 at 4:37 PM, Matthias Günther <matgnt@gmail.com> wrote:
Hi allWe have a workmode here that we have a branch which people can use to "backup" their changes or do whatever they want. To be more precise, it's all branches under namespace tmp/* where developers can push without a review.Now we face the following problem. People create e.g. 3 commits on tmp/mybranch. After a while they want to push those changes to refs/for/master. Gerrit says "no new changes" since it knows all SHAs already.Now I told the developers they should use a rebase which only makes sense here with "--force" to really get new SHAs (without --force the commits could just be fast-forwards).
Until now, no developer could work around the review system for our master branch, but with the following use case you can bypass the system:Let's assume we have the 3 mentioned commits on tmp/mybranch and do a "rebase -i" to squash the latest 2 commits. When you push this to refs/for/master now, the first commit on "tmp/mybranch" is just a fast-forward commit which now slips into master without being reviewed.A-B master\C-D-E tmp/mybranchrebase -i origin/master with squashing D+EA-B-C-'DE'C doesn't get a review!The official way to achieve what you want is to use the %base argument for the targetbranch when pushing for review, see [1].In this case you would need to specify the B as the base:$ git push origin HEAD:refs/for/master%base=BThanks for the hint to %base. I didn't know this. But actually it's not what I want to achieve here. I'd like to also see the "C" commit as a new open change in Gerrit.
But the documentation you're pointing to seems to be the root cause of my problem:"By default new changes are opened only for new unique commits that have never before been seen by the Gerrit server"Is this true? There is no association with a branch? I couldn't find a more detailed documentation about what a new change is and how Change-Id, SHA and branches are linked to each other in Gerrit.So my question is, how would you change our workmode?Another possibility would be to create an additional project which would only be used for backups.Then, your developers can create another remote called "backup" that would push all (or a subset)of their local branches to that backup project. Each developer could get own branch namespaceinto the backup project:[remote "backup"]pushurl = url-of-the-backup-projectpush = refs/heads/*:refs/heads/zivkov/*to backup my local branches I only need to:$ git push backupYes, this is another way to provide those temporary branch options for the developers. We decided to provide this in the same project to make it easier for the developers because we thought it's possible with the Gerrit rights management.
Matthias--
Let's assume we have the 3 mentioned commits on tmp/mybranch and do a "rebase -i" to squash the latest 2 commits. When you push this to refs/for/master now, the first commit on "tmp/mybranch" is just a fast-forward commit which now slips into master without being reviewed.A-B master\C-D-E tmp/mybranchrebase -i origin/master with squashing D+EA-B-C-'DE'C doesn't get a review!The official way to achieve what you want is to use the %base argument for the targetbranch when pushing for review, see [1].In this case you would need to specify the B as the base:$ git push origin HEAD:refs/for/master%base=BThanks for the hint to %base. I didn't know this. But actually it's not what I want to achieve here. I'd like to also see the "C" commit as a new open change in Gerrit.Have you tried that?If your HEAD points at DE and you do:git push origin HEAD:refs/for/master%base=Byou should get new open changes for C and DE commits.This is also what the commit message of 5d8a290d0622ce0469fb0abfdab182b5e100189f tells
Hi Saša,Let's assume we have the 3 mentioned commits on tmp/mybranch and do a "rebase -i" to squash the latest 2 commits. When you push this to refs/for/master now, the first commit on "tmp/mybranch" is just a fast-forward commit which now slips into master without being reviewed.A-B master\C-D-E tmp/mybranchrebase -i origin/master with squashing D+EA-B-C-'DE'C doesn't get a review!The official way to achieve what you want is to use the %base argument for the targetbranch when pushing for review, see [1].In this case you would need to specify the B as the base:$ git push origin HEAD:refs/for/master%base=BThanks for the hint to %base. I didn't know this. But actually it's not what I want to achieve here. I'd like to also see the "C" commit as a new open change in Gerrit.Have you tried that?If your HEAD points at DE and you do:git push origin HEAD:refs/for/master%base=Byou should get new open changes for C and DE commits.This is also what the commit message of 5d8a290d0622ce0469fb0abfdab182b5e100189f tellsYou're right, it creates the 3 new changes I want. The problem is still that I can't enforce this. I can only hope the developers use this feature.
When I tried this new feature I figured out it seems having a bug. After submitting via the Web-UI the 3 changes are still in status "Submitted, Merge Pending", even though I can see the 3 commits on master already. (2.7-rc1)I'll file a bug for this.
In general I think my initial problem could be solved with an option per project or globally, where I can configure namespaces (like "tmp/*") not to be "monitored" by Gerrit.At the end I have 2 options- trust the developers to not bypass the review (use a rebase --force for now (2.6) or the above mentioned %base option later (with 2.7))- don't allow the tmp/* namespace for backups and rather create separate projects (which is a bit more effort for me to maintain + more effort for the developers to integrate into their local projects)Thanks for your help
Matthias
On Fri, Jun 21, 2013 at 10:23 AM, Matthias Günther <mat...@gmail.com> wrote:
Hi Saša,Let's assume we have the 3 mentioned commits on tmp/mybranch and do a "rebase -i" to squash the latest 2 commits. When you push this to refs/for/master now, the first commit on "tmp/mybranch" is just a fast-forward commit which now slips into master without being reviewed.A-B master\C-D-E tmp/mybranchrebase -i origin/master with squashing D+EA-B-C-'DE'C doesn't get a review!The official way to achieve what you want is to use the %base argument for the targetbranch when pushing for review, see [1].In this case you would need to specify the B as the base:$ git push origin HEAD:refs/for/master%base=BThanks for the hint to %base. I didn't know this. But actually it's not what I want to achieve here. I'd like to also see the "C" commit as a new open change in Gerrit.Have you tried that?If your HEAD points at DE and you do:git push origin HEAD:refs/for/master%base=Byou should get new open changes for C and DE commits.This is also what the commit message of 5d8a290d0622ce0469fb0abfdab182b5e100189f tellsYou're right, it creates the 3 new changes I want. The problem is still that I can't enforce this. I can only hope the developers use this feature.Like every other feature ;-)You can't even enforce they use refs/for/master
When I tried this new feature I figured out it seems having a bug. After submitting via the Web-UI the 3 changes are still in status "Submitted, Merge Pending", even though I can see the 3 commits on master already. (2.7-rc1)I'll file a bug for this.This sounds like a bug.In general I think my initial problem could be solved with an option per project or globally, where I can configure namespaces (like "tmp/*") not to be "monitored" by Gerrit.At the end I have 2 options- trust the developers to not bypass the review (use a rebase --force for now (2.6) or the above mentioned %base option later (with 2.7))- don't allow the tmp/* namespace for backups and rather create separate projects (which is a bit more effort for me to maintain + more effort for the developers to integrate into their local projects)