summaryrefslogtreecommitdiff
path: root/docs
AgeCommit message (Collapse)Author
3 dayshooks: pass yes flag when availableRahul Yadav
Pass the -y flag as a keyword argument "yes" to the hook main function. This allows upload hooks (such as auto-fixers) to automatically apply fixes when the -y flag is passed, rather than prompting the user. Bug: 498893733 Change-Id: I12096029aa3af471ba9175314d749deb0ebd1007 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/605261 Commit-Queue: Rahul Yadav <yadavrah@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Rahul Yadav <yadavrah@google.com>
2026-06-30sync: Implement fetchcmd for standard Git layoutsGavin Mak
Introduce support for `repo.fetchcmd` configuration, allowing users to specify a custom command to fetch project data instead of `_RemoteFetch`. When `repo.fetchcmd` is specified, `repo` will execute it instead of `_RemoteFetch` during the network half of sync. Note that `repo.fetchcmd` requires `repo.uselocalgitdirs` to be enabled. The command is executed in a subshell with project-context environment variables, including the new `REPO_TREV` (target revision resolved to a commit hash) and `REPO_PROJECT_FETCH_URL`. After execution, `repo` verifies that the target commit is available and that the tracking ref and FETCH_HEAD are correctly updated. Tested with: ``` > ~/git-repo/repo init -u https://android-review.googlesource.com/platform/manifest \ --repo-url file:///usr/local/google/home/gavinmak/git-repo \ --groups developers \ --no-repo-verify \ --use-local-gitdirs ... > git config --file .repo/manifests.git/config repo.fetchcmd 'mkdir -p $REPO_PATH && cd $REPO_PATH && if [ ! -d .git ]; then git init && git remote add aosp $REPO_PROJECT_FETCH_URL; fi && git fetch aosp $REPO_TREV && git reset --hard $REPO_TREV && mkdir -p .git/refs/remotes/aosp && echo $REPO_TREV > .git/refs/remotes/aosp/main && echo $REPO_TREV > .git/FETCH_HEAD' > ~/git-repo/repo sync -j32 warning: repo is not tracking a remote branch, so it will not receive updates; run `repo init --repo-rev=stable` to fix. You are currently enrolled in Git submodules experiment (go/android-submodules-quickstart). Use --no-use-superproject to override. Syncing: 100% (4/4), done in 1m15.686s Finalizing sync state... repo sync has finished successfully. ``` Bug: 513329573 Change-Id: I754d3f3c78e86fdeee1a72115297a75b571bc497 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/583883 Reviewed-by: Becky Siegel <beckysiegel@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
2026-06-25man: disable line wrappingBrian Gan
When help2man runs the repo script to generate man pages, the argparse module relies on the COLUMNS environment variable to wrap help text. This wrapping can cause URLs and descriptions to be awkwardly broken across lines. Setting COLUMNS="10000" prevents argparse from wrapping the output, keeping URLs intact in the generated man pages. Additionally, this fixes a broken git documentation URL fragment for --partial-clone in the repo script. Bug: 295374161 Change-Id: I0c79f37fbfe2bebe71ff90585f2e5e1f88ea33cb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/601482 Tested-by: Brian Gan <brgan@google.com> Commit-Queue: Brian Gan <brgan@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
2026-06-18sync: Support pluggable remote helpers for smart sync manifest server.Rahul Yadav
Introduce support for pluggable remote helpers (declared via the optional 'helper' attribute in <manifest-server>) to dynamically resolve proxy addresses. Route the XML-RPC manifest server connection through the resolved proxy. Bug: b/517477903 Change-Id: I3b6b8ea2640bb077521df4b4a9e8a34a8c6ecdad Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/591642 Tested-by: Rahul Yadav <yadavrah@google.com> Commit-Queue: Rahul Yadav <yadavrah@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
2026-05-14docs: drop period in headersMike Frysinger
We don't do this in most places, so standardize the outliers. Change-Id: I80c1ef16c5fa7355dcb7797bc8e56852b22c24d5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/583641 Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
2026-04-21Add timing keyword argument for hooksRam Peri
Measure the duration of the sync operation in the Execute method of the Sync command and pass it to post-sync hooks as a standard keyword argument (`sync_duration_seconds`). Updates based on code review: - Update _API_ARGS in hooks.py to allow sync_duration_seconds for post-sync hooks. - Do not cast sync_duration_seconds to int for better granularity. - Update docs/repo-hooks.md to document sync_duration_seconds. - Add unit test for argument validation in test_hooks.py. Test: Ran run_tests using venv python, all 554 tests passed. Bug: TBD Change-Id: Ie29e002a5d283460d993ad96c224dbf4b6d7985c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/575021 Tested-by: Arif Kasim <arifkasim@google.com> Commit-Queue: Ram Peri <ramperi@google.com> Reviewed-by: Arif Kasim <arifkasim@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
2026-04-09manifest: Add `sync-strategy` attribute to project elementsGavin Mak
The only supported sync-strategy is "stateless". The intent is to keep the local workspace as small as possible by not keeping history during syncs. This prevents disk space waste for projects with large binaries where we only care about the current version. A follow up change will implement the logic. Bug: 498730431 Change-Id: I84a436a9ca2492893163c6cfda6c28dc62a568f0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/568462 Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
2026-03-20docs: windows: mention Developer Mode for symlinksv2.62Mike Frysinger
This is probably better than recommending Administrator access. Change-Id: Ic916f15fe03f7fa1e03c685265b4774bfc1279c2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/563581 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
2026-02-19docs: Document support for child elements in extend-projectJeffery Miller
Clarify the existence and behavior of child elements when added to extend-project. Change-Id: Id9f270166c8498d4051495b9a1f68360f66e9143 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/553742 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Jeffery Miller <jefferymiller@google.com> Commit-Queue: Jeffery Miller <jefferymiller@google.com>
2026-02-06manifest: Introduce `sync-j-max` attribute to cap sync jobsGavin Mak
Add a way for manifest owners to limit how many sync jobs run in parallel. Bug: 481100878 Change-Id: Ia6cbe02cbc83c9e414b53b8d14fe5e7e1b802505 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/548963 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
2025-12-02docs: manifest-format: reformat spec to align the CDATA partsMike Frysinger
Most of the file was doing this, but we've been inconsistent when adding new entries. Realign all of them. Change-Id: I99ddb3a1e859235b249b6f08731bdadad8086d4e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/532461 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
2025-11-26manifest: Propagate revision attribute through multiple levels of includePeter Kjellerstedt
Make sure a revision attribute for an include element is propagated through multiple levels of manifest includes. Change-Id: If37d65b0cd47da673719976598175d0eb6b7cbbe Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/525341 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
2025-11-26manifest, project: Store project groups as setsPeter Kjellerstedt
This helps a lot when including common manifests with groups and they use extend-project. Change-Id: Ic574e7d6696139d0eb90d9915e8c7048d5e89c07 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/525323 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
2025-11-26project: Use dicts to keep track of copyfiles and linkfilesPeter Kjellerstedt
This avoids copying/linking the same file/link multiple times if a copyfile/linkfile element with the same values has been specifed multiple times. This can happen when including a common manifest that uses an extend-project element that has a copyfile/linkfile element. This uses dicts rather than sets to store the copyfiles and linkfiles to make sure the order they are specified in the manifest is maintained. For Python 3.7+, maintaining the order that keys are added to dicts is guaranteed, and for Python 3.6 it happened to be true. The _CopyFile class and the _LinkFile class are changed to inherit from NamedTuple to be able to store them in dicts. Change-Id: I9f5a80298b875251a81c5fe7d353e262d104fae4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/525322 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
2025-11-26manifest: Make include groups propagate to extend-project elementsPeter Kjellerstedt
Any groups specified to an include element should propagate to any extend-project elements and then on to the projects. Change-Id: I62b95689cc13660858564ae569cbfd095961ecc7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/525321 Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2025-10-27manifest: Make extend-project support copyfile, linkfile and annotationPeter Kjellerstedt
This allows an existing project to be extended by these elements. Change-Id: I6826e518f39ca86485301491639101943b7e2ae0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/519781 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
2025-07-01sync: support post-sync hook in <repo-hooks>Kenny Cheng
Add support for a new hook type "post-sync" declared in the manifest using <repo-hooks>. This allows executing a script automatically after a successful `repo sync`. This is useful for initializing developer environments, installing project-wide Git hooks, generating configs, and other post-sync automation tasks. Example manifest usage: <project name="myorg/repo-hooks" path="hooks" revision="main" /> <repo-hooks in-project="myorg/repo-hooks" enabled-list="post-sync"> <hook name="post-sync" /> </repo-hooks> The hook script must be named `post-sync.py` and located at the root of the hook project. The post-sync hook does not block `repo sync`; if the script fails, the sync still completes successfully with a warning. Test: Added `post-sync.py` in hook project and verified it runs after `repo sync` Bug: b/421694721 Change-Id: I69f3158f0fc319d73a85028d6e90fea02c1dc8c8 Signed-off-by: Kenny Cheng <chao.shun.cheng.tw@gmail.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/480581 Reviewed-by: Scott Lee <ddoman@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
2025-02-04Update internal filesystem layout for submodulesKaushik Lingarkar
Change the bare checkout directory for submodules from 'subprojects' to 'modules'. Git expects bare submodule checkouts to be in the 'modules' directory. If old subproject directories are found, they will be migrated to the new modules directory. This change is the first step in ensuring Git can understand repo's submodules to some extent. Change-Id: I385029f1bb55d040616d970d6ffb4bb856692520 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/444881 Tested-by: Kaushik Lingarkar <kaushikl@qti.qualcomm.com> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2025-01-30docs: smart-sync: split out & expand detailsMike Frysinger
The existing documentation on smart-sync behavior is a bit light on details, and out of date wrt what the code actually does. Start a dedicated document and fill it out more. Change-Id: I1a8a3ac6edf9291d72182ad55db865035d9b683e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/450002 Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2024-10-28Add REPO_SKIP_SELF_UPDATE check in syncFredrik de Groot
The command _PostRepoFetch will try to self update during repo sync. That is beneficial but adds version uncertainty, fail potential and slow downs in non-interactive scenarios. Conditionally skip the update if env variable REPO_SKIP_SELF_UPDATE is defined. A call to selfupdate works as before, meaning even with the variable set, it will run the update. Change-Id: Iab0ef55dc3d3db3cbf1ba1f506c57fbb58a504c3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/439967 Tested-by: Fredrik de Groot <fredrik.de.groot@haleytek.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
2024-10-28manifest: add optional base check on remove and extendFredrik de Groot
This adds an optional, built-in checker for guarding against patches hanging on wrong base revisions, which is useful if a lower layer of the manifest changes after a patch was done. When adding a patch with a new revision using extend-project or remove-project/project: C---D---E patches in project bla / A---B project bla in manifest state 1 <extend-project name="bla" revision="E" base-rev="B"> If project bla gets updated, in a new snap ID or by a supplier or similar, to a new state: C---D---E patches in project bla / A---B---F---G project bla in manifest state 2 Parsing will fail because revision of bla is now G, giving the choice to create a new patch branch from G and updating base-rev, or keeping previous branch for some reason and only updating base-rev. Intended for use in a layered manifest with hashed revisions. Named refs like branches and tags also work fine when comparing, but will be misleading if a branch is used as base-rev. Change-Id: Ic6211550a7d3cc9656057f6a2087c505b40cad2b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/436777 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Tested-by: Fredrik de Groot <fredrik.de.groot@haleytek.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
2024-03-20git: raise soft version to 2.7.4Mike Frysinger
git-1.9.1 was released in 2014 while git-2.7.4 was released in 2016. Debian Stretch was released in 2017 and Ubuntu Xenial was released in 2016 which are plenty old at this point. Both of those include at least git-2.7.4. We will start warning users of Debian Jessie (released in 2015 & EOL in 2020) and Ubuntu Trusty (released in 2014 & EOL Apr 2024) that they will need to upgrade. Change-Id: I6be3809bc45968fdcb02cad3f7daf75ded1bb5b1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/415137 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
2024-03-20docs: release: add recent git/python/ssh/debian infoMike Frysinger
Change-Id: I744360b1bfc816e94b3511f0130abb2c08dedd42 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/415117 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
2024-01-04docs: fix some grammar typosMike Frysinger
Change-Id: Ie1a32cda67f94b0a2b3329b1be9e03dcbedf39cc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/400917 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
2023-10-14python-support: update with current status & guidelinesMike Frysinger
This doc was written back in 2019 when we were planning on the Python 3 migration. It isn't relevant anymore, and people are reading it thinking we still support Python 2. Rewrite it to match current requirements and to make it clear there is no support for older versions. Bug: 302871152 Change-Id: I2acf3aee1816a03ee0a70774db8bf4a23713a03f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389455 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Mike Frysinger <vapier@google.com>
2023-08-18docs: Document .repo_localsyncstate.jsonGavin Mak
Update docs to reflect the new internal filesystem layout. Bug: b/286126621, b/271507654 Change-Id: I8a2f8f36dff75544f32356ac5e31668f32ddffb3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383074 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com>
2023-06-21manifest: enable remove-project using pathFredrik de Groot
A something.xml that gets included by two different files, that both remove and add same shared project to two different locations, would not work prior to this change. Reason is that remove killed all name keys, even though reuse of same repo in different locations is allowed. Solve by adding optional attrib path to <remove-project name="foo" path="only_this_path" /> and tweak remove-project. Behaves as before without path, and deletes more selectively when remove path is supplied. As secondary feature, a project can now also be removed by only using path, assuming a matching project name can be found. Change-Id: I502d9f949f5d858ddc1503846b170473f76dc8e2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/375694 Tested-by: Fredrik de Groot <fredrik.de.groot@aptiv.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2023-05-05manifest: add support for revision in includeShuchuan Zeng
Attribute groups can now be added to manifest include, thus all projects in an included manifest file can easily modify default branch without modifying all projects in that manifest file. For example, the main manifest.xml has an include node contain revision attribute, ``` <include name="include.xml" revision="r1" /> ``` and the include.xml has some projects, ``` <project path="project1_path" name="project1_name" revision="r2" /> <project path="project2_path" name="project2_name" /> ``` With this change, the final manifest will have revision="r1" for project2. ``` <project name="project1_name" path="project1_path" revision="r2" /> <project name="project2_name" path="project2_path" revision="r1" /> ``` Test: added unit tests to cover the inheritance Change-Id: I4b8547a7198610ec3a3c6aeb2136e0c0f3557df0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/369714 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Shuchuan Zeng <zengshuchuan@allwinnertech.com> Tested-by: Shuchuan Zeng <zengshuchuan@allwinnertech.com>
2023-03-02docs: update Focal Python versionMike Frysinger
It ships with Python 3.8 by default, not 3.7. Change-Id: I11401d1098b60285cfdccadb6a06bb33a5f95369 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/361634 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
2023-01-28Enable use of REPO_CONFIG_DIR to customize .repoconfig locationGavin Mak
For use cases with multiple instances of repo, eg some CI environments. Bug: https://crbug.com/gerrit/15803 Change-Id: I65c1cfc8f6a98adfeb5efefc7ac6b45bf8e134de Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/356719 Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2022-12-12upload: Allow user to configure unusual commit thresholdDavid Greenaway
Add a per-remote option `uploadwarningthreshold` allowing the user to override how many commits can be uploaded prior to a warning being displayed. Change-Id: Ia7e1b2c7de89a0bf9ca1c24cc83dc595b3667437 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354375 Tested-by: David Greenaway <dgreenaway@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2022-12-01release-process: update to use ./release/sign-tag.pyMike Frysinger
We have a helper script for signing releases now, so point the docs to that rather than the multiple manual steps. Change-Id: I309e883dbce1894650e31682d9975cf0d6bdeca3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/352834 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
2022-09-20manifest: allow extend-project to override dest-branch and upstreamErik Elmeke
Bug: https://crbug.com/gerrit/16238 Change-Id: Id6eff34791525b3df690e160c911c0286331984b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/345144 Tested-by: Erik Elmeke <erik@haleytek.corp-partner.google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2022-04-29manifest: add submanifest.default_groups attributev2.25LaMont Jones
When the user does not specify any manifest groups, this allows the parent manifest to indicate which manifest groups should be used for syncing the submanifest. Change-Id: I88806ed35013d13dd2ab3cd245fcd4f9061112c4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/335474 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2022-02-28manifest_xml: group for submanifest projectsLaMont Jones
Add all projects in a submanifest to the group submanifest::<path_prefix> for ease in filtering. Change-Id: Ia6f01f9445f4f8d20fda3402f4d5821c43ceaf7f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/331319 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2022-02-17Add multi-manifest support with <submanifest> elementv2.22LaMont Jones
To be addressed in another change: - a partial `repo sync` (with a list of projects/paths to sync) requires `--this-tree-only`. Change-Id: I6c7400bf001540e9d7694fa70934f8f204cb5f57 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322657 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2022-01-26init: add an option --enable-git-lfs-filterXD Trol
It was reported that git-lfs did not work with git-repo. Specifically, `git read-tree -u` run by `repo sync` would fail git-lfs's smudge filter. See https://github.com/github/git-lfs/issues/1422. In fact, by the time `git read-tree -u` is run, the repository is not bare. It is just that, the working directory is not the same as the .git directory. git-lfs's filter should work. No one seems to have delved into that issue. Today, with newer versions of git-repo and git-lfs, that issue will not reproduce. Tested with - git 2.33, git-lfs 2.13 on macOS - git 2.17, git-lfs 2.3 on ubuntu So, it seems fine to add an option --enable-git-lfs-filter, default to false, and stat that it may not work with older versions of git and git-lfs in the help doc. Bug: https://crbug.com/gerrit/14516 Change-Id: I8d21854eeeea541e072f63d6b10ad1253b1a9826 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/328359 Tested-by: XD Trol <milestonejxd@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2021-09-28Add 'dest-path' to extend-project to support changing pathMichael Kelly
This allows us to move the repository to a new location in the source tree without having to remove-project + add a new project tag. Change-Id: I4dba6151842e57f6f2b8fe60cda260ecea68b7b4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/310962 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Michael Kelly <mkelly@arista.com>
2021-09-28repo: Add support for standalone manifestsJack Neus
Added --standalone_manifest to repo tool. If set, the manifest is downloaded directly from the appropriate source (currently, we only support GS) and used instead of creating a manifest git checkout. The manifests.git repo is still created to keep track of various config but is marked as being for a standalone manifest so that the repo tool doesn't try to run networked git commands in it. BUG=b:192664812 TEST=existing tests (no coverage), manual runs Change-Id: I84378cbc7f8e515eabeccdde9665efc8cd2a9d21 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312942 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2021-09-27superproject: support a new revision attribute.Xin Li
Tested: $ ./run_tests Verified that a manifest that specified superproject revision would use the specified revision, and superproject will use the default revision. Note that this is a slight behavior change from earlier repo versions, which would always use the branch name of the manifest itself. However, the new behavior would be more consisitent with regular "project" element and would allow superproject be used even if it is not enabled for the particular manifest branch, so we have decided to make the change as it would provide more flexibility and better matches what other elements would do. Bug: [google internal] b/187868160 Change-Id: I35255ee347aff6e65179f7879d52931f168b477e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/317643 Tested-by: Xin Li <delphij@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2021-09-24release-process: update distro baseline & add OpenSSHMike Frysinger
Stop tracking Ubuntu Trusty & Xenial and Debian Jessie & Stretch as they only had Python 3.5 available which we've dropped. Backfill OpenSSH versions since we've started testing for it. Change-Id: I03183ed97f6e43dce8a00e36cce2956544a26afc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318835 Reviewed-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
2021-09-03docs: Add version for Ubuntu 21.04 Hirsute and Debian 11 BullseyeRoger Shimizu
* Add footer to the version table, so easier to read and maintain. * Add version entry for Ubuntu 21.04 Hirsute (non-LTS). * Add version entry for Debian 11 Bullseye (LTS). Change-Id: Ic72f911e616b1a13901e56074004f05cdc2c7633 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/313322 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Xin Li <delphij@google.com>
2021-07-29sync: Added logging of repo sync state and config options for analysis.Raman Tenneti
git_config.py: + Added SyncAnalysisState class, which saves the following data into the config object. ++ sys.argv, options, superproject's logging data. ++ repo.*, branch.* and remote.* parameters from config object. ++ current time as synctime. ++ Version number of the object. + All the keys for the above data are prepended with 'repo.syncstate.' + Added GetSyncAnalysisStateData and UpdateSyncAnalysisState methods to GitConfig object to save/get the above data. git_trace2_event_log.py: + Added LogConfigEvents method with code from DefParamRepoEvents to log events. sync.py: + superproject_logging_data is a dictionary that collects all the superproject data that is to be logged as trace2 event. + Sync at the end logs the previously saved syncstate.* parameters as previous_sync_state. Then it calls config's UpdateSyncAnalysisState to save and log all the current options, superproject logged data. docs/internal-fs-layout.md: + Added doc string explaining [repo.syncstate ...] sections of .repo/manifests.git/config file. test_git_config.py: + Added unit test for the new methods of GitConfig object. Tested: $ ./run_tests $ repo_dev init --use-superproject -u https://android.googlesource.com/platform/manifest Tested it by running the following command multiple times. $ repo_dev sync -j 20 repo sync has finished successfully Verified config file has [syncstate ...] data saved. Bug: [google internal] b/188573450 Change-Id: I1f914ce50f3382111b72940ca56de7c41b53d460 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/313123 Tested-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Xin Li <delphij@google.com>
2021-07-23repo: properly handle remote annotations in manifest_xmlJack Neus
BUG=b:192664812 TEST=tests/ Change-Id: I1aa50260f4a00d3cebbd531141e1626825e70127 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312643 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2021-07-08Gracefully ignore bad remove-project lineMichael Kelly
Sometimes, we don't care if the remove project is referring to a non-existing project and we can just ignore it. This change allows us to ignore remove-project entries if the project that they refer to doesn't exist, making them effectively a no-op. Because this change breaks existing configuration, we allow this to be configuration controlled using the `optional` attribute in the remove-project tag. Change-Id: I6313a02983e81344eadcb4e47d7d6b037ee7420e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/310964 Tested-by: Michael Kelly <mkelly@arista.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2021-06-10superproject: add projects from local manifest to local::<filename> group.Raman Tenneti
With repo sync --use-superproject, don't update the commit ids of every project that comes from local manifest. Tested the code with the following commands. $ ./run_tests -v + Test with local.xml 1. repo init --use-superproject -u persistent-https://googleplex-android.git.corp.google.com/a/platform/manifest 2. cd .repo cp -r /google/src/head/depot/google3/wireless/android/build_tools/translations/pipeline/local_manifests local_manifests cd .. local$ time repo_dev sync --use-superproject NOTICE: --use-superproject is in beta; report any issues to the address described in `repo version` .../local/.repo/exp-superproject/feb2c2847da5e274f3d530d5ab438af8-superproject.git: Initial setup for superproject completed. ... Bug: [google internal] b/189360443 Bug: [google internal] b/189139268 Bug: https://crbug.com/gerrit/14499 Change-Id: Ideaf268c294e9b500b2b9726ffbd733dd8d63004 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/308822 Tested-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
2021-05-04manifest_xml: initial support for <contactinfo>Raman Tenneti
It will be used to let manifest authors self-register contact info. This element can be repeated, and any later entries will clobber earlier ones. This would allow manifest authors who extend manifests to specify their own contact info. It would have 1 required attribute: bugurl. "bugurl" specifies the URL to file a bug against the manifest owner. <contactinfo bugurl="bug-url"/> TODO: This CL only implements the parsing logic and further work will be in followup CLs. Tested the code with the following commands. $ ./run_tests tests/test_manifest_xml.py $ ./run_tests -v Bug: [google internal] b/186220520. Change-Id: I47e765ba2dab5cdf850191129f4d4cd6b803f451 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305203 Tested-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
2021-05-04release-process: document the rate limiting in automatic updatesMike Frysinger
We check for updates only once per day, so clarify the docs. Change-Id: Ib669ca6ebc67bc13204996fa40e1a3a82012295e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305145 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
2021-05-01Update copyfile and linkfile if manifest updatedjiajia tang
Currently, copyfiles and linkfiles which marked by "<copyfile/>" and "<linkfile/>" in manifest will be created by first exec 'repo sync'. But if some "<copyfile/>" or "<linkfile/>" are removed in manifest, then 'repo sync', these removed item dest can not be removed in the sourcecode workspace. This patch is intent to fix this issue, by save a 'copy-link-files.json' in .repo and then compared with new dest path when next sync. If any "<copyfile/>" or "<linkfile/>" were removed, the dest path will be removed in sourcecode at the same time. Bug: https://crbug.com/gerrit/11008 Change-Id: I6b7b41e94df0f9e6e52801ec755951a4c572d05d Signed-off-by: jiajia tang <tangjiajia@xiaomi.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/304202 Reviewed-by: Mike Frysinger <vapier@google.com>
2021-04-14help: switch from formatter module to textwrapMike Frysinger
Since Python has deprecated the formatter module, switch to the textwrap module instead for reflowing text. We weren't really using any other feature anyways. Verified by diffing the output before & after the change and making sure it was the same. Then made a few tweaks to tighten up the output. Change-Id: I0be1bc2a6661a311b1a4693c80d0f8366320ba55 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/303282 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>