summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* init: allow REPO_REV/--repo-rev to specify commits/tagsMike Frysinger2020-03-242-23/+167
| | | | | | | | | | | | | | While the help/usage suggested that revisions would work, they never actually did, and just throw confusing errors. Now that we warn if the checkout isn't tracking a branch, allow people to specify commits or tags explicitly. Hopefully our nags will be sufficient to keep most people on the right path. Bug: https://crbug.com/gerrit/11045 Change-Id: I6ea32c677912185f55ab20faaa23c6c0a4c483b3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259492 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
* tests: add more wrapper unittestsMike Frysinger2020-03-242-1/+90
| | | | | | | Change-Id: Ic6b4eb96b871793bc9463c9047674cf3cfbe4b5e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259993 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
* download: add a --branch optionMike Frysinger2020-03-231-1/+11
| | | | | | | | | | | This allows people to quickly create new branches when pulling down changes rather than having to juggle the git calls themselves. Bug: https://crbug.com/gerrit/11609 Change-Id: Ie6a4d05e9f4e9347fe7f7119c768e6446563ae65 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259855 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* download: unify error handling with sub git callsMike Frysinger2020-03-231-11/+21
| | | | | | | | | | | | We gracefully handle cherry-pick errors, but none of the others which means people get confusing Python tracebacks. Move the main logic in a single GitError try block so we can show pretty error messages for all of them. Change-Id: I52cdf6468d21a98de7f65b86d5267b3caabd5af8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259854 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* download: support -x when cherry-pickingMike Frysinger2020-03-232-2/+15
| | | | | | | | | | | This is a pretty common option for people to want too use, so include it as a pass-thru option when cherry-picking. Bug: https://crbug.com/gerrit/9418 Change-Id: I2a24c1ed7544541719caa4d3c0574347a151a1b0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259853 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* download: support --ff when cherry-pickingMike Frysinger2020-03-232-2/+4
| | | | | | | | | | | The git cherry-pick already supports this, so plumb the existing repo option down. Otherwise it's confusing when people use -c --ff and it doesn't use that behavior. Change-Id: Id68932ffa09204bb30b92a21aff185c00394a520 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259852 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* init: rename --repo-branch to --repo-revMike Frysinger2020-03-185-10/+13
| | | | | | | | | | | | We refer to this as "revision" in help text, and in REPO_REV envvar, so rename to --repo-rev to be consistent. We keep --repo-branch for backwards compatibility, but as a hidden option. Bug: https://crbug.com/gerrit/11045 Change-Id: I1ecc282fba32917ed78a63850360c08469db849a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259352 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* launcher: init: stop passing --repo-url/--repo-branch downMike Frysinger2020-03-171-12/+2
| | | | | | | | | | | | | | | | | | | | | When the launcher handles the init subcommand, it takes care of setting the repo url & branch itself when cloning. So we don't need to pass them down to the checked out init subcommand. Further, the init subcommand has never actually done anything with those options, so there's no point in passing them. We'll be changing the latter behavior so that init will reset the url/branch when specified with an existing repo checkout which means passing them through adds overhead: the launcher will checkout to the right value, then chain to the sub-init which will then reset the checkout to the same value. Bug: https://crbug.com/gerrit/11045 Change-Id: Ia2a4ab9d86febc470aea4abd73d75bb10e848b56 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259312 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* init: respect --repo-url changesMike Frysinger2020-03-171-0/+8
| | | | | | | | | | | | We respect this option when running the first `repo init`, but then silently ignore it once the initial sync is done. Make sure users are able to change things on the fly. Bug: https://crbug.com/gerrit/11045 Change-Id: I129ec5fec43a85067d555bb60c0d1ae02465f139 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258893 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* sync: warn if not tracking a branchMike Frysinger2020-03-171-0/+7
| | | | | | | | | | | Since tracking a branch prevents repo from updating, make sure we warn people about the situation when using `repo sync`. Bug: https://crbug.com/gerrit/11045 Change-Id: I966513f510827cc93194f8df176c6745946bd739 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258892 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* subcmds: stop instantiating at import timeMike Frysinger2020-03-174-8/+9
| | | | | | | | | | | | | | | | | | The current subcmds design has singletons in all_commands. This isn't exactly unusual, but the fact that our main & help subcommand will then attach members to the classes before invoking them is. This makes it hard to keep track of what members a command has access to, and the two code paths (main & help) attach different members depending on what APIs they then invoke. Lets pull this back a step by storing classes in all_commands and leave the instantiation step to when they're used. This doesn't fully clean up the confusion, but gets us closer. Change-Id: I6a768ff97fe541e6f3228358dba04ed66c4b070a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259154 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* subcmds: centralize all_commands logicMike Frysinger2020-03-173-10/+9
| | | | | | | | | | | | | | | The branch->branches alias is setup in the main module when that really belongs in the existing all_commands setup. For help, rather than monkey patching all_commands to the class, switch it to use the state directly from the module. This makes it a bit more obvious where it's coming from rather than this one subcommand having a |commands| member added externally to it. Change-Id: I0200def09bf4774cad8012af0f4ae60ea3089dc0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259153 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* upload: add config setting for upload notificationsMike Frysinger2020-03-152-1/+15
| | | | | | | | | | This allows people to set default e-mail notifications via gitconfig. Bug: https://crbug.com/gerrit/12451 Change-Id: Ic04ea3b7df0c5603c491961112c5be8cabb9dddd Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259014 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* repo/init/sync: rework default git download outputMike Frysinger2020-03-142-10/+15
| | | | | | | | | | | | | | | | When we download git sources, we get a progress bar (good) and we get a dump of all the refs we downloaded (bad) as it can easily be 100+ if not 1000+ depending on the project (for each git repo!). Lets rework the output behavior so that: * quiet: Only errors. * default: Progress bars (if on a tty). * verbose: Full output (progress bars & downloaded refs). Bug: https://crbug.com/gerrit/11293 Change-Id: I87a380075e79de6805f91095876dd1b37d32873a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256456 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Michael Mortensen <mmortensen@google.com>
* manifest_xml: unify bool & int parsingMike Frysinger2020-03-132-55/+127
| | | | | | | | | | | | | | | | | We've been overly lenient with boolean parsing by ignoring invalid values as "false" even if the user didn't intend that. Turn all unknown values into warnings to avoid breaking existing manifests, and unify the parsing logic in a helper to simplify. We've been stricter about numbers, but still copying & pasting inconsistent code. Add a helper for this too. For out of range sync-j numbers (i.e. less than 1), throw a warning for now, but mark it for future hard failures. Change-Id: I924162b8036e6a5f1e31b6ebb24b6a26ed63712d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256457 Reviewed-by: Michael Mortensen <mmortensen@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* Reland "Port _FileDescriptorStreamsNonBlocking to use poll()"Theodore Dubois2020-03-131-3/+15
| | | | | | | | | | | Now that repo 2 requires Python 3, we can reland this. This reverts commit 91d9587e45608a5f95cd842426b43452a60abb5e. Change-Id: Id5b178ebb53bdba04bfa79cbb5c698ae5080c957 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258672 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Theodore Dubois <tbodt@google.com>
* diffmanifests: honour --pretty-format when printing --rawConnor Newton2020-03-131-3/+3
| | | | | | | | | | Enable using --pretty-format to build a custom subject line even when using the --raw option. Change-Id: I0c1e682d984e56698fe65939aa6de12a653cd0f1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258565 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Connor Newton <connor@ifthenelse.io>
* sync: fix os.environ logic errorsMike Frysinger2020-03-071-3/+3
| | | | | | | | | This is a dict to index, not a function to call. Change-Id: I0117eeaaa8b2ef4762ab6f0d22f9ffdaee961f52 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258132 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* launcher: warn when verification is disabledMike Frysinger2020-03-011-0/+3
| | | | | | | | | | Make it clear(er) to the user that this option is dangerous. Bug: https://crbug.com/gerrit/11045 Change-Id: I5580996c26653a7c823b69008de3626abf1b0068 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/257333 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* project: fix m/ pseudo ref handling with git worktreesMike Frysinger2020-02-292-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since most ref namespaces are shared among all worktrees, trying to set the pseudo m/<branch> in the common git repo ends up clobbering each other when using shared checkouts. For example, in CrOS: <project path="src/third_party/kernel/v3.8" name="chromiumos/third_party/kernel" revision="refs/heads/chromeos-3.8" /> <project path="src/third_party/kernel/v3.10" name="chromiumos/third_party/kernel" revision="refs/heads/chromeos-3.10" /> Trying to set m/master in chromiumos/third_party/kernel.git/ will keep clobbering the other. Instead, when using git worktrees, lets set the m/ pseudo ref to point into the refs/worktree/ namespace which is unique to each git worktree. So we have in the common dir: chromiumos/third_party/kernel.git/: refs/remotes/m/master: ref: refs/worktree/m/master And then in each worktree we point refs/worktree/m/master to the respective manifest revision expression. Now people can use the m/master in each git worktree and have it resolve to the right commit for that worktree. Bug: https://crbug.com/gerrit/12404 Change-Id: I78814bdd5dd67bb13218c4c6ccd64f8a15dd0a52 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256952 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* release: add tips for when to push prod changesMike Frysinger2020-02-291-2/+11
| | | | | | | Change-Id: Iabfdd322acbc60ee16e5222ecdb261cd3a3c2cf9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/257332 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* README: use new bug templateMike Frysinger2020-02-261-1/+1
| | | | | | | | | This will prefill all the settings so users can report things better. Change-Id: I1ccfd3a2c6835489db1fd2ba71aee39058ffe597 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256872 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* main: improve launcher update messaging wrt system installsMike Frysinger2020-02-261-4/+12
| | | | | | | | | | | | Some users get repo from their distro (e.g. /usr/bin/repo), so the suggestion to copy over top of it makes people uneasy, if it's even possible in the first place. Bug: https://crbug.com/gerrit/12335 Change-Id: I9a0c83d6ba0f466fa8e6d61f674ee13396f9a968 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256893 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* launcher/version: include OS/CPU info in outputMike Frysinger2020-02-252-0/+11
| | | | | | | | | | We often ask users what OS/version they're running when debugging. Include that in the version output to simplify the process. Change-Id: Ie480b6d1c874e6f4c6f4996a03795077b844f858 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256732 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* upload: drop support for draftsMike Frysinger2020-02-252-14/+2
| | | | | | | | | Draft CLs were replaced by private/wip CLs in Gerrit instead years ago. Change-Id: If4f3d6606aad40a6f1617a49681dfd45c64d3d37 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256673 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* README: link to mailing list & add Contact sectionMike Frysinger2020-02-241-0/+17
| | | | | | | Change-Id: I65834e74c1c74f257d17b9da84b00e855ad42599 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256464 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* upload: allow users to set labels when uploadingMike Frysinger2020-02-243-11/+39
| | | | | | | | | Bug: https://crbug.com/gerrit/11801 Change-Id: I060465105b4e68ddfc815e572f62bf5dac2c1ffd Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256614 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* manifest_xml: skip config lookup during first initv2.4.1Mike Frysinger2020-02-241-1/+1
| | | | | | | | | | | | | | | Trying to use the config state when the git tree hasn't yet been created hits bad side effects. Add a check to avoid probing the config logic during the first run. It's not clear what's going wrong at the lower layers, but this gets us back to the behavior before we added worktree support, so lets settle the status quo. Bug: https://crbug.com/gerrit/12387 Change-Id: I85b56797455f3c2e249d02c18496e060be05501d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256592 Reviewed-by: Xin Li <delphij@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: replace GetHeadPath with new git helperv2.4Mike Frysinger2020-02-241-14/+3
| | | | | | | Change-Id: I79931cb484508c78f6a8b8413d05b85ed8bc6d98 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256533 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* project: fix rebase check with worktreesMike Frysinger2020-02-241-8/+23
| | | | | | | | | | Add a helper to our git wrapper to find the .git subdir, and then use that to detect internal rebase state. Change-Id: I3b3b6ed4c1f45cc8c3c98dc19c7ca3aabdc46905 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256532 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* manifest: support optional --manifest-nameSean McAllister2020-02-221-1/+7
| | | | | | | | | | | Still use the repo manifest by default as before, but gives us the option of overriding it to support e.g.: using a subset of the full manifest. Change-Id: Ia42cd1cb3a0a58929d31bb01c9724e9d31f68730 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256372 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Sean McAllister <smcallis@google.com>
* repo/init: improve basic progress messagesMike Frysinger2020-02-222-6/+9
| | | | | | | | | | | | | We produce some simple "Get" messages that aren't super clear as to what they're doing, especially for people not familiar with repo. Rephrase these to explicitly state the thing we're doing so it's clear why we're downloading a particular source. Bug: https://crbug.com/gerrit/11293 Change-Id: I0749504f17c5385c6c65274a274e0ae25b117413 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256455 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* repo/init: add --verbose flagsMike Frysinger2020-02-222-12/+23
| | | | | | | | | | We don't use these for much yet, but init passes it down to the project sync layers which already has support for verbose mode. Change-Id: I651794f1b300be1688eeccf3941ba92c776812b5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256454 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
* repo: show redirects when tracing commandsMike Frysinger2020-02-221-1/+10
| | | | | | | | | | This copies the output style we use in git_command for showing output and input redirections. Change-Id: I449b27e7b262e1b30b24333109a1d91d9c7b1ce7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256453 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* docs: update Windows infoMike Frysinger2020-02-221-4/+29
| | | | | | | | | | Add a section on worktrees to avoid symlink problems, and note that Python 3 is now a hard requirement. Change-Id: I83811db88692127c40cec8270f6f9486c639dc3f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256314 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* init: hide summary output when using --quietMike Frysinger2020-02-221-15/+19
| | | | | | | Change-Id: I5e30a6d6a1c95fb8d75d8b0f4d63b497e9aac526 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256452 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* project: fix worktree init under WindowsMike Frysinger2020-02-221-0/+3
| | | | | | | | | | | Git likes to create .git files with read-only permissions which makes it difficult to open+truncate+write in situ under Windows. Delete it before we write the file content to workaround. Change-Id: I3effd96525f0dfe0b90e298b6bf0b856ea26aa03 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256412 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* manifest_xml: change .repo/manifest.xml to a plain fileMike Frysinger2020-02-222-9/+31
| | | | | | | | | | | | | | | | Changing this to a file instead of using a symlink serves two purposes: * We can insert some comments & doc links to help users learn what this is for, discover relevant documentation, and to discourage them from modifying things. * Windows requires Administrator access to use symlinks. With this last change, Windows users can get repo client checkouts with the new --worktree option and not need symlinks anywhere at all. Which means they no longer need to be an Administrator in order to `repo sync`. Change-Id: I9bc46824fd8d4b0f446ba84bd764994ca1e597e2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256313 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* project: fallback to hardlinks with git hooksMike Frysinger2020-02-211-5/+9
| | | | | | | | | | | | | | Windows requires Administrator access to create symlinks. We can mitigate this a bit by falling back to hardlinks as those may be created by any user on the system. Do this with the git hooks as these are supposed to be internal only and people shouldn't be modifying them. If they do, they'll have to delink first. This seems worth it to allow repo usage without extra privileges. Change-Id: I996ea9c9238f7bd7d27d1d9b1f2786593bf75ef7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256312 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* release: import some helper scripts for managing official releasesMike Frysinger2020-02-215-0/+325
| | | | | | | Change-Id: I9abebfef5ad19f6a637bc3b12effea9dd6d0269d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256234 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* manifest/tests: get them passing under WindowsMike Frysinger2020-02-215-16/+45
| | | | | | | | | | | | | | We also need to check more things in the manifest/project handlers, and use platform_utils in a few places to address Windows behavior. Drop Python 2.7 from Windows testing as it definitely doesn't work and we won't be fixing it. Change-Id: I83d00ee9f1612312bb3f7147cb9535fc61268245 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256113 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* project: unify StartBranch flows behind git-update-refMike Frysinger2020-02-211-13/+5
| | | | | | | | | | | We're using this for git worktrees because it handles the .git file format, but it should work for all flows. Unify to simplify. This also fixes the worktree logic which duplicated .git/config settings. Change-Id: Ie3af2e206710859dccfc376b3593f415d6830738 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256034 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
* repo: fix up license textMike Frysinger2020-02-201-14/+14
| | | | | | | | | | | Switch the copyright holder to "The Android Open Source Project" to match all the other source files in the tree, and move it to the top of the file to match everything else we do. Change-Id: Ie15d8e2bc004a626e45f715271deeaf3919dc44a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256235 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* tests: add git_require coverageMike Frysinger2020-02-201-0/+48
| | | | | | | Change-Id: I0c8fb45f6d5808caf361240a3a0b68eef670eeaa Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256112 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* abandon: add support for --quietMike Frysinger2020-02-201-2/+8
| | | | | | | | | Also fix the normal output to write to stdout. Change-Id: I6c117eea9cec08f5be9a44b90dbe9bf1f824ec95 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256114 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* sync: Fix flake8 E125 and E129 warningsDavid Pursehouse2020-02-201-3/+3
| | | | | | | | | | | | | | - E129 visually indented line with same indent as next logical line - E125 continuation line with same indent as next logical line Fixed automatically by: autopep8 --in-place --select E125,E129 subcmds/sync.py Change-Id: Ia2f82f443e1e6a23ba22c6f9849c8485405aed0e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256092 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* main/repo: add support for subcommand aliasesMike Frysinger2020-02-202-1/+69
| | | | | | | | | This supports [alias] sections with repo subcommands just like git. Change-Id: Ie9235b5d4449414e6a745814f0110bd6af74ea93 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255833 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* git_config: add support for repo-specific settingsMike Frysinger2020-02-202-1/+16
| | | | | | | | | | | This allows people to write ~/.repoconfig/config akin to ~/.gitconfig and .repo/config akin to .git/config. This allows us to add settings specific to repo without mixing up git, and to persist in general. Change-Id: I1c6fbe31e63fb8ce26aa85335349c6ae5b1712c6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255832 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* project/sync: move DeleteProject helper to ProjectMike Frysinger2020-02-202-81/+120
| | | | | | | | | | | | Since deleting a source checkout involves a good bit of internal knowledge of .repo/, move the DeleteProject helper out of the sync code and into the Project class itself. This allows us to add git worktree support to it so we can unlock/unlink project checkouts. Change-Id: If9af8bd4a9c7e29743827d8166bc3db81547ca50 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256072 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: set core.repositoryFormatVersion=1 when using extensionsMike Frysinger2020-02-192-4/+21
| | | | | | | | | | | When using extensions, make sure we set the git repo format version so git knows to check the extension compatibility. We can add a helper to the Project API to simplify this and make it foolproof. Change-Id: I9ab6c32d92fe2b8e5df6e2b080ca71556332e909 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256035 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>