[PATCH v2 0/7] tests: don't depend on "git init" using the template

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This reduced-in-scope re-roll of [1] changes those tests that
implicitly relied on the existence of the default "git init" template
to no longer do so. This makes the intent of the tests more explicit,
e.g. in the case of the .git/branch directory.

Parts of the v1 were already split up, re-rolled and merged as
a5bf611cc4f (Merge branch 'ab/hook-tests-updates', 2022-03-30).

Future goals: I then have a local topic on top of this to add the
"--no-template" option to "git init", and to have the test suite run
in that mode by default, that's currently one of the blockers for
making the test run without the bin-wrappers[2], which as noted in [3]
leaves us with some blind spots in our tests.

But for now this is all relatively straightforward conversion of
existing tests to make them not rely on "git init" giving them a
template, which they opt-in to with a new TEST_CREATE_REPO_NO_TEMPLATE
variable.

Junio: There's a trivial conflict in one of the tests with "next",
i.e.:

	diff --cc t/t6101-rev-parse-parents.sh
	index 5f55ab98d35,a3a41c7a3e4..00000000000
	--- a/t/t6101-rev-parse-parents.sh
	+++ b/t/t6101-rev-parse-parents.sh
	@@@ -8,7 -8,7 +8,11 @@@ test_description='Test git rev-parse wi
	  GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
	  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME

	++<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< HEAD
	 +TEST_CREATE_REPO_NO_TEMPLATE=1
	++================================
	+ TEST_PASSES_SANITIZE_LEAK=true
	++>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> origin/seen

The resolution is to keep both sides, i.e. to end up with:

	TEST_CREATE_REPO_NO_TEMPLATE=1
	TEST_PASSES_SANITIZE_LEAK=true

1. https://lore.kernel.org/git/cover-00.13-00000000000-20211212T201308Z-avarab@xxxxxxxxx/
2. https://lore.kernel.org/git/220405.86k0c3lt2l.gmgdl@xxxxxxxxxxxxxxxxxxx/
3. https://lore.kernel.org/git/211124.86sfvld4cl.gmgdl@xxxxxxxxxxxxxxxxxxx/

Ævar Arnfjörð Bjarmason (7):
  t0008: don't rely on default ".git/info/exclude"
  tests: don't depend on template-created .git/branches
  tests: don't assume a .git/info for .git/info/grafts
  tests: don't assume a .git/info for .git/info/attributes
  tests: don't assume a .git/info for .git/info/refs
  tests: don't assume a .git/info for .git/info/exclude
  tests: don't assume a .git/info for .git/info/sparse-checkout

 t/annotate-tests.sh                    |  3 ++-
 t/lib-submodule-update.sh              |  7 +++++--
 t/t0003-attributes.sh                  |  5 ++++-
 t/t0008-ignores.sh                     | 12 +++++++-----
 t/t0028-working-tree-encoding.sh       |  2 ++
 t/t1011-read-tree-sparse-checkout.sh   |  2 ++
 t/t1090-sparse-checkout-scope.sh       |  5 ++++-
 t/t1301-shared-repo.sh                 |  3 ++-
 t/t2018-checkout-branch.sh             |  4 +++-
 t/t2400-worktree-add.sh                |  4 ++++
 t/t3426-rebase-submodule.sh            |  1 +
 t/t3507-cherry-pick-conflict.sh        |  2 ++
 t/t5000-tar-tree.sh                    |  5 ++++-
 t/t5001-archive-attr.sh                |  5 ++++-
 t/t5002-archive-attr-pattern.sh        |  5 ++++-
 t/t5003-archive-zip.sh                 |  5 ++++-
 t/t5318-commit-graph.sh                |  3 ++-
 t/t5505-remote.sh                      |  6 ++++--
 t/t5516-fetch-push.sh                  | 16 ++++++++++++++--
 t/t5550-http-fetch-dumb.sh             |  3 ++-
 t/t6001-rev-list-graft.sh              |  1 +
 t/t6101-rev-parse-parents.sh           |  2 ++
 t/t6435-merge-sparse.sh                |  2 ++
 t/t7063-status-untracked-cache.sh      |  3 ++-
 t/t7418-submodule-sparse-gitmodules.sh |  3 ++-
 t/t7814-grep-recurse-submodules.sh     |  8 ++++++--
 t/t8001-annotate.sh                    |  1 +
 t/t8002-blame.sh                       |  1 +
 t/t8012-blame-colors.sh                |  1 +
 t/test-lib.sh                          |  4 +++-
 30 files changed, 97 insertions(+), 27 deletions(-)

Range-diff against v1:
 1:  5526d3dc838 <  -:  ----------- t0001: fix gaps in "TEMPLATE DIRECTORY" coverage
 2:  ef2b67768cf <  -:  ----------- init: split out template population from create_default_files()
 3:  784b7947512 <  -:  ----------- init: unconditionally create the "info" directory
 4:  3d4ea5c5d30 =  1:  21927e21832 t0008: don't rely on default ".git/info/exclude"
 5:  6bbb39f13fc <  -:  ----------- init & clone: add a --no-template option
 6:  2f478f7ba4a <  -:  ----------- init & clone: add init.templateDir=[bool]
 7:  9402fb23b40 <  -:  ----------- test-lib: create test data with "git init --no-template" (almost)
 8:  0c9b953dd43 <  -:  ----------- tests: don't depend on template-created .git/branches
 9:  d97122f5fd8 <  -:  ----------- t5540: don't rely on "hook/post-update.sample"
10:  ca55471d134 <  -:  ----------- test-lib-functions: add and use a "write_hook" wrapper
11:  6f805f7ebac <  -:  ----------- tests: change "cat && chmod +x" to use "write_hook"
12:  2acbaa77f8d <  -:  ----------- tests: migrate miscellaneous "write_script" to "write_hooks"
13:  d021a5981a1 <  -:  ----------- tests: don't depend on template-created .git/hooks
 -:  ----------- >  2:  c4d0e6c684b tests: don't depend on template-created .git/branches
 -:  ----------- >  3:  967762b4670 tests: don't assume a .git/info for .git/info/grafts
 -:  ----------- >  4:  64292c20c84 tests: don't assume a .git/info for .git/info/attributes
 -:  ----------- >  5:  b9f667bf292 tests: don't assume a .git/info for .git/info/refs
 -:  ----------- >  6:  29da5a3d431 tests: don't assume a .git/info for .git/info/exclude
 -:  ----------- >  7:  0149c80f09c tests: don't assume a .git/info for .git/info/sparse-checkout
-- 
2.36.1.1119.g5a713b43bd4




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux