git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] make usage text consistent in git commands
@ 2013-02-24  0:20 David Aguilar
  2013-02-24  0:20 ` [PATCH 01/16] git-sh-setup: make usage text consistent David Aguilar
  2013-02-24  0:29 ` [PATCH 00/16] make usage text consistent in git commands Jonathan Nieder
  0 siblings, 2 replies; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Various helper commands around Git say "Usage: ..." when
invoked as "git $cmd -h".  This is inconsitent with the core
git commands which all use the lowercase "usage: ..." form.

Adjust these so that they match the convention used by
builtin/help.c and git.c.

I fixed a tiny problem in import-zips.py while I was in
there, though it's unlikely that anyone uses such an old
Python these days.

There are still one or two results for "git grep Usage:"
near the tests, but end users do not ever see them so I
figured it was best to leave them as-is.

David Aguilar (16):
  git-sh-setup: make usage text consistent
  git-svn: make usage text consistent
  git-relink: make usage text consistent
  git-merge-one-file: make usage text consistent
  git-archimport: make usage text consistent
  git-cvsexportcommit: make usage text consistent
  git-cvsimport: make usage text consistent
  git-cvsimport: make usage text consistent
  contrib/credential: make usage text consistent
  contrib/fast-import: make usage text consistent
  contrib/fast-import/import-zips.py: fix broken error message
  contrib/fast-import/import-zips.py: use spaces instead of tabs
  contrib/examples: make usage text consistent
  contrib/hooks/setgitperms.perl: make usage text consistent
  templates/hooks--update.sample: make usage text consistent
  Documentation/user-manual.txt: make usage text consistent

 Documentation/user-manual.txt                      |  4 +-
 .../gnome-keyring/git-credential-gnome-keyring.c   |  2 +-
 .../osxkeychain/git-credential-osxkeychain.c       |  2 +-
 .../credential/wincred/git-credential-wincred.c    |  2 +-
 contrib/examples/git-remote.perl                   |  2 +-
 contrib/examples/git-svnimport.perl                |  2 +-
 contrib/fast-import/git-import.perl                |  2 +-
 contrib/fast-import/git-import.sh                  |  2 +-
 contrib/fast-import/import-zips.py                 | 98 +++++++++++-----------
 contrib/hooks/setgitperms.perl                     |  2 +-
 git-archimport.perl                                |  2 +-
 git-cvsexportcommit.perl                           |  2 +-
 git-cvsimport.perl                                 |  2 +-
 git-cvsserver.perl                                 |  2 +-
 git-merge-one-file.sh                              |  2 +-
 git-relink.perl                                    |  2 +-
 git-sh-setup.sh                                    |  6 +-
 git-svn.perl                                       |  2 +-
 templates/hooks--update.sample                     |  2 +-
 19 files changed, 70 insertions(+), 70 deletions(-)

-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 01/16] git-sh-setup: make usage text consistent
  2013-02-24  0:20 [PATCH 00/16] make usage text consistent in git commands David Aguilar
@ 2013-02-24  0:20 ` David Aguilar
  2013-02-24  0:20   ` [PATCH 02/16] git-svn: " David Aguilar
  2013-02-24  0:25   ` [PATCH 01/16] git-sh-setup: " Jonathan Nieder
  2013-02-24  0:29 ` [PATCH 00/16] make usage text consistent in git commands Jonathan Nieder
  1 sibling, 2 replies; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

mergetool, bisect, and other commands that use
git-sh-setup print a usage string that is inconsistent
with the rest of Git when they are invoked as "git $cmd -h".

The compiled builtins use the lowercase "usage:" string
but these commands say "Usage:".  Adjust the shell library
to make these consistent.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-sh-setup.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 795edd2..9cfbe7f 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -84,14 +84,14 @@ if test -n "$OPTIONS_SPEC"; then
 else
 	dashless=$(basename "$0" | sed -e 's/-/ /')
 	usage() {
-		die "Usage: $dashless $USAGE"
+		die "usage: $dashless $USAGE"
 	}
 
 	if [ -z "$LONG_USAGE" ]
 	then
-		LONG_USAGE="Usage: $dashless $USAGE"
+		LONG_USAGE="usage: $dashless $USAGE"
 	else
