<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7400-submodule-basic.sh, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-02-11T07:48:27Z</updated>
<entry>
<title>tests: remove most uses of test_i18ncmp</title>
<updated>2021-02-11T07:48:27Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-02-11T01:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1108cea7f8ee38a8507c1cc68d1fafe2eb31d623'/>
<id>urn:sha1:1108cea7f8ee38a8507c1cc68d1fafe2eb31d623</id>
<content type='text'>
As a follow-up to d162b25f956 (tests: remove support for
GIT_TEST_GETTEXT_POISON, 2021-01-20) remove most uses of test_i18ncmp
via a simple s/test_i18ncmp/test_cmp/g search-replacement.

I'm leaving t6300-for-each-ref.sh out due to a conflict with in-flight
changes between "master" and "seen", as well as the prerequisite
itself due to other changes between "master" and "next/seen" which add
new test_i18ncmp uses.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7[0-4]*: adjust the references to the default branch name "main"</title>
<updated>2020-11-19T23:44:18Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-11-18T23:44:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=01dc81336dc10c8f2350454c755a8a0ab676a9c9'/>
<id>urn:sha1:01dc81336dc10c8f2350454c755a8a0ab676a9c9</id>
<content type='text'>
Carefully excluding t7064, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t7[0-4]*. This trick was performed via

	$ (cd t &amp;&amp;
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t7[0-4]*.sh &amp;&amp;
	   git checkout HEAD -- t7064\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: mark tests relying on the current default for `init.defaultBranch`</title>
<updated>2020-11-19T23:44:17Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-11-18T23:44:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=334afbc76fbd4a8d850946a2b450ba036365b554'/>
<id>urn:sha1:334afbc76fbd4a8d850946a2b450ba036365b554</id>
<content type='text'>
In addition to the manual adjustment to let the `linux-gcc` CI job run
the test suite with `master` and then with `main`, this patch makes sure
that GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME is set in all test scripts
that currently rely on the initial branch name being `master by default.

To determine which test scripts to mark up, the first step was to
force-set the default branch name to `master` in

- all test scripts that contain the keyword `master`,

- t4211, which expects `t/t4211/history.export` with a hard-coded ref to
  initialize the default branch,

- t5560 because it sources `t/t556x_common` which uses `master`,

- t8002 and t8012 because both source `t/annotate-tests.sh` which also
  uses `master`)

This trick was performed by this command:

	$ sed -i '/^ *\. \.\/\(test-lib\|lib-\(bash\|cvs\|git-svn\)\|gitweb-lib\)\.sh$/i\
	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
	' $(git grep -l master t/t[0-9]*.sh) \
	t/t4211*.sh t/t5560*.sh t/t8002*.sh t/t8012*.sh

After that, careful, manual inspection revealed that some of the test
scripts containing the needle `master` do not actually rely on a
specific default branch name: either they mention `master` only in a
comment, or they initialize that branch specificially, or they do not
actually refer to the current default branch. Therefore, the
aforementioned modification was undone in those test scripts thusly:

	$ git checkout HEAD -- \
		t/t0027-auto-crlf.sh t/t0060-path-utils.sh \
		t/t1011-read-tree-sparse-checkout.sh \
		t/t1305-config-include.sh t/t1309-early-config.sh \
		t/t1402-check-ref-format.sh t/t1450-fsck.sh \
		t/t2024-checkout-dwim.sh \
		t/t2106-update-index-assume-unchanged.sh \
		t/t3040-subprojects-basic.sh t/t3301-notes.sh \
		t/t3308-notes-merge.sh t/t3423-rebase-reword.sh \
		t/t3436-rebase-more-options.sh \
		t/t4015-diff-whitespace.sh t/t4257-am-interactive.sh \
		t/t5323-pack-redundant.sh t/t5401-update-hooks.sh \
		t/t5511-refspec.sh t/t5526-fetch-submodules.sh \
		t/t5529-push-errors.sh t/t5530-upload-pack-error.sh \
		t/t5548-push-porcelain.sh \
		t/t5552-skipping-fetch-negotiator.sh \
		t/t5572-pull-submodule.sh t/t5608-clone-2gb.sh \
		t/t5614-clone-submodules-shallow.sh \
		t/t7508-status.sh t/t7606-merge-custom.sh \
		t/t9302-fast-import-unpack-limit.sh

We excluded one set of test scripts in these commands, though: the range
of `git p4` tests. The reason? `git p4` stores the (foreign) remote
branch in the branch called `p4/master`, which is obviously not the
default branch. Manual analysis revealed that only five of these tests
actually require a specific default branch name to pass; They were
modified thusly:

	$ sed -i '/^ *\. \.\/lib-git-p4\.sh$/i\
	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
	' t/t980[0167]*.sh t/t9811*.sh

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7400: make hash size independent</title>
<updated>2020-07-30T16:16:47Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-07-29T23:14:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0b65ea8fda9959c6bb4036c7bff22d5e769973c'/>
<id>urn:sha1:c0b65ea8fda9959c6bb4036c7bff22d5e769973c</id>
<content type='text'>
Instead of using cut with hard-coded hash sizes, use cut with fields, or
where that's not possible, sed with $OID_REGEX, so that the tests are
independent of hash size.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t: fix whitespace around &amp;&amp;</title>
<updated>2020-03-22T23:41:05Z</updated>
<author>
<name>Andrei Rybak</name>
<email>rybak.a.v@gmail.com</email>
</author>
<published>2020-03-22T21:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64d1022e14cafa211f84aab9e1a9f7aab8164855'/>
<id>urn:sha1:64d1022e14cafa211f84aab9e1a9f7aab8164855</id>
<content type='text'>
Add missing spaces before '&amp;&amp;' and switch tabs around '&amp;&amp;' to spaces.
Also fix the space after redirection operator in t3701 while we're here.

These issues were found using `git grep '[^ ]&amp;&amp;$'` and
`git grep -P '&amp;&amp;\t' t/`.

Signed-off-by: Andrei Rybak &lt;rybak.a.v@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pk/status-of-uncloned-submodule'</title>
<updated>2020-02-14T20:54:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-02-14T20:54:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f2dcfcc21d233c71e47e2ddae799968a18775a1d'/>
<id>urn:sha1:f2dcfcc21d233c71e47e2ddae799968a18775a1d</id>
<content type='text'>
The way "git submodule status" reports an initialized but not yet
populated submodule has not been reimplemented correctly when a
part of the "git submodule" command was rewritten in C, which has
been corrected.

* pk/status-of-uncloned-submodule:
  t7400: testcase for submodule status on unregistered inner git repos
  submodule: fix status of initialized but not cloned submodules
  t7400: add a testcase for submodule status on empty dirs
</content>
</entry>
<entry>
<title>Merge branch 'hw/advice-add-nothing'</title>
<updated>2020-02-14T20:54:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-02-14T20:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=daef1b300b07c3d17d47c3bf01ebde28b62ff3fe'/>
<id>urn:sha1:daef1b300b07c3d17d47c3bf01ebde28b62ff3fe</id>
<content type='text'>
Two help messages given when "git add" notices the user gave it
nothing to add have been updated to use advise() API.

* hw/advice-add-nothing:
  add: change advice config variables used by the add API
  add: use advise function to display hints
</content>
</entry>
<entry>
<title>t7400: testcase for submodule status on unregistered inner git repos</title>
<updated>2020-02-04T19:26:22Z</updated>
<author>
<name>Peter Kaestle</name>
<email>peter@piie.net</email>
</author>
<published>2020-02-02T23:32:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f38c92452d0ad75b1c5c5cfdd04223ad7a9a08a9'/>
<id>urn:sha1:f38c92452d0ad75b1c5c5cfdd04223ad7a9a08a9</id>
<content type='text'>
We have test coverage for "git submodule status" output in
various cases, i.e.

  1) not-init, not-cloned: status should initially be "missing"
  2) init, not-cloned: status should be "missing"
  3) not-init, cloned: status should ignore the inner git-repo
  4) init, cloned: status should be "up-to-date" after update
  4.1) + modified: status should be "modified" after submodule commit
  4.2) + modified, committed: status should be "up-to-date" after update

the case 3) is not covered yet.

Test that submodule status reports an inner git repo as unknown, while
it is not added to the superproject.  This covers case (3).

Signed-off-by: Peter Kaestle &lt;peter@piie.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: fix status of initialized but not cloned submodules</title>
<updated>2020-01-27T18:14:00Z</updated>
<author>
<name>Peter Kaestle</name>
<email>peter.kaestle@nokia.com</email>
</author>
<published>2020-01-24T10:34:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b2885ec9ba0b1328858231c9f5095e7f85d9f23'/>
<id>urn:sha1:3b2885ec9ba0b1328858231c9f5095e7f85d9f23</id>
<content type='text'>
Original bash helper for "submodule status" was doing a check for
initialized but not cloned submodules and prefixed the status with
a minus sign in case no .git file or folder was found inside the
submodule directory.

This check was missed when the original port of the functionality
from bash to C was done.

Signed-off-by: Peter Kaestle &lt;peter.kaestle@nokia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7400: add a testcase for submodule status on empty dirs</title>
<updated>2020-01-27T18:13:32Z</updated>
<author>
<name>Peter Kaestle</name>
<email>peter.kaestle@nokia.com</email>
</author>
<published>2020-01-24T10:34:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ace912bfb8e0cf85e29cc2d81fd847a96637be36'/>
<id>urn:sha1:ace912bfb8e0cf85e29cc2d81fd847a96637be36</id>
<content type='text'>
We have test coverage for "git submodule status" output in
various cases, i.e.

    1) not-init, not-cloned: status should initially be "missing"
    2) init, not-cloned: status should be "missing"
    3) not-init, cloned:
    4) init, cloned: status should be "up-to-date" after update
    4.1) + modified: status should be "modified" after submodule commit
    4.2) + modified, committed: status should be "up-to-date" after update

but the cases 2) and 3) are not covered.

Test that submodule status reports initialized but not cloned
submodules as missing to fill the gap in test coverage; this covers
case (2) above, but case (3) remains uncovered.

Signed-off-by: Peter Kaestle &lt;peter.kaestle@nokia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
