# [PATCH] Use "-script" postfix for scripts

9 messages from 2005-08-12 to 2005-08-13. Participants: Johannes Schindelin, Junio C Hamano, Linus Torvalds, Ryan Anderson, Petr Baudis.
Thread: https://gitlist.dev/t/1482

## Johannes Schindelin, 2005-08-12 13:28

Subject: [PATCH] Use "-script" postfix for scripts
Message-ID: <Pine.LNX.4.63.0508121526050.25606@wgmdd8.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0508121526050.25606%40wgmdd8.biozentrum.uni-wuerzburg.de

```

For consistency reasons, the names of all scripts should end in "-script".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

This may be a bit controversial (people might find it unnecessary). 
Subject to discussion.

---

 Makefile                   |   15 ++++++++-------
 git-cherry-script          |    0 
 git-clone-dumb-http-script |    0 
 git-clone-script           |    2 +-
 git-rebase-script          |    4 ++--
 git-request-pull-script    |    4 ++--
 git-shortlog-script        |    0 
 git-whatchanged-script     |    0 
 8 files changed, 13 insertions(+), 12 deletions(-)
 rename git-cherry => git-cherry-script (100%)
 rename git-clone-dumb-http => git-clone-dumb-http-script (100%)
 rename git-shortlog => git-shortlog-script (100%)
 rename git-whatchanged => git-whatchanged-script (100%)

5cc55f08d874b61f1067857c7310fac325504ec8
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -58,15 +58,16 @@ SPARSE_FLAGS?=-D__BIG_ENDIAN__ -D__power
 
 
 SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
-	git-pull-script git-tag-script git-resolve-script git-whatchanged \
-	git-fetch-script git-status-script git-commit-script \
-	git-log-script git-shortlog git-cvsimport-script git-diff-script \
-	git-reset-script git-add-script git-checkout-script git-clone-script \
-	gitk git-cherry git-rebase-script git-relink-script git-repack-script \
+	git-pull-script git-tag-script git-resolve-script \
+	git-whatchanged-script git-fetch-script git-status-script \
+	git-commit-script git-log-script git-shortlog-script \
+	git-cvsimport-script git-diff-script git-reset-script git-add-script \
+	git-checkout-script git-clone-script gitk git-cherry-script \
+	git-rebase-script git-relink-script git-repack-script \
 	git-format-patch-script git-sh-setup-script git-push-script \
 	git-branch-script git-parse-remote git-verify-tag-script \
-	git-ls-remote-script git-clone-dumb-http git-rename-script \
-	git-request-pull-script git-bisect-script
+	git-ls-remote-script git-clone-dumb-http-script \
+	git-rename-script git-request-pull-script git-bisect-script
 
 SCRIPTS += git-count-objects-script
 # SCRIPTS += git-send-email-script
diff --git a/git-cherry b/git-cherry-script
similarity index 100%
rename from git-cherry
rename to git-cherry-script
diff --git a/git-clone-dumb-http b/git-clone-dumb-http-script
similarity index 100%
rename from git-clone-dumb-http
rename to git-clone-dumb-http-script
diff --git a/git-clone-script b/git-clone-script
--- a/git-clone-script
+++ b/git-clone-script
@@ -89,7 +89,7 @@ yes,yes)
 		rsync $quiet -avz --ignore-existing "$repo/refs/" "$D/.git/refs/"
 		;;
 	http://*)
-		git-clone-dumb-http "$repo" "$D"
+		git-clone-dumb-http-script "$repo" "$D"
 		case "$?" in
 		2)
 			echo "Somebody should define smarter http server protocol" >&2
diff --git a/git-rebase-script b/git-rebase-script
--- a/git-rebase-script
+++ b/git-rebase-script
@@ -7,7 +7,7 @@
 
 usage="usage: $0 "'<upstream> [<head>]
 
-Uses output from git-cherry to rebase local commits to the new head of
+Uses output from git-cherry-script to rebase local commits to the new head of
 upstream tree.'
 
 case "$#,$1" in
@@ -36,7 +36,7 @@ trap "rm -rf $tmp-*" 0 1 2 3 15
 
 >$fail
 
-git-cherry $upstream $ours |
+git-cherry-script $upstream $ours |
 while read sign commit
 do
 	case "$sign" in
diff --git a/git-request-pull-script b/git-request-pull-script
--- a/git-request-pull-script
+++ b/git-request-pull-script
@@ -24,12 +24,12 @@ headrev=`git-rev-parse --verify $head^0`
 
 echo "The following changes since commit $baserev:"
 git log --max-count=1 --pretty=short "$baserev" |
-git-shortlog | sed -e 's/^\(.\)/  \1/'
+git-shortlog-script | sed -e 's/^\(.\)/  \1/'
 
 echo "are found in the git repository at:" 
 echo
 echo "  $url"
 echo
 
-git log  $baserev..$headrev | git-shortlog ;
+git log  $baserev..$headrev | git-shortlog-script ;
 git diff $baserev..$headrev | git-apply --stat --summary
diff --git a/git-shortlog b/git-shortlog-script
similarity index 100%
rename from git-shortlog
rename to git-shortlog-script
diff --git a/git-whatchanged b/git-whatchanged-script
similarity index 100%
rename from git-whatchanged
rename to git-whatchanged-script

```