-		LONG_USAGE="Usage: $dashless $USAGE
+		LONG_USAGE="usage: $dashless $USAGE
 
 $LONG_USAGE"
 	fi
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 02/16] git-svn: make usage text consistent
  2013-02-24  0:20 ` [PATCH 01/16] git-sh-setup: make usage text consistent David Aguilar
@ 2013-02-24  0:20   ` David Aguilar
  2013-02-24  0:20     ` [PATCH 03/16] git-relink: " David Aguilar
  2013-02-24  0:25   ` [PATCH 01/16] git-sh-setup: " Jonathan Nieder
  1 sibling, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-svn.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-svn.perl b/git-svn.perl
index b46795f..a93166f 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -382,7 +382,7 @@ sub usage {
 	my $fd = $exit ? \*STDERR : \*STDOUT;
 	print $fd <<"";
 git-svn - bidirectional operations between a single Subversion tree and git
-Usage: git svn <command> [options] [arguments]\n
+usage: git svn <command> [options] [arguments]\n
 
 	print $fd "Available commands:\n" unless $cmd;
 
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 03/16] git-relink: make usage text consistent
  2013-02-24  0:20   ` [PATCH 02/16] git-svn: " David Aguilar
@ 2013-02-24  0:20     ` David Aguilar
  2013-02-24  0:20       ` [PATCH 04/16] git-merge-one-file: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-relink.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-relink.perl b/git-relink.perl
index f29285c..236a352 100755
--- a/git-relink.perl
+++ b/git-relink.perl
@@ -163,7 +163,7 @@ sub link_two_files($$) {
 
 
 sub usage() {
-	print("Usage: git relink [--safe] <dir>... <master_dir> \n");
+	print("usage: git relink [--safe] <dir>... <master_dir> \n");
 	print("All directories should contain a .git/objects/ subdirectory.\n");
 	print("Options\n");
 	print("\t--safe\t" .
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 04/16] git-merge-one-file: make usage text consistent
  2013-02-24  0:20     ` [PATCH 03/16] git-relink: " David Aguilar
@ 2013-02-24  0:20       ` David Aguilar
  2013-02-24  0:20         ` [PATCH 05/16] git-archimport: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-merge-one-file.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index f612cb8..3373c04 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -18,7 +18,7 @@
 
 USAGE='<orig blob> <our blob> <their blob> <path>'
 USAGE="$USAGE <orig mode> <our mode> <their mode>"
-LONG_USAGE="Usage: git merge-one-file $USAGE
+LONG_USAGE="usage: git merge-one-file $USAGE
 
 Blob ids and modes should be empty for missing files."
 
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 05/16] git-archimport: make usage text consistent
  2013-02-24  0:20       ` [PATCH 04/16] git-merge-one-file: " David Aguilar
@ 2013-02-24  0:20         ` David Aguilar
  2013-02-24  0:20           ` [PATCH 06/16] git-cvsexportcommit: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-archimport.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-archimport.perl b/git-archimport.perl
index bc32f18..9cb123a 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -75,7 +75,7 @@ our($opt_h,$opt_f,$opt_v,$opt_T,$opt_t,$opt_D,$opt_a,$opt_o);
 
 sub usage() {
     print STDERR <<END;
-Usage: git archimport     # fetch/update GIT from Arch
+usage: git archimport     # fetch/update GIT from Arch
        [ -h ] [ -v ] [ -o ] [ -a ] [ -f ] [ -T ] [ -D depth ] [ -t tempdir ]
        repository/arch-branch [ repository/arch-branch] ...
 END
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 06/16] git-cvsexportcommit: make usage text consistent
  2013-02-24  0:20         ` [PATCH 05/16] git-archimport: " David Aguilar
