summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* main: fix pager logic after negation cleanupMike Frysinger2020-02-191-1/+1
| | | | | | | | | | | | | The pager setting is tristate (where None means "auto"), so make sure we still handle that setting. Change-Id: I89fe352572dd15922c61e3bb65ac33f847d01ee0 Test: `repo help upload` triggers the pager Test: `repo -p help upload` triggers the pager Test: `repo --no-pager help upload` doesn't trigger the pager Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255852 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* upload: improve no pending CL error handlingMike Frysinger2020-02-191-2/+6
| | | | | | | | | Show clearer messages and exit non-zero if there's nothing to upload. Change-Id: Icd9c13b9b1126610a409fc13d1d11bfc66f5e802 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255834 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* docs: add per-project review/remote/branch settingsMike Frysinger2020-02-191-1/+59
| | | | | | | Change-Id: Iae7dc438b4a145140b4e105a61024a11e30b2c2b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255792 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* avoid negative variablesMike Frysinger2020-02-197-32/+34
| | | | | | | | | | | Trying to use booleans with names like "no_xxx" are hard to follow due to the double negatives. Invert all of them so we only have positive meanings to follow. Change-Id: Ifd37d0368f97034d94aa2cf38db52c723ac0c6ed Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255493 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* Open temporary cookie file as writable in sync.pyCollin Fijalkovich2020-02-181-1/+1
| | | | | | | | | | | | | Named Temporary file defaults to mode 'w+b' which causes repo sync to fail. By opening the tmpcookiefile in PersistentTransport.request as writable, we are able to run sync successfully. Bug: https://crbug.com/gerrit/12370 Test: Ran smartsync successfully Change-Id: I01ddf915fc30eb3ff0e4d440a6f1aa261c63e88d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255692 Tested-by: Jonathan Nieder <jrn@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
* platform_utils: have Windows select stream return "" at EOFMike Frysinger2020-02-181-1/+1
| | | | | | | | | | This matches *NIX behavior where the last read is '', not None. Bug: https://crbug.com/gerrit/12329 Change-Id: I48b026b4d1b8d7c6abbce198757b970931869e1a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255352 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* main: add python version checkingMike Frysinger2020-02-181-0/+28
| | | | | | | | | | | | If an older launcher script is used with newer repo source tree, we might be issuing python version warnings. Plus, we want to be able to roll Python version requirements independently of the launcher. Add some version checking here too. Change-Id: Ia35fc821f93c429296bdf5fd578276fef796b649 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255592 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* resort a few module imports to follow PEP8Mike Frysinger2020-02-183-8/+9
| | | | | | | | | All the stdlib imports are supposed to come before any local imports. Change-Id: I10c0335ba2ff715fd34c9eb91bfe6560e904df08 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255593 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* project: Fix E125 continuation line with same indent as next logical lineDavid Pursehouse2020-02-181-5/+5
| | | | | | | Change-Id: I71d2b105baacf6968a29391e9e2a74bba1b4fd0b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255555 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* project: move successful fetch output behind verboseMike Frysinger2020-02-182-3/+10
| | | | | | | | | | | | | Syncing projects works fine the majority of the time. So rather than dump all of that noisy output to stdout, lets capture it and only show when things fail or in verbose mode. This tidies up the default `repo sync` output. Bug: https://crbug.com/gerrit/11293 Change-Id: I8314dd92e1e6aadeb26e36a8c92610da419684e6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255413 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* diff: delete unused nested funcMike Frysinger2020-02-171-4/+0
| | | | | | | Change-Id: I43ab4bc944269e43a6cd7b2ac350c09b7c700a6c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255492 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* sync: introduce --verbose optionMike Frysinger2020-02-172-25/+31
| | | | | | | | | | | | | This allows us to control sync output better by having three levels of output: quiet (only errors), default (progress bars), verbose (all the things). For now, we just put the chatty "already have persistent ref" message behind the verbose level. Bug: https://crbug.com/gerrit/11293 Change-Id: Ia61333fd8085719f3e99edb7b466cdb04031b67f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255414 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* project: disable stat output when fast forwarding mergesMike Frysinger2020-02-171-1/+1
| | | | | | | | | | Our sync output is pretty chatty, and the stat output on fast forward merges doesn't really help. Suppress it to tighten up the output. Change-Id: I91e50639b3cd8db9df3d13a7da6d1aaa70d7932f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255412 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* Update commit-msg hook to version from Gerrit 3.1.3David Pursehouse2020-02-171-173/+45
| | | | | | | | | | | | | | Includes the following commits (redacted to those that are relevant): da300bd9bd8 - Do not create a change id if gerrit.createChangeId == false 731eb42b8ae - Do not strip out "-- >8 --" comment in commit-msg hook 627d07c2bfc - Handle messages with only comments in the commit-msg hook 68296f71804 - Simplify the hook script using git-interpret-trailers Change-Id: I7a82836495427df3c5437ba88a9576b47629065f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255393 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* github: enable github actions for postsubmit testingMike Frysinger2020-02-163-0/+40
| | | | | | | | | | | | This gives us a bit of feedback by running our testsuite on Linux, macOS, and Windows platforms. While Linux & macOS are passing, Windows fails some of them. We can figure that out later. This is better than what we have now which is manual one-offs. Change-Id: I9d2d644be97ec76645db0bc15739e7679310a647 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255314 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* tox: get tests passing a bit on WindowsMike Frysinger2020-02-152-4/+10
| | | | | | | | | | | We need to use the path separators provided by the python library, and we need to set the git env vars so the name is always known. Not all tests pass, but at least the basic frameworks work now. Change-Id: Icea67098a8d7d58bbf918c78325681cf12a2e5f2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255313 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* README: add <> around linksMike Frysinger2020-02-151-5/+5
| | | | | | | | | | Some markdown renderers want <> around links to linkify them. Other renderers strip them out as redundant. Change-Id: Ib7f9962ce1dd47b4494a824c69358c75d98eb838 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255312 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* Reword the documentation regarding coding styleDavid Pursehouse2020-02-151-22/+13
| | | | | | | | | | | | | | | | | | | | | - flake8 is a wrapper around pyflakes, so it's redundant to mention both of them. Roll the explicit sections about coding errors and coding style violations into a single section. - After recent cleanups the project now has zero warnings or errors from flake8. Reword the requirements so that it is now mandatory to not introduce new warnings. - Expand the section on suppression of warnings to differentiate between suppressing inline individually and globally suppressing for the whole project. - Properly capitalize "Python Style Guide". Change-Id: I4b333d013e985db252873441b16cb719ed5be5b5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255040 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: handle bad programs a bit betterMike Frysinger2020-02-151-5/+13
| | | | | | | | | | | | | | If programs emit non-UTF-8 output, we currently throw a fatal error. We largely only care about the exit status of programs, and even the output we do parse is a bit minimal. Lets make it into a warning and mangle the invalid bytes into U+FFFD. This should complain enough to annoy but not to break when it's not necessary. Bug: https://crbug.com/gerrit/12337#c2 Change-Id: Idbc94f19ff4d84d2e47e01960dd17d5b492d4a8a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255272 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* flake8: Suppress "F821 undefined name" inline for Python 2 namesDavid Pursehouse2020-02-155-6/+6
| | | | | | | | | | | | | | | | All of the instances of this are related to Python 2 names that don't exist in Python 3, and the warnings are raised when running flake8 on Python 3. All of these will go away once we completely remove support for Python 2, so just suppress them inline. We don't globally suppress the check so that we will still see legitimate errors if/when they occur in new code. Change-Id: Iccf955f50abfc9f83b371fc0af6cceb51037456f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255039 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: rework gpg import for WindowsMike Frysinger2020-02-151-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some versions of gpg on Windows mishandle native paths with homedir. It manifests itself like: gpg: keybox 'C:\Users\.../.repoconfig\gnupg/pubring.kbx' created gpg: C:\Users\.../.repoconfig\gnupg/trustdb.gpg: trustdb created gpg: key 16530D5E920F5C65: public key "Repo Maintainer <repo@android.kernel.org>" imported gpg: can't connect to the agent: Invalid value passed to IPC gpg: Total number processed: 1 gpg: imported: 1 fatal: registering repo maintainer keys failed It seems gpg (at least version 2.2.17) needs paths to be specified in cygwin form (e.g. "/c/Users/.../.repoconfig/gnupg") otherwise it fails to talk to its own processes. We can work around this with a minor trick: we cd to the right path and then invoke gpg with --homedir . and let gpg itself resolve . to whatever form it really wants. This is a bit hacky, but we don't control gpg, and this allows us to avoid having to muck with the environment. Since --homedir has been around since at least gpg-1.4.x from 2004, backwards compat shouldn't be an issue. While we're here, touch up the output a bit: there's no need to dump all the chatty gpg output if things don't fail, so always swallow the output. If things do fail, our exception handler takes care of dumping the full stdout & stderr. Change-Id: I74ab98e1e61e95318fda6faf57c6a8699f775935 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255120 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* flake8: Suppress "E731 do not assign a lambda expression, use a def"David Pursehouse2020-02-151-0/+2
| | | | | | | | | | | | | The Google Python Style Guide [1] says that lambdas are OK for one-liners. All the current usages are one-liners, so let's just suppress it. [1] http://google.github.io/styleguide/pyguide.html#210-lambda-functions Change-Id: I404c7a8e5e71870caf0f4604862cbf01db495863 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255038 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: rework parser setup to handle `init -c`Mike Frysinger2020-02-142-28/+47
| | | | | | | | | | | | | | | | | | | | We added support for `repo init -c` to main.py, but not to the launcher, so the -c option only works after the first init has run which kind of defeats its purpose. Rework the parser setup so that we can tell it whether it's for "init" or "gitc-init" and then add the -c option in the same way we do in main.py. This has the benefit of getting the parser entirely out of the module scope which makes it a lot easier to reason about, and it means we can write some unittests. Change-Id: Icbc2ec3aceb938d5a8f941d5fbce1548553dc5f7 Test: repo help init Test: repo help gitc-init Test: repo init -u https://android.googlesource.com/platform/manifest -c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255113 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* repo: add some newer RSA/ECC signing keysMike Frysinger2020-02-141-4/+34
| | | | | | | | | | | | We've been using a DSA/1024 key to sign our tags. Time to update to something a bit newer. We'll include RSA & ECC keys, but only use RSA keys initially for backwards compatibility and see how it goes with our user base. Change-Id: I683c97b6fbd860f220ed4ddc7b21f07db279a916 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255112 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* repo: Fix warnings reported by flake8David Pursehouse2020-02-141-3/+5
| | | | | | | | | | repo:342:5: E306 expected 1 blank line before a nested definition, found 0 repo:617:5: F841 local variable 'ret' is assigned to but never used Change-Id: I364fdb5dac8ebaff398b848935fe8356cb9ed2d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255035 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* repo: add trace support to the launcherMike Frysinger2020-02-131-0/+24
| | | | | | | | | | Now that we have a central run_command point, we can easily add tracing support to the launcher script. Change-Id: I9e0335c196cafd6263ff501925abfe835f036c5e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254755 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* repo: add some helpers akin to subprocess.runMike Frysinger2020-02-131-138/+104
| | | | | | | | | | | We can't rely on subprocess.run yet as that requires Python 3.6, but we can clean up the code we have with some ad-hoc replacement. This unifies all the inconsistent subprocess.Popen usage we have. Change-Id: I56af40a3df988ee47b299105d692ff419d07ad6b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254754 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* pyflakes: Fix remaining "E501 line too long" warningsDavid Pursehouse2020-02-136-6/+12
| | | | | | | | | | | We increased the max line length to 100 columns which got rid of the majority of these warnings, but there were still a few lines that exceeded 100 columns. Change-Id: Ib3372868ca2297f83073a14f91c8ae3df9d0d0e6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254699 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* Update .mailmapDavid Pursehouse2020-02-131-0/+1
| | | | | | | Change-Id: I502a07e7702b73db9f0933cbfd4007c119e3463a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254700 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* project: Don't emit locally modified hook warning in quiet modeDavid Pursehouse2020-02-131-10/+12
| | | | | | | Change-Id: I0f6db037b85f2a015fc7b7fd37472df848a58266 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254698 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Mention exceptions to Google Style Guide in SUBMITTING_PATCHES.mdDavid Pursehouse2020-02-131-3/+8
| | | | | | | Change-Id: I05d313c66f312942405a884a54118cb1d7af1bac Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254671 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* Don't format version to 5 characters in new version messageDavid Pursehouse2020-02-131-1/+1
| | | | | | | Change-Id: I6c734170173f77a6fef0678f189e198bdaeec425 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254668 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* Replace 'A new repo command' with 'A new version of repo'David Pursehouse2020-02-131-2/+2
| | | | | | | Change-Id: I3288f5c963b69d05d113fc039e4b4f22721f1de9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254667 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: Remove duplicate import of 'os'David Pursehouse2020-02-131-1/+0
| | | | | | | Change-Id: I9874a5deacdb6a8ce98a8a383326a5b41b1518df Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254697 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* repo: Remove another usage of bare 'except'David Pursehouse2020-02-131-1/+1
| | | | | | | Change-Id: I9195b40f5af7cbf74b47376a4708de82495f8fba Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254696 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* repo: Remove unused variable in 'except'David Pursehouse2020-02-131-1/+1
| | | | | | | Change-Id: I90f89ed6638a3d2a9e665ebbedef5dd7902f5429 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254695 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* repo: Fix blank line issues reported by flake8David Pursehouse2020-02-131-0/+3
| | | | | | | Change-Id: I62633e71a36b2acbd09e205447a02159dd334896 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254694 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* repo: bump launcher version for accumulated fixesv2.3Mike Frysinger2020-02-121-1/+1
| | | | | | | Change-Id: I5d9b866cc53d3824a01f5f0af127cf0c3ff97366 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254757 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* repo: avoid bare excepts to allow SystemExit to bubbleMike Frysinger2020-02-121-1/+1
| | | | | | | | Bug: https://crbug.com/gerrit/12327 Change-Id: I4ce1142379b111f9ba3a2e5a437026e5c0378a9e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254756 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* sync: add a "finished" messageMike Frysinger2020-02-121-0/+3
| | | | | | | | | | | | | Some people find the existing output to be a bit confusing. It spews a lot of git output before exiting, but it's not exactly clear what the final state is when things pass. Add an explicit message. Bug: https://crbug.com/gerrit/10501 Change-Id: I9de83b595d3185feb820005b8fc81c6adc55b357 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254732 Reviewed-by: Michael Mortensen <mmortensen@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* repo: add --version support to the launcherMike Frysinger2020-02-123-1/+38
| | | | | | | | | | | We can get version info when in a checkout, but it'd be helpful to show that info at all times. Change-Id: Ieeb44a503c9d7d8c487db4810bdcf3d5f6656c82 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254712 Reviewed-by: Michael Mortensen <mmortensen@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* repo: export GIT_TRACE2_PARENT_SIDMike Frysinger2020-02-122-13/+84
| | | | | | | | | | | | | This helps with people tracing repo/git execution. We use a similar format to git, but a little simpler since we always initialize the env var setting, and we want to avoid too much overhead. Bug: https://crbug.com/gerrit/12314 Change-Id: I75675b6cc4c6f7c4f5e09f54128eba9456364d04 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254331 Reviewed-by: Josh Steadmon <steadmon@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* flake8: Add comments in config to explain suppressed checksDavid Pursehouse2020-02-121-1/+11
| | | | | | | Change-Id: Ib5c09b36d40a96ba9167b42b3bd2f1ed072660b7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254611 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: move parser init out of module scopeMike Frysinger2020-02-121-82/+68
| | | | | | | | | | | We import the wrapper on the fly, so minimize how much code we run in module scope. It's pointless/wasted when importing. Change-Id: I4a71c2030325d0a639585671cd7ebe8f22687ecd Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254072 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* drop old git_require checksMike Frysinger2020-02-123-7/+3
| | | | | | | | | | We've been requiring git-1.7.2 since Oct 2012, so we can safely drop the individual checks sprinkled throughout the code base for older. Change-Id: I1737fff7b3f27f475960b0bff9cb300aefd5d108 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253135 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* flake8: Ignore 'line break before/after binary operator'David Pursehouse2020-02-121-1/+1
| | | | | | | | | | | | | | - W503 line break before binary operator - W504 line break after binary operator There doesn't seem to be a nice way of fixing all of these without replacing W503 with W504 or vice-versa, or unwrapping them resulting in excessively long lines. Let's just suppress them. Change-Id: I7846d0124054f58e1cb480d4459cd9c86b737a50 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254608 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* git_config: Stop using backslash to wrap linesDavid Pursehouse2020-02-121-7/+6
| | | | | | | | | | Unwrap one unnecessarily wrapped line, and use parentheses on a wrapped condition instead of wrapping with backslashes. Change-Id: I12679a0547dd822b15a6551e0f6c308239ff7b2d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254607 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix usage of bare 'except'David Pursehouse2020-02-123-6/+6
| | | | | | | | | | | | | | | | | | | | | | flake8 reports: E722 do not use bare 'except' Replace them with 'except Exception' per [1] which says: Bare except will catch exceptions you almost certainly don't want to catch, including KeyboardInterrupt (the user hitting Ctrl+C) and Python-raised errors like SystemExit If you don't have a specific exception you're expecting, at least except Exception, which is the base type for all "Regular" exceptions. [1] https://stackoverflow.com/a/54948581 Change-Id: Ic555ea9482645899f5b04040ddb6b24eadbf9062 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254606 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix blank line issues reported by flake8David Pursehouse2020-02-1243-12/+148
| | | | | | | | | | | | | | | | | | | | - E301 expected 1 blank line - E302 expected 2 blank lines - E303 too many blank lines - E305 expected 2 blank lines after class or function definition - E306 expected 1 blank line before a nested definition Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E301,E302,E303,E305,E306 Manually fix issues in project.py caused by misuse of block comments. Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix indentation issues reported by flake8David Pursehouse2020-02-1219-133/+133
| | | | | | | | | | | | | | | | | | | | | - E121 continuation line under-indented for hanging indent - E122 continuation line missing indentation or outdented - E125 continuation line with same indent as next logical line - E126 continuation line over-indented for hanging indent - E127 continuation line over-indented for visual indent - E128 continuation line under-indented for visual indent - E129 visually indented line with same indent as next logical line - E131 continuation line unaligned for hanging indent Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E121,E122,E125,E126,E127,E128,E129,E131 Change-Id: Ifd95fb8e6a1a4d6e9de187b5787d64a6326dd249 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254605 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>