git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] test shell-library cleanups
@ 2020-03-26  8:23 Jeff King
  2020-03-26  8:25 ` [PATCH 1/2] t/lib-credential.sh: drop shebang line Jeff King
  2020-03-26  8:25 ` [PATCH 2/2] t/lib-*.sh: drop executable bit Jeff King
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff King @ 2020-03-26  8:23 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Junio C Hamano

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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] t/lib-credential.sh: drop shebang line
  2020-03-26  8:23 [PATCH 0/2] test shell-library cleanups Jeff King
@ 2020-03-26  8:25 ` Jeff King
  2020-03-26  8:33   ` Denton Liu
  2020-03-26  8:25 ` [PATCH 2/2] t/lib-*.sh: drop executable bit Jeff King
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff King @ 2020-03-26  8:25 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Junio C Hamano

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] t/lib-*.sh: drop executable bit
  2020-03-26  8:23 [PATCH 0/2] test shell-library cleanups Jeff King
  2020-03-26  8:25 ` [PATCH 1/2] t/lib-credential.sh: drop shebang line Jeff King
@ 2020-03-26  8:25 ` Jeff King
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff King @ 2020-03-26  8:25 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Junio C Hamano

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] t/lib-credential.sh: drop shebang line
  2020-03-26  8:25 ` [PATCH 1/2] t/lib-credential.sh: drop shebang line Jeff King
@ 2020-03-26  8:33   ` Denton Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Denton Liu @ 2020-03-26  8:33 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Johannes Schindelin, Junio C Hamano

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-26  8:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26  8:23 [PATCH 0/2] test shell-library cleanups Jeff King
2020-03-26  8:25 ` [PATCH 1/2] t/lib-credential.sh: drop shebang line Jeff King
2020-03-26  8:33   ` Denton Liu
2020-03-26  8:25 ` [PATCH 2/2] t/lib-*.sh: drop executable bit Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).