<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/lib-submodule-update.sh, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-09-08T02:05:20Z</updated>
<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>
<entry>
<title>submodule: submodule_move_head omits old argument in forced case</title>
<updated>2018-01-05T20:35:35Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-01-05T20:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7dcc1f4df8c74ec43d9b3e8c97aa985c2663b467'/>
<id>urn:sha1:7dcc1f4df8c74ec43d9b3e8c97aa985c2663b467</id>
<content type='text'>
When using hard reset or forced checkout with the option to recurse into
submodules, the submodules need to be reset, too.

It turns out that we need to omit the duplicate old argument to read-tree
in all forced cases to omit the 2 way merge and use the more assertive
behavior of reading the specific new tree into the index and updating
the working tree.

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>t/lib-submodule-update.sh: fix test ignoring ignored files in submodules</title>
<updated>2018-01-05T20:35:35Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-01-05T20:03:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63d963a4706c6a085f6d790d7e589de3e9b369a4'/>
<id>urn:sha1:63d963a4706c6a085f6d790d7e589de3e9b369a4</id>
<content type='text'>
It turns out that the test replacing a submodule with a file with
the submodule containing an ignored file is incorrectly titled,
because the test put the file in place, but never ignored that file.
When having an untracked file Instead of an ignored file in the
submodule, git should refuse to remove the submodule, but that is
a bug in the implementation of recursing into submodules, such that
the test just passed, removing the untracked file.

Fix the test first; in a later patch we'll fix gits behavior,
that will make sure untracked files are not deleted.

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>t/lib-submodule-update.sh: clarify test</title>
<updated>2018-01-05T20:35:04Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-01-05T20:03:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6419a12397c8ea2017a2540e23c8ea3cc67ce60f'/>
<id>urn:sha1:6419a12397c8ea2017a2540e23c8ea3cc67ce60f</id>
<content type='text'>
Keep the local branch name as the upstream branch name to avoid confusion.

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