aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Fix segfault in diff-delta.c when FLEX_ARRAY is 1Pierre Habouzit2007-12-17
| | | | | | | | aka don't do pointer arithmetics on structs that have a FLEX_ARRAY member, or you'll end up believing your array is 1 cell off its real address. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2007-12-17
|\ | | | | | | | | | | * maint: git-send-email: avoid duplicate message-ids clone: correctly report http_fetch errors
| * git-send-email: avoid duplicate message-idsJeff King2007-12-17
| | | | | | | | | | | | | | | | | | We used to unconditionally add a message-id to the outgoing email without bothering to check if it already had one. Instead, let's use the existing one. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * clone: correctly report http_fetch errorsJeff King2007-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The exit status from curl was accidentally lost by the 'case' statement. We need to explicitly save it so that $? doesn't get overwritten. This improves the error message when fetching from an http repository which has never had update-server-info run. Previously, it would fail to note the fetch error and produce multiple errors about the lack of origin branches. It now correctly suggests running git-update-server-info. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase -p -i: handle "no changes" gracefullyJohannes Schindelin2007-12-17
| | | | | | | | | | | | | | | | | | | | Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092 (rebase -i: style fixes and minor cleanups), unchanged SHA-1s are no longer mapped via $REWRITTEN. But the updating phase was not prepared for the old head not being rewritten. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Document diff.external and mergetool.<tool>.pathJohannes Schindelin2007-12-17
| | | | | | | | | | | | | | | | | | | | There was no documentation for the config variables diff.external and mergetool.<tool>.path. Noticed by Sebastian Schuberth. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Support config variable diff.externalJohannes Schindelin2007-12-17
| | | | | | | | | | | | | | | | We had the diff.external variable in the documentation of the config file since its conception, but failed to respect it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Clean up documentation that references deprecated 'git peek-remote'.Johannes Sixt2007-12-17
| | | | | | | | | | | | | | | | | | | | | | Now that 'git peek-remote' is deprecated and only an alias for 'git ls-remote', it should not be referenced from other manual pages. This also removes the description of the --exec option, which is no longer present. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Clarify error response from 'git fetch' for bad responsesSam Vilain2007-12-17
| | | | | | | | | | | | | | | | This error message prints the reponse from the server at this point. Label it as such in the output. Signed-off-by: Sam Vilain <sam@vilain.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | the use of 'tr' in the test suite isn't really portableH.Merijn Brand2007-12-17
| | | | | | | | | | | | | | | | | | | | Some versions of 'tr' only accept octal codes if entered with three digits, and therefor misinterpret the '\0' in the test suite. Some versions of 'tr' reject the (needless) use of character classes. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Plug a resource leak in threaded pack-objects code.Johannes Sixt2007-12-17
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Documentation/git-submodule: refer to gitmodules(5)Junio C Hamano2007-12-16
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | threaded pack-objects: Use condition variables for thread communication.Johannes Sixt2007-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | builtin-commit: make summary output consistent with statusJunio C Hamano2007-12-16
| | | | | | | | | | | | | | 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>
* | builtin-commit: fix summary output.Junio C Hamano2007-12-16
| | | | | | | | | | | | | | | | 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>
* | builtin-apply: stronger indent-with-on-tab fixingJ. Bruce Fields2007-12-16
| | | | | | | | | | | | | | | | 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>
* | builtin-apply: minor cleanup of whitespace detectionJ. Bruce Fields2007-12-16
| | | | | | | | | | | | | | | | 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>
* | Re-re-re-fix common tail optimizationJunio C Hamano2007-12-16
| | | | | | | | | | | | | | | | 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>
* | whitespace: fix config.txt description of indent-with-non-tabJ. Bruce Fields2007-12-16
| | | | | | | | | | | | | | Fix garbled description. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | whitespace: more accurate initial-indent highlightingJ. Bruce Fields2007-12-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>
* | whitespace: fix initial-indent checkingJ. Bruce Fields2007-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | whitespace: minor cleanupJ. Bruce Fields2007-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | whitespace: reorganize initial-indent checkJ. Bruce Fields2007-12-16
| | | | | | | | | | | | | | | | 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>
* | whitespace: fix off-by-one error in non-space-in-indent checkingJ. Bruce Fields2007-12-16
| | | | | | | | | | | | | | | | | | | | 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>
* | rename git-browse--help to git-help--browseJeff King2007-12-16
| | | | | | | | | | | | | | | | | | 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>
* | Fix a memory leak李鸿2007-12-16
| | | | | | | | | | Signed-off-by: Li Hong <leehong@pku.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: Make config_to_multi return [] instead of [undef]Petr Baudis2007-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | gitweb: Teach "a=blob" action to be more lenient about blob/file mime typeJakub Narebski2007-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | gitweb: disambiguate heads and tags withs the same nameJakub Narebski2007-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | teach bash completion to treat commands with "--" as a helperJeff King2007-12-16
| | | | | | | | | | | | | | | | | | | | 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>
* | trim_common_tail: brown paper bag fix.Jeff King2007-12-16
| | | | | | | | | | | | | | | | 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>
* | Update draft release notes for 1.5.4Junio C Hamano2007-12-14
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Start preparing the API documents.Junio C Hamano2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Retire git-runstatus for real.Junio C Hamano2007-12-14
| | | | | | | | | | | | | | 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>
* | Rename git-browse-help helper to git-browse--helpJunio C Hamano2007-12-14
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-help: add "help.format" config variable.Christian Couder2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'wc/diff'Junio C Hamano2007-12-14
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | Test interaction between diff --check and --exit-codeWincent Colaiuta2007-12-14
| | | | | | | | | | | | | | | | | | | | | 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>
| * | Use shorter error messages for whitespace problemsWincent Colaiuta2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Add tests for "git diff --check" with core.whitespace optionsWincent Colaiuta2007-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Make "diff --check" output match "git apply"Wincent Colaiuta2007-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Unify whitespace checkingWincent Colaiuta2007-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | diff --check: minor fixupsJunio C Hamano2007-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | "diff --check" should affect exit statusWincent Colaiuta2007-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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>
* | | Move fetch_ref from http-push.c and http-walker.c to http.cMike Hommey2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Fix various memory leaks in http-push.c and http-walker.cMike Hommey2007-12-14
| | | | | | | | | | | | | | | Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Use strbuf in http codeMike Hommey2007-12-14
| | | | | | | | | | | | | | | | | | | | | 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>
* | | Avoid redundant declaration of missing_target()Mike Hommey2007-12-14
| | | | | | | | | | | | | | | Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Remove a CURLOPT_HTTPHEADER (un)settingMike Hommey2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Remove the default_headers variable from http-push.cMike Hommey2007-12-14
| | | | | | | | | | | | | | | | | | | | | 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>