Add usage help to git-push.sh
Also clarify failure to push to read-only remote. Especially, state why rsync:// is not used for pushing. [jc: ideally rsync should not be used for anything] Signed-off-by: Chris Shoemaker <c.shoemaker at cox.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
c.shoemaker@cox.net committed
Oct 29, 2005 at 00:16 UTC
c485104741ccdf32dd0c96fcb886c38a0b5badbd
1 file changed
+10
-3
git-push.sh
+10
-3
@@ -1,6 +1,11 @@
1
#!/bin/sh
2
. git-sh-setup || die "Not a git archive"
3
4
+usage () {
5
+ die "Usage: git push [--all] [--force] <repository> [<refspec>]"
6
+}
7
+
8
+
9
# Parse out parameters and then stop at remote, so that we can
10
# translate it using .git/branches information
11
has_all=
@@ -18,7 +23,7 @@ do
23
--exec=*)
24
has_exec="$1" ;;
25
-*)
21
- die "Unknown parameter $1" ;;
26
+ usage ;;
27
*)
28
set x "$@"
29
shift
@@ -41,8 +46,10 @@ esac
46
shift
47
48
case "$remote" in
44
-http://* | https://* | git://* | rsync://* )
45
- die "Cannot push to $remote" ;;
49
+http://* | https://* | git://*)
50
+ die "Cannot use READ-ONLY transport to push to $remote" ;;
51
+rsync://*)
52
+ die "Pushing with rsync transport is deprecated" ;;
53
esac
54
55
set x "$remote" "$@"; shift