## Junio C Hamano, 2005-08-12 15:32

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <7vwtmrxjbb.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vwtmrxjbb.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.63.0508121526050.25606@wgmdd8.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> For consistency reasons, the names of all scripts should end in "-script".
>
> This may be a bit controversial (people might find it unnecessary). 
> Subject to discussion.

I have never liked the original -script name convention.  It
only meant that they are implemented as scripts (as opposed to
those on the $(PROG) Makefile variable), but the end users who
end up typing their names from the command line, and to a lesser
degree the people who use them in their scripts, should not care
how they are implemented to begin with.

And to cope with long names and make things look a bit more
familiar to CVS migrants, "git" wrapper was invented to supply
the -script suffix to grok "git whatever", but just in case if
something was _not_ implemented as a script, it ends up needing
to try "git-whatever" in addition to "git-whatever-script".  The
patch alleviates the "git" problem for "git-whatchanged" and
friends whose names currently do not end with -script, but it
still does not help "git apply", for example.  I like the
general direction of making things consistent, but I wonder if
we can become consistent by losing -script suffix, not adding to
the ones that lack it.

And as you imply, this kind of change inevitable breaks people's
scripts.  But I do agree with you that we should do something
about it, so it may be better to break them sooner rather than
later, as long as we make sure we break them just once.

```

## Johannes Schindelin, 2005-08-12 16:00

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <Pine.LNX.4.63.0508121800050.26333@wgmdd8.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0508121800050.26333%40wgmdd8.biozentrum.uni-wuerzburg.de
In-Reply-To: <7vwtmrxjbb.fsf@assigned-by-dhcp.cox.net>

```
hI,

On Fri, 12 Aug 2005, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > For consistency reasons, the names of all scripts should end in "-script".
> >
> > This may be a bit controversial (people might find it unnecessary). 
> > Subject to discussion.
> 
> I have never liked the original -script name convention.

Okay. I'm all for dropping the "-script" postfix.

Ciao,
Dscho

```

## Linus Torvalds, 2005-08-12 21:55

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <Pine.LNX.4.58.0508121451590.3295@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.58.0508121451590.3295%40g5.osdl.org
In-Reply-To: <7vwtmrxjbb.fsf@assigned-by-dhcp.cox.net>

```


On Fri, 12 Aug 2005, Junio C Hamano wrote:
> 
> I have never liked the original -script name convention.  It
> only meant that they are implemented as scripts (as opposed to
> those on the $(PROG) Makefile variable), but the end users who
> end up typing their names from the command line, and to a lesser
> degree the people who use them in their scripts, should not care
> how they are implemented to begin with.

Well, end users _don't_ care, since they are supposed to use just a simple
"git xxx".

