aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* builtin-archive.c: rename remote_request() to extract_remote_arg()Junio C Hamano2006-09-12
| | | | | | Suggested by Franck, and I think it makes sense. Signed-off-by: Junio C Hamano <junkio@cox.net>
* upload-archive: monitor child communication more carefully.Junio C Hamano2006-09-12
| | | | | | | | | | | | | | | | | | | Franck noticed that the code around polling and relaying messages from the child process was quite bogus. Here is an attempt to clean it up a bit, based on his patch: - When POLLHUP is set, it goes ahead and reads the file descriptor. Worse yet, it does not check the return value of read() for errors when it does. - When we processed one POLLIN, we should just go back and see if any more data is available. We can check if the child is still there when poll gave control back at us but without any actual input. [jc: with simplification suggested by Franck. ] Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add sideband status report to git-archive protocolJunio C Hamano2006-09-10
| | | | | | | | Using the refactored sideband code from existing upload-pack protocol, this lets the error condition and status output sent from the remote process to be shown locally. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/sideband' into jc/archiveJunio C Hamano2006-09-10
|\ | | | | | | | | | | | | | | * jc/sideband: Prepare larger packet buffer for upload-pack protocol. Move sideband server side support into reusable form. Move sideband client side support into reusable form. get_sha1_hex() micro-optimization
| * Prepare larger packet buffer for upload-pack protocol.Junio C Hamano2006-09-10
| | | | | | | | | | | | | | | | | | The original side-band support added to the upload-pack protocol used the default 1000-byte packet length. The pkt-line format allows up to 64k, so prepare the receiver for the maximum size, and have the uploader and downloader negotiate if larger packet length is allowed. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Move sideband server side support into reusable form.Junio C Hamano2006-09-10
| | | | | | | | | | | | | | | | The server side support; this is just the very low level, and the caller needs to know which band it wants to send things out. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from b786552b67878c7780c50def4c069d46dc54efbe commit)
| * Move sideband client side support into reusable form.Junio C Hamano2006-09-10
| | | | | | | | | | | | | | | | This moves the receiver side of the sideband support from fetch-clone.c to sideband.c and its header file, so that archiver protocol can use it. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * get_sha1_hex() micro-optimizationJunio C Hamano2006-09-09
| | | | | | | | | | | | | | | | | | The function appeared high on a gprof output for a rev-list run of a non-trivial size, and it was an obvious low-hanging fruit. The code is from Linus. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Teach --exec to git-archive --remoteJunio C Hamano2006-09-10
| | | | | | | | | | | | | | | | | | | | Some people needed --exec to specify the location of the upload-pack executable, because their default SSH log-in does not include the directory they have their own private copy of git on the $PATH. These people need to be able to say --exec to git-archive --remote for the same reason. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Add --verbose to git-archiveJunio C Hamano2006-09-10
| | | | | | | | | | | | | | And teach backends about it. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 9e2c44a2893ae90944a0b7c9f40a9d22b759b5c0 commit)
* | archive: force line buffered output to stderrJunio C Hamano2006-09-10
| | | | | | | | | | | | | | | | Otherwise the remote notification that comes with -v option can get clumped together. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from a675cda60ead41f439b04bc69e0f19ace04e59d3 commit)
* | Use xstrdup instead of strdup in builtin-{tar,zip}-tree.cRene Scharfe2006-09-10
| | | | | | | | | | | | Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 5d2aea4cb383a43e40d47ab69d8ad7a495df6ea2 commit)
* | archive: allow remote to have more formats than we understand.Junio C Hamano2006-09-09
| | | | | | | | | | | | | | | | This fixes git-archive --remote not to parse archiver arguments; otherwise if the remote end implements formats other than the one known locally we will not be able to access that format. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-archive: make compression level of ZIP archives configurableRene Scharfe2006-09-09
| | | | | | | | | | Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Add git-upload-archiveFranck Bui-Huu2006-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command implements the git archive protocol on the server side. This command is not intended to be used by the end user. Underlying git-archive command line options are sent over the protocol from "git-archive --remote=...", just like upload-tar currently does with "git-tar-tree=...". As for "git-archive" command implementation, this new command does not execute any existing "git-{tar,zip}-tree" but rely on the archive API defined by "git-archive" patch. Hence we get 2 good points: - "git-archive" and "git-upload-archive" share all option parsing code. - All kind of git-upload-{tar,zip} can be deprecated. Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-archive: wire up ZIP format.Franck Bui-Huu2006-09-09
| | | | | | | | | | | | | | | | | | Again, this is based on Rene Scharfe's earlier patch, but uses the archiver support introduced by the previous patch. Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-archive: wire up TAR format.Franck Bui-Huu2006-09-09
| | | | | | | | | | | | | | | | | | This is based on Rene Scharfe's earlier patch, but uses the archiver support introduced by the previous patch. Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Add git-archiveFranck Bui-Huu2006-09-09
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-archive is a command to make TAR and ZIP archives of a git tree. It helps prevent a proliferation of git-{format}-tree commands. Instead of directly calling git-{tar,zip}-tree command, it defines a very simple API, that archiver should implement and register in "git-archive.c". This API is made up by 2 functions whose prototype is defined in "archive.h" file. - The first one is used to parse 'extra' parameters which have signification only for the specific archiver. That would allow different archive backends to have different kind of options. - The second one is used to ask to an archive backend to build the archive given some already resolved parameters. The main reason for making this API is to avoid using git-{tar,zip}-tree commands, hence making them useless. Maybe it's time for them to die ? It also implements remote operations by defining a very simple protocol: it first sends the name of the specific uploader followed the repository name (git-upload-tar git://example.org/repo.git). Then it sends options. It's done by sending a sequence of one argument per packet, with prefix "argument ", followed by a flush. The remote protocol is implemented in "git-archive.c" for client side and is triggered by "--remote=<repo>" option. For example, to fetch a TAR archive in a remote repo, you can issue: $ git archive --format=tar --remote=git://xxx/yyy/zzz.git HEAD We choose to not make a new command "git-fetch-archive" for example, avoind one more GIT command which should be nice for users (less commands to remember, keeps existing --remote option). Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* autoconf: Add config.cache to .gitignoreJakub Narebski2006-09-07
| | | | | | | | | Add generated file config.cache (default cache file, when running ./configure with -C, --config-cache option) to the list of ignored files. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* autoconf: Add support for setting NO_ICONV and ICONVDIRJakub Narebski2006-09-07
| | | | | | | | | | | Add support for ./configure options --without-iconv (if neither libc nor libiconv properly support iconv), and for --with-iconv=PATH (to set prefix to libiconv library and headers, used only when NEED_LIBICONV is set). While at it, make ./configure set or unset NO_ICONV always (it is not autodetected in Makefile). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* autoconf: Set NO_ICONV if iconv is found neither in libc, nor in libiconvJakub Narebski2006-09-07
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/daemon'Junio C Hamano2006-09-07
|\ | | | | | | | | | | | | * jc/daemon: Revert "daemon: add upload-tar service." multi-service daemon: documentation daemon: add upload-tar service.
| * Revert "daemon: add upload-tar service."Junio C Hamano2006-09-07
| | | | | | | | | | | | | | | | | | | | This reverts parts of commit 74c0cc2 and part of commit 355f541. Franck and Rene are working on a unified upload-archive which would supersede this when done, so better not to get in their way. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * multi-service daemon: documentationJunio C Hamano2006-08-27
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * daemon: add upload-tar service.Junio C Hamano2006-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows clients to ask for tarballs with: git tar-tree --remote=git://server/repo refname By default, the upload-tar service is not enabled. To enable it server-wide, the server can be started with: git-daemon --enable=upload-tar This service is by default overridable per repostiory, so alternatively, a repository can define "daemon.uploadtar = true" to enable it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'pm/diff'Junio C Hamano2006-09-07
|\ \ | | | | | | | | | | | | * pm/diff: diff-index --cc shows a 3-way diff between HEAD, index and working tree.
| * | diff-index --cc shows a 3-way diff between HEAD, index and working tree.Paul Mackerras2006-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements a 3-way diff between the HEAD commit, the state in the index, and the working directory. This is like the n-way diff for a merge, and uses much of the same code. It is invoked with the -c flag to git-diff-index, which it already accepted and did nothing with. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-repack: create new packs inside $GIT_DIR, not cwdMartin Langhoff2006-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid failing when cwd is !writable by writing the packfiles in $GIT_DIR, which is more in line with other commands. Without this, git-repack was failing when run from crontab by non-root user accounts. For large repositories, this also makes the mv operation a lot cheaper, and avoids leaving temp packfiles around the fs upon failure. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Teach rev-list an option to read revs from the standard input.Junio C Hamano2006-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When --stdin option is given, in addition to the <rev>s listed on the command line, the command can read one rev parameter per line from the standard input. The list of revs ends at the first empty line or EOF. Note that you still have to give all the flags from the command line; only rev arguments (including A..B, A...B, and A^@ notations) can be give from the standard input. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | revision.c: allow injecting revision parameters after setup_revisions().Junio C Hamano2006-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setup_revisions() wants to get all the parameters at once and then postprocesses the resulting revs structure after it is done with them. This code structure is a bit cumbersome to deal with efficiently when we want to inject revision parameters from the side (e.g. read from standard input). Fortunately, the nature of this postprocessing is not affected by revision parameters; they are affected only by flags. So it is Ok to do add_object() after the it returns. This splits out the code that deals with the revision parameter out of the main loop of setup_revisions(), so that we can later call it from elsewhere after it returns. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Fix memory leak in prepend_to_path (git.c).Christian Couder2006-09-05
| | | | | | | | | | | | | | | | | | | | | | | | Some memory was allocated for a new path but not freed after the path was used. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | send-pack: remove remote reference limitAndy Whitcroft2006-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When build a pack for a push we query the remote copy for existant heads. These are used to prune unnecessary objects from the pack. As we receive the remote references in get_remote_heads() we validate the reference names via check_ref() which includes a length check; rejecting those >45 characters in size. This is a miss converted change, it was originally designed to reject messages which were less than 45 characters in length (a 40 character sha1 and refs/) to prevent comparing unitialised memory. check_ref() now gets the raw length so check for at least 5 characters. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | autoconf: Fix copy'n'paste errorJakub Narebski2006-09-05
|/ / | | | | | | | | | | Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'jc/pack'Junio C Hamano2006-09-04
|\ \ | | | | | | | | | | | | | | | | | | * jc/pack: more lightweight revalidation while reusing deflated stream in packing pack-objects: fix thinko in revalidate code pack-objects: re-validate data we copy from elsewhere.
| * | more lightweight revalidation while reusing deflated stream in packingJunio C Hamano2006-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying from an existing pack and when copying from a loose object with new style header, the code makes sure that the piece we are going to copy out inflates well and inflate() consumes the data in full while doing so. The check to see if the xdelta really apply is quite expensive as you described, because you would need to have the image of the base object which can be represented as a delta against something else. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | pack-objects: fix thinko in revalidate codeJunio C Hamano2006-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | When revalidating an entry from an existing pack entry->size and entry->type are not necessarily the size of the final object when the entry is deltified, but for base objects they must match. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | pack-objects: re-validate data we copy from elsewhere.Junio C Hamano2006-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reusing data from an existing pack and from a new style loose objects, we used to just copy it staight into the resulting pack. Instead make sure they are not corrupt, but do so only when we are not streaming to stdout, in which case the receiving end will do the validation either by unpacking the stream or by constructing the .idx file. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | autoconf: Quote AC_CACHE_CHECK argumentsJakub Narebski2006-09-04
| | | | | | | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | autoconf: Check for subprocess.pyJakub Narebski2006-09-04
| | | | | | | | | | | | | | | | | | | | | | | | Add custom test for checking if Python comes with subprocess.py, or should we use our own subprocess.py by defining WITH_OWN_SUBPROCESS_PY. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | autoconf: Add -liconv to LIBS when NEEDS_LIBICONVJakub Narebski2006-09-04
| | | | | | | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | gitweb: Divide page path into directories -- path's "breadcrumbs"Jakub Narebski2006-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Divide page path into directories, so that each part of path links to the "tree" view of the $hash_base (or HEAD, if $hash_base is not set) version of the directory. If the entity is blob, final part (basename) links to $hash_base or HEAD revision of the "raw" blob ("blob_plain" view). If the entity is tree, link to the "tree" view. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | gitweb: Correct typo: '==' instead of 'eq' in git_difftree_bodyJakub Narebski2006-09-04
| | | | | | | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | gitweb: Add GIT favicon, assuming image/png typeJakub Narebski2006-09-04
| | | | | | | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Fix git-fsck-objects SIGSEGV/divide-by-zeroLinus Torvalds2006-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you try to fsck a repository that isn't entirely empty, but that has no inter-object references (ie all the objects are blobs, and don't refer to anything else), git-fsck-objects currently fails. This probably cannot happen in practice, but can be tested with something like git init-db touch dummy git add dummy git fsck-objects where the fsck will die by a divide-by-zero when it tries to look up the references from the one object it found (hash_obj() will do a modulus by refs_hash_size). On some other archiectures (ppc, sparc) the divide-by-zero will go unnoticed, and we'll instead SIGSEGV when we hit the "refs_hash[j]" access. So move the test that should protect against this from mark_reachable() into lookup_object_refs(), which incidentally in the process also fixes mark_reachable() itself (it used to not mark the one object that _was_ reachable, because it decided that it had no refs too early). Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | gitweb: Change the name of diff to parent link in "commit" view to "diffJakub Narebski2006-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the name of diff to parent (current commit to one of parents) link in "commit" view (git_commit subroutine) from "commitdiff" to "diff". Let's leave "commitdiff" for equivalent of git-show, or git-diff-tree with one revision, i.e. diff for a given commit to its parent (parents). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Update GIT_TRACE documentation.Christian Couder2006-09-03
| | | | | | | | | | | | | | | Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'master' into cc/traceJunio C Hamano2006-09-02
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Trace into a file or an open fd and refactor tracing code. Replace uses of strdup with xstrdup. consolidate two copies of new style object header parsing code. Documentation: Fix howto/revert-branch-rebase.html generation fmt-merge-msg: fix off-by-one bug git-rev-list(1): group options; reformat; document more options Constness tightening for move/link_temp_to_file() gitweb: Fix git_blame Include config.mak.autogen in the doc Makefile Use xmalloc instead of malloc git(7): move gitk(1) to the list of porcelain commands gitk: Fix some bugs in the new cherry-picking code gitk: Improve responsiveness while reading and layout out the graph gitk: Update preceding/following tag info when creating a tag gitk: Add a menu item for cherry-picking commits gitk: Fix a couple of buglets in the branch head menu items gitk: Add a context menu for heads gitk: Add a row context-menu item for creating a new branch gitk: Recompute ancestor/descendent heads/tags when rereading refs gitk: Minor cleanups
| * | Trace into a file or an open fd and refactor tracing code.Christian Couder2006-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If GIT_TRACE is set to an absolute path (starting with a '/' character), we interpret this as a file path and we trace into it. Also if GIT_TRACE is set to an integer value greater than 1 and lower than 10, we interpret this as an open fd value and we trace into it. Note that this behavior is not compatible with the previous one. We also trace whole messages using one write(2) call to make sure messages from processes do net get mixed up in the middle. This patch makes it possible to get trace information when running "make test". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Replace uses of strdup with xstrdup.Shawn Pearce2006-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like xmalloc and xrealloc xstrdup dies with a useful message if the native strdup() implementation returns NULL rather than a valid pointer. I just tried to use xstrdup in new code and found it to be missing. However I expected it to be present as xmalloc and xrealloc are already commonly used throughout the code. [jc: removed the part that deals with last_XXX, which I am finding more and more dubious these days.] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | consolidate two copies of new style object header parsing code.Junio C Hamano2006-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also while we are at it, remove redundant typename[] array from unpack_sha1_header. The only reason it is different from the type_names[] array in object.c module is that this code cares about the subset of object types that are valid in a loose object, so prepare a separate array of boolean that tells us which types are valid, and share the name translation with the others. Signed-off-by: Junio C Hamano <junkio@cox.net>