summaryrefslogtreecommitdiff
path: root/git-fetch.sh
Commit message (Collapse)AuthorAgeFilesLines
* make git a bit less cryptic on fetch errorsNicolas Pitre2006-12-181-1/+1
| | | | | | | | | | | | The remote server might not want to tell why it doesn't like us for security reasons, but let's make the client report such error in a bit less confusing way. The remote failure remains a mystery, but the local message might be a bit less so. [jc: with a gentle wording updates from Andy Parkins] Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: Avoid reading packed refs over and over againJunio C Hamano2006-12-171-9/+3
| | | | | | | | | | | | When checking which tags to fetch, the old code used to call git-show-ref --verify for each remote tag. Since reading even packed refs is not a cheap operation when there are a lot of local refs, the code became quite slow. This fixes it by teaching git-show-ref to filter out existing refs using a new mode of operation of git-show-ref. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: make it work from within a subdirectory.Junio C Hamano2006-12-141-0/+6
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'master' into jc/globfetchJunio C Hamano2006-11-251-5/+6
|\ | | | | | | | | | | This is to pick up the fix made on master: git-fetch: exit with non-zero status when fast-forward check fails
| * git-fetch: exit with non-zero status when fast-forward check failsJunio C Hamano2006-11-251-5/+6
| | | | | | | | | | | | | | | | | | When update_local_ref() refuses to update a branch head due to fast-forward check, it was not propagated properly in the call chain and the command did not exit with non-zero status as a result. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-fetch: fix dumb protocol transport to fetch from pack-pruned refJunio C Hamano2006-11-231-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | Earlier, commit walkers downloaded loose refs from refs/ hierarchy of the remote side to find where to start walking; this would not work for a repository whose refs are packed and then pruned. With the previous change, we have ls-remote output from the remote in-core; we can use the value from there without requiring loose refs anymore. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-fetch: reuse ls-remote result.Junio C Hamano2006-11-231-5/+8
|/ | | | | | | | This will become necessary to update the dumb protocol transports to fetch from a repository with packed and then pruned tags. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: follow lightweit tags as well.Junio C Hamano2006-11-191-2/+3
| | | | | | | | This side-ports commit fd19f620 from Cogito, in which I fixed exactly the same bug. Somehow nobody noticed this for a long time in git. Signed-off-by: Junio C Hamano <junkio@cox.net>
* remove .keep pack lock files when done with refs updateNicolas Pitre2006-11-031-1/+9
| | | | | | | | | | This makes both git-fetch and git-push (fetch-pack and receive-pack) safe against a possible race with aparallel git-repack -a -d that could prune the new pack while it is not yet referenced, and remove the .keep file after refs have been updated. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch can use both --thin and --keep with fetch-pack nowNicolas Pitre2006-11-031-2/+2
| | | | | Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/refs-and-fetch'Junio C Hamano2006-11-011-4/+4
|\ | | | | | | | | * jc/refs-and-fetch: git-fetch: adjust to packed-refs.
| * git-fetch: adjust to packed-refs.Junio C Hamano2006-10-011-4/+4
| | | | | | | | | | | | | | The command checked the presence of a ref by directly looking into $GIT_DIR/refs directory. Update it to use show-ref. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'lj/refs'Junio C Hamano2006-11-011-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lj/refs: (63 commits) Fix show-ref usagestring t3200: git-branch testsuite update sha1_name.c: avoid compilation warnings. Make git-branch a builtin ref-log: fix D/F conflict coming from deleted refs. git-revert with conflicts to behave as git-merge with conflicts core.logallrefupdates thinko-fix git-pack-refs --all core.logallrefupdates create new log file only for branch heads. Remove bashism from t3210-pack-refs.sh ref-log: allow ref@{count} syntax. pack-refs: call fflush before fsync. pack-refs: use lockfile as everybody else does. git-fetch: do not look into $GIT_DIR/refs to see if a tag exists. lock_ref_sha1_basic does not remove empty directories on BSD Do not create tag leading directories since git update-ref does it. Check that a tag exists using show-ref instead of looking for the ref file. Use git-update-ref to delete a tag instead of rm()ing the ref file. Fix refs.c;:repack_without_ref() clean-up path Clean up "git-branch.sh" and add remove recursive dir test cases. ...
| * | git-fetch: do not look into $GIT_DIR/refs to see if a tag exists.Junio C Hamano2006-10-031-1/+1
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'maint'Junio C Hamano2006-10-251-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: xdiff: Match GNU diff behaviour when deciding hunk comment worthiness of lines Update cherry documentation. Refer to git-rev-parse:Specifying Revisions from git.txt git-fetch.sh printed protocol fix RPM package re-classification. Documentation: note about contrib/. git-svn: fix symlink-to-file changes when using command-line svn 1.4.0 Set $HOME for selftests
| * | | git-fetch.sh printed protocol fixTuncer Ayaz2006-10-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have supported https:// protocol for some time and in 1.4.3 added ftp:// protocol. The transfer were still reported to be over http. [jc: Tuncer used substring parameter substitution ${remote%%:*} but I am deferring it to a later day. We should replace colon-expr with substring substitution after everybody's shell can grok it someday, but we are not in a hurry. ] Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'sb/fetch'Junio C Hamano2006-10-181-16/+25
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| | | | * sb/fetch: merge and resolve: Output short hashes and .. in "Updating ..." fetch: Misc output cleanup
| * | fetch: Misc output cleanupSanti B,Ai(Bjar2006-09-301-16/+25
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular it removes duplicate information, uses short hashes (as git-log and company) and uses .. for fast forwarding commits and ... for not-fast-forwarding commits (shorter, easier to copy&paste). It also reformat the output as: 1. the ones we store in our local ref (either branches or tags): 1a) fast-forward * refs/heads/origin: fast forward to branch 'master' of ../git/ old..new: 1ad7a06..bc1a580 1b) same (only shown under -v) * refs/heads/next: same as branch 'origin/next' of ../git/ commit: ce47b9f 1c) non-fast-forward, forced * refs/heads/pu: forcing update to non-fast forward branch 'pu' of ../git/ old...new: 7c733a8...5faa935 1d) non-fast-forward, did not update because not forced * refs/heads/po: not updating to non-fast forward branch 'po' of ../git/ old...new: 7c733a8...5faa935 1e) creating a new local ref to store * refs/tags/v1.4.2-rc4: storing tag 'v1.4.2-rc4' of ../git/ tag: 8c7a107 * refs/heads/next: storing branch 'next' of ../git/ commit: f8a20ae 2. the ones we do not store in our local ref (only shown under -v): * fetched branch 'master' of ../git commit: 695dffe * fetched tag 'v1.4.2-rc4' of ../git tag: 8c7a107 Signed-off-by: Santi B.ANijar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-fetch --update-head-ok typofixJunio C Hamano2006-10-101-3/+3
|/ | | | | | | | Martin Waitz noticed that one of the case arms had an impossible choice. It turns out that what it was checking was redundant and the typo did not have any effect. Signed-off-by: Junio C Hamano <junkio@cox.net>
* fetch: Reset remote refs list each time fetch_main is calledSanti Béjar2006-09-291-0/+1
| | | | | | | This prevents the fetch of the heads again in the second call of fetch_main. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* http/ftp: optionally ask curl to not use EPSV commandSasha Khapyorsky2006-09-281-1/+5
| | | | | | | | | | 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>
* Fetch: default remote repository from branch propertiesSanti Béjar2006-09-241-5/+4
| | | | | | | | | | | | | If in branch "foo" and this in config: [branch "foo"] remote=bar "git fetch" = "git fetch bar" "git pull" = "git pull bar" Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Trivial support for cloning and fetching via ftp://.Sasha Khapyorsky2006-09-131-2/+2
| | | | | | | 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>
* Merge branch 'jc/clone-bind-failure'Junio C Hamano2006-07-251-2/+9
|\ | | | | | | | | * jc/clone-bind-failure: fetch/clone: check return status from ls-remote
| * fetch/clone: check return status from ls-remoteJunio C Hamano2006-07-131-2/+9
| | | | | | | | Some callers of ls-remote did not check its return status.
* | Defaulting fetch to origin when set in the repo-configSanti Béjar2006-07-241-1/+2
| | | | | | | | | | Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-fetch: fix --keep vs --thinJunio C Hamano2006-07-171-1/+2
| | | | | | | | | | | | | | | | When --keep is specified there is no reason to pass --thin to git-fetch-pack, which are mutually exclusive. This does not hurt because fetch-pack disables thin transfer when both are given internally, but still is confusing. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Fix "git-fetch --tags" exit status when nothing has been changedSergey Vlasov2006-07-141-1/+1
|/ | | | | | | | | After commit 55b7835e1b81a6debc7648149d2b8a4c5c64ddba git-fetch --tags exits with status 1 when no tags have been changed, which breaks calling git-fetch from scripts. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: fix a bashism (==)Eric Wong2006-07-111-1/+1
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Log ref changes made by git-fetch and git-pull.Shawn Pearce2006-07-101-5/+15
| | | | | | | | | When git-fetch updates a reference record in the associated reflog what type of update took place and who caused it (git-fetch or git-pull, by invoking git-fetch). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Using 'perl' in *.shMichal Rokos2006-07-081-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>
* fetch: do not report "same" unless -verbose.Junio C Hamano2006-06-031-1/+4
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: avoid using "case ... in (arm)"Junio C Hamano2006-05-281-3/+3
| | | | | | | | | | NetBSD ash chokes on the optional open parenthesis for case arms. Inside $(command substitution), however, bash barfs without. So adjust things accordingly. Originally pointed out by Dennis Stosberg. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: resolve remote symrefs for HTTP transportNick Hengeveld2006-04-261-4/+12
| | | | | | | | | git-fetch validates that a remote ref resolves to a SHA1 prior to calling git-http-fetch. This adds support for resolving a few levels of symrefs to get to the SHA1. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix-up previous expr changes.Junio C Hamano2006-04-131-2/+2
| | | | | | | | | | | | | | The regexp on the right hand side of expr : operator somehow was broken. expr 'z+pu:refs/tags/ko-pu' : 'z\+\(.*\)' does not strip '+'; write 'z+\(.*\)' instead. We probably should switch to shell based substring post 1.3.0; that's not bashism but just POSIX anyway. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Shell utilities: Guard against expr' magic tokens.Mark Wooding2006-04-131-9/+9
| | | | | | | | | 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>
* Merge branch 'jc/fetch' into nextJunio C Hamano2006-03-171-0/+1
|\ | | | | | | | | * jc/fetch: fetch: exit non-zero when fast-forward check fails.
| * fetch: exit non-zero when fast-forward check fails.Junio C Hamano2006-03-171-0/+1
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | fetch,parse-remote,fmt-merge-msg: refs/remotes/* supportEric Wong2006-03-101-2/+8
|/ | | | | | | | | | | | We can now easily fetch and merge things from heads in the refs/remotes/ hierarchy in remote repositories. The refs/remotes/ hierarchy is likely to become the standard for tracking foreign SCMs, as well as the location of Pull: targets for tracking remote branches in newly cloned repositories. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: print the new and old ref when fast-forwardingLukas Sandström2006-02-251-0/+1
| | | | | Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
*-. Merge branches 'jc/rev-list' and 'jc/pack-thin'Junio C Hamano2006-02-241-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/rev-list: rev-list --objects: use full pathname to help hashing. rev-list --objects-edge: remove duplicated edge commit output. rev-list --objects-edge * jc/pack-thin: pack-objects: hash basename and direname a bit differently. pack-objects: allow "thin" packs to exceed depth limits pack-objects: use full pathname to help hashing with "thin" pack. pack-objects: thin pack micro-optimization. Use thin pack transfer in "git fetch". Add git-push --thin. send-pack --thin: use "thin pack" delta transfer. Thin pack - create packfile with missing delta base. Conflicts: pack-objects.c (taking "next") send-pack.c (taking "next")
| | * Use thin pack transfer in "git fetch".Junio C Hamano2006-02-201-1/+1
| |/ | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-fetch: follow tag only when tracking remote branch.v1.2.3Junio C Hamano2006-02-221-14/+19
|/ | | | | | | | | | | | | | | | | | Unless --no-tags flag was given, git-fetch tried to always follow remote tags that point at the commits we picked up. It is not very useful to pick up tags from remote unless storing the fetched branch head in a local tracking branch. This is especially true if the fetch is done to merge the remote branch into our current branch as one-shot basis (i.e. "please pull"), and is even harmful if the remote repository has many irrelevant tags. This proposed update disables the automated tag following unless we are storing the a fetched branch head in a local tracking branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch --upload-pack: disambiguate.Junio C Hamano2006-01-261-2/+2
| | | | | | | | | Johannes noticed the recent addition of this new flag inadvertently took over existing --update-head-ok (-u). Require longer abbreviation to this new option which would be needed in a rare setup. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-{fetch,peek-remote} handling of --upload-packMichal Ostrowski2006-01-241-2/+4
| | | | | | | | | | git-peek-remote needs to handle a -u|--upload-pack parameter just like git-fetch (and git-fetch has to pass it on to git-peek-remote). (This is actually a follow-up to my previous git-fetch patch.) Signed-off-by: Michal Ostrowski <mostrows@heater.watson.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: pass --upload-pack to fetch-packMichal Ostrowski2006-01-241-1/+7
| | | | | | | | | | | | | | | | | Without this, there is no way to specify a remote executable when invoking git-pull/git-fetch as there is for git-clone. [jc: I have a mild suspicion that this is a broken environment (aka sysadmin disservice). It may be legal to configure your sshd to spawn named program without involving shell at all, and if your sysadmin does so and you have your git programs under your home directory, you would need something like this, but then I suspect you would need such workaround everywhere, not just git. But we have these options we can use to work around the issue, so there is no strong reason not to reject this patch, either. ] Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add --keep option to keep downloaded packs to git-fetch.Tom Prince2006-01-101-1/+4
| | | | | Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch: auto-following tags.Junio C Hamano2006-01-071-119/+156
| | | | | | | | | | | I added things to ls-remote so that Cogito can auto-follow tags easily and correctly a while ago, but git-fetch did not use the facility. Recently added git-describe command relies on repository keeping up-to-date set of tags, which made it much more attractive to automatically follow tags, so we do that as well. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-fetch --tags: reject malformed tags.Junio C Hamano2006-01-051-5/+14
| | | | | | | | | | When the other end was prepared with older git and has tags that do not follow the naming convention (see check-ref-format), do not barf but simply reject to copy them. Initial fix by Simon Richter, but done differently. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Do not mark tags fetched via --tags flag as mergeableJunio C Hamano2005-12-271-1/+1
| | | | | | | Otherwise "git pull --tags" would mistakenly try to merge all of them, which is never what the user wants. Signed-off-by: Junio C Hamano <junkio@cox.net>