Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2009-11-23strbuf_add_wrapped_text(): factor out strbuf_add_indented_text()René Scharfe
Add a new helper function, strbuf_add_indented_text(), to indent text without a width limit, and call it from strbuf_add_wrapped_text(). It respects both indent (applied to the first line) and indent2 (applied to the rest of the lines); indent2 was ignored by the indent-only path of strbuf_add_wrapped_text() before the patch. Two simple test cases are added, one exercising strbuf_add_wrapped_text() and the other strbuf_add_indented_text(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-23grep: unset GREP_OPTIONS before spawning external grepRené Scharfe
While we're at it, also unset GREP_COLOR and GREP_COLORS in case colouring is not enabled, to be on the safe side. The presence of these variables alone is not sufficient to trigger coloured output with GNU grep, but other implementations may behave differently. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-21Merge branch 'jh/notes' (early part)Junio C Hamano
* 'jh/notes' (early part): Add selftests verifying concatenation of multiple notes for the same commit Refactor notes code to concatenate multiple notes annotating the same object Add selftests verifying that we can parse notes trees with various fanouts Teach the notes lookup code to parse notes trees with various fanout schemes Teach notes code to free its internal data structures on request Add '%N'-format for pretty-printing commit notes Add flags to get_commit_notes() to control the format of the note string t3302-notes-index-expensive: Speed up create_repo() fast-import: Add support for importing commit notes Teach "-m <msg>" and "-F <file>" to "git notes edit" Add an expensive test for git-notes Speed up git notes lookup Add a script to edit/inspect notes Introduce commit notes Conflicts: .gitignore Documentation/pretty-formats.txt pretty.c
2009-11-21Merge branch 'sp/smart-http'Junio C Hamano
* sp/smart-http: (37 commits) http-backend: Let gcc check the format of more printf-type functions. http-backend: Fix access beyond end of string. http-backend: Fix bad treatment of uintmax_t in Content-Length t5551-http-fetch: Work around broken Accept header in libcurl t5551-http-fetch: Work around some libcurl versions http-backend: Protect GIT_PROJECT_ROOT from /../ requests Git-aware CGI to provide dumb HTTP transport http-backend: Test configuration options http-backend: Use http.getanyfile to disable dumb HTTP serving test smart http fetch and push http tests: use /dumb/ URL prefix set httpd port before sourcing lib-httpd t5540-http-push: remove redundant fetches Smart HTTP fetch: gzip requests Smart fetch over HTTP: client side Smart push over HTTP: client side Discover refs via smart HTTP server when available http-backend: more explict LocationMatch http-backend: add example for gitweb on same URL http-backend: use mod_alias instead of mod_rewrite ... Conflicts: .gitignore remote-curl.c
2009-11-21Merge branch 'jn/editor-pager'Junio C Hamano
* jn/editor-pager: Provide a build time default-pager setting Provide a build time default-editor setting am -i, git-svn: use "git var GIT_PAGER" add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR" Teach git var about GIT_PAGER Teach git var about GIT_EDITOR Suppress warnings from "git var -l" Do not use VISUAL editor on dumb terminals Handle more shell metacharacters in editor names
2009-11-21Merge branch 'bg/format-patch-doc-update'Junio C Hamano
* bg/format-patch-doc-update: format-patch: Add "--no-stat" as a synonym for "-p" format-patch documentation: Fix formatting format-patch documentation: Remove diff options that are not useful format-patch: Always generate a patch
2009-11-21Merge branch 'tr/filter-branch'Junio C Hamano
* tr/filter-branch: filter-branch: nearest-ancestor rewriting outside subdir filter filter-branch: stop special-casing $filter_subdir argument
2009-11-21Merge branch 'jl/submodule-add-noname'Junio C Hamano
* jl/submodule-add-noname: git submodule add: make the <path> parameter optional
2009-11-21Merge branch 'sb/ls-tree-parseopt'Junio C Hamano
* sb/ls-tree-parseopt: ls-tree: migrate to parse-options t3101: test more ls-tree options
2009-11-21Merge branch 'jp/fetch-cull-many-refs'Junio C Hamano
* jp/fetch-cull-many-refs: remote: fix use-after-free error detected by glibc in ref_remove_duplicates fetch: Speed up fetch of large numbers of refs remote: Make ref_remove_duplicates faster for large numbers of refs
2009-11-21describe: do not use unannotated tag even if exact matchThomas Rast
4d23660 (describe: when failing, tell the user about options that work, 2009-10-28) forgot to update the shortcut path where the code detected and used a possible exact match. This means that an unannotated tag on HEAD would be used by 'git describe'. Guard this code path against the new circumstances, where unannotated tags can be present in ->util even if we're not actually planning to use them. While there, also add some tests for --all. Reported by 'yashi' on IRC. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-18Merge branch 'sb/tutorial-test'Junio C Hamano
* sb/tutorial-test: t1200: prepare for merging with Fast-forward bikeshedding t1200: further modernize test script style t1200: Make documentation and test agree t1200: cleanup and modernize test style
2009-11-17Merge git://git.bogomips.org/git-svnJunio C Hamano
* git://git.bogomips.org/git-svn: Document git-svn's first-parent rule git svn: attempt to create empty dirs on clone+rebase git svn: add authorsfile test case for ~/.gitconfig git svn: read global+system config for clone+init git svn: handle SVN merges from revisions past the tip of the branch
2009-11-17t3101: test more ls-tree optionsStephen Boyd
Add tests for --full-name, --full-tree, --abbrev, and --name-only. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-16git svn: attempt to create empty dirs on clone+rebaseEric Wong
We parse unhandled.log files for empty_dir statements and make a best effort attempt to recreate empty directories on fresh clones and rebase. This should cover the majority of cases where users work off a single branch or for projects where branches do not differ in empty directories. Since this cannot affect "normal" git commands like "checkout" or "reset", so users switching between branches in a single working directory should use the new "git svn mkdirs" command after switching branches. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-11-16Merge branch 'js/maint-diff-color-words'Junio C Hamano
* js/maint-diff-color-words: diff --color-words: bit of clean-up diff --color-words -U0: fix the location of hunk headers t4034-diff-words: add a test for word diff without context Conflicts: diff.c
2009-11-16Merge branch 'fc/doc-fast-forward'Junio C Hamano
* fc/doc-fast-forward: Use 'fast-forward' all over the place Conflicts: builtin-merge.c
2009-11-16Merge branch 'jk/maint-add-p-empty'Junio C Hamano
* jk/maint-add-p-empty: add-interactive: handle deletion of empty files
2009-11-15remote: fix use-after-free error detected by glibc in ref_remove_duplicatesJulian Phillips
In ref_remove_duplicates, when we encounter a duplicate and remove it from the list we need to make sure that the prev pointer stays pointing at the last entry and also skip over adding the just freed entry to the string_list. Previously fetch could crash with: *** glibc detected *** git: corrupted double-linked list: ... Also add a test to try and catch problems with duplicate removal in the future. Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-15git svn: add authorsfile test case for ~/.gitconfigEric Wong
The commit for: git svn: read global+system config for clone+init Initially lacked a test case because the author was unable to reproduce it under his test environment, this adds it. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-11-15git svn: handle SVN merges from revisions past the tip of the branchToby Allsopp
When recording the revisions that it has merged, SVN sets the top revision to be the latest revision in the repository, which is not necessarily a revision on the branch that is being merged from. When it is not on the branch, git-svn fails to add the extra parent to represent the merge because it relies on finding the commit on the branch that corresponds to the top of the SVN merge range. In order to correctly handle this case, we look for the maximum revision less than or equal to the top of the SVN merge range that is actually on the branch being merged from. [ew: This includes the following (squashed) commit to prevent errors during bisect:] Author: Toby Allsopp <toby.allsopp@navman.co.nz> Date: Fri Nov 13 09:48:39 2009 +1300 git-svn: add (failing) test for SVN 1.5+ merge with intervening commit This test exposes a bug in git-svn's handling of SVN 1.5+ mergeinfo properties. The problematic case is when there is some commit on an unrelated branch after the last commit on the merged-from branch. When SVN records the mergeinfo property, it records the latest revision in the whole repository, which, in the problematic case, is not on the branch it is merging from. To trigger the git-svn bug, we modify t9151 to include two SVN merges, the second of which has an intervening commit. The SVN dump was generated using SVN 1.6.6 (on Debian squeeze amd64). Signed-off-by: Toby Allsopp <toby.allsopp@navman.co.nz> Acked-by: Eric Wong <normalperson@yhbt.net>
2009-11-13Provide a build time default-editor settingJonathan Nieder
Provide a DEFAULT_EDITOR knob to allow setting the fallback editor to use instead of vi (when VISUAL, EDITOR, and GIT_EDITOR are unset). The value can be set at build time according to a system’s policy. For example, on Debian systems, the default editor should be the 'editor' command. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-13Do not use VISUAL editor on dumb terminalsJonathan Nieder
Refuse to use $VISUAL and fall back to $EDITOR if TERM is unset or set to "dumb". Traditionally, VISUAL is set to a screen editor and EDITOR to a line-based editor, which should be more useful in that situation. vim, for example, is happy to assume a terminal supports ANSI sequences even if TERM is dumb (e.g., when running from a text editor like Acme). git already refuses to fall back to vi on a dumb terminal if GIT_EDITOR, core.editor, VISUAL, and EDITOR are unset, but without this patch, that check is suppressed by VISUAL=vi. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-13filter-branch: nearest-ancestor rewriting outside subdir filterThomas Rast
Since a0e4639 (filter-branch: fix ref rewriting with --subdirectory-filter, 2008-08-12) git-filter-branch has done nearest-ancestor rewriting when using a --subdirectory-filter. However, that rewriting strategy is also a useful building block in other tasks. For example, if you want to split out a subset of files from your history, you would typically call git filter-branch -- <refs> -- <files> But this fails for all refs that do not point directly to a commit that affects <files>, because their referenced commit will not be rewritten and the ref remains untouched. The code was already there for the --subdirectory-filter case, so just introduce an option that enables it independently. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-10Merge branch 'jk/maint-format-patch-p-suppress-stat'Junio C Hamano
* jk/maint-format-patch-p-suppress-stat: format-patch: make "-p" suppress diffstat
2009-11-10Merge branch 'jk/maint-1.6.3-ls-files-i'Junio C Hamano
* jk/maint-1.6.3-ls-files-i: ls-files: unbreak "ls-files -i"
2009-11-10Merge branch 'bg/merge-ff-only'Junio C Hamano
* bg/merge-ff-only: Teach 'git merge' and 'git pull' the option --ff-only
2009-11-10Merge branch 'jp/dirty-describe'Junio C Hamano
* jp/dirty-describe: Teach "git describe" --dirty option
2009-11-10format-patch: Always generate a patchBjörn Gustavsson
Jeff King recently reinstated -p to suppress the default diffstat (as -p used to work before 68daa64, about 14 months ago). However, -p is also needed in combination with certain options (e.g. --stat or --numstat) in order to produce any patch at all. The documentation does not mention this. Since the purpose of format-patch is to produce a patch that can be emailed, it does not make sense that certain combination of options will suppress the generation of the patch itself. Therefore: * Update 'git format-patch' to always generate a patch. * Since the --name-only, --name-status, and --check suppresses the generation of the patch, disallow those options, and remove the description of them in the documentation. * Remove the reference to -p in the description of -U. * Remove the descriptions of the options that are synonyms for -p plus another option (--patch-with-raw and --patch-with-stat). * While at it, slightly tweak the description of -p itself to say that it generates "plain patches", so that you can think of -p as "plain patch" as an mnemonic aid. Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-10t5551-http-fetch: Work around broken Accept header in libcurlShawn O. Pearce
Unfortunately at least one version of libcurl has a bug causing it to include "Accept: */*" in the same POST request where we have already asked for "Accept: application/x-git-upload-pack-response". This is a bug in libcurl, not Git, or our test vector. The application has explicitly asked the server for a single content type, but libcurl has mistakenly also told the server the client application will accept */*, which is any content type. Based on the libcurl change log, this "Accept: */*" header bug may have been fixed in version 7.18.1 released March 30, 2008: http://curl.haxx.se/changes.html#7_18_1 Rather than require users to upgrade libcurl we change the test vector to trim this line out of the 2nd request. Reported-by: Tarmigan <tarmigan+git@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-10t5551-http-fetch: Work around some libcurl versionsShawn O. Pearce
Some versions of libcurl report their output when GIT_CURL_VERBOSE is set differently than other versions do. At least one variant (version unknown but likely pre-7.18.1) reports the POST payload to stderr, and omits the blank line after each HTTP request/response. We clip these lines out of the stderr output now before doing the compare, so we aren't surprised by this trivial difference. Reported-by: Tarmigan <tarmigan+git@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-10http-backend: Protect GIT_PROJECT_ROOT from /../ requestsShawn O. Pearce
Eons ago HPA taught git-daemon how to protect itself from /../ attacks, which Junio brought back into service in d79374c7b58d ("daemon.c and path.enter_repo(): revamp path validation"). I did not carry this into git-http-backend as originally we relied only upon PATH_TRANSLATED, and assumed the HTTP server had done its access control checks to validate the resolved path was within a directory permitting access from the remote client. This would usually be sufficient to protect a server from requests for its /etc/passwd file by http://host/smart/../etc/passwd sorts of URLs. However in 917adc036086 Mark Lodato added GIT_PROJECT_ROOT as an additional method of configuring the CGI. When this environment variable is used the web server does not generate the final access path and therefore may blindly pass through "/../etc/passwd" in PATH_INFO under the assumption that "/../" might have special meaning to the invoked CGI. Instead of permitting these sorts of malformed path requests, we now reject them back at the client, with an error message for the server log. This matches git-daemon behavior. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-09format-patch: make "-p" suppress diffstatJeff King
Once upon a time, format-patch would use its default stat plus patch format only when no diff format was given on the command line. This meant that "format-patch -p" would suppress the stat and show just the patch. Commit 68daa64 changed this to keep the stat format when we had an "implicit" patch format, like "-U5". As a side effect, this meant that an explicit patch format was now ignored (because cmd_format_patch didn't know the reason that the format was set way down in diff_opt_parse). This patch unbreaks what 68daa64 did (while still preserving what 68daa64 was trying to do), reinstating "-p" to suppress the default behavior. We do this by parsing "-p" ourselves in format-patch, and noting whether it was used explicitly. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-07Merge branch 'jc/commit-s-subject-is-not-a-footer'Junio C Hamano
* jc/commit-s-subject-is-not-a-footer: builtin-commit.c: fix logic to omit empty line before existing footers
2009-11-07builtin-commit.c: fix logic to omit empty line before existing footersJunio C Hamano
"commit -s" used to add an empty line before adding S-o-b line only when the last line of the existing log message is not another S-o-b line, but c1e01b0 (commit: More generous accepting of RFC-2822 footer lines., 2009-10-28) introduced logic to omit this empty line when the message ends with a run of "footer" lines, to cover S-o-b's friends, e.g. Acked-by. However, the logic was overzealous and missed one corner case. A message that consists of a single line that begins with Token + colon, it can be mistaken as a S-o-b's friend. We do want an empty line in such a case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-07t1200: prepare for merging with Fast-forward bikesheddingJunio C Hamano
A tree-wide bikeshedding to replace "fast forward" into "fast-forward" is in 'master'. Since we want to keep this "test modernization" series mergeable also to the maintenance track, we would need to tweak the test to accept both old spellings and new spellings. Sigh... This kind of headache is the primary reason we try not to allow such a tree-wide bike-shedding, but the damage has already been done. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-07t1200: further modernize test script styleJunio C Hamano
Instead of using bare "cmp", use "test_cmp". Output when the test is run with a -v option becomes easier to diagnose when something goes wrong because on saner platforms test_cmp uses "diff -u". There is no need to put an extra backslash to a line that ends with a '|' (i.e. the upstream of a pipe). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-07t1200: Make documentation and test agreeStephen Boyd
There were some differences between t1200 and the gitcore-tutorial. Add missing tests for manually merging two branches, and use the same commands in both files. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-07t1200: cleanup and modernize test styleStephen Boyd
Many parts of the tests in t1200 are run outside the test harness, circumventing the usefulness of -v and spewing messages to stdout when -v isn't used. Fix these problems by modernizing the test a bit. An extra test_done has existed since commit 6a74642 (git-commit --amend: two fixes., 2006-04-20) leading to the last 6 tests never being run. Remove it and teach the resolve merge test about fast-forward merges. Also fix the last test's incorrect find command and prune before checking for unpacked objects so we remove the unreachable conflict-marked blob. Finally, we remove the TODO notes, because fetch, push, and clone have their own tests since t1200 was introduced and we're not going to add them here 4 years later. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-05http-backend: Test configuration optionsShawn O. Pearce
Test the major configuration settings which control access to the repository: http.getanyfile http.uploadpack http.receivepack Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-05test smart http fetch and pushShawn O. Pearce
The top level directory "/smart/" of the test Apache server is mapped through our git-http-backend CGI, but uses the same underlying repository space as the server's document root. This is the most simple installation possible. Server logs are checked to verify the client has accessed only the smart URLs during the test. During fetch testing the headers are also logged from libcurl to ensure we are making a reasonably sane HTTP request, and getting back reasonably sane response headers from the CGI. When validating the request headers used during smart fetch we munge away the actual Content-Length and replace it with the placeholder "xxx". This avoids unnecessary varability in the test caused by an unrelated change in the requested capabilities in the first want line of the request. However, we still want to look for and verify that Content-Length was used, because smaller payloads should be using Content-Length and not "Transfer-Encoding: chunked". When validating the server response headers we must discard both Content-Length and Transfer-Encoding, as Apache2 can use either format to return our response. During development of this test I observed Apache returning both forms, depending on when the processes got CPU time. If our CGI returned the pack data quickly, Apache just buffered the whole thing and returned a Content-Length. If our CGI took just a bit too long to complete, Apache flushed its buffer and instead used "Transfer-Encoding: chunked". Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-05http tests: use /dumb/ URL prefixShawn O. Pearce
To clarify what part of the HTTP transprot is being tested we change the URLs used by existing tests to include /dumb/ at the start, indicating they use the non-Git aware code paths. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-05set httpd port before sourcing lib-httpdClemens Buchacher
If LIB_HTTPD_PORT is not set already, lib-httpd will set it to the default 8111. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-05t5540-http-push: remove redundant fetchesTay Ray Chuan
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-02Merge branch 'jn/show-normalized-refs'Junio C Hamano
* jn/show-normalized-refs: t1402: Make test executable
2009-11-02t1402: Make test executableStephen Boyd
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-31fixup tr/stash-format mergeJunio C Hamano
2009-10-31Merge branch 'js/diff-verbose-submodule'Junio C Hamano
* js/diff-verbose-submodule: add tests for git diff --submodule Add the --submodule option to the diff option family
2009-10-31Merge branch 'jn/show-normalized-refs'Junio C Hamano
* jn/show-normalized-refs: check-ref-format: simplify --print implementation git check-ref-format --print Add tests for git check-ref-format Conflicts: Documentation/git-check-ref-format.txt
2009-10-31remote-helpers: return successfully if everything up-to-dateClemens Buchacher
Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>