summaryrefslogtreecommitdiff
path: root/git-clone.sh
AgeCommit message (Collapse)AuthorFilesLines
2006-12-16git-clone: lose the traditional 'no-separate-remote' layoutLibravatar Junio C Hamano1-46/+12
Finally. The separate-remote layout is so much more organized than traditional and easier to work with especially when you need to deal with remote repositories with multiple branches and/or you need to deal with more than one remote repositories, and using traditional layout for new repositories simply does not make much sense. Internally we still have code for 1:1 mappings to create a bare clone; that is a good thing and will not go away. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16git-clone: lose the artificial "first" fetch refspecLibravatar Junio C Hamano1-4/+4
Now we lost the "first refspec is the one that is merged by default" rule, there is no reason for clone to list the remote primary branch in the config file explicitly anymore. We still need it for the traditional layout for other reasons, though. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16git-clone: use wildcard specification for tracking branchesLibravatar Junio C Hamano1-17/+30
This stops enumerating the set of branches found on the remote side when a clone was made in the configuration file. Instead, a single entry that maps each remote branch to the local tracking branch for the remote under the same name is created. Doing it this way not only shortens the configuration file, but automatically adjusts to a new branch added on the remote side after the clone is made. Unfortunately this cannot be done for the traditional layout, where we always need to special case the 'master' to 'origin' mapping within the local branch namespace. But that is Ok; it will be going away before v1.5.0. We could also lose the "primary branch" mapping at the beginning, but that has to wait until we implement the "forbid 'git pull' when we do not have branch.$current.merge for the current branch" policy we earlier discussed. That should also be in v1.5.0 Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-06Explicitly add the default "git pull" behaviour to .git/config on cloneLibravatar Andy Parkins1-1/+3
Without any specification in the .git/config file, git-pull will execute "git-pull origin"; which in turn defaults to pull from the first "pull" definition for the remote, "origin". This is a difficult set of defaults to track for a new user, and it's difficult to see what tells git to do this (especially when it is actually hard-coded behaviour). To ameliorate this slightly, this patch explicitly specifies the default behaviour during a clone using the "branch" section of the config. For example, a clone of a typical repository would create a .git/config containing: [remote "origin"] url = proto://host/repo.git fetch = refs/heads/master:refs/remotes/origin/master [branch "master"] remote = origin merge = refs/heads/master The [branch "master"] section is such that there is no change to the functionality of git-pull, but that functionality is now explicitly documented. Signed-off-by: Andy Parkins <andyparkins@gmail.com>
2006-12-06Merge Libravatar Junio C Hamano1-5/+5
2006-12-04git-clone: Rename --use-immingled-remote option to --no-separate-remoteLibravatar Jakub Narebski1-3/+3
With making --use-separate-remote default when creating non-bare clone, there was need for the flag which would turn off this behavior. It was called --use-immingled-remote. Immingle means to blend, to combine into one, to intermingle, but it is a bit obscure word. I think it would be better to use simply --no-separate-remote as the opposite to --use-separate-remote option to git clone. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Use .git/config for storing "origin" shortcut repositoryLibravatar Andy Parkins1-5/+5
Rather than use a separate config .git/remotes/ for remote shortcuts, this patch adds the analagous definitions to .git/config using git-repo-config calls. For example what was previously .git/remotes/origin URL: proto://host/path Pull: refs/heads/master:refs/heads/origin Is now added to .git/config as [remote "origin"] url = proto://host/path fetch = refs/heads/master:refs/heads/origin Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24git-clone: stop dumb protocol from copying refs outside heads/ and tags/.Libravatar Junio C Hamano1-0/+4
Most notably, the original code first copied refs/remotes/ that remote side had to local, and overwrote them by mapping refs/heads/ from the remote when a dumb protocol transport was used. This makes the clone behaviour by dumb protocol in line with the git native and rsync transports. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23Make git-clone --use-separate-remote the defaultLibravatar Petr Baudis1-7/+7
We've talked about this for quite some time on the list, and it is a sane thing to do for a repository with an associcated working tree. For somebody who wants to use the traditional layout, there is a backward compatibility option --use-immingled-remote, but it is expected to be removed before the next major release. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23Merge branch 'maint'Libravatar Junio C Hamano1-1/+2
* maint: gitweb: Fix setting $/ in parse_commit() daemon: do not die on older clients. xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header. git-clone: honor --quiet Documentation for the [remote] config prune-packed: Fix uninitialized variable.
2006-10-23git-clone: honor --quietLibravatar Jim Meyering1-1/+2
I noticed that a cron-launched "git-clone --quiet" was generating progress output to standard error -- and thus always spamming me. The offending output was due to git-clone invoking git-read-tree with its undocumented -v option. This change turns off "-v" for --quiet. Signed-off-by: Jim Meyering <jim@meyering.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-20git-clone: define die() and use it.Libravatar Dmitry V. Levin1-37/+24
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-14clone: the given repository dir should be relative to $PWDLibravatar Yasushi SHOJI1-1/+1
the repository argument for git-clone should be relative to $PWD instead of the given target directory. The old behavior gave us surprising success and you need a few minute to know why it worked. GIT_DIR is already exported so no need to cd into $D. And this makes $PWD for git-fetch-pack, which is the actual command to take the given repository dir, the same as git-clone. Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28http/ftp: optionally ask curl to not use EPSV commandLibravatar Sasha Khapyorsky1-0/+4
If http.noEPSV config variable is defined and true, or if GIT_CURL_FTP_NO_EPSV environment variable is defined, disable using of EPSV ftp command (PASV will be used instead). This is helpful with some "poor" ftp servers which does not support EPSV mode. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-13Trivial support for cloning and fetching via ftp://.Libravatar Sasha Khapyorsky1-1/+1
This adds trivial support for cloning and fetching via ftp://. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-07handle https:// protocol in git-cloneLibravatar Michael Krelin1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02Ensure git-clone exits with error if perl script fails.Libravatar Ramsay Allan Jones1-2/+3
This helps tests 5400,5600,5700,5710 "fail correctly" rather than give some false positives. Also ensure cleanup actions in exit trap work correctly even if user has alias rm='rm -i'. Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13fetch/clone: check return status from ls-remoteLibravatar Junio C Hamano1-2/+2
Some callers of ls-remote did not check its return status.
2006-07-08Using 'perl' in *.shLibravatar Michal Rokos1-1/+1
Some GIT's shell script are using bare 'perl' for perl invocation. Use @@PERL@@ symbol and replace it with PERL_PATH_SQ everywhere. Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-27Fix expr usage for FreeBSDLibravatar Dennis Stosberg1-1/+1
Some implementations of "expr" (e.g. FreeBSD's) fail, if an argument starts with a dash. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-10git-clone: fix --bare over dumb-httpLibravatar Junio C Hamano1-6/+2
It left an extra .git/ directory under the target directory by mistake. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-08git-clone: fix duplicated "master" in $GIT_DIR/remotes/originLibravatar Junio C Hamano1-5/+10
Under --use-separate-remote we ended up duplicating the branch remote HEAD pointed at in $GIT_DIR/remotes/origin file. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-28Let git-clone to pass --template=dir option to git-init-db.Libravatar Junio C Hamano1-2/+8
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22Problem: 'trap...exit' causes error message when /bin/sh is ash.Libravatar Yakov Lerner1-2/+2
Problem: 'trap...exit' causes error message when /bin/sh is ash. Fix: Change 'trap...exit' to 'trap...0' like in other scripts. Signed-off-by: Yakov Lerner <iler.ml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07clone: don't clone the info/alternates fileLibravatar Martin Waitz1-5/+1
Now that the cloned alternates file is parsed, too we don't need to copy it into our new repository, we just reference it. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-07clone: keep --reference even with -l -sLibravatar Martin Waitz1-1/+1
Both -l -s and --reference update objects/info/alternates and used to write over each other. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13Shell utilities: Guard against expr' magic tokens.Libravatar Mark Wooding1-3/+3
Some words, e.g., `match', are special to expr(1), and cause strange parsing effects. Track down all uses of expr and mangle the arguments so that this isn't a problem. Signed-off-by: Mark Wooding <mdw@distorted.org.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-02git-clone: fix handling of upsteram whose HEAD does not point at master.Libravatar Junio C Hamano1-19/+28
When cloning from a remote repository that has master, main, and origin branches _and_ with the HEAD pointing at main branch, we did quite confused things during clone. So this cleans things up. The behaviour is a bit different between separate remotes/ layout and the mixed branches layout. The newer layout with $GIT_DIR/refs/remotes/$origin/, things are simpler and more transparent: - remote branches are copied to refs/remotes/$origin/. - HEAD points at the branch with the same name as the remote HEAD points at, and starts at where the remote HEAD points at. - $GIT_DIR/remotes/$origin file is set up to fetch all remote branches, and merge the branch HEAD pointed at at the time of the cloning. Everything-in-refs/heads layout was the more confused one, but cleaned up like this: - remote branches are copied to refs/heads, but the branch "$origin" is not copied, instead a copy of the branch the remote HEAD points at is created there. - HEAD points at the branch with the same name as the remote HEAD points at, and starts at where the remote HEAD points at. - $GIT_DIR/remotes/$origin file is set up to fetch all remote branches except "$origin", and merge the branch HEAD pointed at at the time of the cloning. With this, the remote has master, main and origin, and its HEAD points at main, you could: git clone $URL --origin upstream to use refs/heads/upstream as the tracking branch for remote "main", and your primary working branch will also be "main". "master" and "origin" are used to track the corresponding remote branches and with this setup they do not have any special meaning. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-30git-clone: exit early if repo isn't specifiedLibravatar Yasushi SHOJI1-2/+8
git-clone without a repo isn't useful at all. print message and get out asap. This patch also move the variable 'local' to where other variables are initialized. Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-30Make git-clone to take long double-dashed origin option (--origin)Libravatar Yasushi SHOJI1-5/+6
git-clone currently take option '-o' to specify origin. this patch makes git-clone to take double-dashed option '--origin' and other abbreviations in addtion to the current single-dashed option. [jc: with minor fixups] Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-22git-clone: typofix.Libravatar Junio C Hamano1-2/+2
The traditional one created refs/origin by mistake, not refs/heads/origin. Also it mistakenly failed to prevent $origin from being listed twice in remotes/origin file. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-21clone: record the remote primary branch with remotes/$origin/HEADLibravatar Junio C Hamano1-3/+9
This matches c51d13692d4e451c755dd7da3521c5db395df192 commit to record the primary branch of the remote with a symbolic ref remotes/$origin/HEAD. The user can later change it to point at different branch to change the meaning of "$origin" shorthand. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-21revamp git-clone (take #2).Libravatar Junio C Hamano1-19/+31
This builds on top of the previous one. * --use-separate-remote uses .git/refs/remotes/$origin/ directory to keep track of the upstream branches. * The $origin above defaults to "origin" as usual, but the existing "-o $origin" option can be used to override it. I am not yet convinced if we should make "$origin" the synonym to "refs/remotes/$origin/$name" where $name is the primary branch name of $origin upstream, nor if so how we should decide which upstream branch is the primary one, but that is more or less orthogonal to what the clone does here. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-20revamp git-clone.Libravatar Junio C Hamano1-32/+152
This does two things. * A new flag --reference can be used to name a local repository that is to be used as an alternate. This is in response to an inquiry by James Cloos in the message on the list <m3r74ykue7.fsf@lugabout.cloos.reno.nv.us>. * A new flag --use-separate-remote stops contaminating local branch namespace by upstream branch names. The upstream branch heads are copied in .git/refs/remotes/ instead of .git/refs/heads/ and .git/remotes/origin file is set up to reflect this as well. It requires to have fetch/pull update to understand .git/refs/remotes by Eric Wong to further update the repository cloned this way. For the former change, git-fetch-pack is taught a new flag --all to fetch from all the remote heads. Nobody uses the git-clone-pack with this change, so we could deprecate the command, but removal of the command will be left to a separate round. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-23Merge fixes early for next maint series.Libravatar Junio C Hamano1-2/+2
2006-02-23Merge branches 'jc/fix-co-candy', 'jc/fix-rename-leak' and 'ar/fix-win' into ↵Libravatar Junio C Hamano1-2/+2
maint * jc/fix-co-candy: checkout - eye candy. * jc/fix-rename-leak: diffcore-rename: plug memory leak. * ar/fix-win: fix t5600-clone-fail-cleanup.sh on windows
2006-02-23fix t5600-clone-fail-cleanup.sh on windowsLibravatar Alex Riesen1-1/+1
In windows you cannot remove current or opened directory, an opened file, a running program, a loaded library, etc... [jc: signoffs? With a minor quoting fix.] Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-22checkout - eye candy.Libravatar Junio C Hamano1-1/+1
This implements "eye candy" similar to the pack-object/unpack-object to entertain users while a large tree is being checked out after a clone or a pull. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-21Merge part of jc/portable branchLibravatar Junio C Hamano1-1/+1
2006-02-17Fix cpio callLibravatar Johannes Schindelin1-1/+1
To some cpio's, -a and -m options are mutually exclusive. Use only -m. Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-17Trap exit to clean up created directory if clone fails.Libravatar Carl Worth1-0/+4
Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-15Print an error if cloning a http repo and NO_CURL is setLibravatar Fernando J. Pereda1-1/+7
If Git is compiled with NO_CURL=YesPlease and one tries to clone a http repository, git-clone tries to call the curl binary. This trivial patch prints an error instead in such situation. Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-24clone: do not accept more than one -o option.Libravatar Junio C Hamano1-1/+15
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-24clone: do not create remotes/origin nor origin branch in a bare repository.Libravatar Junio C Hamano1-1/+1
It is simply pointless, since no merges will ever happen in such a repository. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-24git-clone: PG13 --naked option to --bare.Libravatar Junio C Hamano1-7/+8
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-19Fix generation of "humanish" part of source repoLibravatar Uwe Zeisberger1-1/+1
If repo has the form <host>:<path> and <path> doesn't contain a slash, the cloned repository is named "<host>:<path>", instead of "<path>" only. Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-14clone: --naked option.Libravatar Junio C Hamano1-26/+40
The new option --naked is to help creating a naked repository for public consumption. $ git clone -l -s --naked \ /pub/scm/.../torvalds/linux-2.6.git subproj-2.6.git is equivalent to this sequence: $ git clone -l -s -n /pub/scm/.../torvalds/linux-2.6.git temp $ mv temp/.git subproj-2.6.git $ rmdir temp Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-23git-clone: do not special case dumb http.Libravatar Junio C Hamano1-15/+1
Underlying http-fetch is supposed to be capable of handling packed repositories just fine, so no need to special case it in the wrapper script. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-22git-clone: Support changing the origin branch with -oLibravatar Johannes Schindelin1-4/+13
Earlier, git-clone stored upstream's master in the branch named 'origin', possibly overwriting an existing such branch. Now you can change it by calling git-clone with '-o <other_name>'. [jc: added ref format check, subdirectory safety, documentation and usage string.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14Trivial usage string clean-upLibravatar freku045@student.liu.se1-1/+1
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>