-2

Hi I set up my Gerrit with for the latest android aosp 5.1.1_r3.

repo init --mirror -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r3

Update the default.xml with the below changes.

<remote  name="aosp"
           fetch="ssh://xx.xx.xx.xx:29418/" />
  <default revision="refs/tags/android-5.1.1_r3"
           remote="http://xx.xx.xx.xx:8080/"
           sync-j="4" />

I have created a mirror for this version on my AWS instance under /git/ But when i do a : repo init -u http://xx.xx.xx.xx:8080/platform/manifest -b android-5.1.1_r3

The manifest is still showing as below. Does it mean its going to sync from AOSP or from my AWS server?

 <remote  name="aosp"
               fetch=".." />
      <default revision="refs/tags/android-5.1.1_r3"
               remote="aosp"
               sync-j="4" />

Please help me to fix this issue. Many thanks

Magnus Bäck
  • 11,381
  • 3
  • 47
  • 59

1 Answers1

1

You apparently didn't push your change to your server (which is why the manifest file doesn't include your change). However, you don't have to change the manifest in order to sync code. The fetch=".." part in the original manifest means that the gits are going to be synced from the same source as the manifest itself.

However, you do have to change the manifest if you want Repo to send commits to your Gerrit server when running repo upload. Make sure you push your manifest change, e.g. like this:

git push ssh://xx.xx.xx.xx:29418/platform/manifest HEAD:refs/for/name-of-your-branch

Finally, do not change the "remote" attribute of the <default> element. It shouldn't contain a URL but the name of a remote specified in the manifest, in this case "aosp".

Setting up a local AOSP mirror and allowing local code reviews requires some thinking about the branching strategy and how you mirror branches. The following questions discuss this topic:

Community
  • 1
  • 1
Magnus Bäck
  • 11,381
  • 3
  • 47
  • 59
  • Thanks a lot Magnus for the detailed answer. I have pushed the manifest file and its fine now. I have also updated the default remote to "aosp". Yes I need to understand a lot on the branching and mirroring concepts. The links you have shared will be a lot of help. Cheers. – Brijesh Somu Jun 09 '15 at 03:09
  • @user1293879: Please upvote and/or accept the answer if it was helpful. – Magnus Bäck Jun 09 '15 at 09:53
  • Sure Magnus. Here are the steps I have followed till now to setup my gerrit. 1. Created a mirror on AWS with AOSP 5.1.1_r3 branch 2. Added the review in default.xml to facilitate the code reviews. Now i am working on 3. Creating a separate branch other than -b android-5.1.1_r3 to facilitate our developers to work upon and push their changes. I am going through the 4 documents which you have shared. Do I need to understand any other stuffs before I perform these activities? Any suggestion will be helpful. Thanks – Brijesh Somu Jun 10 '15 at 07:12
  • No, I think those documents should cover most things you need to know. – Magnus Bäck Jun 10 '15 at 08:39
  • Hi Magnus, need your help here. I have followed the instruction in the first reference to create a branch in my server. By default i had mirrored with the -b android-5.1.1_r3. But now i need to create a development branch for my team in the server. I did the following changes. 1. git push origin default:refs/heads/mybranch 2. repo forall -c 'git push aosp HEAD:refs/heads/mybranch' this is asking me username and password for every git project. Are the steps correct what i have done? – Brijesh Somu Jun 11 '15 at 09:07
  • Well, it's one way of doing it. As I believe one of the links describe you don't have to branch every single git, but if you do it looks like you're doing the right thing. – Magnus Bäck Jun 11 '15 at 09:58
  • but entering the username and password for all the git repo's is very tedious. Is there a better way of creating a branch ? – Brijesh Somu Jun 11 '15 at 10:07
  • repo forall -c 'git push aosp HEAD:refs/heads/mybranch' is it possible to do something like this : repo forall -c 'git push aosp/* HEAD:refs/heads/mybranch' – Brijesh Somu Jun 11 '15 at 10:14
  • Address the real problem, which is that you have to enter username and password. How to solve that depends on what protocol you're using. Ask a new StackOverflow question for that (but google the problem first). – Magnus Bäck Jun 11 '15 at 10:15
  • I don't understand what `git push aosp/*` is supposed to do. – Magnus Bäck Jun 11 '15 at 10:16
  • Username for 'http://xx.xx.xx.xx:8080': username Password for 'http://username@xx.xx.xx.xx:8080': password Total 0 (delta 0), reused 0 (delta 0) remote: Processing changes: refs: 1, done To http://xx.xx.xx.xx:8080/platform/dalvik * [new branch] HEAD -> mybranch What i was trying to ask you is, for every single project its asking me to enter username and password, which is very tedious. Is there an option to enter once and it does for all the repo's. I am little new to this, so pls suggest. – Brijesh Somu Jun 11 '15 at 10:23
  • Yes, I undestood _that_ but the `aosp/*` stuff didn't make sense. See http://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-github. Over and out. – Magnus Bäck Jun 11 '15 at 12:00
  • I was trying to check the available option. Anyway you can leave that! Thanks a lot for the timely help. – Brijesh Somu Jun 11 '15 at 13:47