Giter Site home page Giter Site logo

esrlabs / git-repo Goto Github PK

View Code? Open in Web Editor NEW
431.0 38.0 145.0 1.59 MB

repo - The multiple repository tool (also works on MS Windows!)

Home Page: https://code.google.com/p/git-repo/

License: Apache License 2.0

Python 98.53% Shell 1.46% Batchfile 0.01%

git-repo's Introduction

Repo for Microsoft Windows and Linux

This is E.S.R.Labs Repo - just like Google Repo but this one also runs under Microsoft Windows. For more information, see Version Control with Repo and Git.

Repo is a repository management tool that Google built on top of Git. Repo unifies many Git repositories when necessary, does the uploads to a revision control system, and automates parts of the development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of multiple repositories. The repo command is an executable Python script that you can put anywhere in your path. In working with the source files, you will use Repo for across-network operations. For example, with a single Repo command you can download files from multiple repositories into your local working directory.

Setup steps for Microsoft Windows

Fix priviledges to allow for creation of symbolic links
  • If you are a member of the Administrators group you have to turn off User Access Control (UAC) and then restart the computer.

  • Otherwise you have to adjust your user rights to get SeCreateSymbolicLinkPrivilege priviledges. The editrights tools is provided as part of git-repo for Microsoft Windows.

  • Highly experimental (do not use except for developing this feature!): If you prefer to not use symbolic links but junctions for folders and hardlinks for files instead, you have to set the following in your ~/.gitconfig:

      [portable]
          windowsNoSymlinks = true
    

    This will not require to set the the priviledges as described above.

    Known issue: Hard links are destroyed by git for example when you delete a branch (breaks .git/config). This will destroy the project workspace!

