<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/command.py, branch v2.12</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.12</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.12'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2021-01-06T18:53:05+00:00</updated>
<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>command: add a `repo help` tip to --help output</title>
<updated>2020-02-19T08:23:04+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2020-02-19T06:20:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=72ebf19e52e7c4b270e40ba07fec1048b3612797'/>
<id>urn:sha1:72ebf19e52e7c4b270e40ba07fec1048b3612797</id>
<content type='text'>
For people used to running `repo xxx --help`, they might not realize
that there are detailed man pages behind `repo help xxx`.  Add a note
to all --help commands to improve discoverability.

Change-Id: I84af58aa0514cc7ead185f6c2534a8f88e09a236
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255853
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>Fix blank line issues reported by flake8</title>
<updated>2020-02-12T06:36:40+00:00</updated>
<author>
<name>David Pursehouse</name>
<email>dpursehouse@collab.net</email>
</author>
<published>2020-02-12T06:20:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=819827a42ddb364f98c3a1a7eae2536dc54bc4cc'/>
<id>urn:sha1:819827a42ddb364f98c3a1a7eae2536dc54bc4cc</id>
<content type='text'>
- 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 &lt;vapier@google.com&gt;
Tested-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>command: Add parentheses on wrapped condition</title>
<updated>2020-02-12T06:32:47+00:00</updated>
<author>
<name>David Pursehouse</name>
<email>dpursehouse@collab.net</email>
</author>
<published>2020-02-12T05:55:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=5a2517f4115916bee9e55d99dab93a8b6ca4e185'/>
<id>urn:sha1:5a2517f4115916bee9e55d99dab93a8b6ca4e185</id>
<content type='text'>
Surround the condition with parentheses rather than using
backslashes. This prevents confusion about indentation when
running flake8/autoflake8.

Change-Id: I01775b96f817ee616f545b55369a4864fa1d6712
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254603
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>command: filter projects by active manifest groups</title>
<updated>2019-10-08T20:15:08+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-10-04T18:21:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=e778e57f11f208bd70c51d9cc57090a5cf9e41fa'/>
<id>urn:sha1:e778e57f11f208bd70c51d9cc57090a5cf9e41fa</id>
<content type='text'>
`repo forall &lt;proj&gt;` will look up all &lt;proj&gt; in the manifest for all
manifest groups regardless of which are active.  If &lt;proj&gt; is checked
out to different locations depending on the group, this ultimately
fails as we're unable to locate all of them.

Simple fix is to only include projects that match the manifest groups
that we already passed down &amp; initialized to the active set, and that
we already use when getting the default project list.

Bug: https://crbug.com/gerrit/11677
Bug: https://crbug.com/1011226
Change-Id: I975f10f9a9e5a1cad7d87344123f8003732dab27
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/239652
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Raul Rangel &lt;rrangel@chromium.org&gt;
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>split out cli validation from execution</title>
<updated>2019-08-28T03:54:11+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-27T05:10:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=ae6cb08ae52d488a4cc6892f811c1c1acf8c3c12'/>
<id>urn:sha1:ae6cb08ae52d488a4cc6892f811c1c1acf8c3c12</id>
<content type='text'>
A common pattern in our subcommands is to verify the arguments &amp;
options before executing things.  For some subcommands, that check
stage is quite long which makes the execution function even bigger.
Lets split that logic out of the execute phase so it's easier to
manage these.

This is most noticeable in the sync subcommand whose Execute func
is quite large, and the option checking makes up ~15% of it.

The manifest command's Execute can be simplified significantly as
the optparse configuration always sets output_file to a string.

Change-Id: I7097847ff040e831345e63de6b467ee17609990e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234834
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>Remove unused pylint suppressions</title>
<updated>2018-07-24T14:20:08+00:00</updated>
<author>
<name>David Pursehouse</name>
<email>dpursehouse@collab.net</email>
</author>
<published>2018-06-24T07:21:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=65b0ba5aa0447f7ee25103828115662b1eb80ff9'/>
<id>urn:sha1:65b0ba5aa0447f7ee25103828115662b1eb80ff9</id>
<content type='text'>
pylint is not used since bb5b1a0. The pyflakes cleanup mentioned in that
commit has not been done, but given that this project is no longer being
actively developed I don't think it's worth spending time doing it.

Leaving the pylint suppressions causes confusion because it leads people
to think that we are still using pylint.

Change-Id: If7d9f280a0f408c780f15915ffdb80579ae21f69
</content>
</entry>
<entry>
<title>sync: Add support to dump a JSON event log of all sync events.</title>
<updated>2017-05-29T04:39:54+00:00</updated>
<author>
<name>David Riley</name>
<email>davidriley@google.com</email>
</author>
<published>2017-04-05T07:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=e0684addeeb920ddf83168d5fbbbe50cb9287abd'/>
<id>urn:sha1:e0684addeeb920ddf83168d5fbbbe50cb9287abd</id>
<content type='text'>
Change-Id: Id4852968ac1b2bf0093007cf2e5ca951ddab8b3b
</content>
</entry>
<entry>
<title>repo: Repo does not always handle '.' parameter correctly</title>
<updated>2016-04-08T00:07:52+00:00</updated>
<author>
<name>Mark E. Hamilton</name>
<email>mhamilt@sandia.gov</email>
</author>
<published>2016-02-24T01:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=f9fe3e14d2b56140c90a8969892e06aa71127305'/>
<id>urn:sha1:f9fe3e14d2b56140c90a8969892e06aa71127305</id>
<content type='text'>
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:

  &lt;project name="proj_name" path="." /&gt;
  &lt;project name="sierra.other.git" path="other" /&gt;

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
</content>
</entry>
</feed>
