summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-01-18t4034 (diff --word-diff): add a minimum Perl drier test vectorJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18t4034 (diff --word-diff): style suggestionsJonathan Nieder
Rearrange code to be easier to browse: - first data - then functions - then test assertions Mark up inline test vectors as cat >vector <<-\EOF data data EOF for visual scannability. Use words like "set up" for tests that set up for other tests, to make it obvious which tests are safe to skip. Use repeated function calls instead of a loop for the language-specific tests, so the invocations can be easily tweaked individually (for example if one starts to fail). This means if you add a new subdirectory to t4034/, it will not be automatically used. I think that's worth it for the added explicitness. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18userdiff: simplify word-diff safeguardJonathan Nieder
git's diff-words support has a detail that can be a little dangerous: any text not matched by a given language's tokenization pattern is treated as whitespace and changes in such text would go unnoticed. Therefore each of the built-in regexes allows a special token type consisting of a single non-whitespace character [^[:space:]]. To make sure UTF-8 sequences remain human readable, the builtin regexes also have a special token type for runs of bytes with the high bit set. In English, non-ASCII characters are usually isolated so this is analogous to the [^[:space:]] pattern, except it matches a single _multibyte_ character despite use of the C locale. Unfortunately it is easy to make typos or forget entirely to include these catch-all token types when adding support for new languages (see v1.7.3.5~16, userdiff: fix typo in ruby and python word regexes, 2010-12-18). Avoid this by including them automatically within the PATTERNS and IPATTERN macros. While at it, change the UTF-8 sequence token type to match exactly one non-ASCII multi-byte character, rather than an arbitrary run of them. Suggested-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18t4034: bulk verify builtin word regex sanityThomas Rast
The builtin word regexes should be tested with some simple examples against simple issues. Do this in bulk. Mainly due to a lack of language knowledge and inspiration, most of the test cases (cpp, csharp, java, objc, pascal, php, python, ruby) are directly based off a C operator precedence table to verify that all operators are split correctly. This means that they are probably incomplete or inaccurate except for 'cpp' itself. Still, they are good enough to already have uncovered a typo in the python and ruby patterns. 'fortran' is based on my anecdotal knowledge of the DO10I parsing rules, and thus probably useless. The rest (bibtex, html, tex) are an ad-hoc test of what I consider important splits in those languages. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13Git 1.7.4-rc2v1.7.4-rc2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13Merge branch 'jn/gitweb-no-logo'Junio C Hamano
* jn/gitweb-no-logo: gitweb: make logo optional
2011-01-13Merge branch 'jn/perl-funcname'Junio C Hamano
* jn/perl-funcname: userdiff/perl: catch BEGIN/END/... and POD as headers diff: funcname and word patterns for perl
2011-01-13Merge branch 'sr/gitweb-hilite-more'Junio C Hamano
* sr/gitweb-hilite-more: gitweb: remove unnecessary test when closing file descriptor gitweb: add extensions to highlight feature map
2011-01-13Merge branch 'rj/svn-test'Junio C Hamano
* rj/svn-test: lib-git-svn.sh: Move web-server handling code into separate function
2011-01-13Merge branch 'rj/test-fixes'Junio C Hamano
* rj/test-fixes: t4135-*.sh: Skip the "backslash" tests on cygwin t3032-*.sh: Do not strip CR from line-endings while grepping on MinGW t3032-*.sh: Pass the -b (--binary) option to sed on cygwin t6038-*.sh: Pass the -b (--binary) option to sed on cygwin Conflicts: t/t3032-merge-recursive-options.sh
2011-01-13Merge branch 'jk/diff-driver-binary-doc'Junio C Hamano
* jk/diff-driver-binary-doc: docs: explain diff.*.binary option
2011-01-13Merge branch 'jn/t9010-work-around-broken-svnadmin'Junio C Hamano
* jn/t9010-work-around-broken-svnadmin: t9010: svnadmin can fail even if available
2011-01-13Merge branch 'tr/submodule-relative-scp-url'Junio C Hamano
* tr/submodule-relative-scp-url: submodule: fix relative url parsing for scp-style origin
2011-01-13RelNotes/1.7.4: minor fixesMichael J Gruber
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13t0000: quote TAP snippets in test codeThomas Rast
t0000 contains two snippets of actual test output. This causes problems when passing -v to the test[*]: the test infrastructure echoes the tests before running them, and the TAP parser then sees this test output and concludes that two tests failed and that the TAP output was badly formatted. Guard against this by quoting the output in the source. [*] either by running 'make smoke' with GIT_TEST_OPTS=-v, or with prove ./t0000-basic.sh :: -v Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13Merge branch 'maint'Junio C Hamano
* maint: commit: suggest --amend --reset-author to fix commiter identity
2011-01-12commit: suggest --amend --reset-author to fix commiter identityMatthieu Moy
Since the message advises to fix the configuration first, the advantage of using this command is that it is cut-and-paste ready, while using --author='...' requires the user to type his name and email again. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11t9157-*.sh: Make the svn version check more preciseRamsay Jones
These tests require an svn version 1.5 or newer to run correctly. In particular, all 1.4.x versions and earlier are too old, so fix up the case label regex to cover this range exactly. [Fix provided by Anders Kaseorg <andersk@MIT.EDU>] Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10Merge branch 'maint'Junio C Hamano
* maint: Documentation/githooks: post-rewrite-copy-notes never existed Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10Merge branch 'maint-1.7.2' into maintJunio C Hamano
* maint-1.7.2: Documentation/githooks: post-rewrite-copy-notes never existed Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10Merge branch 'maint-1.7.1' into maint-1.7.2Junio C Hamano
* maint-1.7.1: Documentation/githooks: post-rewrite-copy-notes never existed Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10Merge branch 'maint-1.7.0' into maint-1.7.1Junio C Hamano
* maint-1.7.0: Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10docs: explain diff.*.binary optionJeff King
This was added long ago as part of the userdiff refactoring for textconv, as internally it made the code simpler and cleaner. However, there was never a concrete use case for actually using the config variable. Now that Matthieu Moy has provided such a use case, it's easy to explain it using his example. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10t9010: svnadmin can fail even if availableJonathan Nieder
If svn is built against one version of SQLite and run against another, libsvn_subr needlessly errors out in operations that need to make a commit. That is clearly not a bug in git but let us consider the ramifications for the test suite. git-svn uses libsvn directly and is probably broken by that bug; it is right for git-svn tests to fail. The vcs-svn lib, on the other hand, does not use libsvn and the test t9010 only uses svn to check its work. This points to two possible improvements: - do not disable most vcs-svn tests if svn is missing. - skip validation rather than failing it when svn fails. Bring about both by putting the svn invocations into a single test that builds a repo to compare the test-svn-fe result against. The test will always pass but only will set the new SVNREPO test prereq if svn succeeds; and validation using that repo gets an SVNREPO prerequisite so it only runs with working svn installations. Works-around: http://bugs.debian.org/608925 Noticed-by: A Large Angry SCM <gitzilla@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-01-10submodule: fix relative url parsing for scp-style originThomas Rast
The function resolve_relative_url was not prepared to deal with an scp-style origin 'user@host:path' in the case where 'path' is only a single component. Fix this by extending the logic that strips one path component from the $remoteurl. Also add tests for both styles of URLs. Noticed-by: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10Documentation/githooks: post-rewrite-copy-notes never existedThomas Rast
The documentation for the post-rewrite hook contains a paragraph from its early development, where the automatic notes copying facilities were not part of the series and thus this had to be a hook. Later versions of the series implemented notes copying as a core feature. Thus mentioning post-rewrite-copy-notes was never correct. As the other hooks do not have a "there is no default hook, but..." sentence unless they ship a sample hook in either templates or contrib, we simply remove the whole paragraph. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10Documentation/git-archive: spell --worktree-attributes correctlyThomas Rast
The --worktree-attributes option was correctly documented in ba053ea (archive: do not read .gitattributes in working directory, 2009-04-18). However, later in 9b4c8b0 (archive documentation: attributes are taken from the tree by default, 2010-02-10) the misspelling "--work-tree-attributes" was used to refer to it. Fix this. Noticed-by: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-09Merge branch 'maint'Junio C Hamano
* maint: Mark gitk script executable
2011-01-09t4135-*.sh: Skip the "backslash" tests on cygwinRamsay Jones
The BSLASHPSPEC tests (11-13) fail on cygwin, since you can't create files containing an backslash character in the name. In order to skip these tests, we simply stop (incorrectly) asserting the BSLASHPSPEC prerequisite in test-lib.sh. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-09t3032-*.sh: Do not strip CR from line-endings while grepping on MinGWRamsay Jones
By default grep reads in text mode and converts CRLF into LF line endings, which causes tests 4, 6 and 8 to fail. In a similar manner to commit a94114ad (Do not strip CR when grepping HTTP headers, 2010-09-12), we set (and export) the GREP_OPTIONS variable to -U so that grep will use binary mode. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-09t3032-*.sh: Pass the -b (--binary) option to sed on cygwinRamsay Jones
The test using the conflict_hunks helper function (test 9) fails on cygwin, since sed (by default) throws away the CR from CRLF line endings. This behaviour is undesirable, since the validation code expects the CRLF line-ending to be present. In order to fix the problem we pass the -b (--binary) option to sed, using the SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the conditional initialisation of SED_OPTIONS. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-09t6038-*.sh: Pass the -b (--binary) option to sed on cygwinRamsay Jones
The tests using the fuzz_conflict helper function (tests 5-6) fail on cygwin in the same way they used to on MinGW, prior to commit ca02ad3. The solution is also the same; passing the -b (--binary) option to sed, using the SED_OPTIONS variable. We introduce a new prerequisite SED_STRIPS_CR to use in the conditional initialisation of SED_OPTIONS, rather than MINGW. The new prerequisite is set in test-lib.sh for both MinGW and Cygwin. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-09Mark gitk script executableAnders Kaseorg
The executable bit on gitk-git/gitk was lost (accidentally it seems) by commit 62ba5143ec2ab9d4083669b1b1679355e7639cd5. Put it back, so that gitk can be run directly from a git.git checkout. Note that the script is already executable in gitk.git, just not in git.git. Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-07t9157-*.sh: Add an svn version checkRamsay Jones
Acked-by: Eric Wong <normalperson@yhbt.net> Acked-by: Steven Walter <stevenrwalter@gmail.com> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
2011-01-07git svn: fix the final example in man pageStephenB
'git-remote add' creates a remote.origin.fetch entry in the config, we want to replace this entry rather than add another one (which will cause 'git fetch' to error). This adds 'git config --remove-section remote.origin' after the fetch for encouraging users to only use "git svn" for future updates. [ew: rewording of commit message for present tense] Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: StephenB <mail4stb@gmail.com>
2011-01-06t3032: limit sed branch labels to 8 charactersBrandon Casey
POSIX leaves as unspecified the handling of labels greater than 8 characters. Apparently, Sun decided to treat them as errors. Make sed on Solaris happy by trimming the length of labels to 8 characters. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-06t0001,t1510,t3301: use sane_unset which always returns with status 0Brandon Casey
On some shells (like /usr/xpg4/bin/sh on Solaris), unset will exit non-zero when passed the name of a variable that has not been set. Use sane_unset instead so that the return value of unset can be ignored while the && linkage of the test script can be preserved. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-06trace.c: ensure NULL is not passed to printfBrandon Casey
GNU printf, and many others, will print the string "(null)" if a NULL pointer is passed as the argument to a "%s" format specifier. Some implementations (like on Solaris) do not detect a NULL pointer and will produce a segfault in this case. So, fix this by ensuring that pointer variables do not contain the value NULL. Assign the string "(null)" to the variables are NULL. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-05Git 1.7.4-rc1v1.7.4-rc1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-05Merge branch 'maint' to sync with 1.7.3.5Junio C Hamano
2011-01-05Git 1.7.3.5v1.7.3.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-05Merge branch 'jn/svn-fe' (early part)Junio C Hamano
* 'jn/svn-fe' (early part): vcs-svn: Error out for v3 dumps Conflicts: t/t9010-svn-fe.sh
2011-01-05Merge branch 'ao/t9001-fix'Junio C Hamano
* ao/t9001-fix: t/t9001-send-email.sh: fix '&&' chain in some tests
2011-01-05Merge branch 'pw/convert-pathname-substitution'Junio C Hamano
* pw/convert-pathname-substitution: t0021: avoid getting filter killed with SIGPIPE convert filter: supply path to external driver
2011-01-05Merge branch 'mg/cvsimport'Junio C Hamano
* mg/cvsimport: cvsimport: handle the parsing of uppercase config options cvsimport: partial whitespace cleanup
2011-01-04gitweb: remove unnecessary test when closing file descriptorSylvain Rabot
It happens that closing file descriptor fails whereas the blob is perfectly readable. According to perlman the reasons could be: If the file handle came from a piped open, "close" will additionally return false if one of the other system calls involved fails, or if the program exits with non-zero status. (If the only problem was that the program exited non-zero, $! will be set to 0.) Closing a pipe also waits for the process executing on the pipe to complete, in case you want to look at the output of the pipe afterwards, and implicitly puts the exit status value of that command into $?. Prematurely closing the read end of a pipe (i.e. before the process writ- ing to it at the other end has closed it) will result in a SIGPIPE being delivered to the writer. If the other end can't handle that, be sure to read all the data before closing the pipe. In this case we don't mind that close fails. Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04gitweb: add extensions to highlight feature mapSylvain Rabot
added: sql, php5, phps, bash, zsh, ksh, mk, make Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04t/t9001-send-email.sh: fix '&&' chain in some testsAntonio Ospite
t/README recommends chaining test assertions. Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04lib-git-svn.sh: Move web-server handling code into separate functionRamsay Jones
This library file is currently sourced by 57 test files, of which only four may (optionally) start a web-server in order to access the svn repo via an http url, rather than a file url. In addition to isolating the current web-server handling code from the majority of tests, in a new prepare_httpd function, we also add some more error checking and reporting code to validate the apache installation. Only those tests which attempt to start the web-server, by calling start_httpd, will execute this code. Note that it is important for start_httpd to return an error indication, if prepare_httpd fails, so that the failure to use the web-server, as requested by the user, should not go unnoticed. (Unless the svnrepo variable is set to an http url at the end of start_httpd, the remaining tests will use file urls, without comment.) Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04cvsimport: handle the parsing of uppercase config optionsMichael J Gruber
The current code leads to fatal: bad config value for 'cvsimport.r' in .git/config for a standard use case with cvsimport.r set. cvsimport sets internal variables by checking the config for each possible command line option. The problem is that config items are case insensitive, so config.r and config.R are the same. The ugly error is due to that fact that cvsimport expects a bool for -R (and thus config.R) but a remote name for -r (and thus config.r). Fix this by making cvsimport expect long names for uppercase options. config options for cvsimport have been undocumented so far, though present in the code and advertised in several tutorials. So one may read "enhance" for "fix". Similarly, the names for the options are "documented" in the code, waitiing for their lowercase equivalents to be transformed into long config options, as well. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>