Download and install Git
  • Download Git (http://git-scm.com/downloads)
  • Add Git to your path environment variable: e.g. C:\Program Files (x86)\Git\cmd;
  • Add MinGW to your path environment variable: e.g. C:\Program Files (x86)\Git\bin;
Download and install Python
Download and install Repo either using the Windows Command Shell or Git Bash
Windows Command Shell
md %USERPROFILE%\bin
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > %USERPROFILE%/bin/repo
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > %USERPROFILE%/bin/repo.cmd
Windows PowerShell
md $env:USERPROFILE\bin
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > $env:USERPROFILE/bin/repo
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > $env:USERPROFILE/bin/repo.cmd
Git Bash
mkdir ~/bin
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > ~/bin/repo.cmd
  • Add Repo to your path environment variable: %USERPROFILE%\bin;
  • Create a HOME environment variable that points to %USERPROFILE% (necessary for OpenSSH to find its .ssh directory).
  • Create a GIT_EDITOR environment variable that has an editor executable as value. For this, first add the home directory of the editor executable to the path environment variable. GIT_EDITOR can than be set to "notepad++.exe", "gvim.exe", for example.

Setup steps for Linux

Downloading and installing Git and Python
sudo apt-get install git-core
sudo apt-get install python
Download and install Repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Usage

For more detailed instructions regarding git-repo usage, please visit git-repo.

FAQ Troubleshooting

I can not see any colors for repo status

The pager which is used for repo status is set per default to less, which unless otherwise configured will ignore escape sequences. You can set the environment variable LESS to -FRSX to make less handle colors. (You might also want to set LESSCHARSET to utf-8)

It still doesn't work!

You can try using more as your pager of choice. It doesn't behave exactly the same as less but it might be enough for you.

git config --global core.pager more

. Alternativly, the environment variable GIT_PAGER can be set to more.

I get a WindowsError when initializing my repo with repo init .. in Windows Command Shell

If there is a warning at the beginning of the output which reads states that GPG is not available

warning: gpg (GnuPG) is not available.
warning: Installing it is strongly encouraged.

you have to add gpg.exe to your PATH variable. The executable can be found in your Git installation folder $GIT\usr\bin. When you are using Git Bash, the $Git\usr\bin folder is already added to your PATH.

Changes to original git-repo

Portable changes
  • Added Windows executable repo.cmd
  • Replacing usage of fcntl with sockets for Windows
  • Handling pager and coloring with subprocesses and redirects of sysin, sysout and syserr on Windows
  • Using mklink to create symbolic links on Windows (alternative: use junctions and hardlinks by setting portable.windowsNoSymlinks = true in ~/.gitconfig)
  • fixed some file handling issues / differences
New Features
  • Added push.py sub command to upload and bypass the code review system.
  • Added interactive workflow test

Developer Information

Resyncing with official google repo

For resyncing with the official google repo git, here are the commands for resyncing with the tag v1.12.33 of the official google repo:

# add google git-repo remote with tag
git remote add googlesource https://android.googlesource.com/tools/repo/
git checkout v1.12.33 -b google-latest

# checkout basis for resync
git checkout google-git-repo-base -b update
git merge --allow-unrelated-histories -Xtheirs --squash google-latest
git commit -m "Update: google git-repo v1.12.33"
git rebase stable

# solve conflicts; keep portability in mind

git checkout stable
git rebase update

# cleanup
git branch -D update
git branch -D google-latest
Creating a new signed version

Commands for creating a new version of repo:

git tag -s -u KEYID v0.4.16 -m "COMMENT"
git push origin stable:stable
git push origin v0.4.16
  • replace KEYID (something like 0x..)
  • the v0.4.16 (two times)
  • replace COMMENT with something more explaining

git-repo's People

Contributors

brunovernay avatar drinfiniteexplorer avatar eyvstm avatar itslenny avatar spate avatar stchar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-repo's Issues

Syntax error on repo init

OK, I get the following error when I try to run repo on windows -->

C:\Users\Akshayraj>repo
File "c:/Users/Akshayraj/bin/repo", line 185
print("fatal: invalid branch name '%s'" % branch, file=sys.stderr)
^
SyntaxError: invalid syntax

"fatal: manifest 'default.xml' not available" when exec repo init

repo init -u xxxxxxx -b 7.0_trunk_k44

  • [new branch] xxxxxxxx
    fatal: manifest 'default.xml' not available
    fatal: error parsing manifest D:\workspace\7.0_trunk.repo\manifests\default.xml: syntax error: line 1, column 0

I found something.
ls -l .repo/manifests/default.xml
-rw-r--r-- 1 ZC 1049089 21 七月 28 10:43 .repo/manifests/default.xml

cat .repo/manifests/default.xml
7.0_trunk_k44

default.xml is not a symbollink

OS is win7 x64

Error: project not found when try to create new branch in specified project

Hello,
I successfully installed your git-repo for Windows.
Then init repo with manifest and synced my projects.
When trying to create a new branch with:
$ repo start branch_name project_name
I have an error: project project_name not found.
But command:
$ repo start branch_name --all
works fine.
Why doesn't repo tool see my projects?

repo init error - WindowsError: [Error 2] The system cannot find the file specified

I'm trying to create a simple proof-of-concept configuration on my Windows 10 system to ensure things are working correctly. (I was able to successfully create a similar setup on an Oracle Linux 7.2 system, but I need this to work for a project that is Windows-based.) I'm using the following repo/git versions:

C:\Users\danielre\AppData\Local\Temp\git\repo>repo --ver
repo version v0.4.20
(from https://github.com/esrlabs/git-repo)
repo launcher version 1.25
(from C:\repo\repo)
git version 2.6.4.windows.1
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)]

C:\Users\danielre\AppData\Local\Temp\git\repo>

When I try to run "repo init", I receive the following error:

C:\Users\danielre\AppData\Local\Temp\git\repo>set REPO_TRACE=1

C:\Users\danielre\AppData\Local\Temp\git\repo>
C:\Users\danielre\AppData\Local\Temp\git\repo>repo init -u file://C:\Users\danielre\AppData\Local\Temp\git\remote\manifest.git
: git config --file C:\Users\danielre/.gitconfig --null --list 1>| 2>|
redirecting to cat
Traceback (most recent call last):
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo/main.py", line 538, in
_Main(sys.argv[1:])
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo/main.py", line 512, in _Main
result = repo._Run(argv) or 0
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo/main.py", line 181, in _Run
portable.NoPager(cmd)
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo\portable.py", line 277, in NoPager
RunWindowsShell(cmd)
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo\portable.py", line 281, in RunWindowsShell
redirect_all(executable)
File "C:\Users\danielre\AppData\Local\Temp\git\repo.repo\repo\portable.py", line 288, in redirect_all
p = subprocess.Popen([executable], stdin=subprocess.PIPE, stdout=old_sysout, stderr=old_syserr)
File "C:\Python27\lib\subprocess.py", line 711, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 959, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

