Go to file
Mike Frysinger 1d00a7e2ae project: initial separation of shared project objects
For now, this is opt-in via environment variables:
  - export REPO_USE_ALTERNATES=1

The shared project logic that shares the internal .git/objects/ dir
directly between multiple projects via the project-objects/ tree has
a lot of KI with random corruption.  It all boils down to projects
sharing objects/ but not refs/.  Git operations that use refs to see
what objects are reachable and discard the rest can easily discard
objects that are used by other projects.

Consider this project layout:
<show fs layout>

There are unique refs in each of these trees that are not visible in
the others.  This means it's not safe to run basic operations like
git prune or git gc.

Since we can't share refs (each project needs to have unique refs
like HEAD in order to function), let's change how we share objects.
The old way involved symlinking .git/objects/ to the project-objects
tree.  The new way shares objects using git's info/alternates.

This means project-objects/ will only contain objects that exist in
the remote project.  Local per-project objects (like when creating
branches and making changes) will never be shared.  When running a
prune or gc operation in the per-project state, it will only ever
repack or discard those per-project objects.  The common shared
objects would only be cleaned up when running a common operation
(i.e. by repo itself).

One downside to this for users is if they try blending unrelated
upstream projects.  For example, in CrOS we have multiple kernel
projects (for diff versions) checked out.  If a dev fetched the
upstream Linus tree into one of them, the objects & tags would
not be shared with the others, so they would have to fetch the
upstream state for each project.  Annoying, but better than the
current corruption situation we're in now.

Also if the dev runs a manual `git fetch` in the per-project to
sync it up to newer state than the last `repo sync` they ran,
the objects would get duplicated.  However, git operations later
on should eventually dedupe this.

Bug: https://crbug.com/gerrit/15553
Change-Id: I313a9b8962f9d439ef98ac0ed37ecfb9e0b3864e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/328101
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: LaMont Jones <lamontjones@google.com>
2022-05-26 00:02:18 +00:00
.github/workflows Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
docs manifest: add submanifest.default_groups attribute 2022-04-29 18:42:23 +00:00
hooks Revert "commit-msg: Insert Change-Id at start of trailers" 2020-04-15 07:17:16 +00:00
man man: refresh pages 2021-11-12 17:30:45 +00:00
release sign-launcher: make the help text more automatic 2021-10-06 17:02:56 +00:00
subcmds upload: move label validation to core function 2022-05-21 19:19:44 +00:00
tests tests: switch to tempfile.TemporaryDirectory 2022-05-20 11:38:10 +00:00
.flake8 flake8: Suppress "E731 do not assign a lambda expression, use a def" 2020-02-15 03:41:17 +00:00
.gitattributes Adds additional crlf clobber avoidance. 2016-06-22 08:36:45 +00:00
.gitignore Add parallelism to 'branches' command 2020-12-14 23:35:12 +00:00
.gitreview git-review: add config file 2021-11-15 01:39:36 +00:00
.mailmap Update .mailmap 2020-02-13 04:49:55 +00: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 strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
command.py Add multi-manifest support with <submanifest> element 2022-02-17 21:57:55 +00:00
completion.bash bash-completion: complete projects with repo forall 2021-07-27 06:20:52 +00:00
editor.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
error.py help/version: sprinkle bug report URL around 2021-04-26 21:43:43 +00:00
event_log.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
fetch.py Support more url schemes for getting standalone manifest 2021-10-27 13:20:35 +00:00
git_command.py project: store objects in project-objects directly 2022-01-19 17:24:51 +00:00
git_config.py Fix typo for ValueError 2021-11-07 02:32:08 +00:00
git_refs.py git_refs: fix crash with binary . files in .git/refs/ 2021-02-28 16:07:24 +00:00
git_ssh add license header to a few more files 2019-06-13 13:23:19 -04:00
git_superproject.py Stop passing optparse.Values to git_superproject 2022-04-14 22:23:16 +00:00
git_trace2_event_log.py trace: allow writing traces to a socket 2022-03-16 17:33:07 +00:00
gitc_utils.py superproject: pass groups to ToXml method. 2021-03-11 01:24:52 +00:00
hooks.py drop pyversion & is_python3 checking 2021-01-06 18:53:58 +00:00
LICENSE setup.py: add basic packaging files 2019-12-02 04:23:31 +00:00
main.py Override the manifest for the entire command 2022-04-19 21:28:20 +00:00
manifest_xml.py project: initial separation of shared project objects 2022-05-26 00:02:18 +00:00
MANIFEST.in setup.py: add basic packaging files 2019-12-02 04:23:31 +00:00
pager.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
platform_utils_win32.py drop pyversion & is_python3 checking 2021-01-06 18:53:58 +00:00
platform_utils.py make file removal a bit more robust 2021-09-28 16:06:50 +00:00
progress.py progress: optimize progress bar updates a bit 2022-04-19 23:50:48 +00:00
project.py project: initial separation of shared project objects 2022-05-26 00:02:18 +00:00
README.md README: use new bug template 2020-02-26 23:20:43 +00:00
repo init: add an option --enable-git-lfs-filter 2022-01-26 01:47:20 +00:00
repo_trace.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +00:00
requirements.json Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
run_tests run_tests: fix pytest selection inside tox venv 2021-06-03 15:27:51 +00:00
setup.py Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
ssh.py ssh: handle FileNotFoundError errors 2021-10-26 16:18:45 +00:00
SUBMITTING_PATCHES.md SUBMITTING_PATCHES: link to commit message style docs 2021-11-15 01:39:16 +00:00
tox.ini Drop support for Python 3.5 2021-06-03 11:34:17 +00:00
wrapper.py strip python2-only coding:utf-8 & print_function settings 2021-01-06 18:53:05 +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.

Contact

Please use the repo-discuss mailing list or issue tracker for questions.

You can file a new bug report under the "repo" component.

Please do not e-mail individual developers for support. They do not have the bandwidth for it, and often times questions have already been asked on repo-discuss or bugs posted to the issue tracker. So please search those sites first.

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