@ 2013-02-24  0:20           ` David Aguilar
  2013-02-24  0:20             ` [PATCH 07/16] git-cvsimport: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-cvsexportcommit.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index e6bf252..d13f02d 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -420,7 +420,7 @@ sleep(1);
 
 sub usage {
 	print STDERR <<END;
-Usage: GIT_DIR=/path/to/.git git cvsexportcommit [-h] [-p] [-v] [-c] [-f] [-u] [-k] [-w cvsworkdir] [-m msgprefix] [ parent ] commit
+usage: GIT_DIR=/path/to/.git git cvsexportcommit [-h] [-p] [-v] [-c] [-f] [-u] [-k] [-w cvsworkdir] [-m msgprefix] [ parent ] commit
 END
 	exit(1);
 }
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 07/16] git-cvsimport: make usage text consistent
  2013-02-24  0:20           ` [PATCH 06/16] git-cvsexportcommit: " David Aguilar
@ 2013-02-24  0:20             ` David Aguilar
  2013-02-24  0:20               ` [PATCH 08/16] " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-cvsimport.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 344f120..73d367c 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -38,7 +38,7 @@ sub usage(;$) {
 	my $msg = shift;
 	print(STDERR "Error: $msg\n") if $msg;
 	print STDERR <<END;
-Usage: git cvsimport     # fetch/update GIT from CVS
+usage: git cvsimport     # fetch/update GIT from CVS
        [-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
        [-p opts-for-cvsps] [-P file] [-C GIT_repository] [-z fuzz] [-i] [-k]
        [-u] [-s subst] [-a] [-m] [-M regex] [-S regex] [-L commitlimit]
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 08/16] git-cvsimport: make usage text consistent
  2013-02-24  0:20             ` [PATCH 07/16] git-cvsimport: " David Aguilar
@ 2013-02-24  0:20               ` David Aguilar
  2013-02-24  0:20                 ` [PATCH 09/16] contrib/credential: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-cvsserver.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 3679074..f1c3f49 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -107,7 +107,7 @@ my $work =
 $log->info("--------------- STARTING -----------------");
 
 my $usage =
-    "Usage: git cvsserver [options] [pserver|server] [<directory> ...]\n".
+    "usage: git cvsserver [options] [pserver|server] [<directory> ...]\n".
     "    --base-path <path>  : Prepend to requested CVSROOT\n".
     "                          Can be read from GIT_CVSSERVER_BASE_PATH\n".
     "    --strict-paths      : Don't allow recursing into subdirectories\n".
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 09/16] contrib/credential: make usage text consistent
  2013-02-24  0:20               ` [PATCH 08/16] " David Aguilar
@ 2013-02-24  0:20                 ` David Aguilar
  2013-02-24  0:20                   ` [PATCH 10/16] contrib/fast-import: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +-
 contrib/credential/osxkeychain/git-credential-osxkeychain.c     | 2 +-
 contrib/credential/wincred/git-credential-wincred.c             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
index 41f61c5..f2cdefe 100644
--- a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
+++ b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
@@ -401,7 +401,7 @@ static void usage(const char *name)
 	const char *basename = strrchr(name,'/');
 
 	basename = (basename) ? basename + 1 : name;
-	fprintf(stderr, "Usage: %s <", basename);
+	fprintf(stderr, "usage: %s <", basename);
 	while(try_op->name) {
 		fprintf(stderr,"%s",(try_op++)->name);
 		if(try_op->name)
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
index 6beed12..3940202 100644
--- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
+++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
@@ -154,7 +154,7 @@ static void read_credential(void)
 int main(int argc, const char **argv)
 {
 	const char *usage =
-		"Usage: git credential-osxkeychain <get|store|erase>";
+		"usage: git credential-osxkeychain <get|store|erase>";
 
 	if (!argv[1])
 		die(usage);
diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c
index cbaec5f..6619492 100644
--- a/contrib/credential/wincred/git-credential-wincred.c
+++ b/contrib/credential/wincred/git-credential-wincred.c
@@ -313,7 +313,7 @@ static void read_credential(void)
 int main(int argc, char *argv[])
 {
 	const char *usage =
-	    "Usage: git credential-wincred <get|store|erase>\n";
+	    "usage: git credential-wincred <get|store|erase>\n";
 
 	if (!argv[1])
 		die(usage);
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 10/16] contrib/fast-import: make usage text consistent
  2013-02-24  0:20                 ` [PATCH 09/16] contrib/credential: " David Aguilar
@ 2013-02-24  0:20                   ` David Aguilar
  2013-02-24  0:20                     ` [PATCH 11/16] contrib/fast-import/import-zips.py: fix broken error message David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 contrib/fast-import/git-import.perl | 2 +-
 contrib/fast-import/git-import.sh   | 2 +-
 contrib/fast-import/import-zips.py  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/fast-import/git-import.perl b/contrib/fast-import/git-import.perl