C:\Users\danielre\AppData\Local\Temp\git\repo>

I'm not well versed in Python, but looking at the code, it appears to be trying to invoke a command prompt. I've tried from a standard command prompt, one started "as administrator", and from Git BASH, but it doesn't work (With the Git BASH shell, it gives a different error, but I'm not too concerned about it working correctly within this shell specifically -> fatal: 'C:/Program Files/Git/AppData/Local/Temp/git/remote/manifest.git' does not appear to be a git repository)

Any suggestions on what might be causing the error reported from the Windows command prompts?

Can't sync after initializing mirror repo

'repo sync' fails on repository initialized with --mirror option.

The failure stack is:

$ repo sync
Traceback (most recent call last):
File "c:\test.repo\repo/main.py", line 532, in
result = _Main(sys.argv[1:])
File "c:\test.repo\repo/main.py", line 505, in _Main
result = repo._Run() or 0
File "c:\test.repo\repo/main.py", line 158, in _Run
result = cmd.Execute(copts, cargs)
File "c:\test.repo\repo\subcmds\sync.py", line 584, in Execute
submodules_ok=opt.fetch_submodules)
File "c:\test.repo\repo\command.py", line 188, in GetProjects
result.sort(key=_getpath)
TypeError: unorderable types: str() < NoneType()

$ python --version
Python 3.3.2

It caused during sort of projects list inside command.py:Command class, where some of the projects have no relpath defined.

command.py:

def GetProjects(self, args, missing_ok=False, submodules_ok=False):
.....
def _getpath(x):
return x.relpath

    result.sort(key=_getpath)

Such projects ( git-repo and manifest project ) are specifically added to the list during manifest load if mirror option is used:

manifest_xml.py:

def _Load(self):
...
if self.IsMirror:
self._AddMetaProjectMirror(self.repoProject)
self._AddMetaProjectMirror(self.manifestProject)

_AddMetaProjectMirror specifically adds projects with relpath set to None.

Errors on 2nd run with Git 2 on Windows

Repo is from Git HEAD, Git 2 version is 2.4.5.1.

On the first run (empty workspace) the Jenkins jobs run correctly using repo, but on 2nd run (i.e. workspace is already initialized), it always produces errors like this:

[vs2013] $ /jenkins/tools/utils/repo.cmd sync -d -c -q
error: unable to create directory for .git/logs/HEAD
fatal: update_ref failed for ref 'HEAD': Cannot update the ref 'HEAD'.
error: unable to create directory for .git/logs/HEAD
fatal: update_ref failed for ref 'HEAD': Cannot update the ref 'HEAD'.

It never happens using Git 1 shell (1.9.5). Any ideas?

exception when user.email and user.name not configured when repo init

Traceback (most recent call last):
  File "/home/andreibechet/Projects/audicgw/.repo/repo/main.py", line 532, in <module>
    result = _Main(sys.argv[1:])
  File "/home/andreibechet/Projects/audicgw/.repo/repo/main.py", line 505, in _Main
    result = repo._Run() or 0
  File "/home/andreibechet/Projects/audicgw/.repo/repo/main.py", line 158, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/andreibechet/Projects/audicgw/.repo/repo/subcmds/init.py", line 358, in Execute
    self._ConfigureUser()
  File "/home/andreibechet/Projects/audicgw/.repo/repo/subcmds/init.py", line 256, in _ConfigureUser
    name = self._Prompt('Your Name', mp.UserName)
  File "/home/andreibechet/Projects/audicgw/.repo/repo/project.py", line 623, in UserName
    self._LoadUserIdentity()
  File "/home/andreibechet/Projects/audicgw/.repo/repo/project.py", line 636, in _LoadUserIdentity
    u = self.bare_git.var('GIT_COMMITTER_IDENT')
  File "/home/andreibechet/Projects/audicgw/.repo/repo/project.py", line 2220, in runner
    p.stderr))
error.GitError: manifests var: b'\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email "[email protected]"\n  git config --global user.name "Your Name"\n\nto set your account\'s default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: unable to auto-detect email address (got \'andreibechet@andreibechet-ThinkPad-T440p.(none)\')\n'

