<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/subcmds/sync.py, branch v1.13.11</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v1.13.11</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v1.13.11'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2019-11-12T23:33:51+00:00</updated>
<entry>
<title>sync: merge project updates with status bar</title>
<updated>2019-11-12T23:33:51+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-26T19:32:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=3538dd224d6d48c60b140103f25d94f0e5f76160'/>
<id>urn:sha1:3538dd224d6d48c60b140103f25d94f0e5f76160</id>
<content type='text'>
The current sync output displays "Fetching project" and "Checking out
project" messages and progress bar updates independently leading to a
lot of spam.  Lets merge these periodic outputs with the status bar to
get a little bit tighter output in the normal case.  This doesn't solve
all our problems, but gets us closer.

Bug: https://crbug.com/gerrit/11293
Change-Id: Icd627830af4dd934a9355b7ace754b56dc96cfef
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/244934
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>sync: report list of failing git trees</title>
<updated>2019-11-12T21:08:54+00:00</updated>
<author>
<name>Vadim Bendebury</name>
<email>vbendeb@chromium.org</email>
</author>
<published>2019-11-06T19:05:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=dff919493aae85d2462b614c9cb4eedeb23fdb96'/>
<id>urn:sha1:dff919493aae85d2462b614c9cb4eedeb23fdb96</id>
<content type='text'>
When repo sync fails because some git trees are not in clean state and
as such can not be rebased automatically, it is a pain to figure out
which trees are the culprits.

With this patch the list of offending trees is printed when repo sync
reports checkout errors.

TEST=ran 'repo sync' and observed the proper list of directories show
     up after the final error message

Bug: https://crbug.com/gerrit/11293
Change-Id: Icdf1a03e9014ecb184f331f513cc9a2efc7d11ed
Signed-off-by: Vadim Bendebury &lt;vbendeb@google.com&gt;
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/244053
Reviewed-by: Mike Frysinger &lt;vapier@google.com&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>sync: create dedicated manifest project update func</title>
<updated>2019-09-19T01:52:08+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-27T06:34:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=fb527e3f522a9f6ae05ee1fd707fb0b45c9190f2'/>
<id>urn:sha1:fb527e3f522a9f6ae05ee1fd707fb0b45c9190f2</id>
<content type='text'>
Cut out some more standalone code from Execute to make this func a
bit more manageable.  The manifest project update is pretty simple
and standalone, but still takes up a good chunk of what's left.

Change-Id: Idc2442d9def495eccd0a49cda203c44aef16f129
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/236614
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>sync: create dedicated smart sync func</title>
<updated>2019-09-11T23:24:11+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-27T05:56:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=01d6c3c0c5cfb9ccf6b60d4db78852dfbf1e3c39'/>
<id>urn:sha1:01d6c3c0c5cfb9ccf6b60d4db78852dfbf1e3c39</id>
<content type='text'>
The smart sync logic takes up about 45% of the overall Execute func
and is about 100 lines of code.  The only effect it has on the rest
of the code is to set the manifest_name variable.  Since this func
is already quite huge, split the smart sync logic out.

Change-Id: Id861849b0011ab47387d74e92c2ac15afcc938ba
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234835
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>sync: fix deprecated command line option -f</title>
<updated>2019-08-30T16:29:01+00:00</updated>
<author>
<name>Stefan Müller-Klieser</name>
<email>s.mueller-klieser@phytec.de</email>
</author>
<published>2019-08-30T08:20:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=46702eddc7b5f38391e121e47f0ab4dbd6fbdf58'/>
<id>urn:sha1:46702eddc7b5f38391e121e47f0ab4dbd6fbdf58</id>
<content type='text'>
In commit d9e5cf0e ("sync: invert --force-broken with --fail-fast") the
force-broken option has been deprecated. Accidentally the option has
been changed from Boolean to Value. This breaks all users of repo with:

  main.py: error: -f option requires an argument

This is easy to avoid by keeping the type.

Signed-off-by: Stefan Müller-Klieser &lt;s.mueller-klieser@phytec.de&gt;
Change-Id: Ia8b589cf41ac756d10c61e17ec8d76ba8f7031f9
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/235043
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&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>sync: invert --force-broken with --fail-fast</title>
<updated>2019-08-27T01:20:44+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-26T07:12:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=d9e5cf0ee76d55a94079c34f78ffb9dff858e93e'/>
<id>urn:sha1:d9e5cf0ee76d55a94079c34f78ffb9dff858e93e</id>
<content type='text'>
People seem to not expect the sync process to halt immediately if an
error is encountered.  It's also basically guaranteed to leave their
tree in an incomplete state.  Lets invert the default behavior so we
attempt to sync (both fetch &amp; checkout) all projects.  If an error is
hit, we still exit(1) and show it at the end.

If people want the sync to abort quickly, they can use the new option
--fail-fast.

Bug: https://crbug.com/gerrit/11293
Change-Id: I49dd6c4dc8fd5cce8aa905ee169ff3cbe230eb3d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234812
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>rebase/sync: use exit(1) for errors instead of exit(-1)</title>
<updated>2019-08-08T05:07:31+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-07T21:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a850ca2712b61cd820a9138c9e97f3fbb583e509'/>
<id>urn:sha1:a850ca2712b61cd820a9138c9e97f3fbb583e509</id>
<content type='text'>
Callers don't actually see -1 (they'll usually see 255, but the exact
answer here is complicated).  Just switch to 1 as that's the standard
value tools use to indicate an error.

Change-Id: Ib712db1924bc3e5f7920bafd7bb5fb61f3bda44f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/233553
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>sync: fix handling of -f and local checkouts</title>
<updated>2019-08-08T02:54:39+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-08-07T22:07:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a34186e4813170f3c71ec51c740cd571c79e12b5'/>
<id>urn:sha1:a34186e4813170f3c71ec51c740cd571c79e12b5</id>
<content type='text'>
The partial clone rework (commit 745be2ede1e67421275afc00c04d996d9d6908ee
"Add support for partial clone") changed the behavior when a single repo
hit a failure: it would always call sys.exit() immediately.  This isn't
even necessary as we already pass down an error event object which the
workers set and the parent checks.  Just delete the exit entirely.

Change-Id: Id72d8642aefa2bde24e1a438dbe102c3e3cabf48
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/233552
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
</feed>
