Skip to content
  1. Jan 05, 2024
  2. Nov 12, 2020
  3. Nov 04, 2020
    • Remy Bohmer's avatar
      Move RepoHook class from project.py file to dedicated file · 16c1328f
      Remy Bohmer authored
      
      
      The project.py file is huge and contains multiple
      classes. By moving it to seperate class files the code
      becomes more readable and maintainable.
      
      Signed-off-by: default avatarRemy Bohmer <github@bohmer.net>
      Change-Id: Ida9d99d31751d627ae1ea0373418080696d2e14b
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/281293
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      Tested-by: default avatarRemy Bohmer <linux@bohmer.net>
      16c1328f
    • Jonathan Nieder's avatar
      launcher: simplify .repo search ceiling check · 6248e0fd
      Jonathan Nieder authored
      In the .repo discovery loop
      
        while curdir != '/' and curdir != olddir:
          ... break if we found .repo ...
          olddir = curdir
          curdir = os.path.dirname(curdir)
      
      the "while" condition is meant to avoid searching forever if we do not
      find .repo before reaching the top-level directory of the filesystem.
      For that purpose, the first half of the condition is redundant; once
      we reach "/", the parent directory will be "/" again and the curdir !=
      olddir check would suffice to terminate the search.  Simplify by
      removing the redundant first half of the check.
      
      Noticed by code inspection.  The first half of the check was retained
      when introducing the second half in df14a70c
      
       ("Make path references OS
      independent", 2011-01-09), in an excess of caution.
      
      This also improves consistency a little: if I start with curdir =
      '/home/me', then with the redundant check in place we search
      
      	/home/me
      	/home
      
      before hitting / and giving up.  On Windows, if I start with
      'c:/users/me', then we search
      
      	c:/users/me
      	c:/users
      	c:/
      
      before hitting a repetition and giving up.  Fortunately it is not
      common for people to set up repo clients at the top level of
      filesystems, but consistently following the latter behavior should
      make debugging a little easier in case it comes up.
      
      Link: https://gerrit-review.googlesource.com/id/Ib9e830e3b9adfb1c4e56f3bcfba4746c401fb84f
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/286002
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      Tested-by: default avatarJonathan Nieder <jrn@google.com>
      6248e0fd
  4. Sep 09, 2020
  5. Sep 07, 2020
  6. Sep 02, 2020
    • Mike Frysinger's avatar
      init: reject unknown args · 0578ebf6
      Mike Frysinger authored
      
      
      If you pass args to `repo init` when first creating a checkout, the
      repo launcher throws an error.  But the init subcommand that runs in
      an existing checkout silently ignores them.  Throw a proper error.
      
      Change-Id: I433bfcc73902d25f6b6a2974e77f6a977a75ed16
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/279696
      Reviewed-by: default avatarJonathan Nieder <jrn@google.com>
      Tested-by: default avatarMike Frysinger <vapier@google.com>
      0578ebf6
  7. Jul 31, 2020
  8. Jul 25, 2020
  9. Jul 23, 2020
  10. Jun 07, 2020
  11. May 26, 2020
    • Mike Frysinger's avatar
      manifest: normalize name & path when constructing fs paths · cebf2270
      Mike Frysinger authored
      
      
      If the manifest uses a trailing slash on the name attribute, repo
      will construct bad internal filesystem paths which confuses tools
      later on.
      
      For example, this manifest entry:
        <project name="aosp/platform/system/libhidl/" ...
      will cause repo to use paths like:
        .repo/project-objects/aosp/platform/system/libhidl/.git/
      when it really should be using:
        .repo/project-objects/aosp/platform/system/libhidl.git
      
      Apply the normalization when we construct the local filesystem paths
      as we cannot guarantee that the remote URL constructed from these
      will behave the same.  A server might really want:
        https://example.com/aosp/platform/system/libhidl/
      and would throw an error if we instead tried to fetch:
        https://example.com/aosp/platform/system/libhidl
      
      Unfortunately, any existing repo client checkouts that use such a
      manifest will hit a one-time sync error as the internal git location
      has changed.  I'm not sure there's a way to cleanly migrate that.
      
      Bug: https://crbug.com/1086043
      Change-Id: I30bea0ffd23e478de89a035f408055e48a102658
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/268742
      Tested-by: default avatarMike Frysinger <vapier@google.com>
      Reviewed-by: default avatarDavid Pursehouse <dpursehouse@digital.ai>
      cebf2270
  12. May 25, 2020
  13. May 22, 2020
  14. May 19, 2020
    • Sean McAllister's avatar
      Fix how we format the full destination branch when uploading. · 682f0b64
      Sean McAllister authored
      
      
      If the dest-branch attribute is set in the project manifest, then
      we need to push to that branch.  Previously, we would unconditionally
      pre-pend the refs/heads prefix to it.  The dest-branch attribute is
      allowed to be a ref expression though, so it may already have it.
      
      Simple fix is to check if it already has the prefix before adding it.
      
      Bug: crbug.com/gerrit/12770
      
      Change-Id: I45d6107ed6cf305cf223023b0ddad4278f7f4146
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/268152
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      Tested-by: default avatarSean McAllister <smcallis@google.com>
      682f0b64
  15. May 13, 2020
  16. May 06, 2020
    • Angel Petkov's avatar
      project.py: Fix check for wild cards · dbfbcb14
      Angel Petkov authored
      
      
      The intention of the check is to verify whether the target
      file name contains a wild card. The code, however, assumes
      that if the file is non-existent - it contains a wild card.
      This has the side effect that a target file that does not
      exist at the moment of the check is considered to contain a
      wild card, this leads itself to softlink not being created.
      
      Change-Id: I4e4cd7b5e1b8ce2e4b2edc9abf5a1147cd86242f
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/265736
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      Tested-by: default avatarAngel Petkov <apetkov86@gmail.com>
      v2.7
      dbfbcb14
  17. Apr 30, 2020
  18. Apr 29, 2020
  19. Apr 28, 2020
  20. Apr 21, 2020
  21. Apr 17, 2020
    • Sean McAllister's avatar
      Expose upstream and dest-branch attributes through environment · 74e8ed4b
      Sean McAllister authored
      
      
      Recent changes in ChromeOS Infra to ensure we're reading from
      snapshot manifests properly have exposed several bugs in our
      assumptions about manifest files.  Mainly that the revision field
      for a project does _not_ have to refer to a ref, it can just be
      a commit hash.
      
      Several places assume that the revision field can be parsed as a
      ref to get the branch the project is on, which isn't true.  To fix
      this we need to be able to look at the upstream and dest-branch
      attributes of the repo, so we expose them through the environment
      variables set in `repo forall`.
      
      Test: manual 'repo forall' run
      Bug: https://crbug.com/1032441
      
      Change-Id: I2c039e0f4b2e0f430602932e91b782edb6f9b1ed
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/263132
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      Tested-by: default avatarSean McAllister <smcallis@google.com>
      74e8ed4b
  22. Apr 16, 2020
  23. Apr 15, 2020
  24. Apr 14, 2020
  25. Apr 13, 2020
    • Marcos Marado's avatar
      tests: fix SetupGnuPG test · 2735bfc5
      Marcos Marado authored
      
      
      The SetupGnuPG test tries to test the full setup, including the
      creation of the directories. In order to do that, it create a
      temporary directory, and redefines the home_dot_repo to point there.
      
      When a home_dot_repo directory does not exist, it should be created.
      The gpg_dir, which should exist inside home_dot_repo, also needs to be
      created if it does not exist. However, since the gpg_dir path is
      relative to home_dot_repo, once we redefine one, we need to redifine
      the other.
      
      The failure of this test might have gone unnoticed so far, since in
      only fails if you do not have a ~/.repoconfig/gnupg/ on the
      environment you are running the tests on.
      
      Change-Id: Ic69d59e56137eea43349a61b5cf81f215c6a7f9a
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/262573
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      Reviewed-by: default avatarDavid Pursehouse <dpursehouse@collab.net>
      Tested-by: default avatarMarcos Marado <mindboosternoori@gmail.com>
      2735bfc5
  26. Apr 08, 2020
    • David Pursehouse's avatar
      commit-msg: Insert Change-Id at start of trailers · 653f8b71
      David Pursehouse authored
      
      
      In older versions of Gerrit the Change-Id field was inserted at the
      start of the trailers. Commit 68296f71804feab2e0ae18ae33f834a8a41621e4
      simplified the trailers code by using git trailers instead of custom
      code but now inserts Change-Id at the end of the trailers section.
      
      A consequence of this is that folks who sign-off their commits using
      `git commit -s` now has the sign-off appear first followed by
      Change-Id. If the user then runs `git commit -s --amend` to update
      the change because the Sign-off-by line is not last, git inserts
      a 2nd duplicate Signed-off-by line.
      
      This patch simply restores the previous behaviour of the Gerrit
      commit-msg hook where Change-Id would be inserted before the
      Sign-off-by line to avoid this issue.
      
      Backported from [1] by Thanh Ha.
      
      [1] https://gerrit-review.googlesource.com/c/gerrit/+/262072
      
      Bug: https://crbug.com/12546
      Change-Id: I1406c763a3935761247f6771f55e02367f698e6e
      Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/262352
      Reviewed-by: default avatarMike Frysinger <vapier@google.com>
      Tested-by: default avatarDavid Pursehouse <dpursehouse@collab.net>
      653f8b71
  27. Apr 03, 2020
  28. Mar 31, 2020
  29. Mar 25, 2020
  30. Mar 24, 2020
    • Mike Frysinger's avatar
      init: allow REPO_REV/--repo-rev to specify commits/tags · cfc8111f
      Mike Frysinger authored
      
      
      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: default avatarMike Frysinger <vapier@google.com>
      Reviewed-by: default avatarJonathan Nieder <jrn@google.com>
      cfc8111f