fatal: Couldn't find remote ref refs/heads/master

Full error:

fatal: Couldn't find remote ref refs/heads/master
fatal: The remote end hung up unexpectedly�

I initialize a repository using:

repo init -u [email protected]:manifests/release.git -b release-2.9.0 -m c4_windows_master.xml

Sync using:

repo sync -d -c -q --jobs=8 --no-tags

Since I use Jenkins in my build environment, if I don't wipe the workspace, the same commands as above are executed, however the 'repo sync' command throws the fatal error. This does not happen on linux using google's repo tool (with or without jenkins, it was manifested in jenkins).

In examining the trace log on windows I find this:

: git fetch --quiet origin --no-tags +refs/heads/master:refs/remotes/origin/master 1>| 2>|�

Looking at the trace log on linux I see this:

: git fetch --quiet origin --no-tags +refs/heads/release-2.9.0:refs/remotes/origin/release-2.9.0 1>| 2>|

Contents of .repo/manifests/.git/config on windows looks like this:

[core]
repositoryformatversion = 0
filemode = false
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = [email protected]:manifests/release.git
fetch = +refs/heads/:refs/remotes/origin/
[branch "default"]
remote = origin
merge = refs/heads/release-2.9.0�
Contents of .repo/manifests/.git/config on Linux looks like this:

[core]
repositoryformatversion = 0
filemode = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = [email protected]:manifests/release.git
fetch = +refs/heads/:refs/remotes/origin/
[branch "default"]
remote = origin
merge = refs/heads/release-2.9.0

If I run 'git fetch --quiet origin --no-tags +refs/heads/master:refs/remotes/origin/master' I see the fatal error thrown.

If I run 'git fetch --quiet origin --no-tags +refs/heads/master:refs/remotes/origin/release-2.9.0' no errors.

This version of repo seems to always run 'git fetch --quiet origin --no-tags +refs/heads/master:refs/remotes/origin/master' instead of the branch specified.

Let me know if you need more info. I think this is headed in the right direction! Thanks for providing a native windows tool!

fatal: manifest url (-u) is required.

Hi,
I followed all steps and this is what I got in the end.


 * [new tag]         v0.4.7               -> v0.4.7
 * [new tag]         v0.4.8               -> v0.4.8
 * [new tag]         v0.4.9               -> v0.4.9
fatal: manifest url (-u) is required.
Get https://github.com/esrlabs/git-repo

commit hooks not executable

repo brings some commit hooks to add the gerrit change id.
this only works when the hooks are executable.
tested on Linux system

repo don't support refs/changes/... in XML

Hi,

It seem that this repo not support refs/changes/... in XML, while it's supported by Android.
Such construction is required when doing Jenkins continuous integration on patch submitted to gerrit.

Applying such patch fix (inspired from Android):

$ git diff
diff --git a/git_config.py b/git_config.py
index 8a9b46c..e45a265 100644
--- a/git_config.py
+++ b/git_config.py
@@ -652,6 +652,10 @@ class Remote(object):
         for spec in self.fetch:
             if spec.SourceMatches(rev):
                 return spec.MapSource(rev)
+
+        if not rev.startswith(R_HEADS):
+              return rev
+
         raise GitError('remote %s does not have %s' % (self.name, rev))

     def WritesTo(self, ref):
diff --git a/project.py b/project.py
index 5d9a4a6..a4b8cec 100644
--- a/project.py
+++ b/project.py
@@ -1675,9 +1675,9 @@ class Project(object):
             branch = self.revisionExpr
             if is_sha1:
                 branch = self.upstream
