{"thread":{"id":"1226","subject":"[PATCH] clone-pack and clone-script: documentation and add a missing parameter.","startedAt":"2005-07-14T03:25:54Z","lastAt":"2005-07-14T03:25:54Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"6107","messageId":"7vhdeykr0d.fsf@assigned-by-dhcp.cox.net","threadId":"1226","inReplyTo":null,"subject":"[PATCH] clone-pack and clone-script: documentation and add a missing parameter.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-07-14T03:25:54Z","receivedAt":"2005-07-14T03:25:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"While adding the documentation for these two commands, I noticed\nthat the name of the program on the other end (git-upload-pack)\nis already almost configurable but git-clone-pack lacked command\nline parameter parsing to actually use anything but default, so\nI introduced --exec= like other remote commands while I was at it.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n Documentation/git-clone-pack.txt   |   60 ++++++++++++++++++++++++++++++++++++\n Documentation/git-clone-script.txt |   60 ++++++++++++++++++++++++++++++++++++\n Documentation/git.txt              |    7 ++++\n clone-pack.c                       |    6 +++-\n git-clone-script                   |   12 ++++++-\n 5 files changed, 142 insertions(+), 3 deletions(-)\n create mode 100644 Documentation/git-clone-pack.txt\n create mode 100644 Documentation/git-clone-script.txt\n\n7fffcd07cc6e81c0e50ee4d0f0d32d1aadb243c6\ndiff --git a/Documentation/git-clone-pack.txt b/Documentation/git-clone-pack.txt\nnew file mode 100644\n--- /dev/null\n+++ b/Documentation/git-clone-pack.txt\n@@ -0,0 +1,60 @@\n+git-clone-pack(1)\n+=================\n+v0.1, July 2005\n+\n+NAME\n+----\n+git-clone-pack - Clones a repository by receiving packed objects.\n+\n+\n+SYNOPSIS\n+--------\n+'git-clone-pack' [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>...]\n+\n+DESCRIPTION\n+-----------\n+Clones a repository into the current repository by invoking\n+'git-upload-pack', possibly on the remote host via ssh, in\n+the named repository, and invoking 'git-unpack-objects' locally\n+to receive the pack.\n+\n+OPTIONS\n+-------\n+-q::\n+\tPass '-q' flag to 'git-unpack-objects'; this makes the\n+\tcloning process less verbose.\n+\n+--exec=<git-upload-pack>::\n+\tUse this to specify the path to 'git-upload-pack' on the\n+\tremote side, if is not found on your $PATH.\n+\tInstallations of sshd ignores the user's environment\n+\tsetup scripts for login shells (e.g. .bash_profile) and\n+\tyour privately installed GIT may not be found on the system\n+\tdefault $PATH.  Another workaround suggested is to set\n+\tup your $PATH in \".bashrc\", but this flag is for people\n+\twho do not want to pay the overhead for non-interactive\n+\tshells by having a lean .bashrc file (they set most of\n+\tthe things up in .bash_profile).\n+\n+[<host>:]<directory::\n+\tThe (possibly remote) repository to clone from.\n+\n+<heads>...::\n+\tThe heads to update.  This is relative to $GIT_DIR\n+\t(e.g. \"HEAD\", \"refs/heads/master\").  When unspecified,\n+\tall heads are updated to match the remote repository.\n+\n+\n+Author\n+------\n+Written by Linus Torvalds <torvalds@osdl.org>\n+\n+Documentation\n+--------------\n+Documentation by Junio C Hamano.\n+\n+\n+GIT\n+---\n+Part of the link:git.html[git] suite\n+\ndiff --git a/Documentation/git-clone-script.txt b/Documentation/git-clone-script.txt\nnew file mode 100644\n--- /dev/null\n+++ b/Documentation/git-clone-script.txt\n@@ -0,0 +1,60 @@\n+git-clone-script(1)\n+===================\n+v0.1, July 2005\n+\n+NAME\n+----\n+git-clone-script - Clones a repository.\n+\n+\n+SYNOPSIS\n+--------\n+'git clone' [-l] [-u <upload-pack>] [-q] <repository> <directory>\n+\n+DESCRIPTION\n+-----------\n+Clones a repository into a newly created directory.\n+\n+OPTIONS\n+-------\n+-l::\n+\tWhen the repository to clone from is on a local machine,\n+\tthis flag bypasses normal \"git aware\" transport\n+\tmechanism and clones the repository by making a copy of\n+\tHEAD and everything under objects and refs directories.\n+\tThe files under .git/objects/ directory are hardlinked\n+\tto save space when possible.\n+\n+-q::\n+\tOperate quietly.  This flag is passed to \"rsync\" and\n+\t\"git-clone-pack\" commands when given.\n+\n+-u <upload-pack>::\n+\tWhen given, and the repository to clone from is handled\n+\tby 'git-clone-pack', '--exec=<upload-pack>' is passed to\n+\tthe command to specify non-default path for the command\n+\trun on the other end.\n+\n+<repository>::\n+\tThe (possibly remote) repository to clone from.  It can\n+\tbe an \"rsync://host/dir\" URL, an \"http://host/dir\" URL,\n+\tor [<host>:]/dir notation that is used by 'git-clone-pack'.\n+\tCurrently http transport is not supported.\n+\n+<directory>::\n+\tThe name of a new directory to be cloned into.  It is an\n+\terror to specify an existing directory.\n+\n+Author\n+------\n+Written by Linus Torvalds <torvalds@osdl.org>\n+\n+Documentation\n+--------------\n+Documentation by Junio C Hamano.\n+\n+\n+GIT\n+---\n+Part of the link:git.html[git] suite\n+\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -127,6 +127,13 @@ link:git-apply-patch-script.html[git-app\n link:git-convert-cache.html[git-convert-cache]::\n \tConverts old-style GIT repository\n \n+link:git-clone-script.html[git-clone-script]::\n+\tClones a repository into the current repository (user interface)\n+\n+link:git-clone-pack.html[git-clone-pack]::\n+\tClones a repository into the current repository (engine\n+\tfor ssh and local transport)\n+\n link:git-http-pull.html[git-http-pull]::\n \tDownloads a remote GIT repository via HTTP\n \ndiff --git a/clone-pack.c b/clone-pack.c\n--- a/clone-pack.c\n+++ b/clone-pack.c\n@@ -4,7 +4,7 @@\n #include <sys/wait.h>\n \n static int quiet;\n-static const char clone_pack_usage[] = \"git-clone-pack [host:]directory [heads]*\";\n+static const char clone_pack_usage[] = \"git-clone-pack [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>]*\";\n static const char *exec = \"git-upload-pack\";\n \n struct ref {\n@@ -196,6 +196,10 @@ int main(int argc, char **argv)\n \t\t\t\tquiet = 1;\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tif (!strncmp(\"--exec=\", arg, 7)) {\n+\t\t\t\texec = arg + 7;\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tusage(clone_pack_usage);\n \t\t}\n \t\tdest = arg;\ndiff --git a/git-clone-script b/git-clone-script\n--- a/git-clone-script\n+++ b/git-clone-script\n@@ -6,7 +6,7 @@\n # Clone a repository into a different directory that does not yet exist.\n \n usage() {\n-\techo >&2 \"* git clone [-l] <repo> <dir>\"\n+\techo >&2 \"* git clone [-l] [-q] [-u <upload-pack>] <repo> <dir>\"\n \texit 1\n }\n \n@@ -16,11 +16,16 @@ get_repo_base() {\n \n quiet=\n use_local=no\n+upload_pack=\n while\n \tcase \"$#,$1\" in\n \t0,*) break ;;\n         *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;\n \t*,-q|*,--quiet) quiet=-q ;;\n+\t1,-u|*,--upload-pack) usage ;;\n+\t*,-u|*,--upload-pack)\n+\t\tshift\n+\t\tupload_pack=\"--exec=$2\" ;;\n \t*,-*) usage ;;\n \t*) break ;;\n \tesac\n@@ -90,6 +95,9 @@ http://*)\n \texit 1\n \t;;\n *)\n-\tcd \"$D\" && git-clone-pack $quiet \"$repo\"\n+\tcd \"$D\" && case \"$upload_pack\" in\n+\t'') git-clone-pack $quiet \"$repo\" ;;\n+\t*) git-clone-pack $quiet \"$upload_pack\" \"$repo\" ;;\n+\tesac\n \t;;\n esac\n"}]}