index f9fef6d..0891b9e 100755
--- a/contrib/fast-import/git-import.perl
+++ b/contrib/fast-import/git-import.perl
@@ -7,7 +7,7 @@
 use strict;
 use File::Find;
 
-my $USAGE = 'Usage: git-import branch import-message';
+my $USAGE = 'usage: git-import branch import-message';
 my $branch = shift or die "$USAGE\n";
 my $message = shift or die "$USAGE\n";
 
diff --git a/contrib/fast-import/git-import.sh b/contrib/fast-import/git-import.sh
index 0ca7718..f8d803c 100755
--- a/contrib/fast-import/git-import.sh
+++ b/contrib/fast-import/git-import.sh
@@ -5,7 +5,7 @@
 # but is meant to be a simple fast-import example.
 
 if [ -z "$1" -o -z "$2" ]; then
-	echo "Usage: git-import branch import-message"
+	echo "usage: git-import branch import-message"
 	exit 1
 fi
 
diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py
index 5cec9b0..f54c65b 100755
--- a/contrib/fast-import/import-zips.py
+++ b/contrib/fast-import/import-zips.py
@@ -19,7 +19,7 @@ if hexversion < 0x01060000:
         sys.exit(1)
 
 if len(argv) < 2:
-	print 'Usage:', argv[0], '<zipfile>...'
+	print 'usage:', argv[0], '<zipfile>...'
 	exit(1)
 
 branch_ref = 'refs/heads/import-zips'
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 11/16] contrib/fast-import/import-zips.py: fix broken error message
  2013-02-24  0:20                   ` [PATCH 10/16] contrib/fast-import: " David Aguilar
@ 2013-02-24  0:20                     ` David Aguilar
  2013-02-24  0:20                       ` [PATCH 12/16] contrib/fast-import/import-zips.py: use spaces instead of tabs David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

The 'sys' module is not imported but all of the bits
we want from it are.  Adjust the script to not fail
when run on old Python versions and fix the inconsistent
use of tabs.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 contrib/fast-import/import-zips.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py
index f54c65b..b528798 100755
--- a/contrib/fast-import/import-zips.py
+++ b/contrib/fast-import/import-zips.py
@@ -14,9 +14,9 @@ from time import mktime
 from zipfile import ZipFile
 
 if hexversion < 0x01060000:
-        # The limiter is the zipfile module
-        sys.stderr.write("import-zips.py: requires Python 1.6.0 or later.\n")
-        sys.exit(1)
+	# The limiter is the zipfile module
+	stderr.write("import-zips.py: requires Python 1.6.0 or later.\n")
+	exit(1)
 
 if len(argv) < 2:
 	print 'usage:', argv[0], '<zipfile>...'
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 12/16] contrib/fast-import/import-zips.py: use spaces instead of tabs
  2013-02-24  0:20                     ` [PATCH 11/16] contrib/fast-import/import-zips.py: fix broken error message David Aguilar
@ 2013-02-24  0:20                       ` David Aguilar
  2013-02-24  0:20                         ` [PATCH 13/16] contrib/examples: make usage text consistent David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Follow the conventional Python style by using 4-space indents
instead of hard tabs.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 contrib/fast-import/import-zips.py | 98 +++++++++++++++++++-------------------
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py
index b528798..d12c296 100755
--- a/contrib/fast-import/import-zips.py
+++ b/contrib/fast-import/import-zips.py
@@ -14,13 +14,13 @@ from time import mktime
 from zipfile import ZipFile
 
 if hexversion < 0x01060000:
-	# The limiter is the zipfile module
-	stderr.write("import-zips.py: requires Python 1.6.0 or later.\n")
-	exit(1)
+    # The limiter is the zipfile module
+    stderr.write("import-zips.py: requires Python 1.6.0 or later.\n")
+    exit(1)
 
 if len(argv) < 2:
-	print 'usage:', argv[0], '<zipfile>...'
-	exit(1)
+    print 'usage:', argv[0], '<zipfile>...'
+    exit(1)
 
 branch_ref = 'refs/heads/import-zips'
 committer_name = 'Z Ip Creator'
@@ -28,51 +28,51 @@ committer_email = 'zip@example.com'
 
 fast_import = popen('git fast-import --quiet', 'w')
 def printlines(list):
-	for str in list:
-		fast_import.write(str + "\n")
+    for str in list:
+        fast_import.write(str + "\n")
 
 for zipfile in argv[1:]:
