1. 23 Aug, 2016 1 commit
  2. 19 Aug, 2016 1 commit
  3. 17 Aug, 2016 4 commits
  4. 16 Aug, 2016 4 commits
    • Jonathan Nieder's avatar
    • Mike Frysinger's avatar
      RepoHook: allow users to approve hooks via manifests · 40252c20
      Mike Frysinger authored
      The constant prompting when registered hooks change can be tedious and
      has a large multiplication factor when the project is large (e.g. the
      AOSP).  It gets worse as people want to write more checks, hooks, docs,
      and tests (or fix bugs), but every CL that goes in will trigger a new
      prompt to approve.
      
      Let's tweak our trust model when it comes to hooks.  Since people start
      off by calling `repo init` with a URL to a manifest, and that manifest
      defines all the hooks, anchor trust in that.  This requires that we get
      the manifest over a trusted link (e.g. https or ssh) so that it can't
      be MITM-ed.  If the user chooses to use an untrusted link (e.g. git or
      http), then we'll fallback to the existing hash based approval.
      
      Bug: Issue 226
      Change-Id: I77be9e4397383f264fcdaefb582e345ea4069a13
      40252c20
    • David Pursehouse's avatar
      project: Set config option to skip lfs smudge filter · 76a4a9df
      David Pursehouse authored
      During sync, repo runs `git read-tree --reset -u -v HEAD` which causes
      git-lfs's smudge filter to run. However this fails because git-lfs does
      not work with bare repositories.
      
      Add lfs.filter configuration to the project config as suggested in the
      comments on the upstream git-lfs client issue [1]. This prevents the
      smudge filter from running, and the sync completes successfully.
      
      For any projects that have LFS objects, `git lfs pull` must be executed.
      
      [1] https://github.com/github/git-lfs/issues/1422
      
      Bug: Issue 224
      Change-Id: I091ff37998131e2e6bbc59aa37ee352fe12d7fcd
      76a4a9df
    • Mike Frysinger's avatar
      improve docs · befaec1e
      Mike Frysinger authored
      Change-Id: Ide4008f09c2f17f8fb3d85dfffe94544abfdd6a6
      befaec1e
  5. 15 Aug, 2016 3 commits
  6. 14 Aug, 2016 1 commit
  7. 16 Jul, 2016 1 commit
  8. 29 Jun, 2016 3 commits
  9. 28 Jun, 2016 1 commit
    • Aymen Bouaziz's avatar
      Fix variable assignment · 037040f7
      Aymen Bouaziz authored
      If upstream string is empty, current_branch_only variable will be assigned
      to an empty string.
      
      This is not what we expect here as this variable is a boolean.
      
      Change-Id: Ibba935e25a74c2be1e50c88b4b403cf394ba365e
      037040f7
  10. 22 Jun, 2016 1 commit
    • Fredrik Berggren's avatar
      Adds additional crlf clobber avoidance. · 01952e66
      Fredrik Berggren authored
      Adds the hook-scripts to .gitattributes due to the shell-scripts not
      liking CRLF which they will get if a user sets 'autocrlf = true'
      in their global gitconfig.
      
      Further, since the python interpreter can handle either CRLF or LF, 
      python-scripts specific line-ending rules have been removed.
      
      Change-Id: I2d6bfd491b2f626b9ca93c40a3a7f2cfba6c54f0
      01952e66
  11. 21 Jun, 2016 1 commit
    • Stefan Beller's avatar
      pylint: Fix unused-{argument,variable} warning · 9d2b14d2
      Stefan Beller authored
      
      This commit fixes 4 out of the remaining 5 pylint warnings:
      
      $ pylint --rcfile=.pylintrc *.py
      ************* Module gitc_utils
      W:146, 0: TODO(sbasi/jorg): Come up with a solution to remove the sleep below. (fixme)
      W:130, 6: Unused variable 'name' (unused-variable)
      ************* Module main
      W:382,32: Unused argument 'fp' (unused-argument)
      W:382,36: Unused argument 'code' (unused-argument)
      W:382,42: Unused argument 'msg' (unused-argument)
      
      Change-Id: Ie3d77b9a65b7daefaa9aa4b80f4b682c1678fd58
      Signed-off-by: default avatarStefan Beller <sbeller@google.com>
      9d2b14d2
  12. 17 Jun, 2016 2 commits
    • Stefan Beller's avatar
      pylint: fix indentation in manifest_xml · 66851063
      Stefan Beller authored
      
      This fixes pylint warning:
      
      ************* Module manifest_xml
      W:975, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)
      
      Change-Id: I967212f9439430351836ebdc27e442d7b77476e2
      Signed-off-by: default avatarStefan Beller <sbeller@google.com>
      66851063
    • Stefan Beller's avatar
      pylint: ignore bad-whitespace · d64e8eee
      Stefan Beller authored
      
      This ignores whitespaces errors, which we have quite a few of in argument
      lists, for example:
      
      ************* Module git_config
      C:209, 0: No space allowed around keyword argument assignment
        def HasSection(self, section, subsection = ''):
                                                 proxy_http_version 1.1; (bad-whitespace)
      C:320, 0: No space allowed around keyword argument assignment
                         capture_stdout = True,
                                        proxy_http_version 1.1; (bad-whitespace)
      C:321, 0: No space allowed around keyword argument assignment
                         capture_stderr = True)
                                        proxy_http_version 1.1; (bad-whitespace)
      C:427, 0: Exactly one space required after comma
                           '-o','ControlPath %s' % ssh_sock(),
                               proxy_http_version 1.1; (bad-whitespace)
      C:436, 0: Exactly one space required after comma
          check_command = command_base + ['-O','check']
                                              proxy_http_version 1.1; (bad-whitespace)
      C:464, 0: Exactly one space required after comma
                   % (host,port, str(e)), file=sys.stderr)
                          proxy_http_version 1.1; (bad-whitespace)
      C:707, 0: No space allowed around keyword argument assignment
          return self._config.GetString(key, all_keys = all_keys)
                                                      proxy_http_version 1.1; (bad-whitespace)
      C:759, 0: No space allowed around keyword argument assignment
          return self._config.GetString(key, all_keys = all_keys)
                                                      proxy_http_version 1.1; (bad-whitespace)
      
      Change-Id: Ia8f154f6741ce609787551f65877d7584c457903
      Signed-off-by: default avatarStefan Beller <sbeller@google.com>
      d64e8eee
  13. 22 Apr, 2016 2 commits
  14. 21 Apr, 2016 1 commit
  15. 18 Apr, 2016 1 commit
  16. 13 Apr, 2016 2 commits
  17. 08 Apr, 2016 1 commit
    • Mark E. Hamilton's avatar
      repo: Repo does not always handle '.' parameter correctly · f9fe3e14
      Mark E. Hamilton authored
      The repo script allows a manifest to specify a '.' as the path the
      top-level directory, which co-locates the .git and .repo directories,
      and places files from the git repository at the top-level:
      
        <project name="proj_name" path="." />
        <project name="sierra.other.git" path="other" />
      
      Most commands work correctly with this setup. Some commands, however,
      fail to find the project. For instance, 'repo sync' works, and 'repo sync .'
      works in a sub-project ('other' in this case) but 'repo sync .' in the
      top-level directory fails with the error:
      
      error: project . not found
      
      There are two reasons for this:
      
      1. The self.worktree attribute of the Project object is not normalized,
      so with a '.' for path its value would be '/my/project/root/.'. This is
      fine when used as a path, since it's the same path as '/my/project/root',
      but when used in a string comparison it fails. This commit applies
      os.path.normpath() to that value before storing it.
      
      2. The _GetProjectByPath method in command.py was not checking the path
      against manifest.topdir, so even once it was normalized the project was
      not found. This commit adds a check against manifest.topdir if the
      loop drops out without finding a project.
      
      Change-Id: Ic84d053f1bbb5a357cad566805d5a326ae8246d2
      f9fe3e14
  18. 06 Apr, 2016 1 commit
    • Dan Willemsen's avatar
      Fix symlinking of new projects · bdb866ea
      Dan Willemsen authored
      We weren't copying these lists, so the += was actually changing the
      underlying lists.
      
      When a new project was added to the manifest, we run _CheckDirReference
      against the manifest project with share_refs=True, which added the
      working_tree_* to the shareable_* lists. Then, when we load the new
      manifest and create the new project, it uses the lists that already
      contain the working_tree_* files, even though we passed
      share_refs=False.
      
      This happens reliably under the above conditions, but doesn't seem to
      happen when syncing a fresh tree. So we've got a mixture of links that
      may need to be cleaned up later. This patch will just stop it from
      happening in the future.
      
      Change-Id: Ib7935bfad78af1e494a75e55134ec829f13c2a41
      bdb866ea
  19. 05 Apr, 2016 2 commits
  20. 15 Mar, 2016 1 commit
  21. 14 Mar, 2016 1 commit
  22. 05 Mar, 2016 1 commit
    • Mike Frysinger's avatar
      RepoHook: set __file__ when running the hook · 4aa4b211
      Mike Frysinger authored
      A common design pattern is to use __file__ to find the location of the
      active python module to assist in output or loading of related assets.
      The current hook systems runs the pre-upload.py hook in a context w/out
      that set leading to runtime errors:
      
      $ repo upload --cbr .
      ERROR: Traceback (most recent call last):
        File ".../repo/project.py", line 481, in _ExecuteHook
          self._script_fullpath, 'exec'), context)
        File ".../repohooks/pre-upload.py", line 32, in <module>
          path = os.path.dirname(os.path.realpath(__file__))
      NameError: name '__file__' is not defined
      
      Define this variable in this context so code can safely use it.
      
      Change-Id: If6331312445fa61d9351b59f83abcc1c99ae6748
      4aa4b211
  23. 02 Mar, 2016 2 commits
    • Mark E. Hamilton's avatar
      command.py: Cleaned up pylint/pep8 violations · 8ccfa74d
      Mark E. Hamilton authored
      I noticed when running pylint (as the SUBMITTING_PATCHES file directs)
      that there were a few violations reported. This makes it difficult
      to see violations I might have introduced. This commit corrects all
      pylint violations in the command.py script.
      
      This script now has a pylint score of 10.0.
      
      Change-Id: Ibb35fa9af0e0b9b40e02ae043682b3af23286748
      8ccfa74d
    • Mark E. Hamilton's avatar
      project.py: Cleaned up pylint/pep8 violations · 30b0f4e0
      Mark E. Hamilton authored
      I noticed when running pylint (as the SUBMITTING_PATCHES file directs)
      that there were a number of violations reported. This makes it difficult
      to see violations I might have introduced. This commit corrects all
      pylint violations in the project.py script.
      
      This script now has a pylint score of 10.0, and no violations reported
      by pep8.
      
      Change-Id: I1462fd84f5b6b4c0dc893052671373e7ffd838f1
      30b0f4e0
  24. 27 Feb, 2016 1 commit
  25. 18 Feb, 2016 1 commit
    • Alexandre Garnier's avatar
      Better error display on forall · 4cfb6d71
      Alexandre Garnier authored
      It was only displaying 'Project list error: GitError()'
      without any useful info about the project nor the error
      
      Change-Id: Iad66cbaa03cad1053b5ae9ecc90d7772aa42ac13
      4cfb6d71