summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Don't log spam `repo sync` by defaultv2.40Tomasz Wasilczyk2023-12-082-14/+23
| | | | | | | | | | | | | | | Most times a repo sync after some time (week+) results in a bunch of messages, which are not very useful for average user: - discarding 1 commits - Deleting obsolete checkout. Bug: N/A Test: repo sync Change-Id: I881eab61f9f261e98f3656c09e73ddd159ce288c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/397038 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Tomasz Wasilczyk <twasilczyk@google.com>
* tox: Remove pylint timeoutJosip Sokcevic2023-12-081-3/+0
| | | | | | | | | | It's not a valid pylint config Change-Id: Ida480429a3a86637f26e9fc3a0d6fa2d225d952a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/396921 Reviewed-by: Scott Lee <ddoman@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com>
* Update commit-msg hookOrgad Shaneh2023-12-041-11/+18
| | | | | | | | | | | Modified in https://gerrit-review.googlesource.com/c/gerrit/+/394841. Change-Id: I381e48fbdb92b33454219dd9d945a1756e551a77 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/395577 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Orgad Shaneh <orgads@gmail.com> Commit-Queue: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Ernesto Rodriguez <guez30nesto@gmail.com>
* sync: Fix partial sync false positiveMatt Schulte2023-11-302-1/+39
| | | | | | | | | | | | | | | | | | | | | In the case of a project being removed from the manifest, and in the path in which the project used to exist, and symlink is place to another project repo will start to warn about partial syncs when a partial sync did not occur. Repro steps: 1) Create a manifest with two projects. Project a -> a/ and project b -> b/ 2) Run `repo sync` 3) Remove project b from the manifest. 4) Use `link` in the manifest to link all of Project a to b/ Bug: 314161804 Change-Id: I4a4ac4f70a7038bc7e0c4e0e51ae9fc942411a34 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/395640 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Matt Schulte <matsch@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* repo: add repo main script's directory to PYTHONPATH.Duy Truong2023-11-291-0/+8
| | | | | | | | | | | | | | | | | | | Python 3.11 introduces PYTHONSAFEPATH and the -P flag which, if enabled, does not prepend the script's directory to sys.path by default. This breaks repo because main.py expects its own directory to be part of Python's import path. This causes problems with tools that add PYTHONSAFEPATH to python programs, most notably Bazel. We will simply prepend main.py's path to PYTHONPATH instead. Bug: 307767740 Change-Id: I94f3fda50213e450df0d1e2df6a0b8b597416973 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391236 Tested-by: Duy Truong <duytruong@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* info: Handle undefined mergeBranchJosip Sokcevic2023-11-201-1/+3
| | | | | | | | | | | | When a repo client is initialized with --standalone-manifest, it doesn't have merge branch defined. This results in mergeBranch being None. Bug: b/308025460 Change-Id: Iebceac0976e5d3adab5300bd8dfc76744a791234 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/393716 Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* manifest_xml: support nested submanifestsGuillaume Micouin-Jorda2023-11-151-1/+1
| | | | | | | | | | | | | Change-Id: I58f91c6b0db631bb7f55164f41d11d3a349ac94f Signed-off-by: Guillaume Micouin-Jorda <gmicouin@netcourrier.com> Signed-off-by: Hadamik Stephan <Stephan.Hadamik@continental-corporation.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/392020 Reviewed-by: Ben PUJOL <pujolbe@gmail.com> Reviewed-by: LaMont Jones <lamontjones@google.com> Tested-by: Roberto Prado <roberto.prado.c@gmail.com> Commit-Queue: Roberto Prado <roberto.prado.c@gmail.com> Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Roberto Prado <roberto.prado.c@gmail.com>
* repo_logging: Ensure error details are printedJosh Bartel2023-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This updates RepoLogger.log_aggregated_errors to print out the error message the RepoExitError when there is not a list of aggregated errors. Previously it would log out: ======================================================================= Repo command failed: ManifestParseError This told us what class of error occurred but missed the helpful error message that developers put in the error. After this change it will now print out the error message: ======================================================================= Repo command failed: ManifestParseError error parsing manifest /path/to/manifest.xml: no element found: line 197, column 0 Change-Id: I4805540fddb5fa9171dbc8912becfa7fdfb1ba67 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/392614 Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Joshua Bartel <josh.bartel@garmin.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
* repo: Use the worktree when checking the repo rev.Jason R. Coombs2023-11-131-1/+1
| | | | | | | | | | | | | Avoids treating the operation as if it were acting on a bare repository, thereby triggering failures when the Git client is configured with `safe.bareRepository=explicit`. Repo doesn't actually use a bare repository, but pointing at the gitdir acts as if it had. Bug: 307559774 Change-Id: I2c142275b2726a59526729c0b2c54faf728f125d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391554 Commit-Queue: Jason R. Coombs <jaraco@google.com> Tested-by: Jason R. Coombs <jaraco@google.com> Tested-by: Emily Shaffer <emilyshaffer@google.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* git_superproject: tell git that superproject is bareEmily Shaffer2023-11-091-5/+7
| | | | | | | | | | | | | | | | | | | | | | The superproject is initialized as a bare repo in Superproject:_Init(). That means that later operations must treat it as a bare repository, specifying the gitdir and setting 'bare' appropriately when launching GitCommand()s. It's also OK not to specify cwd here because GitCommand() will drop cwd if bare == True anyways. With this change, it's possible to run `repo init` and `repo sync` with the Git config 'safe.bareRepository' set to 'explicit'. This config strengthens Git's security posture against embedded bare repository attacks like https://github.com/justinsteven/advisories/blob/main/2022_git_buried_bare_repos_and_fsmonitor_various_abuses.md. Bug: b/227257481 Change-Id: I954a64c6883d2ca2af9c603e7076fd83b52584e9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389794 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Jason R. Coombs <jaraco@google.com> Tested-by: Emily Shaffer <emilyshaffer@google.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* Correctly handle schema-less URIs for remote fetch URLMichael Kelly2023-11-082-13/+74
| | | | | | | | | | | | | | | | Currently we don't deal with schema-less URIs like `git@github.com:foo` at all resulting in a scenario where we append them to the manifest repo URL. In order to deal with this, we munge both the manifest URL and the fetch URL into a format we like and proceed with that. Bug: https://g-issues.gerritcodereview.com/issues/40010331 Change-Id: I7b79fc4ed276630fdbeb235b94e327b172f0879b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386954 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Michael Kelly <mkelly@arista.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* main: Log ManifestParseError exception messagesLuK13372023-11-061-0/+2
| | | | | | | | | | This lets us see manifest parsing error messages again. Change-Id: I2d90b97cfb50e4520f79e75fa0d648c373b49e98 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391477 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Łukasz Patron <priv.luk@gmail.com> Tested-by: Łukasz Patron <priv.luk@gmail.com>
* repo: Remove unreachable code.Jason R. Coombs2023-11-011-35/+4
| | | | | | | | Change-Id: I41371feb88c85e9da0656b9fab04057c22d1dcf4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391514 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* cleanup: Update codebase to expect Python 3.6Jason R. Coombs2023-10-3133-225/+169
| | | | | | | | | | | - Bump minimum version to Python 3.6. - Use f-strings in a lot of places. Change-Id: I2aa70197230fcec2eff8e7c8eb754f20c08075bb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389034 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* sync: PersistentTransport call parent initv2.39Daniel Kutik2023-10-251-0/+1
| | | | | | | | | | | | | | Found via pylint: W0231: __init__ method from base class 'Transport' is not called (super-init-not-called) Just fixed for code correctness and to avoid potential future bugs. Change-Id: Ie1e723c2afe65d026d70ac01a16ee7a40c149834 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390676 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* sync: TeeStringIO write should return intDaniel Kutik2023-10-241-1/+2
| | | | | | | | Change-Id: I211776a493cad4b005c6e201833e9700def2feb9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390657 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com>
* sync: Fix tracking of broken linksJason Chang2023-10-241-1/+0
| | | | | | | | | | Change-Id: Ice4f4cc745cbac59f356bd4ce1124b6162894e61 Bug: b/113935847 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390434 Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
* project: Speculative fix for project corruptionJosip Sokcevic2023-10-232-2/+11
| | | | | | | | | | | | | | | | When a new shared project is added to manifest, there's a short window where objects can be deleted that are used by other projects. To close that window, set preciousObjects during git init. For non-shared projects, repo should correct the state in the same execution instance. Bug: 288102993 Change-Id: I366f524535ac58c820d51a88599ae2108df9ab48 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390234 Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* cleanup: convert exceptions to OSErrorJason R. Coombs2023-10-217-22/+19
| | | | | | | | | | | In Python 3, these exceptions were merged into OSError, so switch everything over to that. Change-Id: If876a28b692de5aa5c62a3bdc8c000793ce52c63 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390376 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* cleanup: delete redundant "r" open modeJason R. Coombs2023-10-217-10/+10
| | | | | | | | Change-Id: I86ebb8c5a9dc3752e8a25f4b11b64c5be3a6429e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390375 Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
* cleanup: use new dict & set generator stylesJason R. Coombs2023-10-213-8/+8
| | | | | | | | Change-Id: Ie34ac33ada7855945c77238da3ce644f8a9f8306 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390374 Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
* manifest_xml: Fix empty project list when DOCTYPE is presentChris Allen2023-10-202-1/+19
| | | | | | | | | | | | | | | When parsing the manifest XML, the code looks for a top level DOM node named "manifest". However, it doesn't check that it's an element type node so if there is also an XML document type declaration node present (which has the same name as the root element) then it selects the wrong node and hence you end up with no projects defined at all. Change-Id: I8d101caffbbc2a06e56136ff21302e3f09cfc96b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390357 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Chris Allen <chris.allen@arm.com> Commit-Queue: Chris Allen <chris.allen@arm.com>
* cleanup: leverage yield from in more placesJason R. Coombs2023-10-203-9/+5
| | | | | | | | Change-Id: I4f9cb27d89241d3738486764817b51981444a903 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390274 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* git_config: GetBoolean should return boolDaniel Kutik2023-10-201-1/+1
| | | | | | | | | Test: tox Change-Id: Ifc0dc089deef5a3b396d889c9ebfcf8d4f007bf2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390360 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* project: using --depth results in error when including submanifestsRoberto Vladimir Prado Carranza2023-10-202-2/+5
| | | | | | | | | | | Fix: https://issues.gerritcodereview.com/issues/40015442 Change-Id: I7fb6c50cf2e438b21181ce1a5893885f09b9ee2b Signed-off-by: Roberto Vladimir Prado Carranza <roberto.prado.c@gmail.com> Signed-off-by: Guillaume Micouin-Jorda <gmicouin@netcourrier.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385995 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jerome Couto <jerome.couto@renault.com>
* repo: drop Python 2 compat logicMike Frysinger2023-10-201-4/+1
| | | | | | | | | Bug: 302871152 Change-Id: Ie7a0219e7ac582cd25c2bc5fb530e2c03bcbcc6e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390034 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* delete Python 2 (object) compatMike Frysinger2023-10-2019-43/+43
| | | | | | | | | Bug: 302871152 Change-Id: I39636d73a6e1d69efa8ade74f75c5381651e6dc8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390054 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* tests: Set HOME to a temporary directory when running tests.v2.38Jason R. Coombs2023-10-171-0/+49
| | | | | | | | | | | | When running the tests in my environment, tests that derived from `test_wrapper.GitCheckoutTestCase` would fail on commit or tag due to incomplete or incorrect gpg config. Ideally, the tests should not be dependent on the user's git config. This change ensures $HOME (or Windows equivalent) is replaced for the session. Bug: 302797407 Change-Id: Ib42b712dd7b6602fee6e18329a8c6d52fb9458b9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/388235 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* tests: added python 3.12Daniel Kutik2023-10-173-3/+4
| | | | | | | | | | | adding the recently released python 3.12 to our list of test environments. Change-Id: I05ec0129ad29c16fff65ddfb389f251571f811a2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389754 Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com>
* github: add python 3.11 to test-ci.ymlDaniel Kutik2023-10-161-1/+1
| | | | | | | | | | added python 3.11 to the test matrix. Change-Id: I0533205b5a10105b3144f770aa08c4c649aaf6be Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389675 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* github: pin ubuntu to 20.04 to make py36 workDaniel Kutik2023-10-161-1/+2
| | | | | | | | | | | Ubuntu versions newer that 20.04 do not support Python 3.6 as per https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json Change-Id: I92d8e762a7d05e4b0d6d6e90944ceedbbfa74e57 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389117 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* python-support: update with current status & guidelinesMike Frysinger2023-10-141-29/+75
| | | | | | | | | | | | | | 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>
* hooks: drop support for Python 2Mike Frysinger2023-10-131-60/+3
| | | | | | | | | | | | Stop running old repohooks via python2. Abort immediately with a clear error for the user. Bug: 302871152 Change-Id: I750c6cbbf3c7950e249512bb1bd023c32587eef5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389454 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* main: drop Python 2 checkMike Frysinger2023-10-131-16/+8
| | | | | | | | | | | | Python 2 can't even parse this code anymore due to syntax changes, so there's no point in checking for it explicitly. Bug: 302871152 Change-Id: I9852ace5f5079d037c60fd3ac490d77e074e6875 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389434 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* Update logger.warn to logger.warningAravind Vasudevan2023-10-137-18/+20
| | | | | | | | | Bug: 305035810 Change-Id: Ic2b35d5c3cbe92480c24da612f29382f5d26d4aa Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389414 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
* git_command: read1 needs a size in py3.6Daniel Kutik2023-10-091-2/+3
| | | | | | | | | | | | | | | | | Not setting size causes "TypeError: read1() takes exactly one argument (0 given)" in Python 3.6. In Python 3.7 onwards size defaults to -1, which means an arbitrary number of bytes will be returned. Compare https://docs.python.org/3.6/library/io.html#io.BufferedReader.read1 and https://docs.python.org/3.7/library/io.html#io.BufferedIOBase.read1 for more details. Change-Id: Ia4aaf8140ead9493ec650fac167c641569e6a9d8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/388718 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* git_command: lru_cache needs maxsize for py36 & 37Daniel Kutik2023-10-091-1/+1
| | | | | | | | | | | | Python 3.6 and 3.7 do not have a default value for lru_cache maxsize. Not setting it would cause: TypeError: Expected maxsize to be an integer or None Change-Id: I32d4fb6a0040a0c24da0b2f29f22f85a36c96531 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/388737 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* sync: Fix print statement in _PostRepoFetchAravind Vasudevan2023-10-061-1/+1
| | | | | | | | | | | R=jasonnc@google.com Bug: b/303806829 Change-Id: I49075bfb55b842610786e61a0dedfe008cd1296a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/388614 Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Jason Chang <jasonnc@google.com> Tested-by: Aravind Vasudevan <aravindvasudev@google.com>
* git_command: Augment underlying git errors with suggestionsAravind Vasudevan2023-10-063-31/+270
| | | | | | | | | | | | | | | This change appends suggestions to the underlying git error to make the error slightly more actionable. DD: go/improve-repo-error-reporting & go/tee-repo-stderr Bug: b/292704435 Change-Id: I2bf8bea5fca42c6a9acd2fadc70f58f22456e027 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/387774 Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Jason Chang <jasonnc@google.com> Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
* project: Invoke realpath on dotgit for symmetry with gitdir to ensure a ↵Jason R. Coombs2023-10-051-1/+2
| | | | | | | | | | | | short relpath. Bug: 302680231 Change-Id: Icd01dd2ce62d737a4acb114e729189cd31f6bde9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/388234 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* Reset info logs back to print in syncv2.37Aravind Vasudevan2023-09-282-14/+11
| | | | | | | | | Bug: b/292704435 Change-Id: Ib4b4873de726888fc68e476167ff2dcd74ec9045 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/387974 Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Jason Chang <jasonnc@google.com>
* Track expected git errors in logsJason Chang2023-09-272-7/+26
| | | | | | | | | | | | Sometimes it is expected that a GitCommand executed in repo fails. In such cases indicate in trace logs that the error was expected. Bug: b/293344017 Change-Id: If137fae9ef9769258246f5b4494e070345db4a71 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/387714 Commit-Queue: Jason Chang <jasonnc@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Jason Chang <jasonnc@google.com>
* tests: Fix tox error in py36 use virtualenv<20.22.0Daniel Kutik2023-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | tox uses virtualenv under its hood for managing virtual environments. Virtualenv 20.22.0 dropped support for Python <= 3.6. Since we want to test against Python 3.6 we need to make sure we use a version of virtualenv earlier than 20.22.0. This error was not stopping any tests from passing but was printed multiple times to stderr when executing the py36 target: Error processing line 1 of [...]/.tox/py36/[...]/_virtualenv.pth: Traceback (most recent call last): File "/usr/lib/python3.6/site.py", line 168, in addpackage exec(line) File "<string>", line 1, in <module> File "[...]/.tox/py36/[...]/_virtualenv.py", line 3 from __future__ import annotations ^ SyntaxError: future feature annotations is not defined Source: https://tox.wiki/en/latest/faq.html#testing-end-of-life-python-versions Change-Id: I27bd8200987ecf745108ee8c7561a365f542102a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/387694 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* Use non-deprecated API for obtaining UTC timeLuK13372023-09-185-9/+13
| | | | | | | | | | | | | DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). Change-Id: Ia2c46fb87c544d98cc2dd68a829f67d4770b479c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386615 Tested-by: Łukasz Patron <priv.luk@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Łukasz Patron <priv.luk@gmail.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* main: Use repo loggerAravind Vasudevan2023-09-183-107/+104
| | | | | | | | | Bug: b/292704435 Change-Id: Ica02e4c00994a2f64083bb36e8f4ee8aa45d76bd Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386454 Reviewed-by: Jason Chang <jasonnc@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Aravind Vasudevan <aravindvasudev@google.com>
* project: Use repo loggerAravind Vasudevan2023-09-141-103/+69
| | | | | | | | | Bug: b/292704435 Change-Id: I510fc911530db2c84a7ee099fa2905ceac35d0b7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386295 Reviewed-by: Jason Chang <jasonnc@google.com> Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
* subcmds: Use repo loggerAravind Vasudevan2023-09-1412-115/+121
| | | | | | | | | Bug: b/292704435 Change-Id: Ia3a45d87fc0bf0d4a1ba53050d9c3cd2dba20e55 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386236 Reviewed-by: Jason Chang <jasonnc@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Aravind Vasudevan <aravindvasudev@google.com>
* github: add PR closerMike Frysinger2023-09-131-0/+22
| | | | | | | | | | | We don't accept PRs via GH, so add a job to automatically close them with an explanation for how to submit. Change-Id: I5cc3176549a04ff23b04dae1110cd27a58ba1fd3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386134 Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
* tests: test_subcmds_sync.py: fix for py3.6 & 3.7Daniel Kutik2023-09-131-2/+6
| | | | | | | | | | | | | | | | tests/test_subcmds_sync.py::LocalSyncState::test_prune_removed_projects was failing in Python 3.6 and 3.7 due to topdir not being set with the following error message: TypeError: expected str, bytes or os.PathLike object, not MagicMock topdir is accessed from within PruneRemovedProjects(). Test: tox with Python 3.6 to 3.11 Change-Id: I7ba5144df0a0126c01776384e2178136c3510091 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382816 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com>
* tests: test_git_superproject.py: fix py3.6 & 3.7Daniel Kutik2023-09-131-2/+6
| | | | | | | | | | | | | | tests/test_git_superproject.py::SuperprojectTestCase::test_Fetch was failing in Python 3.6 and 3.7 due to attribute args only being introduced in Python 3.8. Falling back on old way of accessing the arguments. Test: tox with Python 3.6 to 3.11 Change-Id: Iae1934a7bce8cbd6b4519e4dbc92d94e21b43435 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382818 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>