summaryrefslogtreecommitdiff
path: root/git-fetch.sh
AgeCommit message (Collapse)AuthorFilesLines
2007-01-31Escape --upload-pack from expr.Libravatar Shawn O. Pearce1-1/+1
Recent commit ae1dffcb28ee89a23f8d2747be65e17c8eab1690 by Junio changed the way --upload-pack was passed around between clone, fetch and ls-remote and modified the handling of the command line parameter parsing. Unfortunately FreeBSD 6.1 insists that the expression expr --upload-pack=git-upload-pack : '-[^=]*=\(.*\)' is illegal, as the --upload-pack option is not supported by their implementation of expr. Elsewhere in Git we use z as a leading prefix of both arguments, ensuring the -- isn't seen by expr. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-28[PATCH] Rename git-repo-config to git-config.Libravatar Tom Prince1-1/+1
Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-24make --upload-pack option to git-fetch configurableLibravatar Uwe Kleine-König1-0/+6
This introduces the config item remote.<name>.uploadpack to override the default value (which is "git-upload-pack"). Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-24ls-remote and clone: accept --upload-pack=<path> as well.Libravatar Junio C Hamano1-4/+7
This makes them consistent with other commands that take the path to the upload-pack program. We also pass --upload-pack instead of --exec to the underlying fetch-pack, although it is not strictly necessary. [jc: original motivation from Uwe] Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-12Use cd_to_toplevel in scripts that implement it by hand.Libravatar Junio C Hamano1-5/+1
This converts scripts that do "cd $(rev-parse --show-cdup)" by hand to use cd_to_toplevel. I think git-fetch does not have to go to the toplevel, but that should be dealt with in a separate patch. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07git-fetch: allow updating the current branch in a bare repository.Libravatar Junio C Hamano1-4/+5
Sometimes, people have only fetch access into a bare repository that is used as a back-up location (or a distribution point) but does not have a push access for networking reasons, e.g. one end being behind a firewall, and updating the "current branch" in such a case is perfectly fine. This allows such a fetch without --update-head-ok, which is a flag that should never be used by end users otherwise. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01git-fetch: remove .keep file at the end.Libravatar Junio C Hamano1-7/+16
Removal of them is needed regardless of errors. The original code had the removal outside of the process which sets the flag to tell the later step what to remove, but it runs as a downstream of a pipeline and its effect was lost. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28Merge branch 'js/shallow'Libravatar Junio C Hamano1-1/+15
* js/shallow: fetch-pack: Do not fetch tags for shallow clones. get_shallow_commits: Avoid memory leak if a commit has been reached already. git-fetch: Reset shallow_depth before auto-following tags. upload-pack: Check for NOT_SHALLOW flag before sending a shallow to the client. fetch-pack: Properly remove the shallow file when it becomes empty. shallow clone: unparse and reparse an unshallowed commit Why didn't we mark want_obj as ~UNINTERESTING in the old code? Why does it mean we do not have to register shallow if we have one? We should make sure that the protocol is still extensible. add tests for shallow stuff Shallow clone: do not ignore shallowness when following tags allow deepening of a shallow repository allow cloning a repository "shallowly" support fetching into a shallow repository upload-pack: no longer call rev-list
2006-12-28Use GIT_REFLOG_ACTION environment variable instead.Libravatar Shawn O. Pearce1-13/+8
Junio rightly pointed out that the --reflog-action parameter was starting to get out of control, as most porcelain code needed to hand it to other porcelain and plumbing alike to ensure the reflog contained the top-level user action and not the lower-level actions it invoked. At Junio's suggestion we are introducing the new set_reflog_action function to all shell scripts, allowing them to declare early on what their default reflog name should be, but this setting only takes effect if the caller has not already set the GIT_REFLOG_ACTION environment variable. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-27Merge branch 'master' into js/shallowLibravatar Junio C Hamano1-34/+36
This is to adjust to: count-objects -v: show number of packs as well. which will break a test in this series. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18make git a bit less cryptic on fetch errorsLibravatar Nicolas Pitre1-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>
2006-12-17git-fetch: Avoid reading packed refs over and over againLibravatar Junio C Hamano1-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>
2006-12-14git-fetch: make it work from within a subdirectory.Libravatar Junio C Hamano1-0/+6
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-25Merge branch 'master' into jc/globfetchLibravatar Junio C Hamano1-5/+6
This is to pick up the fix made on master: git-fetch: exit with non-zero status when fast-forward check fails
2006-11-25git-fetch: exit with non-zero status when fast-forward check failsLibravatar Junio C Hamano1-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>
2006-11-24git-fetch: Reset shallow_depth before auto-following tags.Libravatar Alexandre Julliard1-0/+2
Otherwise fetching the tags could also fetch commits up to the specified depth, which isn't the expected behavior. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24allow deepening of a shallow repositoryLibravatar Johannes Schindelin1-1/+13
Now, by saying "git fetch -depth <n> <repo>" you can deepen a shallow repository. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23git-fetch: fix dumb protocol transport to fetch from pack-pruned refLibravatar Junio C Hamano1-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>
2006-11-23git-fetch: reuse ls-remote result.Libravatar Junio C Hamano1-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>
2006-11-19git-fetch: follow lightweit tags as well.Libravatar Junio C Hamano1-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>
2006-11-03remove .keep pack lock files when done with refs updateLibravatar Nicolas Pitre1-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>
2006-11-03git-fetch can use both --thin and --keep with fetch-pack nowLibravatar Nicolas Pitre1-2/+2
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-01Merge branch 'jc/refs-and-fetch'Libravatar Junio C Hamano1-4/+4
* jc/refs-and-fetch: git-fetch: adjust to packed-refs.
2006-11-01Merge branch 'lj/refs'Libravatar Junio C Hamano1-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. ...
2006-10-25Merge branch 'maint'Libravatar Junio C Hamano1-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
2006-10-25git-fetch.sh printed protocol fixLibravatar Tuncer Ayaz1-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>
2006-10-18Merge branch 'sb/fetch'Libravatar Junio C Hamano1-16/+25
* sb/fetch: merge and resolve: Output short hashes and .. in "Updating ..." fetch: Misc output cleanup
2006-10-10git-fetch --update-head-ok typofixLibravatar Junio C Hamano1-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>
2006-10-03git-fetch: do not look into $GIT_DIR/refs to see if a tag exists.Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-01git-fetch: adjust to packed-refs.Libravatar Junio C Hamano1-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>
2006-09-30fetch: Misc output cleanupLibravatar Santi B,Ai(Bjar1-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>
2006-09-29fetch: Reset remote refs list each time fetch_main is calledLibravatar Santi Béjar1-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>
2006-09-28http/ftp: optionally ask curl to not use EPSV commandLibravatar Sasha Khapyorsky1-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>
2006-09-24Fetch: default remote repository from branch propertiesLibravatar Santi Béjar1-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>
2006-09-13Trivial support for cloning and fetching via ftp://.Libravatar Sasha Khapyorsky1-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>
2006-07-25Merge branch 'jc/clone-bind-failure'Libravatar Junio C Hamano1-2/+9
* jc/clone-bind-failure: fetch/clone: check return status from ls-remote
2006-07-24Defaulting fetch to origin when set in the repo-configLibravatar Santi Béjar1-1/+2
Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-17git-fetch: fix --keep vs --thinLibravatar Junio C Hamano1-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>
2006-07-14Fix "git-fetch --tags" exit status when nothing has been changedLibravatar Sergey Vlasov1-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>
2006-07-13fetch/clone: check return status from ls-remoteLibravatar Junio C Hamano1-2/+9
Some callers of ls-remote did not check its return status.
2006-07-11git-fetch: fix a bashism (==)Libravatar Eric Wong1-1/+1
Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-10Log ref changes made by git-fetch and git-pull.Libravatar Shawn Pearce1-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>
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-03fetch: do not report "same" unless -verbose.Libravatar Junio C Hamano1-1/+4
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-28git-fetch: avoid using "case ... in (arm)"Libravatar Junio C Hamano1-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>
2006-04-26git-fetch: resolve remote symrefs for HTTP transportLibravatar Nick Hengeveld1-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>
2006-04-13Fix-up previous expr changes.Libravatar Junio C Hamano1-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>
2006-04-13Shell utilities: Guard against expr' magic tokens.Libravatar Mark Wooding1-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>
2006-03-17Merge branch 'jc/fetch' into nextLibravatar Junio C Hamano1-0/+1
* jc/fetch: fetch: exit non-zero when fast-forward check fails.
2006-03-17fetch: exit non-zero when fast-forward check fails.Libravatar Junio C Hamano1-0/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>