-            if branch.startswith(R_HEADS):
-                branch = branch[len(R_HEADS):]
-            cmd.append(('+refs/heads/%s:' % branch) + remote.ToLocal('refs/head
+            if not branch.startswith('refs/'):
+                branch = R_HEADS + branch
+            cmd.append(('+%s:' % branch) + remote.ToLocal(branch))

         ok = False
         for _i in range(2):

Is it possible to integrate it in master branch ?

Thanks & Best regards,
JP

repo init provokes No such file or directory

Hello

I have the following error when running repo init in windows + git bash

Any ideas ?

Jonathan

JSoto@PS-TLS-P-1502 MINGW64 ~/dev
$ repo init
gpg: keyblock resource '/c/Users/JSoto/dev/C:\Users\JSoto/.repoconfig-esrlabs\gnupg/pubring.kbx': No such file or directory
gpg: no writable keyring found: Not found
gpg: error reading '[stdin]': General error
gpg: import from '[stdin]' failed: General error
gpg: Total number processed: 0
fatal: registering repo maintainer keys failed

JSoto@PS-TLS-P-1502 MINGW64 ~/dev
$ git --version
git version 2.19.0.windows.1

JSoto@PS-TLS-P-1502 MINGW64 ~/dev
$ python --version
Python 2.7.15

repo Not an internal command

The environment variables have been configured correctly,At the command line repo Not an internal command

screenshot as follows:
image

uploaded version not signed correclty

when executing repo I always get this message:

info: A new version of repo is available
warning: project 'repo' branch 'master' is not signed
warning: Skipped upgrade to unverified version

WindowsError: [Error 2] The system cannot find the file specified

Traceback (most recent call last):
File "c:\dev\here\sop4.repo\repo/main.py", line 538, in
_Main(sys.argv[1:])
File "c:\dev\here\sop4.repo\repo/main.py", line 512, in _Main
result = repo._Run(argv) or 0
File "c:\dev\here\sop4.repo\repo/main.py", line 181, in _Run
portable.NoPager(cmd)
File "c:\dev\here\sop4.repo\repo\portable.py", line 277, in NoPager
RunWindowsShell(cmd)
File "c:\dev\here\sop4.repo\repo\portable.py", line 281, in RunWindowsShell
redirect_all(executable)
File "c:\dev\here\sop4.repo\repo\portable.py", line 288, in redirect_all
p = subprocess.Popen([executable], stdin=subprocess.PIPE, stdout=old_sysout, stderr=old_syserr)
File "C:\Python27\lib\subprocess.py", line 390, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

rmtree python failed when switching from a branch1 to Branch2

Hello ,

I am on the last stable branch of git-repo
I have python27
and i used GIT BASH 2.8.1

I have an issue on Windows

  1. repo init -b branch1
    "Manifest contains a module DocGeneration"
  2. repo sync
    OK
  3. repo init -b branch2
    "Manifest does not contain a module DocGeneration"
  4. repo sync

Deleting obsolete path C:/Project/SPC5_DEV/DEV/Tools/DocGeneration
Traceback (most recent call last):
File "C:\project\git-repo\main.py", line 538, in
_Main(sys.argv[1:])
File "C:\project\git-repo\main.py", line 512, in _Main
result = repo._Run(argv) or 0
File "C:\project\git-repo\main.py", line 185, in _Run
result = cmd.Execute(copts, cargs)
File "C:\project\git-repo\subcmds\sync.py", line 753, in Execute
if self.UpdateProjectList():
File "C:\project\git-repo\subcmds\sync.py", line 493, in UpdateProjectList
shutil.rmtree(project.worktree)
File "C:\Python27\lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Python27\lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Python27\lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Python27\lib\shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "C:\Python27\lib\shutil.py", line 250, in rmtree
os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'C:/Project/SPC5_DEV/DEV/Tools/DocGeneration.git\objects\pack\pack-770eb7371be8e228d1bd76eda4a516c99289ba50.idx'

rmtree is KO

        Best regards

                           Erwan

Errorcode 0 on failed sync

To detect a failed or incomplete "repo sync", it would be desirable to receive errorcode 1 instead of 0 if any error occurs.

(win7) local project git configuration breaks the symlink of the config file in the .git

Any local configuration of a project within a repo causes the symlink of the config file to break and thus causes a repo sync failure.

You can recreate the problem by

repo init ...
repo sync ..
cd to one of the project
git config hello.foo boo

Now any repo sync will fail and will ask for --force-sync.

You can look at the .git directory of the project and see that the symlink of config file is gone and now the file is on its own (regular file and not a symlink).

fatal error on repo init

i did all steps u mention on main page
and when i run repo init -u https://github.com/......git -b .... i get :

fatal: cannot make 'user dir here' /.repoconfig-esrlabs directory: system couldn't find directory

same for git clone then repo init

same with windows terminal or gitbash

Alternative to using "more" for GIT_PAGER

In the readme.md documentation, the section about "I can not see any colors for repo status" mentions that overriding git-pager with "more" should solve the problem.

In my particular case, that did not work, because I don't have a version of "more" available anywhere (other than in "C:\Windows\System32"). So, when I set GIT_PAGER=more, I get the following error during "repo status":

  File "C:\python_27_amd64\files\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\python_27_amd64\files\lib\subprocess.py", line 896, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

I found out that an alternative to using a custom GIT_PAGER program is to set the LESS environment variable like this

SET LESS=-r

This tells less to stop escaping ansi sequences, leaving them untouched, so that the console subsystem has a chance to process and interpret them.

My suggestion is to either

  • Update the FAQ section to mention this alternative
  • Or update "repo" to allow passing "-r" to less by default

ValueError on repo init

I get the following error when I try to run repo on windows 7

D:\172.16.10.72.gerrit.repo\test>repo init -u ssh://172.16.10.72:29418/manifest/test
...
Get ssh://172.16.10.72:29418/manifest/test
Traceback (most recent call last):
File "C:\Users\Administrator.e430-PC\git-repo-win\main.py", line 532, in
result = _Main(sys.argv[1:])
File "C:\Users\Administrator.e430-PC\git-repo-win\main.py", line 505, in _Main
result = repo._Run() or 0
File "C:\Users\Administrator.e430-PC\git-repo-win\main.py", line 158, in _Run
result = cmd.Execute(copts, cargs)
File "C:\Users\Administrator.e430-PC\git-repo-win\subcmds\init.py", line 353, in Execute
self._SyncManifest(opt)
File "C:\Users\Administrator.e430-PC\git-repo-win\subcmds\init.py", line 139, in _SyncManifest
m._InitGitDir()
File "C:\Users\Administrator.e430-PC\git-repo-win\project.py", line 1893, in _InitGitDir
self._InitHooks()
File "C:\Users\Administrator.e430-PC\git-repo-win\project.py", line 1926, in _InitHooks
portable.os_link(stock_hook, dst)
File "C:\Users\Administrator.e430-PC\git-repo-win\portable.py", line 55, in os_link
src = os.path.relpath(src, os.path.dirname(dst))
File "C:\Python33\lib\ntpath.py", line 622, in relpath
raise ValueError(error)
ValueError: path is on mount 'C:', start on mount 'D:'

"The system cannot find the file specified." - on repo init

We always get this message when cloning. It doesn't seem to cause an issue functionally but it does cause our users concern and raises a lot of questions.

We're on windows. It appears to be related to shallow links being created, the core part of the trace output is:

cmd /c mklink /J C:\wt\test\error.repo\manifests.git\refs C:\wt\test\error.repo\manifests.git\refs
Using no symlinks for file from C:\wt\test\error.repo\manifests.git\shallow to C:\wt\test\error.repo\manifests.git\shallow
cmd /c mklink /H C:\wt\test\error.repo\manifests.git\shallow C:\wt\test\error.repo\manifests.git\shallow
The system cannot find the file specified.
Using no symlinks for dir from C:\wt\test\error.repo\manifests.git\objects to C:\wt\test\error.repo\manifests.git\objects

I have attached the full output.

Git version:
$ git --version
git version 2.10.1.windows.1

Here's my gitconfig for reference:
$ git config --global --list
http.sslverify=false
diff.tool=kdiff3
difftool.cmd="c:\Program Files\KDiff3\KDiff3.exe"
merge.tool=kdiff3
mergetool.kdiff3.cmd="c:\Program Files\KDiff3\KDiff3.exe" $BASE $LOCAL $REMOTE -o $MERGED
mergetool.kdiff3.keepbackup=false
user.name=Leigh Grealis
user.email=[email protected]
alias.sdm=c:/Users/lgrealis/My Documents/git/SDM-FE-Git-Assets/workspace/create-git-workspace.sh
alias.status=diff --name-only
core.excludesfile=c:/Users/lgrealis/ignorefiles.txt
core.autocrlf=input
core.ignorestat=false
core.compression=0
core.pager=cat
core.editor=vim
core.fscache=true
core.preloadindex=true
portable.windowsnosymlinks=true
filter.lfs.clean=git-lfs clean %f
filter.lfs.smudge=git-lfs smudge %f
filter.lfs.required=true
lfs.url=http://localhost:8081/artifactory/api/lfs/WLS_GITLFS
credential.helper=store
review.https://gerrit.app.alcatel-lucent.com/gerrit/.username=lgrealis
url.https://gerrit.app.alcatel-lucent.com/gerrit/.pushinsteadof=https://gerrit-nar.app.alcatel-lucent.com/gerrit/
url.ssh://[email protected]:29418.pushinsteadof=ssh://[email protected]:29418
gc.auto=0
commit.template=C:/Users/lgrealis/git-template.txt

Submanifest Mecanism with include

Hello Esrlabs ,

Repo windows is very good to use some submanifest mecanism
I have tried to use include

    <include name="include/CORE_int.xml">

I have some issue
fatal: manifest 'spc5studio5_full_packages.xml' not available
fatal: error parsing manifest C:\Project\multimanifest.repo\manifests\spc5studio5_full_packages.xml: mismatched tag: line 10, column 2

Do you have tested this functionnality ?
I will try on LInux side

       Best Regards

                    Erwan

esrlabs/git-repo does not work with local mirror

Reproduction steps:

  • Create a mirror for any repository in local drive using --mirror option

  • Sync the mirror

  • Now create another directory and try to init repo there using local mirror drive

  • For that I use --reference option to provide the path of mirror drive.

  • It gives error: object directory not found.

  • I have tried DOS format path in --reference option

  • I have also tried other formats for mirror path, in that case the error goes away but it does not reduce the sync time. If local mirror is used then sync time should be very low (at least half), but it is same as using without mirror.

Please help.

repo info -o reports error

Traceback (most recent call last):
File "C:\Users\mthiede\esr-bsw\workspace_remote.repo\repo\main.py", line 532, in
result = _Main(sys.argv[1:])
File "C:\Users\mthiede\esr-bsw\workspace_remote.repo\repo\main.py", line 505, in _Main
Manifest branch: result = repo._Run() or 0
File "C:\Users\mthiede\esr-bsw\workspace_remote.repo\repo\main.py", line 158, in _Run
refs/heads/master result = cmd.Execute(copts, cargs)
File "C:\Users\mthiede\esr-bsw\workspace_remote.repo\repo\subcmds\info.py", line 72, in Execute
File "C:\Users\mthiede\esr-bsw\workspace_remote.repo\repo\subcmds\info.py", line 195, in printCommitOverview
self.sha(split[0] + " ")(args)
Manifest merge branch: TypeError: can't concat bytes to str

refs/heads/master

Projects Overview
eepromManager

  • default ( 1 commit, Thu Feb 20 16:53:14 2014 +0100)

Spaces in repo.cmd path cause file not found error

The repo.cmd command file does not correctly call repo if it is invoked with a path that contains spaces (e.g. C:\This Path Has Spaces\repo.cmd manifest -o -)

The fixed was to add spaces around the path: @call python "%~dp0\repo" %*

windsow 10 : WindowsError: [Error 2]

Traceback (most recent call last):
File "E:\logger.repo\repo/main.py", line 538, in
_Main(sys.argv[1:])
File "E:\logger.repo\repo/main.py", line 512, in _Main
result = repo._Run(argv) or 0
File "E:\logger.repo\repo/main.py", line 181, in _Run
portable.NoPager(cmd)
File "E:\logger.repo\repo\portable.py", line 277, in NoPager
RunWindowsShell(cmd)
File "E:\logger.repo\repo\portable.py", line 281, in RunWindowsShell
redirect_all(executable)
File "E:\logger.repo\repo\portable.py", line 288, in redirect_all
p = subprocess.Popen([executable], stdin=subprocess.PIPE, stdout=old_sysout, stderr=old_syserr)
File "D:\Python27\lib\subprocess.py", line 394, in init
errread, errwrite)
File "D:\Python27\lib\subprocess.py", line 644, in _execute_child
startupinfo)
WindowsError: [Error 2]

