summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2007-12-17Plug a resource leak in threaded pack-objects code.Libravatar Johannes Sixt1-2/+2
A mutex and a condition variable is allocated for each thread and torn down when the thread terminates. However, for certain workloads it can happen that some threads are actually not started at all. In this case we would leak the mutex and condition variable. Now we allocate them only for those threads that are actually started. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16Documentation/git-submodule: refer to gitmodules(5)Libravatar Junio C Hamano1-1/+2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16threaded pack-objects: Use condition variables for thread communication.Libravatar Johannes Sixt1-50/+79
In the threaded pack-objects code the main thread and the worker threads must mutually signal that they have assigned a new pack of work or have completed their work, respectively. Previously, the code used mutexes that were locked in one thread and unlocked from a different thread, which is bogus (and happens to work on Linux). Here we rectify the implementation by using condition variables: There is one condition variable on which the main thread waits until a thread requests new work; and each worker thread has its own condition variable on which it waits until it is assigned new work or signaled to terminate. As a cleanup, the worker threads are spawned only after the initial work packages have been assigned. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16builtin-commit: make summary output consistent with statusLibravatar Junio C Hamano1-0/+3
This enables -B -M to the summary output after a commit is made so that it is in line with what is shown in git-status and commit log template. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16builtin-commit: fix summary output.Libravatar Junio C Hamano1-0/+1
Because print_summary() forgot to call diff_setup_done() after futzing with diff output options, it failed to activate recursive diff, which resulted in an incorrect summary. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16builtin-apply: stronger indent-with-on-tab fixingLibravatar J. Bruce Fields1-2/+1
Fix any sequence of 8 spaces in initial indent, not just the case where the 8 spaces are the first thing on the line. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16builtin-apply: minor cleanup of whitespace detectionLibravatar J. Bruce Fields1-4/+4
Use 0 instead of -1 for the case where not tabs or spaces are found; it will make some later math slightly simpler. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16Re-re-re-fix common tail optimizationLibravatar Junio C Hamano2-1/+70
We need to be extra careful recovering the removed common section, so that we do not break context nor the changed incomplete line (i.e. the last line that does not end with LF). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16whitespace: fix config.txt description of indent-with-non-tabLibravatar J. Bruce Fields1-1/+1
Fix garbled description. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16whitespace: more accurate initial-indent highlightingLibravatar J. Bruce Fields1-8/+16
Instead of highlighting the entire initial indent, highlight only the problematic spaces. In the case of an indent like ' \t \t' there may be multiple problematic ranges, so it's easiest to emit the highlighting as we go instead of trying rember disjoint ranges and do it all at the end. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16whitespace: fix initial-indent checkingLibravatar J. Bruce Fields2-6/+19
After this patch, "written" counts the number of bytes up to and including the most recently seen tab. This allows us to detect (and count) spaces by comparing to "i". This allows catching initial indents like '\t ' (a tab followed by 8 spaces), while previously indent-with-non-tab caught only indents that consisted entirely of spaces. This also allows fixing an indent-with-non-tab regression, so we can again detect indents like '\t \t'. Also update tests to catch these cases. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16whitespace: minor cleanupLibravatar J. Bruce Fields1-12/+9
The variable leading_space is initially used to represent the index of the last space seen before a non-space. Then later it represents the index of the first non-indent character. It will prove simpler to replace it by a variable representing a number of bytes. Eventually it will represent the number of bytes written so far (in the stream != NULL case). Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16whitespace: reorganize initial-indent checkLibravatar J. Bruce Fields1-8/+7
Reorganize to emphasize the most complicated part of the code (the tab case). Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16whitespace: fix off-by-one error in non-space-in-indent checkingLibravatar J. Bruce Fields2-3/+3
If there were no tabs, and the last space was at position 7, then positions 0..7 had spaces, so there were 8 spaces. Update test to check exactly this case. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16rename git-browse--help to git-help--browseLibravatar Jeff King5-5/+5
The convention for helper scripts has been git-$TOOL--$HELPER. Since this is a "browse" helper for the "help" tool, git-help--browse is a more sensible name. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16Fix a memory leakLibravatar 李鸿1-0/+3
Signed-off-by: Li Hong <leehong@pku.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16gitweb: Make config_to_multi return [] instead of [undef]Libravatar Petr Baudis2-1/+26
This is important for the list of clone urls, where if there are no per-repository clone URL configured, the default base URLs are never used for URL construction without this patch. Add tests for different ways of setting project URLs, just in case. Note that those tests in current form wouldn't detect breakage fixed by this patch, as it only checks for errors and not for expected output. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16gitweb: Teach "a=blob" action to be more lenient about blob/file mime typeLibravatar Jakub Narebski1-11/+11
Since 930cf7dd7cc6b87d173f182230763e1f1913d319 'blob' action knows the file type; if the file type is not "text/*" or one of common network image formats/mimetypes (gif, png, jpeg) then the action "blob" defaulted to "blob_plain". This caused the problem if mimetypes file was not well suited for web, for example returning "application/x-sh" for "*.sh" shell scripts, instead of "text/plain" (or other "text/*"). Now "blob" action defaults to "blob_plain" ('raw' view) only if file is of type which is neither "text/*" nor "image/{gif,png,jpeg}" AND it is binary file. Otherwise it assumes that it can be displayed either in <img> tag ("image/*" mimetype), or can be displayed line by line (otherwise). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16gitweb: disambiguate heads and tags withs the same nameLibravatar Jakub Narebski1-6/+8
Avoid wrong disambiguation that would link logs/trees of tags and heads which share the same name to the same page, leading to a disambiguation that would prefer the tag, thus making it impossible to access the corresponding head log and tree without hacking the url by hand. It does it by using full refname (with 'refs/heads/' or 'refs/tags/' prefix) instead of shortened one in the URLs in 'heads' and 'tags' tables. This makes URLs (and refs) provided by gitweb unambiguous. Signed-off-by: Guillaume Seguin <guillaume@segu.in> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16teach bash completion to treat commands with "--" as a helperLibravatar Jeff King1-2/+1
There is a convention that commands containing a double-dash are implementation details and not to be used by mortals. We should automatically remove them from the completion suggestions as such. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16trim_common_tail: brown paper bag fix.Libravatar Jeff King1-5/+4
The recovered context lines were not LF terminated due to off-by-one error, which also caused the outer loop to count the number of recovered lines to terminate after running only once. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Update draft release notes for 1.5.4Libravatar Junio C Hamano1-1/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Start preparing the API documents.Libravatar Junio C Hamano27-5/+675
Most of them are still stubs, but the procedure to build the HTML documentation, maintaining the index and installing the end product are there. I placed names of people who are likely to know the most about the topic in the stub files, so that volunteers will know whom to ask questions as needed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Retire git-runstatus for real.Libravatar Junio C Hamano4-108/+1
The command was removed from the builtin command list and there was no way to invoke it, but the code was still there. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Rename git-browse-help helper to git-browse--helpLibravatar Junio C Hamano5-9/+8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14git-help: add "help.format" config variable.Libravatar Christian Couder4-12/+100
This config variable makes it possible to choose the default format used to display help. This format will be used only if no option like -a|--all|-i|--info|-m|--man|-w|--web is passed to "git-help". The following values are possible for this variable: - "man" --> "man" program is used - "info" --> "info" program is used - "web" --> "git-browse-help" is used By default we still show help using "man". This patch also adds -m|--man command line option to use "man" to allow overriding the "help.format" configuration variable. Note that this patch also revert some recent changes in "git-browse-help" because they prevented to look for config variables in the global configuration file. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Merge branch 'wc/diff'Libravatar Junio C Hamano12-192/+396
* wc/diff: Test interaction between diff --check and --exit-code Use shorter error messages for whitespace problems Add tests for "git diff --check" with core.whitespace options Make "diff --check" output match "git apply" Unify whitespace checking diff --check: minor fixups "diff --check" should affect exit status
2007-12-14Move fetch_ref from http-push.c and http-walker.c to http.cLibravatar Mike Hommey4-163/+89
Make the necessary changes to be ok with their difference, and rename the function http_fetch_ref. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Fix various memory leaks in http-push.c and http-walker.cLibravatar Mike Hommey2-28/+45
Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Use strbuf in http codeLibravatar Mike Hommey5-201/+108
Also, replace whitespaces with tabs in some places Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Avoid redundant declaration of missing_target()Libravatar Mike Hommey3-26/+13
Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Remove a CURLOPT_HTTPHEADER (un)settingLibravatar Mike Hommey1-1/+0
Setting CURLOPT_HTTPHEADER doesn't add HTTP headers, but replaces whatever set of headers was configured before, so setting to NULL doesn't have any magic meaning, and is pretty much useless when setting to another list right after. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Remove the default_headers variable from http-push.cLibravatar Mike Hommey1-7/+0
It appears that despite being initialized, it was never used. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Fix random sha1 in error message in http-fetch and http-pushLibravatar Mike Hommey2-4/+6
When a downloaded ref doesn't contain a sha1, the error message displays a random sha1 because of uninitialized memory. This happens when cloning a repository that is already a clone of another one, in which case refs/remotes/origin/HEAD is a symref. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Fix some more memory leaks in http-push.cLibravatar Mike Hommey1-2/+11
Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Test interaction between diff --check and --exit-codeLibravatar Wincent Colaiuta1-0/+29
Make sure that it works as advertised in the man page. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Use shorter error messages for whitespace problemsLibravatar Wincent Colaiuta2-4/+4
The initial version of the whitespace_error_string() function took the messages from builtin-apply.c rather than the shorter messages from diff.c. This commit addresses Junio's concern that these messages might be too long (now that we can emit multiple warnings per line). Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Use a strbuf for building up section header and key/value pair strings.Libravatar Kristian Høgsberg1-53/+38
Avoids horrible 1-byte write(2) calls and cleans up the logic a bit. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14fast-import: fix unalinged allocation and accessLibravatar David S. Miller1-5/+5
The specialized pool allocator fast-import uses aligned objects on the size of a pointer, which was not sufficient at least on Sparc. Instead, make the alignment for objects of type unitmax_t. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14remote: Fix bogus make_branch() call in configuration reader.Libravatar Junio C Hamano1-1/+1
The configuration reader to enumerate branches that have configuration data were not careful enough and failed to skip "branch.<variable>" entries (e.g. branch.autosetupmerge). This resulted in bogus attempt to allocate huge memory. Noticed by David Miller. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14commit: allow --amend to reuse message from another commitLibravatar Junio C Hamano2-1/+18
After tentatively applying a patch from a contributor, you can get a replacement patch with corrected code and unusable commit log message. In such a case, this sequence ought to give you an editor based on the message in the earlier commit, to let you describe an incremental improvement: git reset --hard HEAD^ ;# discard the earlier one git am <corrected-patch git commit --amend -c HEAD@{1} Unfortunately, --amend insisted reusing the message from the commit being amended, ignoring the -c option. This corrects it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14git-svn: handle our top-level path being deleted and later re-addedLibravatar Eric Wong2-0/+53
Previously, git-svn would ignore cases where the path we're tracking is removed from the repository. This was to prevent heads with follow-parent from ending up with a tree full of empty revisions (and thus breaking rename detection). The previous behavior is fine until the path we're tracking is re-added later on, leading to the old files being merged in with the new files in the directory (because the old files were never marked as deleted) We will now only remove all the old files locally that were deleted remotely iff we detect the directory we're in is being created from scratch. Thanks for Marcus D. Hanwell for the bug report and Peter Baumann for the analysis. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14cvsexportcommit: fix massive commitsLibravatar Jeff King1-14/+23
Because we feed the changed filenames to CVS on the command line, it was possible for massive commits to overflow the system exec limits. Instead, we now do an xargs-like split of the arguments. This means that we lose some of the atomicity of calling CVS in one shot. Since CVS commits are not atomic, but the CVS protocol is, the possible effects of this are not clear; however, since CVS doesn't provide a different interface, this is our only option for large commits (short of writing a CVS client library). The argument size limit is arbitrarily set to 64kB. This should be high enough to trigger only in rare cases where it is necessary, so normal-sized commits are not affected by the atomicity change. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14Documentation: describe pack idx v2Libravatar linux@horizon.com1-33/+61
Lifted from the log message of c553ca25bd60dc9fd50b8bc7bd329601b81cee66 (pack-objects: learn about pack index version 2). Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14xdiff tail trimming: use correct type.Libravatar Junio C Hamano1-3/+2
Inside xdiff library, the number of context lines is represented in long, not int. Noticed by Peter Baumann. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-13Add tests for "git diff --check" with core.whitespace optionsLibravatar Wincent Colaiuta1-20/+70
Make sure that "git diff --check" does the right thing when the core.whitespace options are set. While we are at it, correct many uses of test_expect_failure that ran sequence of commands. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-13Make "diff --check" output match "git apply"Libravatar Wincent Colaiuta2-4/+3
For consistency, make the two tools report whitespace errors in the same way (the output of "diff --check" has been tweaked to match that of "git apply"). Note that although the textual content is basically the same only "git diff --check" provides a colorized version of the problematic lines; making "git apply" do colorization will require more extensive changes (figuring out the diff colorization preferences of the user) and so that will be a subject for another commit. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-13Unify whitespace checkingLibravatar Wincent Colaiuta5-164/+139
This commit unifies three separate places where whitespace checking was performed: - the whitespace checking previously done in builtin-apply.c is extracted into a function in ws.c - the equivalent logic in "git diff" is removed - the emit_line_with_ws() function is also removed because that also rechecks the whitespace, and its functionality is rolled into ws.c The new function is called check_and_emit_line() and it does two things: checks a line for whitespace errors and optionally emits it. The checking is based on lines of content rather than patch lines (in other words, the caller must strip the leading "+" or "-"); this was suggested by Junio on the mailing list to allow for a future extension to "git show" to display whitespace errors in blobs. At the same time we teach it to report all classes of whitespace errors found for a given line rather than reporting only the first found error. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-13diff --check: minor fixupsLibravatar Junio C Hamano7-28/+26
There is no reason --exit-code and --check-diff must be mutually exclusive, so assign different bits to different results and allow them to be returned from the command. Introduce diff_result_code() to factor out the common code to decide final status code based on diffopt settings and use it everywhere. Update tests to match the above fix. Turning pager off when "diff --check" is used is a regression. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-13"diff --check" should affect exit statusLibravatar Wincent Colaiuta8-18/+171
"git diff" has a --check option that can be used to check for whitespace problems but it only reported by printing warnings to the console. Now when the --check option is used we give a non-zero exit status, making "git diff --check" nicer to use in scripts and hooks. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>