Skip to content
  1. Feb 16, 2020
    • Mike Frysinger's avatar
      README: add <> around links · c102fd5c
      Mike Frysinger authored
      
      
      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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Tested-by: default avatarMike Frysinger <vapier@google.com>
      c102fd5c
    • David Pursehouse's avatar
      Reword the documentation regarding coding style · d6b8bd46
      David Pursehouse authored
      
      
      - 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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      d6b8bd46
    • Mike Frysinger's avatar
      repo: handle bad programs a bit better · 6a784ff9
      Mike Frysinger authored
      
      
      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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Tested-by: default avatarMike Frysinger <vapier@google.com>
      6a784ff9
  2. Feb 15, 2020
    • David Pursehouse's avatar
      flake8: Suppress "F821 undefined name" inline for Python 2 names · a46bf7dc
      David Pursehouse authored
      
      
      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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      a46bf7dc
    • Mike Frysinger's avatar
      repo: rework gpg import for Windows · 19a1f22c
      Mike Frysinger authored
      
      
      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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Tested-by: default avatarMike Frysinger <vapier@google.com>
      19a1f22c
    • David Pursehouse's avatar
      flake8: Suppress "E731 do not assign a lambda expression, use a def" · 076512aa
      David Pursehouse authored
      
      
      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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      076512aa
  3. Feb 14, 2020
    • Mike Frysinger's avatar
      repo: rework parser setup to handle `init -c` · d8fda90e
      Mike Frysinger authored
      
      
      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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Tested-by: default avatarMike Frysinger <vapier@google.com>
      d8fda90e
    • Mike Frysinger's avatar
      repo: add some newer RSA/ECC signing keys · 9cc1d704
      Mike Frysinger authored
      
      
      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: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Tested-by: default avatarMike Frysinger <vapier@google.com>
      9cc1d704
    • David Pursehouse's avatar
      repo: Fix warnings reported by flake8 · c19cc5c5
      David Pursehouse authored
      
      
        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: default avatarMike Frysinger <vapier@google.com>
      Tested-by: default avatarDavid Pursehouse <dpursehouse@collab.net>
      c19cc5c5
  4. Feb 13, 2020
  5. Feb 12, 2020