repo sync and repo push on different remotes?

I'm trying to understand if repo is suitable for our fork workflow.

Basically:

  • each developer forks the "blessed" project and clone it on dev pc
  • each developer pushes changes to his own fork, and merge-request to the "blessed" project
  • each developer pulls changes from the "blessed" upstream

What I'm trying to understand is if repo supports this workflow without relying on the "repo forall" command, but so far I found nothing.

Am I missing something, or "repo forall" is really the only way of doing this?

Temp File Isnt Created When Pushing Multiple Repo's

Traceback (most recent call last):
File "C:\Users\Andrew\Documents\Ryuusoft\git-repo\main.py", line 538, in
_Main(sys.argv[1:])
File "C:\Users\Andrew\Documents\Ryuusoft\git-repo\main.py", line 512, in _Main
result = repo._Run(argv) or 0
File "C:\Users\Andrew\Documents\Ryuusoft\git-repo\main.py", line 185, in _Run
result = cmd.Execute(copts, cargs)
File "C:\Users\Andrew\Documents\Ryuusoft\git-repo\subcmds\push.py", line 388, in Execute
self._MultipleBranches(opt, pending)
File "C:\Users\Andrew\Documents\Ryuusoft\git-repo\subcmds\push.py", line 182, in _MultipleBranches
script = Editor.EditString("\n".join(script)).split("\n")
File "C:\Users\Andrew\Documents\Ryuusoft\git-repo\editor.py", line 99, in EditString
% (str(e), editor, path))
error.EditorError: editor failed, [Error 2] The system cannot find the file specified: vi c:\users\andrew\appdata\local\temp\tmpd3bd97

