summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* project: prune sample hooksv2.20Mike Frysinger2022-01-101-0/+5
| | | | | | | | | | These hooks are never used and often get stale, so just trim them. Users rarely look in these dirs to begin with. Change-Id: Ic785aa55fb7ec84a61376df101127d0018882030 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327538 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: drop support for symlinking internal .git filesMike Frysinger2022-01-101-12/+2
| | | | | | | | | | | Since we don't do this anymore, and there prob won't be a need to bring it back, drop support for it. Bug: https://crbug.com/gerrit/15460 Change-Id: I7d86706f108c797a5c7962cb1578693d49430367 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327537 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: abort a bit earlier before migrating .git/Mike Frysinger2022-01-072-13/+53
| | | | | | | | | | | | | Verify all the .git/ paths will be handled by the migration logic before starting the migration. This way we still abort & log an error, but the user gets to see it before we put the tree into a state that they have to manually recover. Also add a few more known-safe-to-clobber paths. Bug: https://crbug.com/gerrit/15273 Change-Id: If49d69b341bc960ddcafa30da333fb5ec7145b51 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327557 Reviewed-by: Colin Cross <ccross@android.com> Tested-by: Mike Frysinger <vapier@google.com>
* Revert "sync: dropped "NOTICE: --use-superproject is in beta ..." message."Raman Tenneti2022-01-061-0/+2
| | | | | | | | | | | | | | | | | This reverts commit d53cb9549a0c57939b12c5c35a6b581aec2ca36f. As long as repo's reference docs treat this feature as a work in progress and don't cover it well enough to allow all repo maintainers to easily support it, it is inconsistent to report to users that it is no longer in beta. Thanks for vapier@google.com for noticing. https://crbug.com/gerrit/15527 tracks the required documentation changes before we'd be ready to roll forward again. Change-Id: Ic9bd951cfb3c1abf6e1bfa30dfe4afa1c9b7bec6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327337 Reviewed-by: Jonathan Nieder <jrn@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Jonathan Nieder <jrn@google.com>
* project: stop symlinking info dir under .git/Mike Frysinger2022-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unsharing this directory shouldn't be a problem. The current repo code treated it as a file, and while that's actually incorrect, files & dirs are basically treated the same, so it's practically the same. Let's enumerate each subpath since there aren't that many. info/refs: Only used when the project is exported over git dumb transports (i.e. a http:// server). Repo never does this, and it's extremely unlikely any user has ever done this. Plus, this proposal talks about unsharing project refs, so this file should get unshared too. info/grafts: A user-configurable file that repo never touches. Might be useful to share across projects, but probably rarely (if ever) used by developers, and forcing them to configure it for each project isn't that big of a deal. info/exclude: info/attributes: User-configurable files that repo never touches. Doesn't seem like most users ever touch these, and if they do, having them do it for each shared project isn't a big deal. info/sparse-checkout: Repo doesn't use sparse checkouts, and it's extremely unlikely to even work if a user tried doing something themselves. Bug: https://crbug.com/gerrit/15460 Change-Id: I53e44d73a6d7a92da615b46600d8ea51cb46e3ac Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327519 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: stop symlinking description file under .git/Mike Frysinger2022-01-061-1/+1
| | | | | | | | | | | | | | | | Nothing uses this path. It’s only for exporting git dirs e.g. for online gitweb use which probably no one does. It is not the same description file as exists on servers we cloned from. Leaving it as the default plain text file will simplify code. We don't undo any existing symlinks if they exist since repo does not care about them, and their existence doesn't hurt. Bug: https://crbug.com/gerrit/15460 Change-Id: Ic34fe7c3cfb8f6da844de5be30158f59382b1cc8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327518 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: stop symlinking svn under .git/Mike Frysinger2022-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This path only matters to users of `git svn` who manually run it in local projects after they get a full repo client checkout. With svn usage falling in general, and with the fact that the source checkout now symlinks its .git/ state to the internal projects/ path, we don't need to manage this anymore. It means the path won't be shared among multiple local projects that have the same remote, but so it goes. It was an optimization only, not functionality required for correctness. We want to simplify the internals to stop messing with git state, and this particular path doesn't seem worth the effort to maintain. We don't undo any existing svn symlinks if they exist since repo does not care about them, and their existence doesn't hurt anything. Bug: https://crbug.com/gerrit/15460 Change-Id: Ie8496b275bcc589771aa9f4ee874ed2ee6d5241d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327517 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: clean up now unused codeMike Frysinger2022-01-061-34/+4
| | | | | | | | | | | | | Now that we symlink worktree .git/ paths to .repo/projects/, we never set share_refs=True anywhere, which means all of this logic is dead code. Throw it all away. Do it as a separate commit to make the parent commit easier to review. Bug: https://crbug.com/gerrit/15273 Change-Id: If496d39029d3d3bd523ba24c603ce47a63ad9b51 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/326817 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jack Neus <jackneus@google.com>
* sync: dropped "NOTICE: --use-superproject is in beta ..." message.Raman Tenneti2021-12-291-2/+0
| | | | | | | | | | | | Tested the code with the following commands. $ ./run_tests -v Bug: [google internal] b/209511230 Change-Id: Ia3c6de47709f5276e324a5bb608383aba3b2c562 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327197 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* sync: With --mirror option, don't display no-use-superproject... message.Raman Tenneti2021-12-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | + Display 'Defaulting to no-use-superproject because there is no working tree.' message if --use-superproject option is used and we are not using superproject because manifest is either a mirror or is an archive. Tested the code with the following commands. $ ./run_tests -v Tested the sync code by using repo_dev alias and pointing to this CL. $ repo init -u https://android.googlesource.com/mirror/manifest --mirror $ repo_dev sync Receiving objects: 100% (3/3), done.eiving objects: 33% (1/3) $ repo_dev sync --use-superproject Defaulting to no-use-superproject because there is no working tree. Fetching: 0% (0/2158) warming up Bug: https://crbug.com/gerrit/15368 Change-Id: I16b87ee9623315dbc3100b612b1decdaab7ac1dc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/325797 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* project: migrate worktree .git/ dirs to symlinksv2.19Mike Frysinger2021-12-012-36/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically we created a .git/ subdir in each source checkout and symlinked individual files to the .repo/projects/ paths. This layer of indirection isn't actually needed: the .repo/projects/ paths are guaranteed to only ever have a 1-to-1 mapping with the actual git checkout. So we don't need to worry about having files in .git/ be isolated. To that end, change how we manage the actual project checkouts from a dir full of symlinks (and a few files) to a symlink to the internal .repo/projects/ dir. This makes the code simpler & faster. The directory structure we have today is: .repo/ project-objects/chromiumos/third_party/kernel.git/ <paths omitted as not relevant to this change> projects/src/third_party/kernel/ v3.8.git/ config description -> …/project-objects/…/config FETCH_HEAD HEAD hooks/ -> …/project-objects/…/hooks/ info/ -> …/project-objects/…/info/ logs/ objects/ -> …/project-objects/…/objects/ packed-refs refs/ rr-cache/ -> …/project-objects/…/rr-cache/ src/third_party/kernel/ v3.8/ .git/ config -> …/projects/…/v3.8.git/config description -> …/project-objects/…/v3.8.git/description HEAD hooks/ -> …/project-objects/…/v3.8.git/hooks/ index info/ -> …/project-objects/…/v3.8.git/info/ logs/ -> …/projects/…/v3.8.git/logs/ objects/ -> …/project-objects/…/v3.8.git/objects/ packed-refs -> …/projects/…/v3.8.git/packed-refs refs/ -> …/projects/…/v3.8.git/refs/ rr-cache/ -> …/project-objects/…/v3.8.git/rr-cache/ The directory structure we have after this commit: .repo/ <nothing changes> src/third_party/kernel/ v3.8/ .git -> …/projects/…/v3.8.git Bug: https://crbug.com/gerrit/15273 Change-Id: I9dd8def23fbfb2f4cb209a93f8b1b2b24002a444 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323695 Reviewed-by: Mike Nichols <mikenichols@google.com> Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* init, sync: fixed flake8 warnings.v2.18Raman Tenneti2021-11-182-9/+8
| | | | | | | | | | | | Tested: + run_tests + flake8 subcmds/init.py + flake8 subcmds/sync.py Change-Id: Ie337481d8a210bfc49b0745f75c05a308a0e74d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/324155 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* superproject: Inherit --no-use-superproject with --mirror option.Raman Tenneti2021-11-182-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | init.py + Similar to opt.archive, gave an error if --mirror option is used with --use-superproject. sync.py + Defaulted to --no-use-superproject if manifest is a mirror or archive (similar to error at line# 1067). Tested: + run_tests + flake8 (will fix known errors in another CL). $ repo_dev init -u sso://googleplex-android.git.corp.google.com/platform/manifest --use-superproject --mirror Usage: repo init [options] [manifest url] main.py: error: --mirror and --use-superproject cannot be used together. + repo init and repo sync with --mirror and without --mirror options. $ repo_dev init -u https://android.googlesource.com/platform/manifest $ repo_dev sync ...superproject.git: Initial setup for superproject completed. + With --mirror option, verfied there are no exceptions in git_superproject.py Bug: [google internal] b/206537893 Change-Id: I059f20e76f0ab36f0587f29779bb53ede4663bd4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323955 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* sync: Handle tag ref in "upstream" fieldRobin Schneider2021-11-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | repo sync only handles a git tag properly when it is in the "revision" field. However, "revision locked manifests" (`repo manifest --revision-as-HEAD`) specifies the tag in the "upstream" field. The issue is that this tag is not fetched. Only the commit that the tag points to is fetched. This cases issues as self._CheckForImmutableRevision() runs and comes to the conclusion that the tag was changed while in fact, it was just not fetched. This causes a full sync. File docs/manifest-format.md, section Element-project: > Attribute upstream: Name of the Git ref in which a sha1 can be found. Used when syncing a revision locked manifest in -c mode to avoid having to sync the entire ref space. Project elements not setting their own upstream will inherit this value. Change-Id: I0507d3a5f30aee8920a9f820bafedb48dd5db554 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323620 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Robin Schneider <ypid@riseup.net>
* project: init hooks in objdir onlyMike Frysinger2021-11-151-7/+4
| | | | | | | | | | | | | | | objdir is the .repo/project-objects/ dir based on the remote path. gitdir is the .repo/projects/ dir based on the local source checkout path. When we setup the gitdir, we symlink "hooks" to the one in the objdir. But when we go to initialize the hooks, we do it via gitdir. There is a 1-to-many mapping from project-objects to projects, so initializing via gitdir can be repetitive. Collapse the hook init logic to the objdir init path. Change-Id: I828fca60ce6e125d6706c709cdb2797faa40aa50 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323815 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* sync: link the internal-fs-layout doc into checkoutsMike Frysinger2021-11-151-0/+9
| | | | | | | | | This should make it easy to discover for people poking around .repo/. Change-Id: Ie5051551f25127c0592df5e36efba7bb2263e5d4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323701 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* git-review: add config fileMike Frysinger2021-11-151-0/+5
| | | | | | | | | This is used by the `git review` tool that some people use. Change-Id: I8dac4e1dad155109a05181deaec61e1a74857b1f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323698 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* SUBMITTING_PATCHES: link to commit message style docsMike Frysinger2021-11-151-5/+9
| | | | | | | Change-Id: I2090ebc43fc1c816b941a53dd89dbedf7bc61289 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323696 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jack Neus <jackneus@google.com>
* man: refresh pagesMike Frysinger2021-11-125-21/+44
| | | | | | | Change-Id: I3f2c3ad77c16a76276bba2954887ab9e7605661c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323516 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* help: fix grammar in help textMike Frysinger2021-11-122-3/+3
| | | | | | | | Bug: https://crbug.com/gerrit/14838 Change-Id: Ic5000921ba9a1baa086153630ebbb429e3d17642 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323515 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* Fix typo for ValueErrorSl0v3C2021-11-071-1/+1
| | | | | | | | | | which will cause error log like below: NameError: name 'ValueErrorl' is not defined Change-Id: I388886b7cf6d700e224c3847b7ba4ba4fe9c041d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323015 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: 彭杨益 <pyy101727@gmail.com>
* sync: make --prune the defaultMike Frysinger2021-11-051-2/+7
| | | | | | | | | | | | | | | | | | | | | | If a remote deletes a ref, and it points to an object that doesn't exist locally, we can get into a bad state, and the only way for the user to recover is to run `repo sync --prune` (and to know that is the option they need). The error message is not helpful: fatal: bad object refs/remotes/cros/firmware-zork-13421.B-master error: https://chromium.googlesource.com/chromiumos/platform/ec did not send all necessary objects This situation can also come up when the remote renames refs in a UNIX FS incompatible way. For example, replacing refs/heads/foo with refs/heads/foo/bar. Also add a --no-prune option for users to disable the behavior. Bug: https://issuetracker.google.com/203366450 Change-Id: Icf45d838a10938feb091d29800f7e49240830ec3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322956 Reviewed-by: Andrew Lamb <andrewlamb@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* sync: fix --tags optionMike Frysinger2021-11-051-3/+2
| | | | | | | | | | | | This has been broken since it was added where --tags was actually the same as --no-tags. Oddly, it was copied from init where the logic is correct. Bug: https://crbug.com/gerrit/12401 Change-Id: I15b89da1a655176a11bebc22573b25c728055328 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322955 Reviewed-by: Andrew Lamb <andrewlamb@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: fix format string in error messageLaMont Jones2021-11-051-1/+1
| | | | | | | | | BUG=None Change-Id: I0b195fd919c6db8cb3547e8d6f4c733f2bd4a535 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322735 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Xin Li <delphij@google.com>
* superproject: added 'implies -c' in the help of --use-superproject option.Raman Tenneti2021-11-012-3/+2
| | | | | | | | | | | | | | sync.py: deleted unused import errno. Tested: $ ./run_tests $ flake8 repo subcmds/sync.py Bug: https://crbug.com/gerrit/15208 Change-Id: I2bb3098f5602ded3861e000100766041ad93b53d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322555 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* Support more url schemes for getting standalone manifestv2.17.3Matt Story2021-10-271-4/+4
| | | | | | | | | | | urllib.requests.urlopen also supports file, so call it unless the scheme is 'gs'. This adds http, https, and ftp support. Change-Id: I3f215c3ebd8e6dee29ba14c7e79ed99d37287109 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322095 Reviewed-by: Michael Kelly <mkelly@arista.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Matt Story <mstory@arista.com>
* fetch: Fix stderr handling for gsutilJack Neus2021-10-262-4/+8
| | | | | | | | | | | | | | | | | Previously gsutil stderr was getting piped into stdout, which yields bad results if there are non-fatal warnings in stderr. Additionally, we should fail outright if gsutil fails (by adding `check = True`) rather than fail later on when we try to sync to a manifest that is in fact just a stderr dump. BUG=none TEST=manual runs with bad gs urls Change-Id: Id71791d0c3f180bd0601ef2c783a8e8e4afa8f59 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/321935 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* ssh: handle FileNotFoundError errorsMike Frysinger2021-10-261-0/+3
| | | | | | | | | | If ssh isn't installed, it throws a distinct error we have to catch. Bug: https://crbug.com/gerrit/15196 Change-Id: I0660e842c304ce7575f5cb100894d05fd65f9454 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322055 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* sync: properly handle standalone manifests for `sync` commandv2.17.2Jack Neus2021-10-151-2/+4
| | | | | | | | | | | | | | sync should not attempt to sync the manifest project if it was created from a standalone manifest. The current work around is to run sync with --nmu. BUG=none TEST=manual runs Change-Id: I2e121af0badf9642143e77c7af89d1c2d993b0f3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/321195 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* subcmds/sync: Use pack-refs instead of gc for redundant gitdirs.Allen Webb2021-10-141-10/+24
| | | | | | | | | | | | | Previously `git gc` was being run on every gitdir even when they shared the same objects. Instead only call it once and use pack-refs for the gitdirs that were not gc'ed. Bug: https://crbug.com/gerrit/15113 Test: repo sync -j # and check that git pack-refs is called Change-Id: Icff37ab3ec78cfb44391d8cc7f2d875991532320 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/320275 Tested-by: Allen Webb <allenwebb@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: more arg checking for --standalone-manifest re-initsv2.17.1Jack Neus2021-10-111-0/+5
| | | | | | | | | | | | | | | | `repo init` doesn't do anything on re-init when the checkout has been initialized using --standalone manifest. Rather than let the tool run through its existing flows (which happen to noop), check the args and explicitly quit if a bare `repo init` is run on a standalone checkout. BUG=none TEST=manual tests Change-Id: Ie4346ef6df1282ec3e3f8045a08138c93653fece Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/320735 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: fix bug with --standalone-manifestJack Neus2021-10-111-2/+4
| | | | | | | | | | | | | We were accidentally always setting manifest.standlone in config, which was messing up behavior for standard use cases. BUG=gerrit:15160 TEST=manual runs Change-Id: Ic80f084ae97de5721aced3bb52d3ea9115f8d833 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/320715 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* sign-launcher: make the help text more automaticMike Frysinger2021-10-061-7/+28
| | | | | | | | | | | | | | | | Rather than display "3.0" all the time and confuse people, extract the version from the launcher we're signing and display that. Also reformat the text to follow our current practice: upload the versioned launcher by itself first, and then later copy that over the default. And while we're here, add tips for rollbacks. Change-Id: I1654425c88e5c67d78879f2f33ad685c59be14dc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319637 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* subcmds/sync: Disable autoDetach for git gc.Allen Webb2021-10-051-0/+1
| | | | | | | | | | | | | | | gc.autoDetach is enabled by default which makes 'git gc --auto' return immediately and run in background. This can lead to a pile up of operations all using large amounts of memory at the same time. To avoid this set gc.autoDetach to false so that the garbage collect task waits for instances to finish before spawning more. Bug: https://crbug.com/gerrit/15113 Test: repo sync -j # and check the number of 'git gc' processes Change-Id: Ic0815156ba3db03972968f33f6f9f51e4928f23b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319835 Tested-by: Allen Webb <allenwebb@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* git_config: Fixed test.gitconfig getting updated when running tests.v2.17Raman Tenneti2021-09-302-29/+19
| | | | | | | | | | | | | | | | | | Moved test_GetSyncAnalysisStateData to GitConfigReadWriteTests class. Deleted [repo "syncstate*..] data from tests/fixtures/test.gitconfig. Tested: ./run_tests ... tests/test_git_config.py::GitConfigReadWriteTests::test_GetSyncAnalysisStateData PASSED [ 84%] ... Bug: https://crbug.com/gerrit/15103 Change-Id: I8cb89ce10b025994a045106c9c66dd243ae8ba50 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319557 Tested-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* Merge "Merge history of v2.14.5." into mainMike Frysinger2021-09-300-0/+0
|\
| * Merge history of v2.14.5.Mike Frysinger2021-09-300-0/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The v2.14.[345] releases were cut on a branch based on v2.14.2. We had some regression fixes we wanted in v2.14, but too many risky changes landed in main since to cut another v2.14.x directly, and we didn't want to destabilize even more by pushing a v2.15 right away. So we branched to keep things healthy. But people with old checkouts trying to upgrade from those versions run into an old repo bug where it only selfupdates with fast-forwards, and repo can't fast-forward from those divergent histories. So let's do a merge commit to stitch the history back together. There's no actual changes in here. Change-Id: I05a96048e3846321e57c5f5224fb8dcf3c191d35
| | * sync: fix recursive fetchingv2.14.5Mike Frysinger2021-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b2fa30a2b891b22c173c960a67bf38ccbba8de1b ("sync: switch network fetch to multiprocessing") accidentally changed the variable passed to the 2nd fetch call from |missing| to |to_fetch| due to a copy & paste of the earlier changed logic. Undo that to fix git submodule fetching. Bug: https://crbug.com/gerrit/14489 Change-Id: I627954f80fd2e80d9d5809b530aa6b0ef9260abb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305262 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
| | * git_config: hoist Windows ssh check earlierv2.14.4Mike Frysinger2021-05-041-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ssh master logic has never worked under Windows which is why this code always returned False when running there (including cygwin). But the OS check was still done while holding the threading lock. While it might be a little slower than necessary, it still worked. The switch from the threading module to the multiprocessing module changed global behavior subtly under Windows and broke things: the globals previously would stay valid, but now they get cleared. So the lock is reset to None in children workers. We could tweak the logic to pass the lock through, but there isn't much point when the rest of the code is still disabled in Windows. So perform the platform check before we grab the lock. This fixes the crash, and probably speeds things up a few nanoseconds. This shouldn't be a problem on Linux systems as the platform fork will duplicate the existing process memory (including globals). Bug: https://crbug.com/gerrit/14480 Change-Id: I1d1da82c6d7bd6b8cdc1f03f640a520ecd047063 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305149 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
| | * sync: fix print error when handling server errorv2.14.3Mike Frysinger2021-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting this logic from print() to the output buffer, this error codepath should have dropped the use of the file= redirect. Bug: https://crbug.com/gerrit/14482 Change-Id: Ib484924a2031ba3295c1c1a5b9a2d816b9912279 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305142 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* | | Merge history of v1.13.11.Xin Li2021-09-300-0/+0
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | For older versions of repo, this would make it easier for it to perform a self update by making it a fast-forward from the following tags: v1.13.9.2, v1.13.9.3, v1.13.9.4, v1.13.10, v1.13.11 Change-Id: Ia75776312eaf802a150db8bd7c0a6dce57914580
| * | Revert "Save cookies back to jar when fetching clone.bundle"v1.13.11repo-1maintMike Frysinger2020-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4abf8e6ef81e78469148b156ae2d2da70ace627a. The curl process for updating the cookie file is not atomic. When fetching many bundles in parallel, we can sometimes corrupt the file causing it to be cleared. Since users should manage gitcookies on their own, leave it read-only. Bug: https://crbug.com/gerrit/12300 Change-Id: Id472c99b197bc4cf8533c649f8881509f38643c1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254092 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit dc1d0e0c7fffa5109048ac52a67aa97bb362ae3a)
| * | repo: bump launcher versionMike Frysinger2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This way we can push out the updated stable branch change. Change-Id: I72d5dab4523a10dfeb6529796892096aa80eba3c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254492 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
| * | project: fix bytes/str encoding when updating git submodulesMike Frysinger2020-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since tempfile.mkstemp() returns a file handle in binary mode, make sure we turn our strings into bytes before writing. Bug: https://crbug.com/gerrit/12043 Change-Id: I3e84d595e84b8bc12a1fbc7fd0bb3ea0ba2832b0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254393 Reviewed-by: Michael Mortensen <mmortensen@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit 163d42eb43ba79677aae22fa859896010badba9b)
| * | repo: allow REPO_REV to be an env varMike Frysinger2020-02-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do this for REPO_URL already. Bug: https://crbug.com/gerrit/10233 Change-Id: I53410645474b00d900467c96fa5d8446f3a607d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253552 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit 563f1a651298eaa3616f92c3cd7b264fe5442379)
| * | Fixing forall subcommand for Py3v1.13.10Jiri Tyr2020-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Execution of 'repo forall -p -c' doesn't work with Py3 and ends up with an error: Got an error, terminating the pool: TypeError: can only concatenate str (not "bytes") to str That's fixed by using the decode() method. Change-Id: Ice01aaa1822dde8d957b5bf096021dd5a2b7dd51 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253659 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Jiri Tyr <jiri.tyr@gmail.com> (cherry picked from commit 83a3227b62c936b346b825b333fc2ca65528ecfd)
| * | remove spurious +x bitsMike Frysinger2020-02-103-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These files are not directly executable, so drop the +x bits. Change-Id: Iaf19a03a497686cc21103e7ddf08073173440dd1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254076 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net> (cherry picked from commit e7c91889a6ff23931d3fbc25481b276e50ed8229)
| * | find python via envMike Frysinger2020-02-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows these scripts to run through the active version of the virtualenv python when invoked via tox. Change-Id: Ib52f475b7b20c34d62cfd179a1341da1a08a8b5c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253974 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit 1b117db767804856a310210c012fdd40addae66a)
| * | git_config: fix encoding handling in GetUrlCookieFileMike Frysinger2020-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure we decode the bytes coming from the subprocess.Popen as we're treating them as strings. Change-Id: I44100ca5cd94f68a35d489936292eb641006edbe Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253973 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit ded477dbb9c6993cbe8b93b10654682b04fdeea8)
| * | Fix inverted logic around [gitc-]init and -cv1.13.9.4Dan Willemsen2020-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of not using '-c' for '--current-branch' when using gitc, we were only using '-c' when using gitc, so we still had the conflict with the gitc option, and other users still couldn't use '-c'. Test: repo init -u https://android.googlesource.com/platform/manifest; repo init -c Test: repo gitc-init -u ... -b ... -c testing Change-Id: I71e4950a49c281418249f0783c6a2ea34f0d3e2b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253795 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Dan Willemsen <dwillemsen@google.com> (cherry picked from commit 93293ca47f3a898b30eecf21e7b4e1038780c867)