<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/git_refs.py, branch v2.16</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.16</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.16'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2021-02-28T16:07:24+00:00</updated>
<entry>
<title>git_refs: fix crash with binary . files in .git/refs/</title>
<updated>2021-02-28T16:07:24+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2021-02-28T02:27:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=6d1faa1db35439b267a7b10725ab0876f027ecb6'/>
<id>urn:sha1:6d1faa1db35439b267a7b10725ab0876f027ecb6</id>
<content type='text'>
On macOS, the Finder app likes to poop .DS_Store files in every path
that the user browses.  If the user pokes around the .git/ tree, it
could generate a .DS_Store file in there too.  When repo goes to read
all the local refs, it tries to decode this binary file as UTF-8 and
subsequently crashes.

Since paths that begin with . are not valid refs, ignore them like we
already do with paths that end in .lock.  Also bump the check up to
ignore dirs that match since that follows the git rules: they apply
to any component in its path, not just the final path (name).

We don't implement the full valid ref algorithm that git employs as
it's a bit complicated, and we only really need to focus on what will
practically show up locally.

Bug: https://crbug.com/gerrit/14162
Change-Id: I6519f990e33cc58a72fcb00c0f983ad3285ace3d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/298662
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Michael Mortensen &lt;mmortensen@google.com&gt;
</content>
</entry>
<entry>
<title>strip python2-only coding:utf-8 &amp; print_function settings</title>
<updated>2021-01-06T18:53:05+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2021-01-01T13:42:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=784ccfc040dc8efa1a64d3c7d4070b66beb15d08'/>
<id>urn:sha1:784ccfc040dc8efa1a64d3c7d4070b66beb15d08</id>
<content type='text'>
We're committed to Python 3 at this point, so clean up boilerplate.

Bug: https://crbug.com/gerrit/10418
Change-Id: Ib1719ba2eb65c53b94881a1a1bf203ddfcaaafed
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/292382
Reviewed-by: Chris Mcdonald &lt;cjmcdonald@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>project: fix m/ pseudo ref handling with git worktrees</title>
<updated>2020-02-29T07:22:08+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2020-02-27T04:53:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=21b7fbe14d9457400a90683a9bd3febe4b7f8840'/>
<id>urn:sha1:21b7fbe14d9457400a90683a9bd3febe4b7f8840</id>
<content type='text'>
Since most ref namespaces are shared among all worktrees, trying to
set the pseudo m/&lt;branch&gt; in the common git repo ends up clobbering
each other when using shared checkouts.  For example, in CrOS:
  &lt;project path="src/third_party/kernel/v3.8"
           name="chromiumos/third_party/kernel"
           revision="refs/heads/chromeos-3.8" /&gt;
  &lt;project path="src/third_party/kernel/v3.10"
           name="chromiumos/third_party/kernel"
           revision="refs/heads/chromeos-3.10" /&gt;

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 &lt;vapier@google.com&gt;
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>Fix various whitespace issues reported by pyflakes</title>
<updated>2020-02-12T06:00:16+00:00</updated>
<author>
<name>David Pursehouse</name>
<email>dpursehouse@collab.net</email>
</author>
<published>2020-02-12T05:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=54a4e6007ab8be5738525b440cd6836c613517df'/>
<id>urn:sha1:54a4e6007ab8be5738525b440cd6836c613517df</id>
<content type='text'>
- E201 whitespace after '['
- E202 whitespace before '}'
- E221 multiple spaces before operator
- E222 multiple spaces after operator
- E225 missing whitespace around operator
- E226 missing whitespace around arithmetic operator
- E231 missing whitespace after ','
- E261 at least two spaces before inline comment
- E271 multiple spaces after keyword

Fixed automatically with autopep8:

  git ls-files | grep py$ | xargs autopep8 --in-place \
    --select E201,E202,E221,E222,E225,E226,E231,E261,E271

Change-Id: I367113eb8c847eb460532c7c2f8643f33040308c
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254601
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>use open context managers in more places</title>
<updated>2019-11-12T03:44:39+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-11-11T10:40:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=3164d40e2247d42537aef8e80fa7e048e14bec9f'/>
<id>urn:sha1:3164d40e2247d42537aef8e80fa7e048e14bec9f</id>
<content type='text'>
Use open() as a context manager to simplify the close logic and make
the code easier to read &amp; understand.  This is also more Pythonic.

