<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/tests, branch v2.24</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.24</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.24'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2022-04-14T22:24:04+00:00</updated>
<entry>
<title>sync: refactor use of self.manifest</title>
<updated>2022-04-14T22:24:04+00:00</updated>
<author>
<name>LaMont Jones</name>
<email>lamontjones@google.com</email>
</author>
<published>2022-04-07T21:57:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a46047a822ad13738af9b17a524a0bd483b98033'/>
<id>urn:sha1:a46047a822ad13738af9b17a524a0bd483b98033</id>
<content type='text'>
We need to iterate over multiple manifests, and generally use the
outer_client.manifest for multi-manifest support.  This refactors the
use of self.manifest into a chosen manifest.

Change-Id: I992f21d610c929675e99555ece9c38df4b635839
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334699
Tested-by: LaMont Jones &lt;lamontjones@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>manifest_xml: use Superproject to hold XML content</title>
<updated>2022-04-12T15:46:23+00:00</updated>
<author>
<name>LaMont Jones</name>
<email>lamontjones@google.com</email>
</author>
<published>2022-04-07T18:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=d56e2eb4216827284220fcc35af42e60b4faaea6'/>
<id>urn:sha1:d56e2eb4216827284220fcc35af42e60b4faaea6</id>
<content type='text'>
Always create Superproject when there is a &lt;superproject&gt; tag, and have
it hold the XML content, similar to how other manifest elements are
handled.

This also adds SetQuiet and SetPrintMessages to Superproject
consistent with manifest.SetUseLocalManifests.

Change-Id: I522bf3da542006575799f0640c67f7052704f266
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334641
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Raman Tenneti &lt;rtenneti@google.com&gt;
Tested-by: LaMont Jones &lt;lamontjones@google.com&gt;
</content>
</entry>
<entry>
<title>sync: respect `sync-c` manifest option</title>
<updated>2022-04-08T21:06:37+00:00</updated>
<author>
<name>Daniel Andersson</name>
<email>daniel.r.andersson@volvocars.com</email>
</author>
<published>2022-04-01T10:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=d52ca421d52c75837d1614ec54549569f354b7ec'/>
<id>urn:sha1:d52ca421d52c75837d1614ec54549569f354b7ec</id>
<content type='text'>
The documentation states that a `sync-c` attribute in the manifest file
can set a default for whether only the current branch should be fetched
or all branches. This seems to have been broken for some time.

Commit 7356114 introduced the `--no-current-branch` CLI option and
relied on getting `None` via `optparse` if neither `--current-branch`
nor `--no-current-branch` was set to distinguish it from a boolean
value. If `None` was received, it would read the value from the manifest
option `sync-c`. The parsing went through the utility function
`_GetCurrentBranchOnly` which returned `True` if `--current-branch` had
been given on the command-line, or fell back on the "superproject"
setting, which would either return `True` or `None`. This would
incorrectly make `repo` fall back to the manifest setting even if the
user had given `--no-current-branch` if no superproject was requested --
the manifest became "too powerful":

Command-line         Using superproject  → `current_branch_only`
------------         ------------------  -----------------------
                     No                  From manifest
                     Yes                 True
--current-branch     No                  True
--current-branch     Yes                 True
--no-current-branch  No                  From manifest ← wrong
--no-current-branch  Yes                 True

In commit 0cb6e92 the superproject configuration value reading changed
from something that could return `None` to something that always
returned a boolean. If it returned `False`, this would then incorrectly
make `repo` ignore the manifest option even if neither
`--current-branch` nor `--no-current-branch` had been given. The
manifest default became useless:

Command-line         Using superproject  → `current_branch_only`
------------         ------------------  -----------------------
                     No                  False ← wrong
                     Yes                 True
--current-branch     No                  True
--current-branch     Yes                 True
--no-current-branch  No                  False
--no-current-branch  Yes                 True

By swapping the order in which the command-line option target and the
superproject setting is evaluated, things should work as documented:

Command-line         Using superproject  → `current_branch_only`
------------         ------------------  -----------------------
                     No                  From manifest
                     Yes                 True
