{"thread":{"id":"2268","subject":"[PATCH] git-push.sh: Factor out usage statement to function; explain why rsync can't push","startedAt":"2005-10-29T04:17:03Z","lastAt":"2005-10-29T04:17:03Z","messageCount":1,"participants":["c.shoemaker@cox.net"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"10782","messageId":"E1EVi9P-0002Tw-BD@localhost","threadId":"2268","inReplyTo":null,"subject":"[PATCH] git-push.sh: Factor out usage statement to function; explain why rsync can't push","fromName":"","fromEmail":"c.shoemaker@cox.net","sentAt":"2005-10-29T04:17:03Z","receivedAt":"2005-10-29T04:17:03Z","isPatch":true,"sender":{"key":"c.shoemaker@cox.net","avatar":null},"body":"Signed-off-by: Chris Shoemaker <c.shoemaker at cox.net>\n\n---\n\n git-push.sh |   12 +++++++++---\n 1 files changed, 9 insertions(+), 3 deletions(-)\n\ncc2f6f361691771cf461df04255a2b842b264371\ndiff --git a/git-push.sh b/git-push.sh\n--- a/git-push.sh\n+++ b/git-push.sh\n@@ -1,6 +1,11 @@\n #!/bin/sh\n . git-sh-setup || die \"Not a git archive\"\n \n+usage () {\n+    die \"Usage: git push [--all] [--force] <repository> [<refspec>]\"\n+}\n+\n+\n # Parse out parameters and then stop at remote, so that we can\n # translate it using .git/branches information\n has_all=\n@@ -18,8 +23,7 @@ do\n \t--exec=*)\n \t\thas_exec=\"$1\" ;;\n \t-*)\n-\t\tdie \"Usage: git push [--all] [--force] <repository> <refspec>\"\n-                ;;\n+                usage ;;\n         *)\n \t\tset x \"$@\"\n \t\tshift\n@@ -41,8 +45,10 @@ esac\n shift\n \n case \"$remote\" in\n-http://* | https://* | git://* | rsync://* )\n+http://* | https://* | git://*)\n \tdie \"Cannot use READ-ONLY transport to push to $remote\" ;;\n+rsync://*)\n+        die \"Pushing with rsync transport is deprecated\" ;;\n esac\n \n set x \"$remote\" \"$@\"; shift\n"}]}