On Mon, May 30, 2016 at 09:00:05PM +0200, Holger Freyther wrote: > Do you know you can directly clone from ssh (one command)?
like, use the ssh shell access and then I get the hook cloned along?? > You can also define one _remote_ and have different pull/push urls (okay > would require post-clone work but maybe a script)? > > git config remote.origin.pushurl ssh://<GERRIT_HOST>:29418/<PROJECT_PATH>.git > git config remote.origin.push refs/heads/*:refs/for/* > git push origin Ah ok, that would be better. Can I also push -f to users/* branches in a similar fashion? > Okay, maybe a clone script? I assume you have one already? not yet, I have only put openbsc and libosmocore on gerrit so far. > $ cat git gerrit-clone git://git.osmocom.org/libosmocore interesting, you can cat git URLs these days! ;) > #!/bin/sh > set -e > git clone $1 > cd `basename $1 git` > git config remote.origin.pushurl ... > git config remote.origin.push.. > scp .. .git/hooks > echo "tada" heh "tada" If we can have the users branch push enabled I'll complete the script and put it in the Gerrit wiki page. > yes, a change in muscle memory. When cloning you have to remember your gerrit > username and that the repository was using gerrit. But from daily workflow it > doesn't look that bad? I have to type "users/" a lot more :P (ok see below) But it would help to get rid of the duplicate remotes = duplicate branches. For me personally, the gerrit username matches my shell username, so no problem there. > Either way you have to make the mental decision if you push a wip branch or > if you want to have review. that's not a problem. But one more thing here: pushing a branch to gerrit is slightly easier than format-patch, but what is really cumbersome now is to push just one commit from a private branch (cherry pick to for/master). With git format-patch I could just supply a range 123abc..ef0987, with gerrit I first need to create a fresh branch with just that commit. Especially if I have a couple of unrelated commits sitting in line on a private branch and I want to submit them separately, I have to create a new branch for each single commit to push for/master. Do I? > > - access rules = obstructed access to branches = add 'users/' to all > > private branches > > = we have scores of old branches now in a namespace we can't use anymore > > Then let's create one group like you did and allow everything for that group > again? So one manual intervention and one can push to everything again. No > issue with that. agreed. I have allowed global push permission for the "known users" group. Since we already have a sysmocom group, sysmocom/* push permission is still exclusive for the sysmocom group. I also made push to master exclusive to admins as a gimmick. I hope it doesn't interfere with the normal merges, we can just drop the rule again if it does. > Under Projects -> "openbsc.git" change it to "Rebase if necessary" and give > it a small try (push a slightly outdated commit so we can see I did that and submitted two test branches with two commits each: One should not have any conflicts during a rebase: https://gerrit.osmocom.org/130 https://gerrit.osmocom.org/131 The other should have a conflict on the first commit: https://gerrit.osmocom.org/132 https://gerrit.osmocom.org/133 For some reason both the second commits on the branches also show a conflict. changed back to 'cherry pick' for now. ~Neels
signature.asc
Description: Digital signature
