0

I have two gerrit sites. Cherry-pick must be run in a work tree. However, git repositories in gerrit are to be shared, which means cherry-pick is not allowed. I hava many commits in both site. How can I do cherry-picks daily without fetching to many codes locally.

For now I do the following to cherry-pick:

  1. Clone repository in gerrit A.
  2. Fetch commit in gerrit B and do cherry-pick in the repository just cloned.
  3. Push back to gerrit A.

This is not what I want because not nice-looking and slow.

This is why I ask pointing "without fetching to many codes locally".

Note: I want to cherry-pick between bare repositories. A little bit confusing.


This is the only part in my problem I can not explain or change.

One gerrit site has 3 parts: code part, gerrit part, database part. Code part contains all the git repositories presenting on the Gerrit. All of them are created by git init --bare cmds. These repositories, for most gerrit users, are so-called "remote repositories". Conveniently, you may run the following in bash mkdir temp_dir; cd temp_dir; git init --bare; git status to check the error print.


Seems that I can do "fetch" in bare repositories.

git fetch ssh://user@server:/project/path.git changes/xx/xxx/x:local_branch

But the change fetched can only been seen in gitweb. Can't review it cause it is not on refs/for branch. How can I fetch a change and get it on refs/for/ branch?

kenorb
  • 155,785
  • 88
  • 678
  • 743
  • I don't fully understand your Gerrit workflow, but it seems to me that if `cherry-pick` is a planned part of your workflow, you might want to consider redesigning it. – Tim Biegeleisen Jul 27 '15 at 08:05
  • 1. `I have two gerrit sites` - why? 2. `git repositories in gerrit are to be shared, which means cherry-pick is not allowed` - I don't get it, what do you mean? – Arkadiusz Drabczyk Jul 27 '15 at 09:06
  • @TimBiegeleisen yes. I want to cherry-pick between bare repositories. A little bit confusing. – outofkurt Jul 27 '15 at 09:38
  • @ArkadiuszDrabczyk 1. This is the only part in my problem I can not explain or change. 2. One gerrit site has 3 parts: code part, gerrit part, database part. Code part contains all the git repositories presenting on the Gerrit. All of them are created by "git init --bare" cmds. These repositories, for most gerrit users, are so-called "remote repositories". Conveniently, you may run the following in bash "`mkdir temp_dir; cd temp_dir; git init --bare; git status`" to check the error print. – outofkurt Jul 27 '15 at 09:49
  • Seems that I can do "fetch" in bare repositories. `git fetch ssh://user@server:/project/path.git changes/xx/xxx/x:local_branch`. But the change fetched can only been seen in gitweb. Can't review it cause it is not on refs/for branch. How can I fetch a change and get it on refs/for/ branch? – outofkurt Jul 28 '15 at 02:22

0 Answers0