path: root/http-push.c
AgeCommit message (Collapse)Author
2006-06-06HTTP cleanupJunio C Hamano
This ifdef's out more functions that are not used while !USE_MULTI in http code. Also the dependency of http related objects on http.h header file was missing in the Makefile. Signed-off-by: Junio C Hamano <>
2006-06-06HTTP cleanupNick Hengeveld
Fix broken build when USE_CURL_MULTI is not defined, as noted by Becky Bruce. During cleanup, free header slist that was created during init, as noted by Junio. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2006-05-31tree_entry(): new tree-walking helper functionLinus Torvalds
This adds a "tree_entry()" function that combines the common operation of doing a "tree_entry_extract()" + "update_tree_entry()". It also has a simplified calling convention, designed for simple loops that traverse over a whole tree: the arguments are pointers to the tree descriptor and a name_entry structure to fill in, and it returns a boolean "true" if there was an entry left to be gotten in the tree. This allows tree traversal with struct tree_desc desc; struct name_entry entry; desc.buf = tree->buffer; desc.size = tree->size; while (tree_entry(&desc, &entry) { ... use "entry.{path, sha1, mode, pathlen}" ... } which is not only shorter than writing it out in full, it's hopefully less error prone too. [ It's actually a tad faster too - we don't need to recalculate the entry pathlength in both extract and update, but need to do it only once. Also, some callers can avoid doing a "strlen()" on the result, since it's returned as part of the name_entry structure. However, by now we're talking just 1% speedup on "git-rev-list --objects --all", and we're definitely at the point where tree walking is no longer the issue any more. ] NOTE! Not everybody wants to use this new helper function, since some of the tree walkers very much on purpose do the descriptor update separately from the entry extraction. So the "extract + update" sequence still remains as the core sequence, this is just a simplified interface. We should probably add a silly two-line inline helper function for initializing the descriptor from the "struct tree" too, just to cut down on the noise from that common "desc" initializer. Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
2006-05-30Remove "tree->entries" tree-entry list from tree parserLinus Torvalds
Instead, just use the tree buffer directly, and use the tree-walk infrastructure to walk the buffers instead of the tree-entry list. The tree-entry list is inefficient, and generates tons of small allocations for no good reason. The tree-walk infrastructure is generally no harder to use than following a linked list, and allows us to do most tree parsing in-place. Some programs still use the old tree-entry lists, and are a bit painful to convert without major surgery. For them we have a helper function that creates a temporary tree-entry list on demand. Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
2006-05-30Make "tree_entry" have a SHA1 instead of a union of object pointersLinus Torvalds
This is preparatory work for further cleanups, where we try to make tree_entry look more like the more efficient tree-walk descriptor. Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
2006-04-18Merge branch 'lt/logopt'Junio C Hamano
* lt/logopt: Fix "git log --stat": make sure to set recursive with --stat. combine-diff: show diffstat with the first parent. git.c: LOGSIZE is unused after log printing cleanup. Log message printout cleanups (#3): fix --pretty=oneline Log message printout cleanups (#2) Log message printout cleanups rev-list --header: output format fix Fixes for option parsing log/whatchanged/show - log formatting cleanup. Simplify common default options setup for built-in log family. Tentative built-in "git show" Built-in git-whatchanged. rev-list option parser fix. Split init_revisions() out of setup_revisions() Fix up rev-list option parsing. Fix up default abbrev in setup_revisions() argument parser. Common option parsing for "git log --diff" and friends
2006-04-17rev-list --boundary: show boundary commits even when limited otherwise.Junio C Hamano
The boundary commits are shown for UI like gitk to draw them as soon as topo-order sorting allows, and should not be omitted by get_revision() filtering logic. As long as their immediate child commits are shown, we should not filter them out. Signed-off-by: Junio C Hamano <>
2006-04-16Split init_revisions() out of setup_revisions()Junio C Hamano
Merging all three option parsers related to whatchanged is unarguably the right thing, but the fallout was too big to scare me away. Let's try it once again, but once step at time. This splits out init_revisions() call from setup_revisions(), so that the callers can set different defaults to match the traditional benaviour. The rev-list command is still broken in a big way, which is the topic of next step. Signed-off-by: Junio C Hamano <>
2006-04-11Merge branch 'jc/diff' into nextJunio C Hamano
* jc/diff: blame and friends: adjust to multiple pathspec change. git log --full-diff tree-diff: do not assume we use only one pathspec
2006-04-11Replace index() with strchr().Dennis Stosberg
strchr() is more portable than index() and is used everywhere in git already. Signed-off-by: Junio C Hamano <>
2006-04-11blame and friends: adjust to multiple pathspec change.Junio C Hamano
This makes things that include revision.h build again. Blame is also built, but I am not sure how well it works (or how well it worked to begin with) -- it was relying on tree-diff to be using whatever pathspec was used the last time, which smells a bit suspicious. Signed-off-by: Junio C Hamano <>
2006-04-09Make "--parents" logs also be incrementalLinus Torvalds
The parent rewriting feature caused us to create the whole history in one go, and then simplify it later, because of how rewrite_parents() had been written. However, with a little tweaking, it's perfectly possible to do even that one incrementally. Right now, this doesn't really much matter, because every user of "--parents" will probably generally _also_ use "--topo-order", which will cause the old non-incremental behaviour anyway. However, I'm hopeful that we could make even the topological sort incremental, or at least _partially_ so (for example, make it incremental up to the first merge). In the meantime, this at least moves things in the right direction, and removes a strange special case. Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
2006-04-04Replace xmalloc+memset(0) with xcalloc.Peter Eriksen
Signed-off-by: Peter Eriksen <> Signed-off-by: Junio C Hamano <>
2006-04-02Fix sparse warnings about non-ANSI function prototypesRene Scharfe
Signed-off-by: Rene Scharfe <> Signed-off-by: Junio C Hamano <>
2006-03-21http-push.c: squelch C90 warnings.Junio C Hamano
If you write code after declarations in a block, gcc scolds you with "warning: ISO C90 forbids mixed declarations and code". Signed-off-by: Junio C Hamano <>
2006-03-20http-push: don't assume char is signedNick Hengeveld
Declare remote_dir_exists[] as signed char to be sure that values of -1 are valid. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2006-03-20http-push: add support for deleting remote branchesNick Hengeveld
Processes new command-line arguments -d and -D to remove a remote branch if the following conditions are met: - one branch name is present on the command line - the specified branch name matches exactly one remote branch name - the remote HEAD is a symref - the specified branch is not the remote HEAD - the remote HEAD resolves to an object that exists locally (-d only) - the specified branch resolves to an object that exists locally (-d only) - the specified branch is an ancestor of the remote HEAD (-d only) Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2006-03-11http-push: cleanupNick Hengeveld
More consistent usage string, condense push output, remove extra slashes in URLs, fix unused variables, include HTTP method name in failure messages. Signed-off-by: Junio C Hamano <>
2006-03-11http-push: support for updating remote info/refsNick Hengeveld
If info/refs exists on the remote, get a lock on info/refs, make sure that there is a local copy of the object referenced in each remote ref (in case someone else added a tag we don't have locally), do all the refspec updates, and generate and send an updated info/refs file. Signed-off-by: Junio C Hamano <>
2006-03-11http-push: improve remote lock managementNick Hengeveld
Associate the remote locks with the remote repo, add a function to check and refresh all current locks. Signed-off-by: Junio C Hamano <>
2006-03-11http-push: refactor remote file/directory processingNick Hengeveld
Replace single-use functions with one that can get a list of remote collections and pass file/directory information to user-defined functions for processing. Signed-off-by: Junio C Hamano <>
2006-03-11HTTP slot reuse fixesNick Hengeveld
Incorporate into http-push a fix related to accessing slot results after the slot was reused, and fix a case in run_active_slot where a finished slot wasn't detected if the slot was reused. Signed-off-by: Junio C Hamano <>
2006-03-11http-push: fix revision walkNick Hengeveld
The revision walk was not including tags because setup_revisions zeroes out the revs flags. Pass --objects so it picks up all the necessary bits. Signed-off-by: Junio C Hamano <>
2006-03-08Update http-push functionalityNick Hengeveld
This brings http-push functionality more in line with the ssh/git version, by borrowing bits from send-pack and rev-list to process refspecs and revision history in more standard ways. Also, the status of remote objects is determined using PROPFIND requests for the object directory rather than HEAD requests for each object - while it may be less efficient for small numbers of objects, this approach is able to get the status of all remote loose objects in a maximum of 256 requests. Signed-off-by: Junio C Hamano <>
2005-11-30Merge branch 'jc/subdir'Junio C Hamano
2005-11-29http-push cleanupNick Hengeveld
The malloc patch from Jan Andres fixed the problem that was causing a segfault when freeing the lock token, and Johannes Schindelin found and fixed a problem when no URL is specified on the command line. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-29Make networking commands to work from a subdirectory.Junio C Hamano
These are whole-tree operations and there is not much point making them operable from within a subdirectory, but it is easy to do so, and using setup_git_directory() upfront helps git:// proxy specification picked up from the correct place. Signed-off-by: Junio C Hamano <>
2005-11-29Fix typo in http-push.cJan Andres
Typo resulted in accessing past the beginning of a string causing segfaults. [jc: signoffs?]
2005-11-20Decide whether to build http-push in the MakefileNick Hengeveld
The decision about whether to build http-push or not belongs in the Makefile. This follows Junio's suggestion to determine whether curl is new enough to support http-push. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-20http-push memory/fd cleanupNick Hengeveld
Clean up memory and file descriptor usage Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-20Improve XML parsing in http-pushNick Hengeveld
Improved XML parsing - replace specialized doc parser callbacks with generic functions that track the parser context and use document-specific callbacks to process that data. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-20Isolate shared HTTP request functionalityNick Hengeveld
Move shared HTTP request functionality out of http-fetch and http-push, and replace the two fwrite_buffer/fwrite_buffer_dynamic functions with one fwrite_buffer function that does dynamic buffering. Use slot callbacks to process responses to fetch object transfer requests and push transfer requests, and put all of http-push into an #ifdef check for curl multi support. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-09sparse fixes for http-{fetch,push}.cPeter Hagervall
Make a bunch of needlessly global functions static, and replace two K&R-style declarations. Signed-off-by: Peter Hagervall <> Signed-off-by: Junio C Hamano <>
2005-11-07Small bugfixes for http-push.cJohannes Schindelin
This patch fixes three things: - older libexpat does not know about enum XML_Status - as in my patch for http-fetch, do not rely on a curl result in free()d data - calloc the new_lock structure Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
2005-11-07Make http-push smarter about creating remote dirsNick Hengeveld
Remember object directories known to exist in the remote repo and don't bother trying to create them. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-07http-push.c: include with angle bracket, not dq.Paul Collins
Do not search the current directory when including expat.h, since it is not supplied by git. Signed-off-by: Paul Collins <> Signed-off-by: Junio C Hamano <>
2005-11-06Refresh the remote lock if it is about to expireNick Hengeveld
Refresh the remote lock if it is about to expire Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-06Improve lock handlingNick Hengeveld
Improve lock handling: parse the server response for the timeout, owner, and lock token Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-06Support remote references with slashes in their namesNick Hengeveld
Support remote references with slashes in their names Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-06Verify remote packs, speed up pending request queueNick Hengeveld
Verify that remote packs exist before using the pack index, add requests to the beginning of the queue to locate pending requests faster. Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>
2005-11-06Add support for pushing to a remote repository using HTTP/DAVNick Hengeveld
Add support for pushing to a remote repository using HTTP/DAV Signed-off-by: Nick Hengeveld <> Signed-off-by: Junio C Hamano <>