aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Add git-for-each-ref: helper for language bindingsJunio C Hamano2006-09-16
| | | | | | | | This adds a new command, git-for-each-ref. You can have it iterate over refs and have it output various aspects of the objects they refer to. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Allow multiple "git_path()" usesLinus Torvalds2006-09-16
| | | | | | | | | | | | | This allows you to maintain a few filesystem pathnames concurrently, by simply replacing the single static "pathname" buffer with a LRU of four buffers. We did exactly the same thing with sha1_to_hex(), for pretty much exactly the same reason. Sometimes you want to use two pathnames, and while it's easy enough to xstrdup() them, why not just do the LU buffer thing. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add link to "project_index" view to "project_list" pageJakub Narebski2006-09-16
| | | | | | | | | | | Add link to "project_index" view as [TXT] beside link to "opml" view, (which is marked by [OPML]) to "project_list" page. While at it add alternate links for "opml" and "project_list" to HTML header for "project_list" view. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Allow for href() to be used for links without project paramJakub Narebski2006-09-16
| | | | | | | | | | | | | | | | | | | | | | | | Make it possible to use href() subroutine to generate link with query string which does not include project ('p') parameter. href() used to add project=$project to its parameters, if it was not set (to be more exact if $params{'project'} was false). Now you can pass "project => undef" if you don't want for href() to add project parameter to query string in the generated link. Links to "project_list", "project_index" and "opml" (all related to list of all projects/all git repositories) doesn't need project parameter. Moreover "project_list" is default view (action) if project ('p') parameter is not set, just like "summary" is default view (action) if project is set; project list served as a kind of "home" page for gitweb instalation, and links to "project_list" view were done without specyfying it as an action. Convert remaining links (except $home_link and anchor links) to use href(); this required adding 'order => "o"' to @mapping in href(). This finishes consolidation of URL generation. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Define fallback PATH_MAX on systems that do not define one in <limits.h>Junio C Hamano2006-09-15
| | | | | | Notably on GNU/Hurd, as reported by Gerrit Pape. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Document git-grep -[Hh]Junio C Hamano2006-09-15
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix duplicate xmalloc in builtin-addLiu Yubao2006-09-15
| | | | | | [jc: patch came without sign-off but it was too obvious and trivial.] Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add git_project_index for generating index.auxJakub Narebski2006-09-14
| | | | | | | | | | | | | | Add git_project_index, which generates index.aux file that can be used as a source of projects list, instead of generating projects list from a directory. Using file as a source of projects list allows for some projects to be not present in gitweb main (project_list) page, and/or correct project owner info. And is probably faster. Additionally it can be used to get the list of all available repositories for scripts (in easily parseable form). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Do not parse refs by hand, use git-peek-remote insteadJakub Narebski2006-09-14
| | | | | | | | | | | | | | | | | | | This is in response to Linus's work on packed refs. Additionally it makes gitweb work with symrefs, too. Do not parse refs by hand, using File::Find and reading individual heads to get hash of reference, but use git-peek-remote output instead. Assume that the hash for deref (with ^{}) always follows hash for ref, and that we have derefs only for tag objects; this removes call to git_get_type (and git-cat-file -t invocation) for tags, which speeds "summary" and "tags" views generation, but might slow generation of "heads" view a bit. For now, we do not save and use the deref hash. Remove git_get_hash_by_ref while at it, as git_get_refs_list was the only place it was used. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use File::Find::find in git_get_projects_listJakub Narebski2006-09-14
| | | | | | | | | | | Earlier code to get list of projects when $projects_list is a directory (e.g. when it is equal to $projectroot) had a hardcoded flat (one level) list of directories. Allow for projects to be in subdirectories also for $projects_list being a directory by using File::Find. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Handle invalid argc gentlyDmitry V. Levin2006-09-14
| | | | | | | | describe, git: Handle argc==0 case the same way as argc==1. merge-tree: Refuse excessive arguments. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add "-h/-H" parsing to "git grep"Linus Torvalds2006-09-14
| | | | | | | | | | | | | It turns out that I actually wanted to avoid the filenames (because I didn't care - I just wanted to see the context in which something was used) when doing a grep. But since "git grep" didn't take the "-h" parameter, I ended up having to do "grep -5 -h *.c" instead. So here's a trivial patch that adds "-h" (and thus has to enable -H too) to "git grep" parsing. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Trivial support for cloning and fetching via ftp://.Sasha Khapyorsky2006-09-13
| | | | | | | 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>
* Documentation: Fix broken linksDmitry V. Levin2006-09-13
| | | | | | | | core-tutorial.txt, cvs-migration.txt, tutorial-2.txt: Fix broken links. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make count-objects, describe and merge-tree work in subdirectoryDmitry V. Levin2006-09-13
| | | | | | | Call setup_git_directory() to make these commands work in subdirectory. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
*-. Merge branches 'maint' and 'jc/http'Junio C Hamano2006-09-13
|\ \ | | | | | | | | | | | | | | | | | | | | | * maint: http-fetch: fix alternates handling. * jc/http: http-fetch: fix alternates handling.
| | * http-fetch: fix alternates handling.Junio C Hamano2006-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fetch over http from a repository that uses alternates to borrow from neighbouring repositories were quite broken, apparently for some time now. We parse input and count bytes to allocate the new buffer, and when we copy into that buffer we know exactly how many bytes we want to copy from where. Using strlcpy for it was simply stupid, and the code forgot to take it into account that strlcpy terminated the string with NUL. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | http-fetch: fix alternates handling.v1.4.2.1Junio C Hamano2006-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fetch over http from a repository that uses alternates to borrow from neighbouring repositories were quite broken, apparently for some time now. We parse input and count bytes to allocate the new buffer, and when we copy into that buffer we know exactly how many bytes we want to copy from where. Using strlcpy for it was simply stupid, and the code forgot to take it into account that strlcpy terminated the string with NUL. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'jc/unpack'Junio C Hamano2006-09-13
|\ \ \ | | | | | | | | | | | | | | | | | | | | * jc/unpack: unpack-objects -r: call it "recover". unpack-objects desperately salvages objects from a corrupt pack
| * | | unpack-objects -r: call it "recover".Junio C Hamano2006-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code called this operation "desperate" but the option flag is -r and the word "recover" describes what it does better. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | unpack-objects desperately salvages objects from a corrupt packJunio C Hamano2006-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command unpack-objects dies upon the first error. This is probably considered a feature -- if a pack is corrupt, instead of trying to extract from it and possibly risking to contaminate a good repository with objects whose validity is dubious, we should seek a good copy of the pack and retry. However, we may not have any good copy anywhere. This implements the last resort effort to extract what are salvageable from such a corrupt pack. This flag might have helped Sergio when recovering from a corrupt pack. In my test, it managed to salvage 247 objects out of a pack that had 251 objects but without it the command stopped after extracting 73 objects. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'jc/binary'Junio C Hamano2006-09-13
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * jc/binary: diff --binary generates full index on binary files. Make apply --binary a no-op.
| * | | | diff --binary generates full index on binary files.Junio C Hamano2006-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... without --full-index. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Make apply --binary a no-op.Junio C Hamano2006-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so. This makes the flag a no-op by always allowing binary patch application. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | Merge branch 'aw/send-pack'Junio C Hamano2006-09-13
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * aw/send-pack: send-pack: switch to using git-rev-list --stdin
| * | | | | send-pack: switch to using git-rev-list --stdinAndy Whitcroft2006-09-07
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are generating packs to update remote repositories we want to supply as much information as possible about the revisions that already exist to rev-list in order optimise the pack as much as possible. We need to pass two revisions for each branch we are updating in the remote repository and one for each additional branch. Where the remote repository has numerous branches we can run out of command line space to pass them. Utilise the git-rev-list --stdin mode to allow unlimited numbers of revision constraints. This allows us to move back to the much simpler unordered revision selection code. [jc: added some comments in the code to describe the pipe flow a bit.] Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | Test return value of finish_connect()Franck Bui-Huu2006-09-13
| |_|_|/ |/| | | | | | | | | | | | | | | Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | contrib/vim: add syntax highlighting file for commitsJeff King2006-09-13
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Fix space in string " false" problem in "trace.c".Christian Couder2006-09-12
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | connect.c: finish_connect(): allow null pid parameterFranck Bui-Huu2006-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_connect() can return 0 if we use git protocol for example. Users of this function don't know and don't care if a process had been created or not, and to avoid them to check it before calling finish_connect() this patch allows finish_connect() to take a null pid. And in that case return 0. [jc: updated function signature of git_connect() with a comment on its return value. ] Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Fix a memory leak in "connect.c" and die if command too long.Christian Couder2006-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use "add_to_string" instead of "sq_quote" and "snprintf", so that there is no memory allocation and no memory leak. Also check if the command is too long to fit into the buffer and die if this is the case, instead of truncating it to the buffer size. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Move add_to_string to "quote.c" and make it extern.Christian Couder2006-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So that this function may be used in places other than "rsh.c". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | gitweb: Paginate history outputJakub Narebski2006-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_history output is now divided into pages, like git_shortlog, git_tags and git_heads output. As whole git-rev-list output is now read into array before writing anything, it allows for better signaling of errors. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | gitweb: Make pickaxe search a featureJakub Narebski2006-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As pickaxe search (selected using undocumented 'pickaxe:' operator in search query) is resource consuming, allow to turn it on/off using feature meachanism. Turned on by default, for historical reasons. Signed-off-by: Jakub Narebski <jnareb@gmail.com> 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>
* | | | 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>