# [PATCH 0/2] test shell-library cleanups

4 messages from 2020-03-26 to 2020-03-26. Participants: Jeff King, Denton Liu.
Thread: https://gitlist.dev/t/53106

## Jeff King, 2020-03-26 08:23

Subject: [PATCH 0/2] test shell-library cleanups
Message-ID: <20200326082338.GA3611364@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200326082338.GA3611364%40coredump.intra.peff.net

```
Inspired by Dscho's cleanup of lib-gpg.sh in [1], I noticed a few other
things.

  [1/2]: t/lib-credential.sh: drop shebang line
  [2/2]: t/lib-*.sh: drop executable bit

 t/lib-credential.sh       | 3 ++-
 t/lib-gpg.sh              | 0
 t/lib-log-graph.sh        | 0
 t/lib-submodule-update.sh | 0
 4 files changed, 2 insertions(+), 1 deletion(-)
 mode change 100755 => 100644 t/lib-credential.sh
 mode change 100755 => 100644 t/lib-gpg.sh
 mode change 100755 => 100644 t/lib-log-graph.sh
 mode change 100755 => 100644 t/lib-submodule-update.sh

-Peff

[1] https://lore.kernel.org/git/c1811d54190a62e3d35505e2b806c89238b56de8.1585114881.git.gitgitgadget@gmail.com/

```

## Jeff King, 2020-03-26 08:25

Subject: [PATCH 1/2] t/lib-credential.sh: drop shebang line
Message-ID: <20200326082527.GA3611762@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200326082527.GA3611762%40coredump.intra.peff.net
In-Reply-To: <20200326082338.GA3611364@coredump.intra.peff.net>

```
The purpose of lib-credential.sh is to be sourced into other test
scripts. It doesn't need a "#!/bin/sh" line, as running it directly
makes no sense. Nor does it serve any real filetype documentation
purpose, as the file is cleary named with a ".sh" extension.

In the spirit of c74c72034f (test: replace shebangs with descriptions in
shell libraries, 2013-11-25), let's replace it with a human-readable
description.

Signed-off-by: Jeff King <peff@peff.net>
---
I left the similar case in lib-gpg alone so as not to conflict with
Dscho's version.

 t/lib-credential.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/lib-credential.sh b/t/lib-credential.sh
index 937b831ea6..5ea8bc9f1d 100755
--- a/t/lib-credential.sh
+++ b/t/lib-credential.sh
@@ -1,4 +1,5 @@
-#!/bin/sh
+# Shell library for testing credential handling including helpers. See t0302
+# for an example of testing a specific helper.
 
 # Try a set of credential helpers; the expected stdin,
 # stdout and stderr should be provided on stdin,
-- 
2.26.0.576.gb87790c3c1


```

## Jeff King, 2020-03-26 08:25

Subject: [PATCH 2/2] t/lib-*.sh: drop executable bit
Message-ID: <20200326082553.GB3611762@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200326082553.GB3611762%40coredump.intra.peff.net
In-Reply-To: <20200326082338.GA3611364@coredump.intra.peff.net>

```
There's no need for shell libraries to have the executable bit. They're
meant to be sourced, and running them stand-alone is pointless. Let's
reduce any possible confusion by making it more clear they're not meant
to be run this way.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-credential.sh       | 0
 t/lib-gpg.sh              | 0
 t/lib-log-graph.sh        | 0
 t/lib-submodule-update.sh | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 t/lib-credential.sh
 mode change 100755 => 100644 t/lib-gpg.sh
 mode change 100755 => 100644 t/lib-log-graph.sh
 mode change 100755 => 100644 t/lib-submodule-update.sh

diff --git a/t/lib-credential.sh b/t/lib-credential.sh
old mode 100755
new mode 100644
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
old mode 100755
new mode 100644
diff --git a/t/lib-log-graph.sh b/t/lib-log-graph.sh
old mode 100755
new mode 100644
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
old mode 100755
new mode 100644
-- 
2.26.0.576.gb87790c3c1

```

## Denton Liu, 2020-03-26 08:33

Subject: Re: [PATCH 1/2] t/lib-credential.sh: drop shebang line
Message-ID: <20200326083346.GA1891350@generichostname>
URL: https://gitlist.dev/e/20200326083346.GA1891350%40generichostname
In-Reply-To: <20200326082527.GA3611762@coredump.intra.peff.net>

```
On Thu, Mar 26, 2020 at 04:25:27AM -0400, Jeff King wrote:
> The purpose of lib-credential.sh is to be sourced into other test
> scripts. It doesn't need a "#!/bin/sh" line, as running it directly
> makes no sense. Nor does it serve any real filetype documentation
> purpose, as the file is cleary named with a ".sh" extension.

s/cleary/clearly/

Patch and message look obviously good otherwise.

```
