summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2014-03-31Merge branch 'ib/rev-parse-parseopt-argh'Libravatar Junio C Hamano1-36/+56
Teaches the "rev-parse --parseopt" mechanism used by scripted Porcelains to parse command line options and give help text how to supply argv-help (the placeholder string for an option parameter, e.g. "key-id" in "--gpg-sign=<key-id>"). * ib/rev-parse-parseopt-argh: t1502: protect runs of SPs used in the indentation rev-parse --parseopt: option argument name hints
2014-03-31Merge branch 'js/userdiff-cc'Libravatar Junio C Hamano32-153/+298
Improves the pattern to match the hunk-header for C/C++. * js/userdiff-cc: userdiff: have 'cpp' hunk header pattern catch more C++ anchor points t4018: test cases showing that the cpp pattern misses many anchor points t4018: test cases for the built-in cpp pattern t4018: reduce test files for pattern compilation tests t4018: convert custom pattern test to the new infrastructure t4018: convert java pattern test to the new infrastructure t4018: convert perl pattern tests to the new infrastructure t4018: an infrastructure to test hunk headers userdiff: support unsigned and long long suffixes of integer constants userdiff: support C++ ->* and .* operators in the word regexp
2014-03-31Merge branch 'dt/tests-with-env-not-subshell'Libravatar Junio C Hamano12-152/+42
* dt/tests-with-env-not-subshell: tests: use "env" to run commands with temporary env-var settings
2014-03-28Merge branch 'bg/rebase-off-of-previous-branch'Libravatar Junio C Hamano1-0/+17
* bg/rebase-off-of-previous-branch: rebase: allow "-" short-hand for the previous branch
2014-03-28Merge branch 'bp/commit-p-editor'Libravatar Junio C Hamano2-9/+58
When it is not necessary to edit a commit log message (e.g. "git commit -m" is given a message without specifying "-e"), we used to disable the spawning of the editor by overriding GIT_EDITOR, but this means all the uses of the editor, other than to edit the commit log message, are also affected. * bp/commit-p-editor: run-command: mark run_hook_with_custom_index as deprecated merge hook tests: fix and update tests merge: fix GIT_EDITOR override for commit hook commit: fix patch hunk editing with "commit -p -m" test patch hunk editing with "commit -p -m" merge hook tests: use 'test_must_fail' instead of '!' merge hook tests: fix missing '&&' in test
2014-03-28Merge branch 'jk/pack-bitmap'Libravatar Junio C Hamano1-1/+4
Instead of dying when asked to (re)pack with the reachability bitmap when a bitmap cannot be built, just (re)pack without producing a bitmap in such a case, with a warning. * jk/pack-bitmap: pack-objects: turn off bitmaps when skipping objects
2014-03-25Merge branch 'ss/test-on-mingw-rsync-path-no-absolute'Libravatar Junio C Hamano1-3/+3
* ss/test-on-mingw-rsync-path-no-absolute: t5510: Do not use $(pwd) when fetching / pushing / pulling via rsync
2014-03-25Merge branch 'us/printf-not-echo'Libravatar Junio C Hamano1-2/+2
* us/printf-not-echo: test-lib.sh: do not "echo" caller-supplied strings rebase -i: do not "echo" random user-supplied strings
2014-03-25Merge branch 'jk/lib-terminal-lazy'Libravatar Junio C Hamano1-18/+19
The test helper lib-terminal always run an actual test_expect_* when included, which screwed up with the use of skil-all that may have to be done later. * jk/lib-terminal-lazy: t/lib-terminal: make TTY a lazy prerequisite
2014-03-25Merge branch 'nd/commit-editor-cleanup'Libravatar Junio C Hamano1-0/+16
"git commit --cleanup=<mode>" learned a new mode, scissors. * nd/commit-editor-cleanup: commit: add --cleanup=scissors wt-status.c: move cut-line print code out to wt_status_add_cut_line wt-status.c: make cut_line[] const to shrink .data section a bit
2014-03-25Merge branch 'jk/mv-submodules-fix'Libravatar Junio C Hamano1-1/+12
"git mv" that moves a submodule forgot to adjust the array that uses to keep track of which submodules were to be moved to update its configuration. * jk/mv-submodules-fix: mv: prevent mismatched data when ignoring errors. builtin/mv: fix out of bounds write
2014-03-23t1502: protect runs of SPs used in the indentationLibravatar Junio C Hamano1-56/+56
The expected output from the argument help use runs of SPs to align the description of each option; a careless use of --whitespace=fix can turn leading parts of them into appropriate number of HTs. Prevent such a breakage by prefixing all the expected lines with leading vertical bars in the original and stripping them with a small sed script. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-23rev-parse --parseopt: option argument name hintsLibravatar Ilya Bobyr1-0/+20
Built-in commands can specify names for option arguments when usage text is generated for a command. sh based commands should be able to do the same. Option argument name hint is any text that comes after [*=?!] after the argument name up to the first whitespace. Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21userdiff: have 'cpp' hunk header pattern catch more C++ anchor pointsLibravatar Johannes Sixt12-12/+0
The hunk header pattern 'cpp' is intended for C and C++ source code, but it is actually not particularly useful for the latter, and even misses some use-cases for the former. The parts of the pattern have the following flaws: - The first part matches an identifier followed immediately by a colon and arbitrary text and is intended to reject goto labels and C++ access specifiers (public, private, protected). But this pattern also rejects C++ constructs, which look like this: MyClass::MyClass() MyClass::~MyClass() MyClass::Item MyClass::Find(... - The second part matches an identifier followed by a list of qualified names (i.e. identifiers separated by the C++ scope operator '::') separated by space or '*' followed by an opening parenthesis (with space between the tokens). It matches function declarations like struct item* get_head(... int Outer::Inner::Func(... Since the pattern requires at least two identifiers, GNU-style function definitions are ignored: void func(... Moreover, since the pattern does not allow punctuation other than '*', the following C++ constructs are not recognized: . template definitions: template<class T> int func(T arg) . functions returning references: const string& get_message() . functions returning templated types: vector<int> foo() . operator definitions: Value operator+(Value l, Value r) - The third part of the pattern finally matches compound definitions. But it forgets about unions and namespaces, and also skips single-line definitions struct random_iterator_tag {}; because no semicolon can occur on the line. Change the first pattern to require a colon at the end of the line (except for trailing space and comments), so that it does not reject constructor or destructor definitions. Notice that all interesting anchor points begin with an identifier or keyword. But since there is a large variety of syntactical constructs after the first "word", the simplest is to require only this word and accept everything else. Therefore, this boils down to a line that begins with a letter or underscore (optionally preceded by the C++ scope operator '::' to accept functions returning a type anchored at the global namespace). Replace the second and third part by a single pattern that picks such a line. This has the following desirable consequence: - All constructs mentioned above are recognized. and the following likely desirable consequences: - Definitions of global variables and typedefs are recognized: int num_entries = 0; extern const char* help_text; typedef basic_string<wchar_t> wstring; - Commonly used marco-ized boilerplate code is recognized: BEGIN_MESSAGE_MAP(CCanvas,CWnd) Q_DECLARE_METATYPE(MyStruct) PATTERNS("tex",...) (The last one is from this very patch.) but also the following possibly undesirable consequence: - When a label is not on a line by itself (except for a comment) it is no longer rejected, but can appear as a hunk header if it occurs at the beginning of a line: next:; IMO, the benefits of the change outweigh the (possible) regressions by a large margin. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21t4018: test cases showing that the cpp pattern misses many anchor pointsLibravatar Johannes Sixt12-0/+66
Most of the tests show C++ code, but there is also a union definition and a GNU style function definition that are not recognized. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21t4018: test cases for the built-in cpp patternLibravatar Johannes Sixt9-0/+55
A later patch changes the built-in cpp pattern. These test cases demonstrate aspects of the pattern that we do not want to change. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21t4018: reduce test files for pattern compilation testsLibravatar Johannes Sixt1-38/+14
All test cases that need a file with specific text patterns have been converted to utilize texts in the t4018/ directory. The remaining tests in the test script deal only with the validity of the regular expressions. These tests do not depend on the contents of files that 'git diff' is invoked on. Remove the largish here-document and use only tiny files. While we are touching these tests, convert grep to test_i18ngrep as the texts checked for may undergo translation in the future. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21t4018: convert custom pattern test to the new infrastructureLibravatar Johannes Sixt4-24/+58
For the test case "matches to end of line", extend the pattern by a few wildcards so that the pattern captures the "RIGHT" token, which is needed for verification, without mentioning it in the pattern. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21t4018: convert java pattern test to the new infrastructureLibravatar Johannes Sixt2-4/+8
Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21t4018: convert perl pattern tests to the new infrastructureLibravatar Johannes Sixt6-88/+44
There is one subtlety: The old test case 'perl pattern gets full line of POD header' does not have its own new test case, but the feature is tested nevertheless by placing the RIGHT tag at the end of the expected hunk header in t4018/perl-skip-sub-in-pod. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21t4018: an infrastructure to test hunk headersLibravatar Johannes Sixt2-6/+72
Add an infrastructure that simplifies adding new tests of the hunk header regular expressions. To add new tests, a file with the syntax to test can be dropped in the directory t4018. The README file explains how a test file must contain; the README itself tests the default behavior. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-21Merge branch 'lt/request-pull'Libravatar Junio C Hamano1-9/+15
Discard the accumulated "heuristics" to guess from which branch the result wants to be pulled from and make sure what the end user specified is not second-guessed by "git request-pull", to avoid mistakes. * lt/request-pull: request-pull: documentation updates request-pull: resurrect "pretty refname" feature request-pull: test updates request-pull: pick up tag message as before request-pull: allow "local:remote" to specify names on both ends request-pull: more strictly match local/remote branches
2014-03-21Merge branch 'nd/upload-pack-shallow'Libravatar Junio C Hamano1-0/+41
Serving objects from a shallow repository needs to write a temporary file to be used, but the serving upload-pack may not have write access to the repository which is meant to be read-only. Instead feed these temporary shallow bounds from the standard input of pack-objects so that we do not have to use a temporary file. * nd/upload-pack-shallow: upload-pack: send shallow info over stdin to pack-objects
2014-03-21Merge branch 'jn/wt-status'Libravatar Junio C Hamano2-13/+13
Unify the codepaths that format new/modified/changed sections and conflicted paths in the "git status" output and make it possible to properly internationalize their output. * jn/wt-status: wt-status: lift the artificual "at least 20 columns" floor wt-status: i18n of section labels wt-status: extract the code to compute width for labels wt-status: make full label string to be subject to l10n
2014-03-21Merge branch 'nd/tag-version-sort'Libravatar Junio C Hamano1-0/+43
Allow v1.9.0 sorted before v1.10.0 in "git tag --list" output. * nd/tag-version-sort: tag: support --sort=<spec>
2014-03-21Merge branch 'tc/commit-dry-run-exit-status-tests'Libravatar Junio C Hamano1-0/+36
* tc/commit-dry-run-exit-status-tests: demonstrate git-commit --dry-run exit code behaviour
2014-03-19t5510: Do not use $(pwd) when fetching / pushing / pulling via rsyncLibravatar Sebastian Schuberth1-3/+3
On MINGW, "pwd" is defined as "pwd -W" in test-lib.sh. This usually is the right thing, but the absolute Windows path with a colon confuses rsync. We could use $PWD in this case to work around the issue, but in fact there is no need to use an absolute path in the first place, so get rid of it. This was discovered in the context of the mingwGitDevEnv project and only did not surface before with msysgit because the latter does not ship rsync. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-19tests: use "env" to run commands with temporary env-var settingsLibravatar David Tran12-152/+42
Ordinarily, we would say "VAR=VAL command" to execute a tested command with environment variable(s) set only for that command. This however does not work if 'command' is a shell function (most notably 'test_must_fail'); the result of the assignment is retained and affects later commands. To avoid this, we used to assign and export environment variables and run such a test in a subshell, like so: ( VAR=VAL && export VAR && test_must_fail git command to be tested ) But with "env" utility, we should be able to say: test_must_fail env VAR=VAL git command to be tested which is much shorter and easier to read. Signed-off-by: David Tran <unsignedzero@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-19rebase: allow "-" short-hand for the previous branchLibravatar Brian Gesiak1-0/+17
Teach rebase the same shorthand as checkout and merge to name the branch to rebase the current branch on; that is, that "-" means "the branch we were previously on". Requested-by: Tim Chase <git@tim.thechases.com> Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-18Merge branch 'rs/grep-h-c'Libravatar Junio C Hamano1-29/+41
"git grep" learns to handle combination of "-h (no header)" and "-c (counts)". * rs/grep-h-c: grep: support -h (no header) with --count t7810: add missing variables to tests in loop
2014-03-18Merge branch 'bg/install-branch-config-skip-prefix'Libravatar Junio C Hamano1-0/+10
* bg/install-branch-config-skip-prefix: branch: use skip_prefix() in install_branch_config() t3200-branch: test setting branch as own upstream
2014-03-18Merge branch 'jc/no-need-for-env-in-sh-scripts'Libravatar Junio C Hamano2-2/+2
* jc/no-need-for-env-in-sh-scripts: *.sh: drop useless use of "env"
2014-03-18Merge branch 'jk/detect-push-typo-early'Libravatar Junio C Hamano1-0/+48
Catch "git push $there no-such-branch" early. * jk/detect-push-typo-early: push: detect local refspec errors early match_explicit_lhs: allow a "verify only" mode match_explicit: hoist refspec lhs checks into their own function
2014-03-18Merge branch 'jk/repack-pack-keep-objects'Libravatar Junio C Hamano1-1/+17
* jk/repack-pack-keep-objects: repack: add `repack.packKeptObjects` config var
2014-03-18Merge branch 'fc/transport-helper-fixes'Libravatar Junio C Hamano1-0/+13
Updates transport-helper, fast-import and fast-export to allow the ref mapping and ref deletion in a way similar to the natively supported transports. * fc/transport-helper-fixes: remote-bzr: support the new 'force' option test-hg.sh: tests are now expected to pass transport-helper.c: do not overwrite forced bit transport-helper: check for 'forced update' message transport-helper: add 'force' to 'export' helpers transport-helper: don't update refs in dry-run transport-helper: mismerge fix
2014-03-18Merge branch 'jk/clean-d-pathspec'Libravatar Junio C Hamano1-0/+16
"git clean -d pathspec" did not use the given pathspec correctly and ended up cleaning too much. * jk/clean-d-pathspec: clean: simplify dir/not-dir logic clean: respect pathspecs with "-d"
2014-03-18test-lib.sh: do not "echo" caller-supplied stringsLibravatar Uwe Storbeck1-2/+2
In some places we "echo" a string that is supplied by the calling test script and may contain backslash sequences. The echo command of some shells, most notably "dash", interprets these backslash sequences (POSIX.1 allows this) which may scramble the test output. Signed-off-by: Uwe Storbeck <uwe@ibr.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-18merge hook tests: fix and update testsLibravatar Benoit Pierre1-6/+21
- update 'no editor' hook test and add 'editor' hook test - make sure the tree is reset to a clean state after running a test (using test_when_finished) so later tests are not impacted Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-18commit: fix patch hunk editing with "commit -p -m"Libravatar Benoit Pierre1-2/+2
Don't change git environment: move the GIT_EDITOR=":" override to the hook command subprocess, like it's already done for GIT_INDEX_FILE. Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-18test patch hunk editing with "commit -p -m"Libravatar Benoit Pierre1-0/+34
Add (failing) tests: with commit changing the environment to let hooks know that no editor will be used (by setting GIT_EDITOR to ":"), the "edit hunk" functionality does not work (no editor is launched and the whole hunk is committed). Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-17pack-objects: turn off bitmaps when skipping objectsLibravatar Jeff King1-1/+4
The pack bitmap format requires that we have a single bit for each object in the pack, and that each object's bitmap represents its complete set of reachable objects. Therefore we have no way to represent the bitmap of an object which references objects outside the pack. We notice this problem while generating the bitmaps, as we try to find the offset of a particular object and realize that we do not have it. In this case we die, and neither the bitmap nor the pack is generated. This is correct, but perhaps a little unfriendly. If you have bitmaps turned on in the config, many repacks will fail which would otherwise succeed. E.g., incremental repacks, repacks with "-l" when you have alternates, ".keep" files. Instead, this patch notices early that we are omitting some objects from the pack and turns off bitmaps (with a warning). Note that this is not strictly correct, as it's possible that the object being omitted is not reachable from any other object in the pack. In practice, this is almost never the case, and there are two advantages to doing it this way: 1. The code is much simpler, as we do not have to cleanly abort the bitmap-generation process midway through. 2. We do not waste time partially generating bitmaps only to find out that some object deep in the history is not being packed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-17mv: prevent mismatched data when ignoring errors.Libravatar brian m. carlson1-1/+12
We shrink the source and destination arrays, but not the modes or submodule_gitfile arrays, resulting in potentially mismatched data. Shrink all the arrays at the same time to prevent this. Add tests to ensure the problem does not recur. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-14t/lib-terminal: make TTY a lazy prerequisiteLibravatar Jeff King1-18/+19
When lib-terminal.sh is sourced by a test script, we immediately set up the TTY prerequisite. We do so inside a test_expect_success, because that nicely isolates any generated output. However, this early test can interfere with a script that later wants to skip all tests (e.g., t5541 then goes on to set up the httpd server, and wants to skip_all if that fails). TAP output doesn't let us skip everything after we have already run at least one test. We could fix this by reordering the inclusion of lib-terminal.sh in t5541 to go after the httpd setup. That solves this case, but we might eventually hit a case with circular dependencies, where either lib-*.sh include might want to skip_all after the other has run a test. So instead, let's just remove the ordering constraint entirely by doing the setup inside a test_lazy_prereq construct, rather than in a regular test. We never cared about the test outcome anyway (it was written to always succeed). Note that in addition to setting up the prerequisite, the current test also defines test_terminal. Since we can't affect the environment from a lazy_prereq, we have to hoist that out. We previously depended on it _not_ being defined when the TTY prereq isn't set as a way to ensure that tests properly declare their dependency on TTY. However, we still cover the case (see the in-code comment for details). Reported-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-14Merge branch 'sg/archive-restrict-remote'Libravatar Junio C Hamano1-0/+9
Allow loosening remote "git archive" invocation security check that refuses to serve tree-ish not at the tip of any ref. * sg/archive-restrict-remote: add uploadarchive.allowUnreachable option docs: clarify remote restrictions for git-upload-archive
2014-03-14Merge branch 'da/difftool-git-files'Libravatar Junio C Hamano1-0/+14
"git difftool" misbehaved when the repository is bound to the working tree with the ".git file" mechanism, where a textual file ".git" tells us where it is. * da/difftool-git-files: t7800: add a difftool test for .git-files difftool: support repositories with .git-files
2014-03-14Merge branch 'tg/index-v4-format'Libravatar Junio C Hamano4-0/+89
* tg/index-v4-format: read-cache: add index.version config variable test-lib: allow setting the index format version introduce GIT_INDEX_VERSION environment variable
2014-03-14Merge branch 'jk/remote-pushremote-config-reading'Libravatar Junio C Hamano1-0/+13
"git push" did not pay attention to branch.*.pushremote if it is defined earlier than remote.pushdefault; the order of these two variables in the configuration file should not matter, but it did by mistake. * jk/remote-pushremote-config-reading: remote: handle pushremote config in any order
2014-03-14Merge branch 'jk/commit-dates-parsing-fix'Libravatar Junio C Hamano2-0/+59
Tighten codepaths that parse timestamps in commit objects. * jk/commit-dates-parsing-fix: show_ident_date: fix tz range check log: do not segfault on gmtime errors log: handle integer overflow in timestamps date: check date overflow against time_t fsck: report integer overflow in author timestamps t4212: test bogus timestamps with git-log
2014-03-14Merge branch 'jh/note-trees-record-blobs'Libravatar Junio C Hamano1-0/+27
"git notes -C <blob>" should not take an object that is not a blob. * jh/note-trees-record-blobs: notes: disallow reusing non-blob as a note object
2014-03-14Merge branch 'nd/no-more-fnmatch'Libravatar Junio C Hamano1-13/+0
We started using wildmatch() in place of fnmatch(3); complete the process and stop using fnmatch(3). * nd/no-more-fnmatch: actually remove compat fnmatch source code stop using fnmatch (either native or compat) Revert "test-wildmatch: add "perf" command to compare wildmatch and fnmatch" use wildmatch() directly without fnmatch() wrapper