aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Update grep internal for grepping only in head/bodyJunio C Hamano2006-09-20
| | | | | | | | This further updates the built-in grep engine so that we can say something like "this pattern should match only in head". This can be used to simplify grepping in the log messages. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-log --author and --committer are not left-anchored by defaultLinus Torvalds2006-09-20
| | | | | | | | | | | | I know that I'd prefer a rule where "--author=^Junio" would result in the grep-pattern being "^author Junio", but without the initial '^' it would be "^author .*Junio". Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* rev-list: fix segfault with --{author,committer,grep}Jeff King2006-09-20
| | | | | | | We need to save the commit buffer if we're going to match against it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* revision traversal: --author, --committer, and --grep.Junio C Hamano2006-09-20
| | | | | | | | This adds three options to setup_revisions(), which lets you filter resulting commits by the author name, the committer name and the log message with regexp. Signed-off-by: Junio C Hamano <junkio@cox.net>
* revision traversal: prepare for commit log match.Junio C Hamano2006-09-20
| | | | | | | | | This is from a suggestion by Linus, just to mark the locations where we need to modify to actually implement the filtering. We do not have any actual filtering code yet. Signed-off-by: Junio C Hamano <junkio@cox.net>
* builtin-grep: make pieces of it available as library.Junio C Hamano2006-09-20
| | | | | | | | | | | | | | | | | | | | | | | This makes three functions and associated option structures from builtin-grep available from other parts of the system. * options to drive built-in grep engine is stored in struct grep_opt; * pattern strings and extended grep expressions are added to struct grep_opt with append_grep_pattern(); * when finished calling append_grep_pattern(), call compile_grep_patterns() to prepare for execution; * call grep_buffer() to find matches in the in-core buffer. This also adds an internal option "status_only" to grep_opt, which suppresses any output from grep_buffer(). Callers of the function as library can use it to check if there is a match without producing any output. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix thinko in git_tags and git_headsJakub Narebski2006-09-20
| | | | | | | | | | | git_get_refs_list always return reference to list (and reference to hash which we ignore), so $taglist (in git_tags) and $headlist (in git_heads) are always defined, but @$taglist / @$headlist might be empty. Replaced incorrect "if (defined @$taglist)" with "if (@$taglist)" in git_tags and respectively in git_heads. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Make git_get_refs_list do work of git_get_referencesJakub Narebski2006-09-20
| | | | | | | | | | | | | | Make git_get_refs_list do also work of git_get_references, to avoid calling git-peek-remote twice. Change meaning of git_get_refs_list meaning: it is now type, and not a full path, e.g. we now use git_get_refs_list("heads") instead of former git_get_refs_list("refs/heads"). Modify git_summary to use only one call to git_get_refs_list instead of one call to git_get_references and two to git_get_refs_list. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Always use git-peek-remote in git_get_referencesJakub Narebski2006-09-20
| | | | | | | | | | | | | Instead of trying to read info/refs file, which might not be present (we did fallback to git-ls-remote), always use git-peek-remote in git_get_references. It is preparation for git_get_refs_info to also return references info. We should not use info/refs for git_get_refs_info as the repository is not served for http-fetch clients. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Require project for almost all actionsJakub Narebski2006-09-20
| | | | | | | | Require that project (repository) is given for all actions except project_list, project_index and opml. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Even more support for PATH_INFO based URLsJakub Narebski2006-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the following types of path based URLs are supported: * project overview (summary) page of project * project/branch shortlog of branch * project/branch:file file in branch, blob_plain view * project/branch:dir/ directory listing of dir in branch, tree view The following shortcuts works (see explanation below): * project/branch: directory listing of branch, main tree view * project/:file file in HEAD (raw) * project/:dir/ directory listing of dir in HEAD * project/: directory listing of project's HEAD We use ':' as separator between branch (ref) name and file name (pathname) because valid branch (ref) name cannot have ':' inside. This limit applies to branch name only. This allow for hierarchical branches e.g. topic branch 'topic/subtopic', separate remotes tracking branches e.g. 'refs/remotes/origin/HEAD', and discriminate between head (branch) and tag with the same name. Empty branch should be interpreted as HEAD. If pathname (the part after ':') ends with '/', we assume that pathname is name of directory, and we want to show contents of said directory using "tree" view. If pathname is empty, it is equivalent to '/' (top directory). If pathname (the part after ':') does not end with '/', we assume that pathname is name of file, and we show contents of said file using "blob_plain" view. Pathname is stripped of leading '/', so we can use ':/' to separate branch from pathname. The rationale behind support for PATH_INFO based URLs was to support project web pages for small projects: just create an html branch and then use an URL like http://nowhere.com/gitweb.cgi/project.git/html:/index.html The ':/' syntax allow for working links between .html files served in such way, e.g. <a href="main.html"> link inside "index.html" would get http://nowhere.com/gitweb.cgi/project.git/html:/main.html. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitk(1): mention --allJonas Fonseca2006-09-20
| | | | | Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix trivial typos and inconsistencies in hooks documentationJonas Fonseca2006-09-20
| | | | | | | Pointed out by Alan Chandler. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix mimetype_guess_file for files with multiple extensionsJakub Narebski2006-09-20
| | | | | | | | | | | Fix getting correct mimetype for "blob_plain" view for files which have multiple extensions, e.g. foo.1.html; now only the last extension is used to find mimetype. Noticed by Martin Waitz. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Patch for http-fetch.c and older curl releasesArt Haas2006-09-20
| | | | | | | | | | | | | | | | Older curl releases do not define CURLE_HTTP_RETURNED_ERROR, they use CURLE_HTTP_NOT_FOUND instead. Newer curl releases keep the CURLE_HTTP_NOT_FOUND definition but using a -DCURL_NO_OLDIES preprocessor flag the old name will not be present in the 'curl.h' header. This patch makes our code written for newer releases of the curl library but allow compiling against an older curl (older than 0x070a03) by defining the missing CURLE_HTTP_RETURNED_ERROR as a synonym for CURLE_HTTP_NOT_FOUND. Signed-off-by: Art Haas <ahaas@airmail.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'sk/ftp'Junio C Hamano2006-09-17
|\ | | | | | | | | | | * sk/ftp: Add ftp:// protocol support for git-http-fetch http-fetch.c: consolidate code to detect missing fetch target
| * Add ftp:// protocol support for git-http-fetchJunio C Hamano2006-09-16
| | | | | | | | | | | | | | | | | | | | Based on Sasha Khapyorsky's patch but adjusted to the refactored "missing target" detection code. It might have been better if the program were called git-url-fetch but it is too late now ;-). Signed-off-by: Junio C Hamano <junkio@cox.net>
| * http-fetch.c: consolidate code to detect missing fetch targetJunio C Hamano2006-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | At a handful places we check two error codes from curl library to see if the file we asked was missing from the remote (e.g. we asked for a loose object when it is in a pack) to decide what to do next. This consolidates the check into a single function. NOTE: the original did not check for HTTP_RETURNED_ERROR when error code is 404, but this version does to make sure 404 is from HTTP and not some other protcol. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge part of branch 'jc/upload-pack'Junio C Hamano2006-09-17
|\ \
| * | upload-pack: minor clean-up in multi-ack logicJunio C Hamano2006-08-12
| | | | | | | | | | | | | | | | | | | | | No changes to what it does, but separating the codepath clearly with if ... else if ... chain makes it easier to follow. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'jc/pack'Junio C Hamano2006-09-17
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/pack: pack-objects: document --revs, --unpacked and --all. pack-objects --unpacked=<existing pack> option. pack-objects: further work on internal rev-list logic. pack-objects: run rev-list equivalent internally. Separate object listing routines out of rev-list
| * | | pack-objects: document --revs, --unpacked and --all.Junio C Hamano2006-09-12
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | pack-objects --unpacked=<existing pack> option.Junio C Hamano2006-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incremental repack without -a essentially boils down to: rev-list --objects --unpacked --all | pack-objects $new_pack which picks up all loose objects that are still live and creates a new pack. This implements --unpacked=<existing pack> option to tell the revision walking machinery to pretend as if objects in such a pack are unpacked for the purpose of object listing. With this, we could say: rev-list --objects --unpacked=$active_pack --all | pack-objects $new_pack instead, to mean "all live loose objects but pretend as if objects that are in this pack are also unpacked". The newly created pack would be perfect for updating $active_pack by replacing it. Since pack-objects now knows how to do the rev-list's work itself internally, you can also write the above example by: pack-objects --unpacked=$active_pack --all $new_pack </dev/null Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | pack-objects: further work on internal rev-list logic.Junio C Hamano2006-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This teaches the internal rev-list logic to understand options that are needed for pack handling: --all, --unpacked, and --thin. It also moves two functions from builtin-rev-list to list-objects so that the two programs can share more code. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | pack-objects: run rev-list equivalent internally.Junio C Hamano2006-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of piping the rev-list output from its standard input, you can say: pack-objects --all --unpacked --revs pack and feed the rev parameters you would otherwise give the rev-list on its command line from the standard input. In other words: echo 'master..next' | pack-objects --revs pack and rev-list --objects master..next | pack-objects pack are equivalent. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Separate object listing routines out of rev-listJunio C Hamano2006-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a separate file, list-objects.c, and move object listing routines from rev-list to it. The next round will use it in pack-objects directly. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'jc/am'Junio C Hamano2006-09-17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * jc/am: Fix git-am safety checks
| * | | | Fix git-am safety checksJunio C Hamano2006-09-16
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An earlier commit cbd64af added a check that prevents "git-am" to run without its standard input connected to a terminal while resuming operation. This was to catch a user error to try feeding a new patch from its standard input while recovery. The assumption of the check was that it is an indication that a new patch is being fed if the standard input is not connected to a terminal. It is however not quite correct (the standard input can be /dev/null if the user knows the operation does not need any input, for example). This broke t3403 when the test was run with its standard input connected to /dev/null. When git-am is given an explicit command such as --skip, there is no reason to insist that the standard input is a terminal; we are not going to read a new patch anyway. Credit goes to Gerrit Pape for noticing and reporting the problem with t3403-rebase-skip test. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'jk/diff'Junio C Hamano2006-09-17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/diff: wt-status: remove extraneous newline from 'deleted:' output git-status: document colorization config options Teach runstatus about --untracked git-commit.sh: convert run_status to a C builtin Move color option parsing out of diff.c and into color.[ch] diff: support custom callbacks for output
| * | | | wt-status: remove extraneous newline from 'deleted:' outputJeff King2006-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was accidentally introduced during the fixes to avoid putting newlines inside of colorized output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | git-status: document colorization config optionsJeff King2006-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Teach runstatus about --untrackedJohannes Schindelin2006-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually, teach runstatus what to do if it is not passed; it should not list the contents of completely untracked directories, but only the name of that directory (plus a trailing '/'). [jc: with comments by Jeff King to match hide-empty-directories behaviour of the original.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | git-commit.sh: convert run_status to a C builtinJeff King2006-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This creates a new git-runstatus which should do roughly the same thing as the run_status function from git-commit.sh. Except for color support, the main focus has been to keep the output identical, so that it can be verified as correct and then used as a C platform for other improvements to the status printing code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Move color option parsing out of diff.c and into color.[ch]Jeff King2006-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intent is to lib-ify colorizing code so it can be reused. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | diff: support custom callbacks for outputJeff King2006-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users can request the DIFF_FORMAT_CALLBACK output format to get a callback consisting of the whole diff_queue_struct. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | gitweb fix validating pg (page) parameterMatthias Lederhofer2006-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it is possible to give any string ending with a number as page. -1 for example is quite bad (error log shows probably 100 warnings). Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | git-repack(1): document --window and --depthJonas Fonseca2006-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy and pasted from git-pack-objects(1). Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | git-apply(1): document --unidiff-zeroJonas Fonseca2006-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | gitweb: fix warnings in PATH_INFO code and add export_ok/strict_exportMatthias Lederhofer2006-09-17
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | upload-archive: monitor child communication even more carefully.Franck Bui-Huu2006-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code works like this: if others flags than POLLIN is raised we assume that (a) something bad happened and the child died or (b) the child has closed the pipe because it had no more data to send. For the latter case, we assume wrongly that one call to process_input() will empty the pipe. Indeed it reads only 16Ko of data by call and the the pipe capacity can be larger than that (on current Linux kernel, it is 65536 bytes). Therefore the child can write 32ko of data, for example, and close the pipe. After that poll will return POLLIN _and_ POLLHUP and the parent will read only 16ko of data. This patch forces the parent to empty the pipe as soon as POLLIN is raised and even if POLLHUP or something else is raised too. Moreover, some implementations of poll might return POLLRDNORM flag even if it is non standard. Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | Merge branch 'jc/archive'Junio C Hamano2006-09-17
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/archive: git-tar-tree: devolve git-tar-tree into a wrapper for git-archive git-archive: inline default_parse_extra() builtin-archive.c: rename remote_request() to extract_remote_arg() upload-archive: monitor child communication more carefully. Add sideband status report to git-archive protocol Prepare larger packet buffer for upload-pack protocol. Teach --exec to git-archive --remote Add --verbose to git-archive archive: force line buffered output to stderr Use xstrdup instead of strdup in builtin-{tar,zip}-tree.c Move sideband server side support into reusable form. Move sideband client side support into reusable form. archive: allow remote to have more formats than we understand. git-archive: make compression level of ZIP archives configurable Add git-upload-archive git-archive: wire up ZIP format. git-archive: wire up TAR format. Add git-archive
| * | | | | git-tar-tree: devolve git-tar-tree into a wrapper for git-archiveRene Scharfe2006-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the custom tree walker tree_traverse(), and makes generate_tar() use write_tar_archive() and the infrastructure provided by git-archive instead. As a kind of side effect, make write_tar_archive() able to handle NULL as base directory, as this is what the new and simple generate_tar() uses to indicate the absence of a base directory. This was simpler and cleaner than playing tricks with empty strings. The behaviour of git-tar-tree should be unchanged (quick tests didn't indicate otherwise) except for the text of some error messages. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | git-archive: inline default_parse_extra()Rene Scharfe2006-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | 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>