Change-Id: I579d03cca86f99b2c6c6a1f557f6e5704e2515a7
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/244734
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>rename local trace module</title>
<updated>2019-08-27T07:08:52+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-27T04:26:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=8a11f6f24cecac28e7cdb3f5d0d7c83aec0df017'/>
<id>urn:sha1:8a11f6f24cecac28e7cdb3f5d0d7c83aec0df017</id>
<content type='text'>
There is a standard Python "trace" module, so having a local trace.py
prevents us being able to import that.  Rename the module to avoid.

Change-Id: I23e29ec95a2204bb168a641323d05e76968d9b57
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234832
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>set default file encoding to utf-8</title>
<updated>2019-06-13T14:30:52+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-06-13T06:30:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=f601376e13e6beca7ab8d660e00d6c14714f305f'/>
<id>urn:sha1:f601376e13e6beca7ab8d660e00d6c14714f305f</id>
<content type='text'>
There's no reason to support any other encoding in these files.
This only affects the files themselves and not streams they open.

Bug: https://crbug.com/gerrit/10418
Change-Id: I053cb40cd3666ce5c8a0689b9dd938f24ca765bf
</content>
</entry>
<entry>
<title>Add support for long paths</title>
<updated>2018-10-22T15:16:35+00:00</updated>
<author>
<name>Renaud Paquay</name>
<email>rpaquay@google.com</email>
</author>
<published>2018-09-27T17:46:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=bed8b62345e484b27e048e8f21280c5611f795df'/>
<id>urn:sha1:bed8b62345e484b27e048e8f21280c5611f795df</id>
<content type='text'>
* Add more file i/o wrappers in platform_utils to allow using
  long paths (length &gt; MAX_PATH) on Windows.

* Paths using the long path syntax ("\\?\" prefix) should never
  escape the platform_utils API surface area, so that this
  specific syntax is not visible to the rest of the repo code base.

* Forward many calls from os.xxx to platform_utils.xxx in various place
  to ensure long paths support, specifically when repo decides to delete
  obsolete directories.

* There are more places that need to be converted to support long paths,
  this commit is an initial effort to unblock a few common use cases.

* Also, fix remove function to handle directory symlinks

Change-Id: If82ccc408e516e96ff7260be25f8fd2fe3f9571a
</content>
</entry>
<entry>
<title>Handle Windows line endings when reading binary files</title>
<updated>2017-08-31T19:13:52+00:00</updated>
<author>
<name>Renaud Paquay</name>
<email>rpaquay@google.com</email>
</author>
<published>2016-11-01T20:48:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=2a4be948788dfe5ae9437b048fba229a96bbff2d'/>
<id>urn:sha1:2a4be948788dfe5ae9437b048fba229a96bbff2d</id>
<content type='text'>
Without this change, '.git\HEAD' files, for examples, are sometime
read incorrectly resulting in the current branch to be reset to
"master" when running a "repo init -b xxx" on an already initialized
repository.

Change-Id: I48c7ef85ff81626edf156914329a560e14252f2a
</content>
</entry>
<entry>
<title>When starting a branch, do not use a tag or change value for branch.merge</title>
<updated>2017-08-25T00:10:29+00:00</updated>
<author>
<name>Zac Livingston</name>
<email>zacl@codeaurora.org</email>
</author>
<published>2017-06-13T14:29:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=9ead97bb51f5b1ad1d0a45e0c5442f15e1e38fd7'/>
<id>urn:sha1:9ead97bb51f5b1ad1d0a45e0c5442f15e1e38fd7</id>
<content type='text'>
When starting a branch, branch.merge is set to project revision unless
the revision is a SHA1. In that case, branch.merge is set to dest_branch
if defined or manifest default revision otherwise. This special handling
allows repo upload to work when the project revision is a SHA1.

Extend the special handling to also happen when the project revision
is a tag value or a change value so that repo upload will work in those
case as well.

Change-Id: Iff81ece40e770cd02535e80dcb023564d42dcf47
</content>
</entry>
</feed>