Adding Windows support on upstream git-repo

Hello,

I'm one of the maintainers of git-repo, and I was just made aware of this fork today.

We currently have a series of patches under review to add support for Windows.

Is this something that you would be interested in helping to review/test, potentially with the aim to contribute some of the work in this fork back upstream?

Thanks.

the push command crash

Traceback (most recent call last):
  File "/Users/baidu/Yohoo/.repo/repo/main.py", line 538, in <module>
    _Main(sys.argv[1:])
  File "/Users/baidu/Yohoo/.repo/repo/main.py", line 512, in _Main
    result = repo._Run(argv) or 0
  File "/Users/baidu/Yohoo/.repo/repo/main.py", line 185, in _Run
    result = cmd.Execute(copts, cargs)
  File "/Users/baidu/Yohoo/.repo/repo/subcmds/push.py", line 381, in Execute
    self.manifest.topdir, abort_if_user_denies=True)

"TypeError: can't use a string pattern on a bytes-like object" on init

On Linux, I am using:

  • repo script VERSION = (1, 19, 1)
  • python3 --version
  • Python 3.4.3

/opt/bin/repo init -u ssh://server.company.com:123456/chose_manifest
Traceback (most recent call last):
File "/opt/bin/repo", line 709, in
main(sys.argv[1:])
File "/opt/bin/repo", line 675, in main
_Init(args)
File "/opt/bin/repo", line 207, in _Init
_Clone(url, dst, opt.quiet)
File "/opt/bin/repo", line 459, in _Clone
if DownloadBundle(url, local, quiet):
File "/opt/bin/repo", line 381, in DownloadBundle
m = re.compile(r'^url.(.
).insteadof (.
)$').match(line)
TypeError: can't use a string pattern on a bytes-like object

I added some debug and it looks like the issue is linked to my ~/.gitconfig

[url "https://[email protected]"]
insteadOf = https://github.com

Debug: url=https://github.com/esrlabs/git-repo/clone.bundle
Debug: line=b'url.https://[email protected] https://github.com\n'

Exception on repo init

Exception on repo init (OSX, Python 3.3.5)

repo init -u https://.../manifest.git -m default.xml -g all,-notdefault,-notci,snapshot
Error in sitecustomize; set PYTHONVERBOSE for traceback:
ValueError: list.remove(x): x not in list
Traceback (most recent call last):
  File "/Users/sebastian/bin/repo", line 709, in <module>
    main(sys.argv[1:])
  File "/Users/sebastian/bin/repo", line 675, in main
    _Init(args)
  File "/Users/sebastian/bin/repo", line 207, in _Init
    _Clone(url, dst, opt.quiet)
  File "/Users/sebastian/bin/repo", line 459, in _Clone
    if _DownloadBundle(url, local, quiet):
  File "/Users/sebastian/bin/repo", line 381, in _DownloadBundle
    m = re.compile(r'^url\.(.*)\.insteadof (.*)$').match(line)
TypeError: can't use a string pattern on a bytes-like object

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.