summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Log ErrorEvent for failing GitCommandsJason Chang2023-09-063-363/+470
| | | | | | | | Change-Id: I270af7401cff310349e736bef87e9b381cc4d016 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385054 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Jason Chang <jasonnc@google.com> Tested-by: Jason Chang <jasonnc@google.com>
* logging: Use log.formatter for coloring logsAravind Vasudevan2023-09-062-61/+33
| | | | | | | | | Bug: b/292704435 Change-Id: Iebdf8fb7666592dc5df2b36aae3185d1fc71bd66 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385514 Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* sync: Preserve errors on KeyboardInterruptJason Chang2023-09-061-41/+78
| | | | | | | | | | | | | If a KeyboardInterrupt is encountered before an error is aggregated then the context surrounding the interrupt is lost. This change aggregates errors as soon as possible for the sync command Bug: b/293344017 Change-Id: Iac14f9d59723cc9dedbb960f14fdc1fa5b348ea3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/384974 Tested-by: Jason Chang <jasonnc@google.com> Commit-Queue: Jason Chang <jasonnc@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
* fix black formatting of standalone programsMike Frysinger2023-09-012-992/+1220
| | | | | | | | | | | | | Black will only check .py files when given a dir and --check, so list our few standalone programs explicitly. This causes the repo launcher to be reformatted since it was missed in the previous mass reformat. Bug: b/267675342 Change-Id: Ic90a7f5d84fc02e9fccb05945310fd067e2ed764 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385034 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* sync: Use repo logger within syncAravind Vasudevan2023-08-313-142/+102
| | | | | | | | | Bug: b/292704435 Change-Id: Iceb3ad5111e656a1ff9730ae5deb032a9b43b4a5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383454 Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* project: Preserve stderr on uploadv2.36.1Jason Chang2023-08-281-3/+1
| | | | | | | | | | | | | A previous change captured stderr when uploading git projects. This change ensures stderr is sent to stderr. Bug: b/297097597 Change-Id: I8314e1017d2a42b7b655fe43ce3c312d397894ca Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/384134 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason Chang <jasonnc@google.com> Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Sam Saccone <samccone@google.com>
* tox.ini: add isort as dependencyDaniel Kutik2023-08-281-0/+1
| | | | | | | | | | | | a previous introduced isort, which causes tox runs to fail for all python versions. adding isort as dependency resolve these issues. Change-Id: If3faf78e6928e6e5111b2ef2359351459832431f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/384175 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* isort: format codebasev2.36Mike Frysinger2023-08-2252-143/+280
| | | | | | | | Change-Id: I6f11d123b68fd077f558d3c21349c55c5f251019 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383715 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* tweak stdlib imports to follow Google style guideMike Frysinger2023-08-228-20/+24
| | | | | | | | | | | | Google Python style guide says to import modules. Clean up all our stdlib imports. Leave the repo ones alone for now as that's a much bigger shave. Change-Id: Ida42fc2ae78b86e6b7a6cbc98f94ca04b295f8cc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383714 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* upload: Suggest full sync if hooks fail with partially synced treeGavin Mak2023-08-223-4/+11
| | | | | | | | | | | Pre-upload hooks may fail because of partial syncs. Bug: b/271507654 Change-Id: I124cd386c5af2c34e1dcaa3e86916624e235b1e3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383474 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com>
* sync: Ignore repo project when checking partial syncsGavin Mak2023-08-222-3/+25
| | | | | | | | | | | | The repo project is fetched at most once a day and should be ignored when checking if the tree is partially synced. Bug: b/286126621, b/271507654 Change-Id: I684ed1669c3b3b9605162f8cc9d57185bb3dfe8e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383494 Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
* upload: fix error handlingJason Chang2023-08-213-129/+200
| | | | | | | | | | | | There was a bug in error handeling code that caused an uncaught exception to be raised. Bug: b/296316540 Change-Id: I49c72f29c00f26ba60de552f958bc6eddf841162 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383254 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason Chang <jasonnc@google.com> Tested-by: Jason Chang <jasonnc@google.com>
* docs: Document .repo_localsyncstate.jsonGavin Mak2023-08-181-2/+6
| | | | | | | | | | | 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>
* gitc: drop supportJason Chang2023-08-1513-523/+23
| | | | | | | | | Bug: b/282775958 Change-Id: Ib6383d6fd82a017d0a6670d6558a905d41be321f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/375314 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Jason Chang <jasonnc@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
* tox: enable python 3.11 testingDaniel Kutik2023-08-152-2/+3
| | | | | | | | | | | Python 3.11 was released almost a year ago. Test: tox -epy311 Change-Id: I447637a1e97038a596373d7612c9000c0c738ec9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382838 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* flake8: exclude venv and .tox folderDaniel Kutik2023-08-151-0/+3
| | | | | | | | | | | Excluding these two folders to avoid countless lint warnings caused by dependencies in these two folders. Change-Id: I2403b23f88cebb5941a4f9b5ac6cc34d107fd2f1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382837 Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* Raise RepoExitError in place of sys.exitJason Chang2023-08-1010-122/+251
| | | | | | | | | | Bug: b/293344017 Change-Id: Icae4932b00e4068cba502a5ab4a0274fd7854d9d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382214 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
* sync: Warn if partial sync state is detectedGavin Mak2023-08-102-1/+101
| | | | | | | | | | | | | | | Partial syncs are not supported and can lead to strange behavior like deleting files. Explicitly warn users on partial sync. Bug: b/286126621, b/271507654 Change-Id: I471f78ac5942eb855bc34c80af47aa561dfa61e8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382154 Reviewed-by: Jason Chang <jasonnc@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
* main: Pass path to python binary as arg0 when restarting repoGavin Mak2023-08-081-2/+1
| | | | | | | | | | | | | | Not including it causes flaky behavior in some Chromium builders because Chromium's custom Python build used by vpython relies on argv[0] to find its own internal files. Bug: https://crbug.com/1468522 Change-Id: I5c32ebe71c9b684d6ee50dbd8c3d6fcd51ca309b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381974 Reviewed-by: Chenlin Fan <fancl@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com>
* Raise repo exit errors in place of sys.exitJason Chang2023-08-079-34/+80
| | | | | | | | | Bug: b/293344017 Change-Id: I92d81c78eba8ff31b5252415f4c9a515a6c76411 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381774 Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
* Prefix error events with RepoErrorEvent:Jason Chang2023-08-072-4/+4
| | | | | | | | | | | | Prior to this change there is no way to distinguish between git sessions logs generated from repo source v.s. from git. Bug: b/294446468 Change-Id: I309f59e146c30cb08a0637e8d0b9c5d9efd5cada Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381794 Commit-Queue: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Jason Chang <jasonnc@google.com>
* Refactor errors for sync commandJason Chang2023-08-025-142/+441
| | | | | | | | | | | | | | | | | | Per discussion in go/repo-error-update updated aggregated and exit errors for sync command. Aggregated errors are errors that result in eventual command failure. Exit errors are errors that result in immediate command failure. Also updated main.py to log aggregated and exit errors to git sessions log Bug: b/293344017 Change-Id: I77a21f14da32fe2e68c16841feb22de72e86a251 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/379614 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Jason Chang <jasonnc@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
* Update errors to extend BaseRepoErrorJason Chang2023-07-315-33/+218
| | | | | | | | | | | | | | | | | | | In order to better analyze and track repo errors, repo command failures need to be tied to specific errors in repo source code. Additionally a new GitCommandError was added to differentiate between general git related errors to failed git commands. Git commands that opt into verification will raise a GitCommandError if the command failed. The first step in this process is a general error refactoring Bug: b/293344017 Change-Id: I46944b1825ce892757c8dd3f7e2fab7e460760c0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/380994 Commit-Queue: Jason Chang <jasonnc@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com>
* [repo logging] Add logging moduleAravind Vasudevan2023-07-312-0/+189
| | | | | | | | | Bug: b/292704435 Change-Id: I8834591f661c75449f8be5de1c61ecd43669026d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/380714 Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
* sync: Track last completed fetch/checkoutGavin Mak2023-07-283-17/+148
| | | | | | | | | | | | Save the latest time any project is fetched and checked out. This will be used to detect partial checkouts. Bug: b/286126621 Change-Id: I53b264dc70ba168d506076dbd693ef79a696b61d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/380514 Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Gavin Mak <gavinmak@google.com>
* main: Fix exitcode loggingv2.35Jason Chang2023-06-261-2/+31
| | | | | | | | | | | | | | | | Fixed a couple of bugs in ExitEvent logging: - log exitcode 130 on KeyboardInterrupt - log exitcode 1 on unhandled Exception - log errorevent with specific reason for exit Before this CL an exitcode of 0 would be logged, and it would be difficult to determine the cause of non-zero exit codes Bug: b/287105597 Change-Id: I2d34f180581f9fbd77a1c78c966ebed065223af6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/377834 Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
* sync: Track new/existing project countJason Chang2023-06-231-0/+7
| | | | | | | | | | | New vs existing project may be a useful measure for analyzing sync performance. Bug: b/287105597 Change-Id: Ibea3e90c9fe3d16fd8b863bcae22b21963a6771a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/377574 Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com>
* manifest: enable remove-project using pathFredrik de Groot2023-06-213-16/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* update links from monorail to issuetrackerMike Frysinger2023-06-144-8/+8
| | | | | | | | Change-Id: Ie05373aa4becc0e4d0cab74e7ea0a61eb2cc2746 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/377014 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* sync: Handle case when output isn't connected to a terminalGavin Mak2023-06-091-5/+6
| | | | | | | | | | | Currently `repo sync | tee` exits with an OSError. Bug: https://crbug.com/gerrit/17023 Change-Id: I91ae05f1c91d374b5d57721d45af74db1b2072a5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/376414 Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* sync: Update sync progress even when _sync_dict is emptyv2.34.1Gavin Mak2023-05-301-3/+7
| | | | | | | | | | | | By chance, _sync_dict can be empty even though repo sync is still working. In that case, the progress message shows incorrect info. Handle this case and fix a bug where "0 jobs" can show. Bug: http://b/284465096 Change-Id: If915d953ba60e7cf84a6fb2d137fd6ed82abd3cc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/375494 Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* sync: Handle race condition when reading active jobsJosip Sokcevic2023-05-261-3/+3
| | | | | | | | | | | | | | | It's possible that number of jobs is more than 0 when we check length, but in the meantime number of jobs drops to 0. In that case, we are working with float(inf) which causes other problems Bug: 284383869 Change-Id: I5d070d1be428f8395df7fde8ca84866db46f2100 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/375134 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
* pager: set $LESS only when missingChih-Hsuan Yen2023-05-261-1/+4
| | | | | | | | | | | | | | | | | | | | | This matches the git behavior. From [1], > When the `LESS` environment variable is unset, Git sets it to `FRX` > (if `LESS` environment variable is set, Git does not change it at > all). The default $LESS is changed from FRSX to FRX since git 2.1.0 [2]. This change also updates the default $LESS for repo. [1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-corepager [2] https://github.com/git/git/commit/b3275838d969b7ecb91aae584226fccbeb046aca Bug: https://crbug.com/gerrit/16973 Change-Id: I64ccaa7b034fdb6a92c10025e47f5d07e85e6451 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/374894 Reviewed-by: Chih-Hsuan Yen <x5f4qvj3w3ge2tiq@chyen.cc> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Chih-Hsuan Yen <x5f4qvj3w3ge2tiq@chyen.cc>
* Add envar to replace shallow clones with partialJason Chang2023-05-254-0/+55
| | | | | | | | | | | | | | | | An investigation go/git-repo-shallow shows a number of problems when doing a shallow git fetch/clone. This change introduces an environment variable REPO_ALLOW_SHALLOW. When this environment variable is set to 1 during a repo init or repo sync all shallow git fetch commands are replaced with partial fetch commands. Any shallow repository needing update is unshallowed. This behavior continues until a subsequent repo sync command is run with REPO_ALLOW_SHALLOW set to 1. Bug: b/274340522 Change-Id: I1c3188270629359e52449788897d9d4988ebf280 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/374754 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Tested-by: Jason Chang <jasonnc@google.com>
* sync: Show number of running fetch jobsv2.34Gavin Mak2023-05-252-8/+10
| | | | | | | | | | | | | Last of the recent `repo sync` UX changes. Show number of fetch jobs eg: "Fetching: 3% (8/251) 0:03 | 8 jobs | 0:01 chromiumos/overlays/chrom.." Bug: https://crbug.com/gerrit/11293 Change-Id: I1b3dcf3e56ae6731c6c6cb73cfce069b2f374b69 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/374920 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Joanna Wang <jojwang@google.com>
* upload: use f-stringJosip Sokcevic2023-05-251-1/+1
| | | | | | | | | Change-Id: I91b99a7147c7c3cb5485d5406316c8ffd79f9272 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/374914 Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* project: Include tags option during fetch retryNasser Grainawi2023-05-251-0/+1
| | | | | | | | | | | | | | If the original fetch attempt did not want tags, we should continue to honor that when doing a retry fetch with depth set to None. This seems to match the intent of the retry based on the inline comment and results in a significant performance improvement when the original fetch-by-sha1 fails due to the server not allowing requests for unadvertised objects. Change-Id: Ia26bb31ea9aecc4ba2d3e87fc0c5412472cd98c4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/374918 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Kaushik Lingarkar <kaushik.lingarkar@linaro.org> Tested-by: Kaushik Lingarkar <kaushik.lingarkar@linaro.org>
* Parse OpenSSH versions with no SSH_EXTRAVERSIONSaagar Jha2023-05-242-1/+3
| | | | | | | | | | | If the Debian banner is not used, then there won't be a space after the version number: it'll be followed directly by a comma. Bug: https://crbug.com/gerrit/16903 Change-Id: I12b873f32afc9424f42b772399c346f96ca95a96 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/372875 Tested-by: Saagar Jha <saagarjha@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* sync: Show elapsed time for the longest syncing projectGavin Mak2023-05-185-26/+70
| | | | | | | | | | | | | | "Last synced: X" is printed only after a project finishes syncing. Replace that with a message that shows the longest actively syncing project. Bug: https://crbug.com/gerrit/11293 Change-Id: I84c7873539d84999772cd554f426b44921521e85 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/372674 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Gavin Mak <gavinmak@google.com>
* [git_trace2] Add logs for critical cmdsJosip Sokcevic2023-05-176-20/+26
| | | | | | | | | | | | Trace logs emitted from repo are not useful on error for many critical commands. This change adds errors for critical commands to trace logs. Change-Id: Ideb9358bee31e540bd84a94327a09ff9b0246a77 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/373814 Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
* [trace2] Add absolute time on trace2 exit eventsJosip Sokcevic2023-05-151-2/+4
| | | | | | | | Change-Id: I58aff46bd4ff4ba79286a7f1226e19eb568c34c5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/373954 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* SUBMITTING_PATCHES: update with commit queue detailsMike Frysinger2023-05-111-14/+19
| | | | | | | | Change-Id: I59dffb8524cb95b3fd4196bcecd18426f09bf9c4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/373694 Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
* sync: Fix how sync times for shared projects are recordedv2.33Gavin Mak2023-05-101-19/+15
| | | | | | | | | | | | https://gerrit.googlesource.com/git-repo/+/d947858325ae70ff9c0b2f463a9e8c4ffd00002a introduced a moving average of fetch times in 2012. The code does not handle shared projects, and averages times based on project names which is incorrect. Change-Id: I9926122cdb1ecf201887a81e96f5f816d3c2f72a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/373574 Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
* manifest: add support for revision in includeShuchuan Zeng2023-05-053-4/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* sync: Display total elapsed fetch timeGavin Mak2023-05-022-9/+71
| | | | | | | | | | | | | Give users an indication that `repo sync` isn't stuck if taking a long time to fetch. Bug: https://crbug.com/gerrit/11293 Change-Id: Iccdaec918f86c9cc2db5dc12f9e3eef7ad0bcbda Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/371414 Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* [SyncAnalysisState] Preserve synctime µsJosip Sokcevic2023-04-271-1/+1
| | | | | | | | | | | | | | | By default, datetime.isoformat() uses different format depending on microseconds - if is equal to 0, microseconds are omitted, but otherwise not. Setting timespec = 'microseconds' ensures the format is the same regardless of current time. Change-Id: Icb1be31eb681247c7e46923cdeabb8f5469c20f0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/371694 Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* tests: do not allow underscores in cli optionsMike Frysinger2023-04-191-0/+14
| | | | | | | | | | | We use dashes in --long-options, not underscores, so add a test to make sure people don't accidentally add them. Change-Id: Iffbce474d22cf1f6c2042f7882f215875c8df3cf Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/369734 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* upload: Add `--no-follow-tags` by default to git pushAravind Vasudevan2023-04-051-0/+6
| | | | | | | | | | | Gerrit does not accept pushing git tags to CLs. Hence, this change disables push.followTags for repo upload. Fixed: b/155095555 Change-Id: I8d99eac29c0b4b375bdb857ed063914441026fa1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/367736 Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
* run_tests: Check flake8Gavin Mak2023-03-313-7/+43
| | | | | | | | | | | This also gets enforced in CQ. Bug: b/267675342 Change-Id: I8ffcc5d583275072fd61ae65ae4214b36bfa59f3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/366799 Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* Update abandon to support multiple branchesAravind Vasudevan2023-03-241-5/+11
| | | | | | | | | | | This change updates `repo abandon` command to take multiple space-separated branchnames as parameters. Bug: https://crbug.com/gerrit/13354 Change-Id: I00ad7a79872c0e4161f8183843835f25cd515605 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/365524 Tested-by: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>