-	commit_time = 0
-	next_mark = 1
-	common_prefix = None
-	mark = dict()
-
-	zip = ZipFile(zipfile, 'r')
-	for name in zip.namelist():
-		if name.endswith('/'):
-			continue
-		info = zip.getinfo(name)
-
-		if commit_time < info.date_time:
-			commit_time = info.date_time
-		if common_prefix == None:
-			common_prefix = name[:name.rfind('/') + 1]
-		else:
-			while not name.startswith(common_prefix):
-				last_slash = common_prefix[:-1].rfind('/') + 1
-				common_prefix = common_prefix[:last_slash]
-
-		mark[name] = ':' + str(next_mark)
-		next_mark += 1
-
-		printlines(('blob', 'mark ' + mark[name], \
-					'data ' + str(info.file_size)))
-		fast_import.write(zip.read(name) + "\n")
-
-	committer = committer_name + ' <' + committer_email + '> %d +0000' % \
-		mktime(commit_time + (0, 0, 0))
-
-	printlines(('commit ' + branch_ref, 'committer ' + committer, \
-		'data <<EOM', 'Imported from ' + zipfile + '.', 'EOM', \
-		'', 'deleteall'))
-
-	for name in mark.keys():
-		fast_import.write('M 100644 ' + mark[name] + ' ' +
-			name[len(common_prefix):] + "\n")
-
-	printlines(('',  'tag ' + path.basename(zipfile), \
-		'from ' + branch_ref, 'tagger ' + committer, \
-		'data <<EOM', 'Package ' + zipfile, 'EOM', ''))
+    commit_time = 0
+    next_mark = 1
+    common_prefix = None
+    mark = dict()
+
+    zip = ZipFile(zipfile, 'r')
+    for name in zip.namelist():
+        if name.endswith('/'):
+            continue
+        info = zip.getinfo(name)
+
+        if commit_time < info.date_time:
+            commit_time = info.date_time
+        if common_prefix == None:
+            common_prefix = name[:name.rfind('/') + 1]
+        else:
+            while not name.startswith(common_prefix):
+                last_slash = common_prefix[:-1].rfind('/') + 1
+                common_prefix = common_prefix[:last_slash]
+
+        mark[name] = ':' + str(next_mark)
+        next_mark += 1
+
+        printlines(('blob', 'mark ' + mark[name], \
+                    'data ' + str(info.file_size)))
+        fast_import.write(zip.read(name) + "\n")
+
+    committer = committer_name + ' <' + committer_email + '> %d +0000' % \
+        mktime(commit_time + (0, 0, 0))
+
+    printlines(('commit ' + branch_ref, 'committer ' + committer, \
+        'data <<EOM', 'Imported from ' + zipfile + '.', 'EOM', \
+        '', 'deleteall'))
+
+    for name in mark.keys():
+        fast_import.write('M 100644 ' + mark[name] + ' ' +
+            name[len(common_prefix):] + "\n")
+
+    printlines(('',  'tag ' + path.basename(zipfile), \
+        'from ' + branch_ref, 'tagger ' + committer, \
+        'data <<EOM', 'Package ' + zipfile, 'EOM', ''))
 
 if fast_import.close():
-	exit(1)
+    exit(1)
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 13/16] contrib/examples: make usage text consistent
  2013-02-24  0:20                       ` [PATCH 12/16] contrib/fast-import/import-zips.py: use spaces instead of tabs David Aguilar
@ 2013-02-24  0:20                         ` David Aguilar
  2013-02-24  0:20                           ` [PATCH 14/16] contrib/hooks/setgitperms.perl: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 contrib/examples/git-remote.perl    | 2 +-
 contrib/examples/git-svnimport.perl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl
index b17952a..b549a3c 100755
--- a/contrib/examples/git-remote.perl
+++ b/contrib/examples/git-remote.perl
@@ -347,7 +347,7 @@ sub rm_remote {
 }
 
 sub add_usage {
-	print STDERR "Usage: git remote add [-f] [-t track]* [-m master] <name> <url>\n";
+	print STDERR "usage: git remote add [-f] [-t track]* [-m master] <name> <url>\n";
 	exit(1);
 }
 
diff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl
index b09ff8f..c414f0d 100755
--- a/contrib/examples/git-svnimport.perl
+++ b/contrib/examples/git-svnimport.perl
@@ -36,7 +36,7 @@ our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,
 
 sub usage() {
 	print STDERR <<END;
-Usage: ${\basename $0}     # fetch/update GIT from SVN
+usage: ${\basename $0}     # fetch/update GIT from SVN
        [-o branch-for-HEAD] [-h] [-v] [-l max_rev] [-R repack_each_revs]
        [-C GIT_repository] [-t tagname] [-T trunkname] [-b branchname]
        [-d|-D] [-i] [-u] [-r] [-I ignorefilename] [-s start_chg]
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 14/16] contrib/hooks/setgitperms.perl: make usage text consistent
  2013-02-24  0:20                         ` [PATCH 13/16] contrib/examples: make usage text consistent David Aguilar
