path: root/git-fetch-script
AgeCommit message (Collapse)Author
2005-09-08Big tool rename.Junio C Hamano
As promised, this is the "big tool rename" patch. The primary differences since 0.99.6 are: (1) git-*-script are no more. The commands installed do not have any such suffix so users do not have to remember if something is implemented as a shell script or not. (2) Many command names with 'cache' in them are renamed with 'index' if that is what they mean. There are backward compatibility symblic links so that you and Porcelains can keep using the old names, but the backward compatibility support is expected to be removed in the near future. Signed-off-by: Junio C Hamano <>
2005-09-02Fix automerge message.Junio C Hamano
The rewrite done while adding the shorthand support made the remote refname recorded in the commit message too long for human consumption, while losing information by using the shorthand not the real URL to name the remote repository there. They were both bad changes done without enough thinking. Pointed out by Linus. Signed-off-by: Junio C Hamano <>
2005-08-27Fix pulling into the same branch.Junio C Hamano
When the "git pull" command updates the branch head you are currently on, before doing anything else, first update your index file and the working tree contents to that of the new branch head. Otherwise, the later resolving steps would think your index file is attempting to revert the change between the original head commit and the updated head commit. It uses two-tree fast-forward form of "read-tree -m -u" to prevent losing whatever local changes you may have in the working tree to do this update. I think this would at least make things safer (a lot safer), and prevent mistakes. Also "git fetch" command is forbidden from fetching and fast forwarding the current branch head unless --update-head-ok flag is given. "git pull" passes the flag when it internally calls "git fetch". Signed-off-by: Junio C Hamano <>
2005-08-25Fix fetching of tags.Junio C Hamano
"git fetch tag <tag>" stored a tag after dereferencing. Bad. Signed-off-by: Junio C Hamano <>
2005-08-24[PATCH] Allow "+remote:local" refspec to cause --force when fetching.Junio C Hamano
With this we could say: Pull: master:ko-master +pu:ko-pu to mean "fast forward ko-master with master, overwrite ko-pu with pu", and the latter one does not require the remote "pu" to be descendant of local "ko-pu". Signed-off-by: Junio C Hamano <>
2005-08-24[PATCH] "git fetch --force".Junio C Hamano
Just like "git push" can forcibly update a ref to a value that is not a fast-forward, teach "git fetch" to do so as well. Signed-off-by: Junio C Hamano <>
2005-08-24[PATCH] Make "git pull" and "git fetch" default to originJunio C Hamano
Amos Waterland sent in a patch for the pre-multi-head aware version of "git pull" to do this, but the code changed quite a bit since then. If there is no argument given to pull from, and if "origin" makes sense, default to fetch/pull from "origin" instead of barfing. [jc: besides, the patch by Amos broke the non-default case where explicit refspecs are specified, and did not make sure we know what "origin" means before defaulting to it.] Signed-off-by: Junio C Hamano <>
2005-08-24[PATCH] Multi-head fetch.Junio C Hamano
Traditionally, fetch takes these forms: $ git fetch <remote> $ git fetch <remote> <head> $ git fetch <remote> tag <tag> This patch updates it to take $ git fetch <remote> <refspec>... where: - A <refspec> of form "<src>:<dst>" is to fetch the objects needed for the remote ref that matches <src>, and if <dst> is not empty, store it as a local <dst>. - "tag" followed by <next> is just an old way of saying "refs/tags/<next>:refs/tags/<next>"; this mimics the current behaviour of the third form above and means "fetch that tag and store it under the same name". - A single token <refspec> without colon is a shorthand for "<refspec>:" That is, "fetch that ref but do not store anywhere". - when there is no <refspec> specified - if <remote> is the name of a file under $GIT_DIR/remotes/ (i.e. a new-style shorthand), then it is the same as giving the <refspec>s listed on Pull: line in that file. - if <remote> is the name of a file under $GIT_DIR/branches/ (i.e. an old-style shorthand, without trailing path), then it is the same as giving a single <refspec> "<remote-name>:refs/heads/<remote>" on the command line, where <remote-name> is the remote branch name (defaults to HEAD, but can be overridden by .git/branches/<remote> file having the URL fragment notation). That is, "fetch that branch head and store it in refs/heads/<remote>". - otherwise, it is the same as giving a single <refspec> that is "HEAD:". The SHA1 object names of fetched refs are stored in FETCH_HEAD, one name per line, with a comment to describe where it came from. This is later used by "git resolve" and "git octopus". Signed-off-by: Junio C Hamano <>
2005-08-12fetch-pack: start multi-head pulling.Junio C Hamano
This is a beginning of resurrecting the multi-head pulling support for git-fetch-pack command. The git-fetch-script wrapper still only knows about fetching a single head, without renaming, so it is not very useful unless you directly call git-fetch-pack itself yet. It also fixes a longstanding obsolete description of how the command discovers the list of local commits.
2005-08-09[PATCH] Make curl fail on server errorCatalin Marinas
Some http servers return an HTML error page and git reads it as normal data. Adding -f option makes curl fail silently. Signed-off-by: Catalin Marinas <> Signed-off-by: Junio C Hamano <>
2005-08-01Retire git-fetch-dumb-http and missing-revsJunio C Hamano
Now git-http-pull knows how to do packed repo, retire scripted hacks I placed as a stop-gap measure. Signed-off-by: Junio C Hamano <>
2005-07-31Fetch from a packed repository on dumb servers.Junio C Hamano
Implement fetching from a packed repository over http/https using the dumb server support files. I consider some parts of the logic should be in a separate C program, but it appears to work with my simple tests. I have backburnered it for a bit too long for my liking, so let's throw it out in the open and see what happens. Signed-off-by: Junio C Hamano <>
2005-07-23[PATCH] Support more http features: https no cert, .netrc -> authDarrin Thompson
Cause setting environment variable GIT_SSL_NO_VERIFY to turn off curl's ssl peer verification. Only use curl for http transfers, instead of curl and wget. Make curl check ~/.netrc for credentials. Signed-off-by: Junio C Hamano <> Signed-off-by: Linus Torvalds <>
2005-07-16git-fetch-script: fix http:// breakageLinus Torvalds
We were trying to fetch using the merge-head name rather than the merge-head SHA1 that we just got. Now, http:// is broken anyway right now for packing, but this should make it work for nonpacked repositories again.
2005-07-16Fix git-fetch-script breakageLinus Torvalds
It had the test for the destination reversed.
2005-07-16[PATCH] fetch/pull: short-hand notation for remote repositories.Junio C Hamano
Since pull and fetch are done often against the same remote repository repeatedly, keeping the URL to pull from along with the name of the head to use in $GIT_DIR/branches/$name makes a lot of sense. Adopt that convention from Cogito, and try to be compatible when possible; storing a partial URL and completing it with a trailing path may not be understood by Cogito. While we are at it, fix pulling a tag. Earlier, we updated only refs/tags/$tag without updating FETCH_HEAD, and called resolve-script using a stale (or absent) FETCH_HEAD. Signed-off-by: Junio C Hamano <> Signed-off-by: Linus Torvalds <>
2005-07-08Add "git-sh-setup-script" for common git shell script setupLinus Torvalds
It sets up the normal git environment variables and a few helper functions (currently just "die()"), and returns ok if it all looks like a git archive. So use it something like . git-sh-setup-script || die "Not a git archive" to make the rest of the git scripts more careful and readable.
2005-07-05Work around git-http-pull breakage in git-fetch-scriptLinus Torvalds
Need to add a final slash. And make it verbose by default, since it's so slow that otherwise people will think it's died.
2005-07-05git-fetch-script: use git-fetch-pack for local and ssh fetches.Linus Torvalds
Also, clean it up a lot.
2005-06-23Make "git fetch" able to fetch a named tagLinus Torvalds
Use "git fetch <repo> tag <tagname>" to get the named tag and everything it points to.
2005-06-21Clean up different special *HEAD handlingLinus Torvalds
We codify the following different heads (in addition to the main "HEAD", which points to the current branch, of course): - FETCH_HEAD Populated by "git fetch" - ORIG_HEAD The old HEAD before a "git pull/resolve" (successful or not) - LAST_MERGE The HEAD we're currently merging in "git pull/resolve" - MERGE_HEAD The previous head of a unresolved "git pull", which gets committed by a "git commit" after manually resolving the result We used to have "MERGE_HEAD" be populated directly by the fetch, and we removed ORIG_HEAD and LAST_MERGE too aggressively.
2005-06-07Make fetch/pull scripts terminate cleanly on errorsLinus Torvalds
Don't continue with a merge if the fetch failed.
2005-05-22Split up git-pull-script into separate "fetch" and "merge" phases.Linus Torvalds
This allows you to just fetch stuff first, inspect it, and then resolve the merge separately if everything looks good.