--current-branch     No                  True
--current-branch     Yes                 True
--no-current-branch  No                  False
--no-current-branch  Yes                 True

Change-Id: I933c232d2fbecc6b9bdc364ebac181798bce9175
Tested-by: Daniel Andersson &lt;daniel.r.andersson@volvocars.com&gt;
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334270
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>trace: allow writing traces to a socket</title>
<updated>2022-03-16T17:33:07+00:00</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2022-03-08T18:24:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=244c9a71a689743acea97c6a07ff4dfce4dc6dab'/>
<id>urn:sha1:244c9a71a689743acea97c6a07ff4dfce4dc6dab</id>
<content type='text'>
Git can write trace2 events to a Unix domain socket [1]. This can be
specified via Git's `trace2.eventTarget` config option, which we read to
determine where to log our own trace2 events. Currently, if the Git
config specifies a socket as the trace2 target, we fail to log any
traces.

Fix this by adding support for writing to a Unix domain socket,
following the same specification that Git supports.

[1]: https://git-scm.com/docs/api-trace2#_enabling_a_target

Change-Id: I928bc22ba04fba603a9132eb055141845fa48ab2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/332339
Reviewed-by: Raman Tenneti &lt;rtenneti@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Josh Steadmon &lt;steadmon@google.com&gt;
</content>
</entry>
<entry>
<title>test_project: use os.readlink instead of Path.readlink</title>
<updated>2022-01-11T20:16:42+00:00</updated>
<author>
<name>Sebastian Wagner</name>
<email>sebix@sebix.at</email>
</author>
<published>2022-01-11T11:12:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a3ac81627885f78b9391ff291c4a5bc617494045'/>
<id>urn:sha1:a3ac81627885f78b9391ff291c4a5bc617494045</id>
<content type='text'>
Path.readlink is only available on Python 3.9, breaking compatibility
with all python versions below. os.readlink is already used in other
places of this file, so use it here as well.

Change-Id: I5acf8f5334a3e7c8de9cea1939d7e2b9af5f30ae
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327844
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Sebastian Wagner &lt;sebix@sebix.at&gt;
</content>
</entry>
<entry>
<title>project: abort a bit earlier before migrating .git/</title>
<updated>2022-01-07T20:17:14+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2022-01-06T10:42:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=89ed8acdbe468fd76d531cd8b7b2ace5b414f0bd'/>
<id>urn:sha1:89ed8acdbe468fd76d531cd8b7b2ace5b414f0bd</id>
<content type='text'>
Verify all the .git/ paths will be handled by the migration logic before
starting the migration.  This way we still abort &amp; log an error, but the
user gets to see it before we put the tree into a state that they have to
manually recover.  Also add a few more known-safe-to-clobber paths.

Bug: https://crbug.com/gerrit/15273
Change-Id: If49d69b341bc960ddcafa30da333fb5ec7145b51
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327557
Reviewed-by: Colin Cross &lt;ccross@android.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>project: migrate worktree .git/ dirs to symlinks</title>
<updated>2021-12-01T15:27:16+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2021-11-14T04:29:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=2a089cfee4a3eb0c28cfb441861fc1fcb05797d3'/>
<id>urn:sha1:2a089cfee4a3eb0c28cfb441861fc1fcb05797d3</id>
<content type='text'>
Historically we created a .git/ subdir in each source checkout and
symlinked individual files to the .repo/projects/ paths.  This layer
of indirection isn't actually needed: the .repo/projects/ paths are
guaranteed to only ever have a 1-to-1 mapping with the actual git
checkout.  So we don't need to worry about having files in .git/ be
isolated.

To that end, change how we manage the actual project checkouts from
a dir full of symlinks (and a few files) to a symlink to the internal
.repo/projects/ dir.  This makes the code simpler &amp; faster.

The directory structure we have today is:
.repo/
  project-objects/chromiumos/third_party/kernel.git/
    &lt;paths omitted as not relevant to this change&gt;
  projects/src/third_party/kernel/
    v3.8.git/
      config
      description   -&gt; …/project-objects/…/config
      FETCH_HEAD
      HEAD
      hooks/        -&gt; …/project-objects/…/hooks/
      info/         -&gt; …/project-objects/…/info/
      logs/
      objects/      -&gt; …/project-objects/…/objects/
      packed-refs
      refs/
      rr-cache/     -&gt; …/project-objects/…/rr-cache/