@ 2013-02-24  0:20                           ` David Aguilar
  2013-02-24  0:20                             ` [PATCH 15/16] templates/hooks--update.sample: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git with Git with Git with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 contrib/hooks/setgitperms.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/hooks/setgitperms.perl b/contrib/hooks/setgitperms.perl
index a577ad0..2770a1b 100644
--- a/contrib/hooks/setgitperms.perl
+++ b/contrib/hooks/setgitperms.perl
@@ -24,7 +24,7 @@ use File::Find;
 use File::Basename;
 
 my $usage =
-"Usage: setgitperms.perl [OPTION]... <--read|--write>
+"usage: setgitperms.perl [OPTION]... <--read|--write>
 This program uses a file `.gitmeta` to store/restore permissions and uid/gid
 info for all files/dirs tracked by git in the repository.
 
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 15/16] templates/hooks--update.sample: make usage text consistent
  2013-02-24  0:20                           ` [PATCH 14/16] contrib/hooks/setgitperms.perl: " David Aguilar
@ 2013-02-24  0:20                             ` David Aguilar
  2013-02-24  0:20                               ` [PATCH 16/16] Documentation/user-manual.txt: " David Aguilar
  0 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 templates/hooks--update.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
index 71ab04e..d847583 100755
--- a/templates/hooks--update.sample
+++ b/templates/hooks--update.sample
@@ -38,7 +38,7 @@ if [ -z "$GIT_DIR" ]; then
 fi
 
 if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
-	echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
+	echo "usage: $0 <ref> <oldrev> <newrev>" >&2
 	exit 1
 fi
 
-- 
1.8.2.rc0.247.g811e0c0

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

* [PATCH 16/16] Documentation/user-manual.txt: make usage text consistent
  2013-02-24  0:20                             ` [PATCH 15/16] templates/hooks--update.sample: " David Aguilar
@ 2013-02-24  0:20                               ` David Aguilar
  0 siblings, 0 replies; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Use a lowercase "usage:" string in the example script
for consistency with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 Documentation/user-manual.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 5f36f81..35a279a 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -2337,7 +2337,7 @@ origin)
 	fi
 	;;
 *)
-	echo "Usage: $0 origin|test|release" 1>&2
+	echo "usage: $0 origin|test|release" 1>&2
 	exit 1
 	;;
 esac
@@ -2351,7 +2351,7 @@ pname=$0
 
 usage()
 {
-	echo "Usage: $pname branch test|release" 1>&2
+	echo "usage: $pname branch test|release" 1>&2
 	exit 1
 }
 
-- 
1.8.2.rc0.247.g811e0c0

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

* Re: [PATCH 01/16] git-sh-setup: make usage text consistent
  2013-02-24  0:20 ` [PATCH 01/16] git-sh-setup: make usage text consistent David Aguilar
  2013-02-24  0:20   ` [PATCH 02/16] git-svn: " David Aguilar
@ 2013-02-24  0:25   ` Jonathan Nieder
  1 sibling, 0 replies; 20+ messages in thread
From: Jonathan Nieder @ 2013-02-24  0:25 UTC (permalink / raw)
  To: David Aguilar; +Cc: Junio C Hamano, git

David Aguilar wrote:

> mergetool, bisect, and other commands that use
> git-sh-setup print a usage string that is inconsistent
> with the rest of Git when they are invoked as "git $cmd -h".
>
> The compiled builtins use the lowercase "usage:" string
> but these commands say "Usage:".  Adjust the shell library
> to make these consistent.

