On Thursday, May 16, 2013 at 02:48 EDT,
Raf <
rafeah....@gmail.com> wrote:
[...]
> 3/ Repo Sync
> $repo sync -j4
If you specify the sync-j attribute to the 'default' element in the
manifest you don't have to specify that option manually. See how it's
done in the original AOSP manifest.
> 4/ Go to kernel and tries to checkout branchA
> $cd kernel
> $git checkout branchA
> error: pathspec 'branchA' did not match any file(s) known to git.
>
> Then, I go and check the list of branches available
> $ git branch -a
> remotes/m/branchA -> origin/branchA
> ...
> ...
> remotes/origin/branchA
>
> So it is obvious the branch is there, but why am I unable to checkout the
> branch?
Normally, when saying
git checkout foo
Git wouldn't search refs/remotes/origin to find the foo ref, but Git
1.6.6 introduced a do-what-I-mean patch (commit 70c9ac2, documented in
commit 00bb437) that made the command above a shortcut for
git checkout -b foo --track <remote>/foo
if there's no local ref with this name and only a single remote with
this ref. But, in your case there are two remotes with this ref as a
leaf, refs/remotes/m/branchA and refs/remotes/origin/branchA, so Git
forces you to be explicit.
In addition to this, your Git might be older than 1.6.6. Repo would've
died on you since it requires 1.7.2, but perhaps you still run an older
version of the 'repo' wrapper script? What does
grep 'VERSION = ' $(which repo)
tell you? Prior to Repo 1.19, released around Jan 3 this year, Repo
only required Git 1.5.4.
The exact rules for Git's ref matching logic can be found in
git-checkout(1) under SPECIFYING REVISIONS.
What did you hope to accomplish with this command? If the manifest lists
branchA for the kernel git then you already have the tip of that branch
checked out after a sync. It makes sense if you want a local branch to
work on (assuming you want to take advantage of Git's do-what-I-mean
feature), but there's also 'repo start' to start local topic branches.
> Is it due to the manifest repo branch name is the same as the revision
> in all the projects?
Yes, sort of. If those names match then checkout's do-what-I-mean is
effectively disabled.
> Should I change the manifest repo branch name to another name?
No, no need for that.
--
Magnus Bäck
ba...@google.com