Skip to content

Commit c74c720

Browse files
jrngitster
authored andcommitted
test: replace shebangs with descriptions in shell libraries
A #! line in these files is misleading, since these scriptlets are meant to be sourced with '.' (using whatever shell sources them) instead of run directly using the interpreter named on the #! line. Removing the #! line shouldn't hurt syntax highlighting since these files have filenames ending with '.sh'. For documentation, add a brief description of how the files are meant to be used in place of the shebang line. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b018c73 commit c74c720

15 files changed

+64
-20
lines changed

t/gitweb-lib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/sh
1+
# Initialization and helpers for Gitweb tests, which source this
2+
# shell library instead of test-lib.sh.
23
#
34
# Copyright (c) 2007 Jakub Narebski
45
#

t/lib-bash.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#!/bin/sh
2-
#
3-
# Ensures that tests are run under Bash; primarily intended for running tests
4-
# of the completion script.
1+
# Shell library sourced instead of ./test-lib.sh by tests that need
2+
# to run under Bash; primarily intended for tests of the completion
3+
# script.
54

65
if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
76
# we are in full-on bash mode

t/lib-cvs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
# Shell library sourced instead of ./test-lib.sh by cvsimport tests.
22

33
. ./test-lib.sh
44

t/lib-diff-alternative.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/sh
1+
# Helpers shared by the test scripts for diff algorithms (patience,
2+
# histogram, etc).
23

34
test_diff_frobnitz() {
45
cat >file1 <<\EOF

t/lib-gettext.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/sh
1+
# Initialization and Icelandic locale for basic git i18n tests,
2+
# which source this scriptlet instead of ./test-lib.sh.
23
#
34
# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
45
#

t/lib-git-daemon.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
#!/bin/sh
1+
# Shell library to run git-daemon in tests. Ends the test early if
2+
# GIT_TEST_GIT_DAEMON is not set.
3+
#
4+
# Usage:
5+
#
6+
# . ./test-lib.sh
7+
# . "$TEST_DIRECTORY"/lib-git-daemon.sh
8+
# start_git_daemon
9+
#
10+
# test_expect_success '...' '
11+
# ...
12+
# '
13+
#
14+
# test_expect_success ...
15+
#
16+
# stop_git_daemon
17+
# test_done
218

319
if test -z "$GIT_TEST_GIT_DAEMON"
420
then

t/lib-httpd.sh

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
#!/bin/sh
1+
# Shell library to run an HTTP server for use in tests.
2+
# Ends the test early if httpd tests should not be run,
3+
# for example because the user has not enabled them.
4+
#
5+
# Usage:
6+
#
7+
# . ./test-lib.sh
8+
# . "$TEST_DIRECTORY"/lib-httpd.sh
9+
# start_httpd
10+
#
11+
# test_expect_success '...' '
12+
# ...
13+
# '
14+
#
15+
# test_expect_success ...
16+
#
17+
# stop_httpd
18+
# test_done
19+
#
20+
# Can be configured using the following variables.
21+
#
22+
# GIT_TEST_HTTPD enable HTTPD tests
23+
# LIB_HTTPD_PATH web server path
24+
# LIB_HTTPD_MODULE_PATH web server modules path
25+
# LIB_HTTPD_PORT listening port
26+
# LIB_HTTPD_DAV enable DAV
27+
# LIB_HTTPD_SVN enable SVN
28+
# LIB_HTTPD_SSL enable SSL
229
#
330
# Copyright (c) 2008 Clemens Buchacher <[email protected]>
431
#

t/lib-pack.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/bin/sh
2-
#
31
# Support routines for hand-crafting weird or malicious packs.
42
#
53
# You can make a complete pack like:

t/lib-pager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
# Helpers for tests of git's choice of pager.
22

33
test_expect_success 'determine default pager' '
44
test_might_fail git config --unset core.pager &&

t/lib-read-tree.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/bin/sh
2-
#
31
# Helper functions to check if read-tree would succeed/fail as expected with
42
# and without the dry-run option. They also test that the dry-run does not
53
# write the index and that together with -u it doesn't touch the work tree.

0 commit comments

Comments
 (0)