<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/lib-submodule-update.sh, branch v2.26.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.1</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-04-01T02:57:37Z</updated>
<entry>
<title>t/lib-submodule-update: use appropriate length constant</title>
<updated>2019-04-01T02:57:37Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:04:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=76c23892bcbc5e8fba1f6d844b05752082d0542e'/>
<id>urn:sha1:76c23892bcbc5e8fba1f6d844b05752082d0542e</id>
<content type='text'>
Instead of using a specific invalid hard-coded object ID, produce one
of the appropriate length by using test_oid.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule deinit: unset core.worktree</title>
<updated>2018-12-26T18:39:54Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-12-14T23:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8eda5efa1269a6117b86a97a309eb3a195b5f087'/>
<id>urn:sha1:8eda5efa1269a6117b86a97a309eb3a195b5f087</id>
<content type='text'>
When a submodule is deinit'd, the working tree is gone, so the setting of
core.worktree is bogus. Unset it. As we covered the only other case in
which a submodule loses its working tree in the earlier step
(i.e. switching branches of top-level project to move to a commit that did
not have the submodule), this makes the code always maintain
core.worktree correctly unset when there is no working tree
for a submodule.

This re-introduces 984cd77ddb (submodule deinit: unset core.worktree,
2018-06-18), which was reverted as part of f178c13fda (Revert "Merge
branch 'sb/submodule-core-worktree'", 2018-09-07)

The whole series was reverted as the offending commit e98317508c
(submodule: ensure core.worktree is set after update, 2018-06-18)
was relied on by other commits such as 984cd77ddb.

Keep the offending commit reverted, but its functionality came back via
4d6d6ef1fc (Merge branch 'sb/submodule-update-in-c', 2018-09-17), such
that we can reintroduce 984cd77ddb now.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: unset core.worktree if no working tree is present</title>
<updated>2018-12-26T18:21:02Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-12-14T23:59:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=898c2e65b7743f7d56bf50b4ba8bf4f59a0caf93'/>
<id>urn:sha1:898c2e65b7743f7d56bf50b4ba8bf4f59a0caf93</id>
<content type='text'>
When a submodules work tree is removed, we should unset its core.worktree
setting as the worktree is no longer present. This is not just in line
with the conceptual view of submodules, but it fixes an inconvenience
for looking at submodules that are not checked out:

    git clone --recurse-submodules git://github.com/git/git &amp;&amp; cd git &amp;&amp;
    git checkout --recurse-submodules v2.13.0
    git -C .git/modules/sha1collisiondetection log
    fatal: cannot chdir to '../../../sha1collisiondetection': \
        No such file or directory

With this patch applied, the final call to git log works instead of dying
in its setup, as the checkout will unset the core.worktree setting such
that following log will be run in a bare repository.

This patch covers all commands that are in the unpack machinery, i.e.
checkout, read-tree, reset. A follow up patch will address
"git submodule deinit", which will also make use of the new function
submodule_unset_core_worktree(), which is why we expose it in this patch.

This patch was authored as 4fa4f90ccd (submodule: unset core.worktree if
no working tree is present, 2018-06-12), which was reverted as part of
f178c13fda (Revert "Merge branch 'sb/submodule-core-worktree'",
2018-09-07). The revert was needed as the nearby commit e98317508c
(submodule: ensure core.worktree is set after update, 2018-06-18) is
faulty and at the time of 7e25437d35 (Merge branch
'sb/submodule-core-worktree', 2018-07-18) we could not revert the faulty
commit only, as they were depending on each other: If core.worktree is
unset, we have to have ways to ensure that it is set again once
the working tree reappears again.

Now that 4d6d6ef1fc (Merge branch 'sb/submodule-update-in-c', 2018-09-17),
specifically 74d4731da1 (submodule--helper: replace
connect-gitdir-workingtree by ensure-core-worktree, 2018-08-13) is
present, we already check and ensure core.worktree is set when
populating a new work tree, such that we can re-introduce the commits
that unset core.worktree when removing the worktree.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Revert "Merge branch 'sb/submodule-core-worktree'"</title>
<updated>2018-09-08T02:05:20Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2018-09-08T00:09:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f178c13fdac42763a7aa58bf260aa67d9f4393ec'/>
<id>urn:sha1:f178c13fdac42763a7aa58bf260aa67d9f4393ec</id>
<content type='text'>
This reverts commit 7e25437d35a70791b345872af202eabfb3e1a8bc, reversing
changes made to 00624d608cc69bd62801c93e74d1ea7a7ddd6598.

v2.19.0-rc0~165^2~1 (submodule: ensure core.worktree is set after
update, 2018-06-18) assumes an "absorbed" submodule layout, where the
submodule's Git directory is in the superproject's .git/modules/
directory and .git in the submodule worktree is a .git file pointing
there.  In particular, it uses $GIT_DIR/modules/$name to find the
submodule to find out whether it already has core.worktree set, and it
uses connect_work_tree_and_git_dir if not, resulting in

	fatal: could not open sub/.git for writing

The context behind that patch: v2.19.0-rc0~165^2~2 (submodule: unset
core.worktree if no working tree is present, 2018-06-12) unsets
core.worktree when running commands like "git checkout
--recurse-submodules" to switch to a branch without the submodule.  If
a user then uses "git checkout --no-recurse-submodules" to switch back
to a branch with the submodule and runs "git submodule update", this
patch is needed to ensure that commands using the submodule directly
are aware of the path to the worktree.

It is late in the release cycle, so revert the whole 3-patch series.
We can try again later for 2.20.

Reported-by: Allan Sandfeld Jensen &lt;allan.jensen@qt.io&gt;
Helped-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'es/test-fixes'</title>
<updated>2018-08-02T22:30:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a135475d327f4f4f7f1b4892f69ba7b6ee88e27'/>
<id>urn:sha1:7a135475d327f4f4f7f1b4892f69ba7b6ee88e27</id>
<content type='text'>
Test clean-up and corrections.

* es/test-fixes: (26 commits)
  t5608: fix broken &amp;&amp;-chain
  t9119: fix broken &amp;&amp;-chains
  t9000-t9999: fix broken &amp;&amp;-chains
  t7000-t7999: fix broken &amp;&amp;-chains
  t6000-t6999: fix broken &amp;&amp;-chains
  t5000-t5999: fix broken &amp;&amp;-chains
  t4000-t4999: fix broken &amp;&amp;-chains
  t3030: fix broken &amp;&amp;-chains
  t3000-t3999: fix broken &amp;&amp;-chains
  t2000-t2999: fix broken &amp;&amp;-chains
  t1000-t1999: fix broken &amp;&amp;-chains
  t0000-t0999: fix broken &amp;&amp;-chains
  t9814: simplify convoluted check that command correctly errors out
  t9001: fix broken "invoke hook" test
  t7810: use test_expect_code() instead of hand-rolled comparison
  t7400: fix broken "submodule add/reconfigure --force" test
  t7201: drop pointless "exit 0" at end of subshell
  t6036: fix broken "merge fails but has appropriate contents" tests
  t5505: modernize and simplify hard-to-digest test
  t5406: use write_script() instead of birthing shell script manually
  ...
</content>
</entry>
<entry>
<title>Merge branch 'sb/submodule-move-head-error-msg'</title>
<updated>2018-07-24T21:50:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-07-24T21:50:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=392b3dde513083b9975c990cd2cf410d2846b941'/>
<id>urn:sha1:392b3dde513083b9975c990cd2cf410d2846b941</id>
<content type='text'>
"git checkout --recurse-submodules another-branch" did not report
in which submodule it failed to update the working tree, which
resulted in an unhelpful error message.

* sb/submodule-move-head-error-msg:
  submodule.c: report the submodule that an error occurs in
</content>
</entry>
<entry>
<title>t/lib-submodule-update: fix "absorbing" test</title>
<updated>2018-07-03T19:38:04Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2018-07-02T00:23:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5d7e9f5164e90386622a80a9dfc4b1675bcc92b'/>
<id>urn:sha1:e5d7e9f5164e90386622a80a9dfc4b1675bcc92b</id>
<content type='text'>
This test has been dysfunctional since it was added by 259f3ee296
(lib-submodule-update.sh: define tests for recursing into submodules,
2017-03-14), however, the problem went unnoticed due to a broken
&amp;&amp;-chain.

The test wants to verify that replacing a submodule containing a .git
directory will absorb the .git directory into the .git/modules/ of the
superproject, and then replace the working tree content appropriate to
the superproject. It is, therefore, incorrect to check if the
submodule content still exists since the submodule will have been
replaced by the content of the superproject.

Fix this by removing the submodule content check, which also happens
to be the line that broke the &amp;&amp;-chain.

While at it, fix broken &amp;&amp;-chains in a couple neighboring tests.

Helped-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule.c: report the submodule that an error occurs in</title>
<updated>2018-06-25T16:06:15Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-20T22:32:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba95d4e4bdf03badef6bc5c44bc059464f3e79d3'/>
<id>urn:sha1:ba95d4e4bdf03badef6bc5c44bc059464f3e79d3</id>
<content type='text'>
When an error occurs in updating the working tree of a submodule in
submodule_move_head, tell the user which submodule the error occurred in.

The call to read-tree contains a super-prefix, such that the read-tree
will correctly report any path related issues, but some error messages
do not contain a path, for example:

  ~/gerrit$ git checkout --recurse-submodules origin/master
  ~/gerrit$ fatal: failed to unpack tree object 07672f31880ba80300b38492df9d0acfcd6ee00a

Give the hint which submodule has a problem.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule deinit: unset core.worktree</title>
<updated>2018-06-19T16:28:13Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-19T00:06:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=984cd77ddbf0eea7371a18ad7124120473b6bb2d'/>
<id>urn:sha1:984cd77ddbf0eea7371a18ad7124120473b6bb2d</id>
<content type='text'>
When a submodule is deinit'd, the working tree is gone, so the setting of
core.worktree is bogus. Unset it.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: unset core.worktree if no working tree is present</title>
<updated>2018-06-14T21:13:46Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-12T23:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4fa4f90ccd85842e1187e5a5daf4633dceaab779'/>
<id>urn:sha1:4fa4f90ccd85842e1187e5a5daf4633dceaab779</id>
<content type='text'>
When a submodules work tree is removed, we should unset its core.worktree
setting as the worktree is no longer present. This is not just in line
with the conceptual view of submodules, but it fixes an inconvenience
for looking at submodules that are not checked out:

    git clone --recurse-submodules git://github.com/git/git &amp;&amp; cd git &amp;&amp;
    git checkout --recurse-submodules v2.13.0
    git -C .git/modules/sha1collisiondetection log
    fatal: cannot chdir to '../../../sha1collisiondetection': \
        No such file or directory

With this patch applied, the final call to git log works instead of dying
in its setup, as the checkout will unset the core.worktree setting such
that following log will be run in a bare repository.

This patch covers all commands that are in the unpack machinery, i.e.
checkout, read-tree, reset. A follow up patch will address
"git submodule deinit", which will also make use of the new function
submodule_unset_core_worktree(), which is why we expose it in this patch.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