Scripts could be grepping for Usage:, but they are asking for
trouble and if anything should check for status 129 instead.
And luckily we have been careful about not checking for this
in tests.  Thanks for the fix.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

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

* Re: [PATCH 00/16] make usage text consistent in git commands
  2013-02-24  0:20 [PATCH 00/16] make usage text consistent in git commands David Aguilar
  2013-02-24  0:20 ` [PATCH 01/16] git-sh-setup: make usage text consistent David Aguilar
@ 2013-02-24  0:29 ` Jonathan Nieder
  2013-02-24  0:37   ` David Aguilar
  1 sibling, 1 reply; 20+ messages in thread
From: Jonathan Nieder @ 2013-02-24  0:29 UTC (permalink / raw)
  To: David Aguilar; +Cc: Junio C Hamano, git

David Aguilar wrote:

>   git-sh-setup: make usage text consistent
>   git-svn: make usage text consistent
>   git-relink: make usage text consistent
[...]

Micronit: titles like

	git-relink: use a lowercase "usage:" string

would make the effect of these patches easier to see in the
shortlog.

With or without that change, all of these except patches 11 and 12 are
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

I have no opinion about patches 11 and 12. :)

Thanks,
Jonathan

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

* Re: [PATCH 00/16] make usage text consistent in git commands
  2013-02-24  0:29 ` [PATCH 00/16] make usage text consistent in git commands Jonathan Nieder
@ 2013-02-24  0:37   ` David Aguilar
  0 siblings, 0 replies; 20+ messages in thread
From: David Aguilar @ 2013-02-24  0:37 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, git

On Sat, Feb 23, 2013 at 4:29 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> David Aguilar wrote:
>
>>   git-sh-setup: make usage text consistent
>>   git-svn: make usage text consistent
>>   git-relink: make usage text consistent
> [...]
>
> Micronit: titles like
>
>         git-relink: use a lowercase "usage:" string
>
> would make the effect of these patches easier to see in the
> shortlog.
>
> With or without that change, all of these except patches 11 and 12 are
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
>
> I have no opinion about patches 11 and 12. :)

Thanks for the review.  I will post a re-roll later to fix these.
-- 
David

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

end of thread, other threads:[~2013-02-24  0:37 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-24  0:20 [PATCH 00/16] make usage text consistent in git commands David Aguilar
2013-02-24  0:20 ` [PATCH 01/16] git-sh-setup: make usage text consistent David Aguilar
2013-02-24  0:20   ` [PATCH 02/16] git-svn: " David Aguilar
2013-02-24  0:20     ` [PATCH 03/16] git-relink: " David Aguilar
2013-02-24  0:20       ` [PATCH 04/16] git-merge-one-file: " David Aguilar
2013-02-24  0:20         ` [PATCH 05/16] git-archimport: " David Aguilar
2013-02-24  0:20           ` [PATCH 06/16] git-cvsexportcommit: " David Aguilar
2013-02-24  0:20             ` [PATCH 07/16] git-cvsimport: " David Aguilar
2013-02-24  0:20               ` [PATCH 08/16] " David Aguilar
2013-02-24  0:20                 ` [PATCH 09/16] contrib/credential: " David Aguilar
2013-02-24  0:20                   ` [PATCH 10/16] contrib/fast-import: " David Aguilar
2013-02-24  0:20                     ` [PATCH 11/16] contrib/fast-import/import-zips.py: fix broken error message David Aguilar
2013-02-24  0:20                       ` [PATCH 12/16] contrib/fast-import/import-zips.py: use spaces instead of tabs David Aguilar
2013-02-24  0:20                         ` [PATCH 13/16] contrib/examples: make usage text consistent David Aguilar
2013-02-24  0:20                           ` [PATCH 14/16] contrib/hooks/setgitperms.perl: " David Aguilar
2013-02-24  0:20                             ` [PATCH 15/16] templates/hooks--update.sample: " David Aguilar
2013-02-24  0:20                               ` [PATCH 16/16] Documentation/user-manual.txt: " David Aguilar
2013-02-24  0:25   ` [PATCH 01/16] git-sh-setup: " Jonathan Nieder
2013-02-24  0:29 ` [PATCH 00/16] make usage text consistent in git commands Jonathan Nieder
2013-02-24  0:37   ` David Aguilar

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).