src/third_party/kernel/
  v3.8/
    .git/
      config        -&gt; …/projects/…/v3.8.git/config
      description   -&gt; …/project-objects/…/v3.8.git/description
      HEAD
      hooks/        -&gt; …/project-objects/…/v3.8.git/hooks/
      index
      info/         -&gt; …/project-objects/…/v3.8.git/info/
      logs/         -&gt; …/projects/…/v3.8.git/logs/
      objects/      -&gt; …/project-objects/…/v3.8.git/objects/
      packed-refs   -&gt; …/projects/…/v3.8.git/packed-refs
      refs/         -&gt; …/projects/…/v3.8.git/refs/
      rr-cache/     -&gt; …/project-objects/…/v3.8.git/rr-cache/

The directory structure we have after this commit:
.repo/
  &lt;nothing changes&gt;
src/third_party/kernel/
  v3.8/
    .git            -&gt; …/projects/…/v3.8.git

Bug: https://crbug.com/gerrit/15273
Change-Id: I9dd8def23fbfb2f4cb209a93f8b1b2b24002a444
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323695
Reviewed-by: Mike Nichols &lt;mikenichols@google.com&gt;
Reviewed-by: Xin Li &lt;delphij@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>git_config: Fixed test.gitconfig getting updated when running tests.</title>
<updated>2021-09-30T21:45:09+00:00</updated>
<author>
<name>Raman Tenneti</name>
<email>rtenneti@google.com</email>
</author>
<published>2021-09-30T21:24:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a0f6006ae7613ba08480bfccac300ea7c7de9af4'/>
<id>urn:sha1:a0f6006ae7613ba08480bfccac300ea7c7de9af4</id>
<content type='text'>
Moved test_GetSyncAnalysisStateData to GitConfigReadWriteTests class.

Deleted [repo "syncstate*..] data from tests/fixtures/test.gitconfig.

Tested:
./run_tests
...
tests/test_git_config.py::GitConfigReadWriteTests::test_GetSyncAnalysisStateData PASSED [ 84%]
...

Bug: https://crbug.com/gerrit/15103
Change-Id: I8cb89ce10b025994a045106c9c66dd243ae8ba50
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319557
Tested-by: Raman Tenneti &lt;rtenneti@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>trace2_event: Add remove_prefix to fix failing tests on Linux &amp; macOS.</title>
<updated>2021-09-29T21:24:59+00:00</updated>
<author>
<name>Raman Tenneti</name>
<email>rtenneti@google.com</email>
</author>
<published>2021-09-29T00:15:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=4f88206178e37205ac13220f4d38b8132839acd9'/>
<id>urn:sha1:4f88206178e37205ac13220f4d38b8132839acd9</id>
<content type='text'>
removeprefix is available i python 3.9. Mac and Linux are running in
a version below 3.9. Thus tests are failing with the following error:
  "AttributeError: 'str' object has no attribute 'removeprefix' "

Replaced the removeprefix with custom function which we will delete
once Linux and macOS versions are updated.

Tested:
$ ./run_tests

Bug: [google internal] b/201453085
Change-Id: I9b4d564ff1176e1b4471805ef05472c1914cd9f9
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319375
Tested-by: Raman Tenneti &lt;rtenneti@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>Add 'dest-path' to extend-project to support changing path</title>
<updated>2021-09-28T20:12:00+00:00</updated>
<author>
<name>Michael Kelly</name>
<email>mkelly@arista.com</email>
</author>
<published>2020-06-13T09:10:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=37c21c268badc2602a827d2236027e235fff95e0'/>
<id>urn:sha1:37c21c268badc2602a827d2236027e235fff95e0</id>
<content type='text'>
This allows us to move the repository to a new location in the source
tree without having to remove-project + add a new project tag.

Change-Id: I4dba6151842e57f6f2b8fe60cda260ecea68b7b4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/310962
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Michael Kelly &lt;mkelly@arista.com&gt;
</content>
</entry>
</feed>
