On Friday, August 16, 2013 at 06:03 EDT,
Ne0 <
liamjam...@googlemail.com> wrote:
> I have an AOSP mirror set up and i want branch from a particular
> Android build and I'm looking for advice on how to do this.
>
> Here is what i think i should do it but i have hit issues.
>
> repo init -u git@development:android.git/platform/manifest.git
> -b android-4.2.2_r1.2 # Success
> repo sync # Success
> repo forall -c "git branch my-4.2.2;git push --all development" # Success
> cd .repo/manifests/ # Success
> git branch my-4.2.2 # Success
> nano default.xml
> <remote name="development"
> fetch=".." />
> <default revision="my-4.2.2"
> remote="development"
> git commit -a -m "Creating my own branch my-4.2.2" # Success
> git push --all development # Success
> cd ../../ # Success
> repo init -u git@development:android.git/platform/manifest.git -b my-4.2.2 #
> Success
> repo sync # Success
This... doesn't add up to me. You created a my-4.2.2 branch in the
manifest and updated the default revision to use that branch for all
gits (the android-4.2.2_r1.2 manifest uses the default revision
everywhere). I don't see how you can switch to that manifest branch
and run 'repo sync' without it complaining about a missing my-4.2.2
branch in every git. Did you forget to mention one of the steps you
did?
> cd build/ # Success
> git branch -t my-4.2.2-changes development/my-4.2.2 # Success
> nano envsetup.sh
> # Making a change!
> git commit -a -m "Made a change" # Success
> git push --all development # Success
> cd ../ # Success
> repo sync # Success
> cd build # Success
> gitg # FAIL - Local head at wrong position.
I'm not familiar with gitg. Perhaps it doesn't like the symlinks in the
.git directories?
> After doing all this I check where sync has left the local head
> and its not checked out to the development/my-4.2.2 branch but an
> m/my-4.2.2 branch that appears to be at the commit behind
> development/my-4.2.2. I'm not sure where m/my-4.2.2 came from or
> why repo is not tracking the remote branch.
You never checked out the my-4.2.2-changes branch, so your commit was
made on top of the detached head. When you ran 'repo sync', the state
of the git was backed out to what the state should be according to the
manifest (i.e. a detached head based on my-4.2.2). The m/my-4.2.2 ref
is a symlink to the branch that the manifest points to, so in this case
you should be seeing this:
$ git branch -a | grep 'm/my-4.2.2'
remotes/m/my-4.2.2 -> development/my-4.2.2
Because of this, 'git rev-parse m/my-4.2.2' will always be the same as
'git rev-parse development/my-4.2.2'.
[...]
--
Magnus Bäck
ba...@google.com