I am developing applications with Android on a custom ARM based
platform. There are multiple users making change to the Android code
for the custom platform. I need to keep a version control system for
all these changes locally and ensure that it is made available to
every other developer withing the team. Therefore, each developer
commits his/her changes locally and generates patches. These patches
will go in to the local Android source repository, from where other
developers can pull in the changes.
I've attempted to show this with an ASCII diagram :-)
---------------------------------------------------------
| Android sources on
Google Server |
---------------------------------------------------------
|
|
---------------------------------------------------------
| Android sources on
local Server | (192.168.10.1)
---------------------------------------------------------
|
|
--------------------------------------------------------------------------------------------------------------------------------------------
| |
| |
|
Developer. 1 Developer 2
Developer 3 Developer 4 Developer 5
I tried to publish the GIT repositories that are cloned on the local
server as a result of 'repo sync'. I am having problems cloning the
published tree.
$ git-clone git://192.168.10.1/bionic.git
Initialized empty Git repository in
/home/user/work/local-copy/bionic/.git/
remote: Counting objects: 1876, done.
remote: Compressing objects: 100% (867/867), done.
remote: Total 1876 (delta 981), reused 1875 (delta 981)
Receiving objects: 100% (1876/1876), 1.41 MiB, done.
Resolving deltas: 100% (981/981), done.
/usr/bin/git-clone: line 451: cd:
/home/user/work/local-copy/bionic/.git/refs/remotes/origin: No such
file or directory
This is because the published bionic GIT repository does not have
a .git/refs/remotes/origin folder but has .git/refs/remotes/korg.
In the manifest file, for starters, I am trying to sync only the
bionic sources. The manifest file that the developer uses to sync
from the local server reads as follows:
------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<manifest branch="master">
<remote name="korg"
fetch="git://192.168.10.1/" />
<default revision="master"
remote="korg" />
<project path="bionic" name="bionic" />
</manifest>
------------------------------------------------------------------------
However, when I do a repo sync with this manifest file, I see the
following errors:
Initializing project bionic ...
Traceback (most recent call last):
File "/home/user/work/local-repo/.repo/repo/main.py", line 202, in <module>
_Main(sys.argv[1:])
File "/home/user/work/local-repo/.repo/repo/main.py", line 186, in _Main
repo._Run(argv)
File "/home/user/work/local-repo/.repo/repo/main.py", line 96, in _Run
cmd.Execute(copts, cargs)
File "/home/user/work/local-repo/.repo/repo/subcmds/sync.py", line
106, in Execute
if not project.Sync_LocalHalf():
File "/home/user/work/local-repo/.repo/repo/project.py", line 580,
in Sync_LocalHalf
self._InitWorkTree()
File "/home/user/work/local-repo/.repo/repo/project.py", line 981,
in _InitWorkTree
rev = self.bare_git.rev_parse('%s^0' % rev)
File "/home/user/work/local-repo/.repo/repo/project.py", line 1164, in runner
p.stderr))
error.GitError: bionic rev-parse: fatal: ambiguous argument
'refs/remotes/korg/master^0': unknown revision or path not in the
working tree.
Use '--' to separate paths from revisions
How do I mirror the sources cloned from the Google repository on my
local server?
Any pointers would help! Thank you for your time
Regards,
Kanagesh
I am developing applications with Android on a custom ARM based
platform. There are multiple users making change to the Android code
for the custom platform. I need to keep a version control system for
all these changes locally and ensure that it is made available to
every other developer withing the team. Therefore, each developer
commits his/her changes locally and generates patches. These patches
will go in to the local Android source repository, from where other
developers can pull in the changes.
I've attempted to show this with an ASCII diagram :-)
---------------------------------------------------------
| Android sources on
Google Server |
I tried to publish the GIT repositories that are cloned on the local
server as a result of 'repo sync'. I am having problems cloning the
published tree.
$ git-clone git://192.168.10.1/bionic.git
Initialized empty Git repository in
/home/user/work/local-copy/bionic/.git/
remote: Counting objects: 1876, done.
remote: Compressing objects: 100% (867/867), done.
remote: Total 1876 (delta 981), reused 1875 (delta 981)
Receiving objects: 100% (1876/1876), 1.41 MiB, done.
Resolving deltas: 100% (981/981), done.
/usr/bin/git-clone: line 451: cd:
/home/user/work/local-copy/bionic/.git/refs/remotes/origin: No such
file or directory
This is because the published bionic GIT repository does not have
a .git/refs/remotes/origin folder but has .git/refs/remotes/korg.
In the manifest file, for starters, I am trying to sync only the
bionic sources. The manifest file that the developer uses to sync
from the local server reads as follows:
------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<manifest branch="master">
<remote name="korg"
fetch="git://192.168.10.1/" />
<default revision="master"
remote="korg" />
<project path="bionic" name="bionic" />
</manifest>
------------------------------------------------------------------------
However, when I do a repo sync with this manifest file, I see the
following errors:
Initializing project bionic ...
Traceback (most recent call last):
error.GitError: bionic rev-parse: fatal: ambiguous argument
'refs/remotes/korg/master^0': unknown revision or path not in the
working tree.
Use '--' to separate paths from revisions
How do I mirror the sources cloned from the Google repository on my
local server?
Shawn, thank you very much for your comments and suggestions, I've
made significant progress today. They are summarized below:
I have created a mirror of the sources hosted at
git://android.git.kernel.org on my local server.
$ repo init -u git://android.git.kernel.org --mirror
$ repo sync
I get a snapshot of the .git folders on completion of repo sync on the
local server. I publish this so that others are able to clone them
(with git-clone). When publishing the components, I have ensure that
they are maintained in the same structure (like 'platform/bionic.git',
'kernel/common.git').
$ git-clone git://192.168.10.1/platform/bionic.git
I have modified the default.xml file so that the server clones are
made from is the local server (192.168.10.1) and not the default.
On a development host system:
$ repo init -u git://android.git.kernel.org/platform/manifest.git
<edit default.xml and make changes for fetching from local server>
$ repo sync
When I do a repo sync with this manifest file on a developer host
system, it is able to clone the git repositories from the local
server. For starters though, I am have an entry in default.xml only
to clone bionic since the entire stuff takes quite some time to sync.
On the developer system:
$ cd bionic
<edit source>
$ git commit -a -m "simple changes to test push to main repo"
$ git format-patch ab43d2..
<generates a patch, say, diff.patch >
On the developer system, the administrator clones the bionic repo,
applies the patch and pushes it to the git repository
$ git-clone git://192.168.10.1/platform/bionic.git
Initialized empty Git repository in /home/user/work/local-repo/bionic/.git/
remote: Counting objects: 1876, done.
remote: Compressing oremote: bjects: 100% (867/867), done.
remote: Total 1876 (delta 981), reused 1875 (delta 981)
Receiving objects: 100% (1876/1876), 1.41 MiB, done.
Resolving deltas: 100% (981/981), done.
$
$ cd bionic
$ patch -p1 diff.patch | patch -p1
$ git commit -a -m "simple changes to test push to main repo"
$ git-push ad...@192.168.10.1:/home/git/android/platform/bionic.git
password:
<changes pushed to git repo>
$
The changes are being reflected, but is this the correct way to commit
changes to the main git repository?
I am now trying to setup a manifest file in the local server so that
the developers can do a 'repo init' with respect to this manifest.git
on the local server.
Thanks and regards,
Kanagesh
------ snip text -----
>>
>> However, when I do a repo sync with this manifest file, I see the
>> following errors:
>>
>> Initializing project bionic ...
>> Traceback (most recent call last):
>
> ...
>>
>> error.GitError: bionic rev-parse: fatal: ambiguous argument
>> 'refs/remotes/korg/master^0': unknown revision or path not in the
>> working tree.
>> Use '--' to separate paths from revisions
>>
>>
>> How do I mirror the sources cloned from the Google repository on my
>> local server?
>
> Err, you mean kernel.org repository?
>
> repo init --mirror git://android.git.kernel.org/platform/manifest.git
> repo sync
>
> I wonder how you got your local mirror of bionic.git in the first place.
> The traceback you cite is caused by your local bionic.git not having a
> "master" branch. Did you just git clone it? You need to either git clone
> --mirror or use repo init --mirror to setup the bionic.git (etc.) on your
> internal server, so that all branches exist, otherwise the manifest will be
> surprised like this when a branch isn't found, but it was assumed to exist
> in the manifest.
>
Yes, I was making a mistake here earlier. I was doing a git-clone of
bionic.git to get the local mirror without --mirror option.
On the developer system:
$ cd bionic
<edit source>
$ git commit -a -m "simple changes to test push to main repo"
$ git format-patch ab43d2..
<generates a patch, say, diff.patch >
On the developer system, the administrator clones the bionic repo,
applies the patch and pushes it to the git repository
$ git-clone git://192.168.10.1/platform/bionic.git
Initialized empty Git repository in /home/user/work/local-repo/bionic/.git/
remote: Counting objects: 1876, done.remote: Compressing oremote: bjects: 100% (867/867), done.
remote: Total 1876 (delta 981), reused 1875 (delta 981)$
Receiving objects: 100% (1876/1876), 1.41 MiB, done.
Resolving deltas: 100% (981/981), done.
$ cd bionic
$ patch -p1 diff.patch | patch -p1
$ git commit -a -m "simple changes to test push to main repo"
The changes are being reflected, but is this the correct way to commit
changes to the main git repository?
Thank you for the comments and suggestions.
Yes, this is exactly what I want to the developers to do too. Do a
repo sync, which will clone all the GIT repositories to their
development systems. Make changes to the code, commit locally and
then push to the local server using git-push command.
However, if I attempt to do a git-push from the GIT repository cloned
as a result of repo-sync, git-push always reports saying that
'Everything is up to date' (in spite of the fact that I have more
recent changes that I have committed to the local GIT repo from where
I am doing a git-push).
This is the reason why I have to clone the specific tree separately,
apply the patch, commit and push. What should I be doing to be able
to use git-push from the GIT repository cloned using 'repo sync'?
Thanks and regards,
Kanagesh