<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7400-submodule-basic.sh, branch v2.23.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.23.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.23.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-04-10T03:52:48Z</updated>
<entry>
<title>submodule: refuse to add repository with no commits</title>
<updated>2019-04-10T03:52:48Z</updated>
<author>
<name>Kyle Meyer</name>
<email>kyle@kyleam.com</email>
</author>
<published>2019-04-09T23:07:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e13811189bbd6b8672e3359f25c1e10f0c9b3c20'/>
<id>urn:sha1:e13811189bbd6b8672e3359f25c1e10f0c9b3c20</id>
<content type='text'>
When the path given to 'git submodule add' is an existing repository
that is not in the index, the repository is passed to 'git add'.  If
this repository doesn't have a commit checked out, we don't get a
useful result: there is no subproject OID to track, and any untracked
files in the sub-repository are added as blobs in the top-level
repository.

To avoid getting into this state, abort if the path is a repository
that doesn't have a commit checked out.  Note that this check must
come before the 'git add --dry-run' check because the next commit will
make 'git add' fail when given a repository that doesn't have a commit
checked out.

Signed-off-by: Kyle Meyer &lt;kyle@kyleam.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-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 helper: convert relative URL to absolute URL if needed</title>
<updated>2018-10-18T02:10:29Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-10-16T17:27:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0a862fdaf7628ceba4ea290b91ffd5d3c46b75b'/>
<id>urn:sha1:e0a862fdaf7628ceba4ea290b91ffd5d3c46b75b</id>
<content type='text'>
The submodule helper update_clone called by "git submodule update",
clones submodules if needed. As submodules used to have the URL indicating
if they were active, the step to resolve relative URLs was done in the
"submodule init" step. Nowadays submodules can be configured active without
calling an explicit init, e.g. via configuring submodule.active.

When trying to obtain submodules that are set active this way, we'll
fallback to the URL found in the .gitmodules, which may be relative to the
superproject, but we do not resolve it, yet:

    git clone https://gerrit.googlesource.com/gerrit
    cd gerrit &amp;&amp; grep url .gitmodules
	url = ../plugins/codemirror-editor
	...
    git config submodule.active .
    git submodule update
    fatal: repository '../plugins/codemirror-editor' does not exist
    fatal: clone of '../plugins/codemirror-editor' into submodule path '/tmp/gerrit/plugins/codemirror-editor' failed
    Failed to clone 'plugins/codemirror-editor'. Retry scheduled
    [...]
    fatal: clone of '../plugins/codemirror-editor' into submodule path '/tmp/gerrit/plugins/codemirror-editor' failed
    Failed to clone 'plugins/codemirror-editor' a second time, aborting
    [...]

To resolve the issue, factor out the function that resolves the relative
URLs in "git submodule init" (in the submodule helper in the init_submodule
function) and call it at the appropriate place in the update_clone helper.

Reported-by: Jaewoong Jung &lt;jungjw@google.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.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 'sg/test-must-be-empty'</title>
<updated>2018-08-27T21:33:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-27T21:33:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=986c5181071ce3aac42d0aaeb7bd691a1a0bdf4a'/>
<id>urn:sha1:986c5181071ce3aac42d0aaeb7bd691a1a0bdf4a</id>
<content type='text'>
Test fixes.

* sg/test-must-be-empty:
  tests: use 'test_must_be_empty' instead of 'test_cmp &lt;empty&gt; &lt;out&gt;'
  tests: use 'test_must_be_empty' instead of 'test_cmp /dev/null &lt;out&gt;'
  tests: use 'test_must_be_empty' instead of 'test ! -s'
  tests: use 'test_must_be_empty' instead of '! test -s'
</content>
</entry>
<entry>
<title>tests: use 'test_must_be_empty' instead of 'test_cmp &lt;empty&gt; &lt;out&gt;'</title>
<updated>2018-08-21T18:48:36Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2018-08-19T21:57:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1c5e94f459a0b7c23ef7e855441a65afdc4effab'/>
<id>urn:sha1:1c5e94f459a0b7c23ef7e855441a65afdc4effab</id>
<content type='text'>
Using 'test_must_be_empty' is shorter and more idiomatic than

  &gt;empty &amp;&amp;
  test_cmp empty out

as it saves the creation of an empty file.  Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).

These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.

Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:

  - Sometimes the expected output is not hard-coded in the test, but
    'test_cmp' is used to ensure that two similar git commands produce
    the same output, and that output happens to be empty, e.g. the
    test 'submodule update --merge  - ignores --merge  for new
    submodules' in 't7406-submodule-update.sh'.

  - Repetitive common tasks, including preparing the expected results
    and running 'test_cmp', are often extracted into a helper
    function, and some of this helper's callsites expect no output.

  - For the same reason as above, the whole 'test_expect_success'
    block is within a helper function, e.g. in 't3070-wildmatch.sh'.

  - Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
    (-p)' in 't9400-git-cvsserver-server.sh'.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/i18n'</title>
<updated>2018-08-15T22:08:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-15T22:08:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4bea8485e395769951c6b9eddfba1081ea7ef47f'/>
<id>urn:sha1:4bea8485e395769951c6b9eddfba1081ea7ef47f</id>
<content type='text'>
Many more strings are prepared for l10n.

* nd/i18n: (23 commits)
  transport-helper.c: mark more strings for translation
  transport.c: mark more strings for translation
  sha1-file.c: mark more strings for translation
  sequencer.c: mark more strings for translation
  replace-object.c: mark more strings for translation
  refspec.c: mark more strings for translation
  refs.c: mark more strings for translation
  pkt-line.c: mark more strings for translation
  object.c: mark more strings for translation
  exec-cmd.c: mark more strings for translation
  environment.c: mark more strings for translation
  dir.c: mark more strings for translation
  convert.c: mark more strings for translation
  connect.c: mark more strings for translation
  config.c: mark more strings for translation
  commit-graph.c: mark more strings for translation
  builtin/replace.c: mark more strings for translation
  builtin/pack-objects.c: mark more strings for translation
  builtin/grep.c: mark strings for translation
  builtin/config.c: mark more strings for translation
  ...
</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>dir.c: mark more strings for translation</title>
<updated>2018-07-23T18:19:10Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-07-21T07:49:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a80897c1e9e853d32457dd2343e9029fdce6091e'/>
<id>urn:sha1:a80897c1e9e853d32457dd2343e9029fdce6091e</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/submodule-core-worktree'</title>
<updated>2018-07-18T19:20:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-07-18T19:20:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7e25437d35a70791b345872af202eabfb3e1a8bc'/>
<id>urn:sha1:7e25437d35a70791b345872af202eabfb3e1a8bc</id>
<content type='text'>
"git submodule" did not correctly adjust core.worktree setting that
indicates whether/where a submodule repository has its associated
working tree across various state transitions, which has been
corrected.

* sb/submodule-core-worktree:
  submodule deinit: unset core.worktree
  submodule: ensure core.worktree is set after update
  submodule: unset core.worktree if no working tree is present
</content>
</entry>
</feed>