The advantage with "git-xxx-script" is for git developers: at least yours 
truly does "grep xyz *.c" all the time, and the "grep abc *-script" is 
entirely analogous to that. That's where the "-script" ending comes from: 
it really helps pick out the stuff you can grep from (as opposed to the 
stuff that got compiled and isn't greppable).

Sure, I could have called it ".sh" instead to make it look even more like 
a shell script thing, but I actually think "-script" describes any 
scripting language - shell, perl, you name it..

			Linus

```

## Ryan Anderson, 2005-08-12 22:27

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <20050812222716.GD22778@mythryan2.michonline.com>
URL: https://gitlist.dev/e/20050812222716.GD22778%40mythryan2.michonline.com
In-Reply-To: <Pine.LNX.4.58.0508121451590.3295@g5.osdl.org>

```
On Fri, Aug 12, 2005 at 02:55:01PM -0700, Linus Torvalds wrote:
> 
> Sure, I could have called it ".sh" instead to make it look even more like 
> a shell script thing, but I actually think "-script" describes any 
> scripting language - shell, perl, you name it..

See, for example, the history on git-rename-script for why this is good.

-- 

Ryan Anderson
  sometimes Pug Majere

```

## Junio C Hamano, 2005-08-13 08:57

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <7v64uaqknh.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v64uaqknh.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050812222716.GD22778@mythryan2.michonline.com>

```
Ryan Anderson <ryan@michonline.com> writes:

> See, for example, the history on git-rename-script for why this is good.

Why do you think it is a good example?  What happens when next
time somebody rewrites it in C?

```

## Linus Torvalds, 2005-08-13 16:35

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <Pine.LNX.4.58.0508130934000.19049@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.58.0508130934000.19049%40g5.osdl.org
In-Reply-To: <7v64uaqknh.fsf@assigned-by-dhcp.cox.net>

```


On Sat, 13 Aug 2005, Junio C Hamano wrote:
> Ryan Anderson <ryan@michonline.com> writes:
> > See, for example, the history on git-rename-script for why this is good.
> 
> Why do you think it is a good example?  What happens when next
> time somebody rewrites it in C?

We'll call the C version "rename.c", and the program gets to be called 
"git-rename", and "git rename" continues to work perfectly fine, so users 
won't be affected in the least.

And "grep ... *.c" and "grep ... *-script" also still work right.

That sounds like a good outcome to me.

		Linus

```

## Ryan Anderson, 2005-08-13 22:25

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <20050813222512.GA6844@mythryan2.michonline.com>
URL: https://gitlist.dev/e/20050813222512.GA6844%40mythryan2.michonline.com
In-Reply-To: <7v64uaqknh.fsf@assigned-by-dhcp.cox.net>

```
On Sat, Aug 13, 2005 at 01:57:22AM -0700, Junio C Hamano wrote:
> Ryan Anderson <ryan@michonline.com> writes:
> 
> > See, for example, the history on git-rename-script for why this is good.
> 
> Why do you think it is a good example?  What happens when next
> time somebody rewrites it in C?

Well, I was really responding to the comment about "-script" being
better than ".sh", as trying ".sh", ".pl", ".php", etc, would rapidly
be annoying.

Honestly, I think the biggest argument against the "-script" suffix is
related to man-page usage:  It requires significant knowledge of the Git
project to figure out what name variant to use to find the man page.

(There are other problems with man pages, but I'll address those
seperately now that they have occurred to me.)

-- 

Ryan Anderson
  sometimes Pug Majere

```

## Petr Baudis, 2005-08-13 22:28

Subject: Re: [PATCH] Use "-script" postfix for scripts
Message-ID: <20050813222851.GN5608@pasky.ji.cz>
URL: https://gitlist.dev/e/20050813222851.GN5608%40pasky.ji.cz
In-Reply-To: <20050813222512.GA6844@mythryan2.michonline.com>

```
Dear diary, on Sun, Aug 14, 2005 at 12:25:12AM CEST, I got a letter
where Ryan Anderson <ryan@michonline.com> told me that...
> Honestly, I think the biggest argument against the "-script" suffix is
> related to man-page usage:  It requires significant knowledge of the Git
> project to figure out what name variant to use to find the man page.

.oO(Hey, tcl has own man section as well!)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

```
