Go to file
Mike Frysinger 3ba716f382 repo: try to reexec self with Python 3 as needed
We want to start warning about Python 2 usage, but we can't do it
simply because the shebang is /usr/bin/python which might be an old
version like python2.7.

We can't change the shebang because program name usage is spotty at
best: on some platforms (like macOS), it's not uncommon to not have
a `python3` wrapper, only a major.minor one like `python3.6`.  Using
python3 wouldn't guarantee a new enough version of Python 3 anyways,
and we don't want to require Python 3.6 exactly, just that minimum.

So we check the current Python version.  If it's older than the ver
of Python 3 we want, we search for a `python3.X` version to run.  If
those don't work, we see if `python3` exists and is a new enough ver.
If it's not, we die if the current Python 3 is too old, and we start
issuing warnings if the current Python version is 2.7.  This should
allow the user to take a bit more action by installing Python 3 on
their system without having to worry about changing /usr/bin/python.

Once we require Python 3 completely, we can simplify this logic a bit
by always bootstrapping up to Python 3 and failing with Python 2.

We have a few KI with Windows atm though, so keep it disabled there
until the fixes are merged.

Bug: https://crbug.com/gerrit/10418
Change-Id: I5e157defc788e31efb3e21e93f53fabdc7d75a3c
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253136
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
2020-02-05 21:32:02 +00:00
docs Add a way to override the remote using <extend-project> 2020-02-04 22:42:28 +00:00
hooks hooks/pre-auto-gc-battery: allow gc to run on non-laptops 2018-07-11 13:45:58 -07:00
subcmds sync: add option to skip manifest update 2020-02-05 18:57:58 +00:00
tests repo: raise min version of git 2020-02-05 19:01:40 +00:00
.flake8 Replace pylint with pyflakes/flake8 2016-09-14 09:49:02 +02:00
.gitattributes Adds additional crlf clobber avoidance. 2016-06-22 08:36:45 +00:00
.gitignore Add PyCharm project directory into the .gitignore 2020-01-24 23:09:49 +00:00
.mailmap Update .mailmap 2017-05-26 21:44:57 +09:00
.project Set correct name in PyDev and Eclipse project config 2013-04-19 09:35:43 +09:00
.pydevproject Leverage the next keyword from python 2.7 2018-12-19 11:06:35 -08:00
color.py set default file encoding to utf-8 2019-06-13 14:30:52 +00:00
command.py command: filter projects by active manifest groups 2019-10-08 20:15:08 +00:00
editor.py upload/editor: fix bytes/string confusion 2019-11-16 23:55:30 +00:00
error.py manifest: add basic path checks for <copyfile> & <linkfile> 2020-02-04 20:34:01 +00:00
event_log.py set default file encoding to utf-8 2019-06-13 14:30:52 +00:00
git_command.py repo: raise min version of git 2020-02-05 19:01:40 +00:00
git_config.py use open context managers in more places 2019-11-12 03:44:39 +00:00
git_refs.py use open context managers in more places 2019-11-12 03:44:39 +00:00
git_ssh add license header to a few more files 2019-06-13 13:23:19 -04:00
gitc_utils.py set default file encoding to utf-8 2019-06-13 14:30:52 +00:00
LICENSE setup.py: add basic packaging files 2019-12-02 04:23:31 +00:00
main.py repo: include subcommands in --help output 2019-12-05 05:00:21 +00:00
manifest_xml.py Add a way to override the remote using <extend-project> 2020-02-04 22:42:28 +00:00
MANIFEST.in setup.py: add basic packaging files 2019-12-02 04:23:31 +00:00
pager.py set default file encoding to utf-8 2019-06-13 14:30:52 +00:00
platform_utils_win32.py Fix a typo 2020-01-25 00:53:39 +00:00
platform_utils.py Revert "Port _FileDescriptorStreamsNonBlocking to use poll()" 2020-02-03 23:01:07 +00:00
progress.py sync: merge project updates with status bar 2019-11-12 23:33:51 +00:00
project.py Do not try to fetch default revision for mirrors always 2020-02-05 15:51:18 +00:00
pyversion.py set default file encoding to utf-8 2019-06-13 14:30:52 +00:00
README.md docs: add Windows support info 2019-12-05 01:02:08 +00:00
repo repo: try to reexec self with Python 3 as needed 2020-02-05 21:32:02 +00:00
repo_trace.py rename local trace module 2019-08-27 07:08:52 +00:00
run_tests run_tests: improve exit code behavior 2019-12-02 04:20:10 +00:00
setup.py setup.py: add basic packaging files 2019-12-02 04:23:31 +00:00
SUBMITTING_PATCHES.md tox: add & document tox usage 2019-12-02 04:24:23 +00:00
tox.ini tox: add & document tox usage 2019-12-02 04:24:23 +00:00
wrapper.py wrapper: Fix indentation level 2019-07-31 08:38:19 +00:00

repo

Repo is a tool built on top of Git. Repo helps manage many Git repositories, does the uploads to revision control systems, and automates parts of the development workflow. Repo is not meant to replace Git, only to make it easier to work with Git. The repo command is an executable Python script that you can put anywhere in your path.

Install

Many distros include repo, so you might be able to install from there.

# Debian/Ubuntu.
$ sudo apt-get install repo

# Gentoo.
$ sudo emerge dev-vcs/repo

You can install it manually as well as it's a single script.

$ mkdir -p ~/.bin
$ PATH="${HOME}/.bin:${PATH}"
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
$ chmod a+rx ~/.bin/repo