summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-03-22t9100, t9129: Use prerequisite tags for UTF-8 testsLibravatar Johannes Sixt2-31/+28
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-22t5302: Use prerequisite tags to skip 64-bit offset testsLibravatar Johannes Sixt1-10/+5
The effects of this patch can be tested on Linux by commenting out #define _FILE_OFFSET_BITS 64 in git-compat-util.h. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-22Skip tests that fail if the executable bit is not handled by the filesystemLibravatar Johannes Sixt5-20/+42
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-22t3600: Use test prerequisite tagsLibravatar Johannes Sixt1-28/+30
There are two prerequisites: - The filesystem supports names with tabs or new-lines. - Files cannot be removed if their containing directory is read-only. Previously, whether these preconditions are satisified was tested inside test_expect_success. We move these tests outside because, strictly speaking, they are not part of the tests. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-21test-lib: Infrastructure to test and check for prerequisitesLibravatar Johannes Sixt2-5/+54
Some tests can be run only if a particular prerequisite is available. For example, some tests require that an UTF-8 locale is available. Here we introduce functions that are used in this way: 1. Insert code that checks whether the prerequisite is available. If it is, call test_set_prereq with an arbitrary tag name that subsequently can be used to check for the prerequisite: case $LANG in *.utf-8) test_set_prereq UTF8 ;; esac 2. In the calls to test_expect_success pass the tag name: test_expect_success UTF8 '...description...' '...tests...' 3. There is an auxiliary predicate that can be used anywhere to test for a prerequisite explicitly: if test_have_prereq UTF8 then ...code to be skipped if prerequisite is not available... fi Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19t0050: Check whether git init detected symbolic link support correctlyLibravatar Johannes Sixt1-2/+26
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19Tests on Windows: $(pwd) must return Windows-style pathsLibravatar Johannes Sixt3-3/+7
Many tests pass $(pwd) in some form to git and later test that the output of git contains the correct value of $(pwd). For example, the test of 'git remote show' sets up a remote that contains $(pwd) and then the expected result must contain $(pwd). Again, MSYS-bash's path mangling kicks in: Plain $(pwd) uses the MSYS style absolute path /c/path/to/git. The test case would write this name into the 'expect' file. But when git is invoked, MSYS-bash converts this name to the Windows style path c:/path/to/git, and git would produce this form in the result; the test would fail. We fix this by passing -W to bash's pwd that produces the Windows-style path. There are a two cases that need an accompanying change: - In t1504 the value of $(pwd) becomes part of a path list. In this case, the lone 'c' in something like /foo:c:/path/to/git:/bar inhibits MSYS-bashes path mangling; IOW in this case we want the /c/path/to/git form to allow path mangling. We use $PWD instead of $(pwd), which always has the latter form. - In t6200, $(pwd) - the Windows style path - must be used to construct the expected result because that is the path form that git sees. (The change in the test itself is just for consistency: 'git fetch' always sees the Windows-style path, with or without the change.) Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19test-lib: Work around missing sum on WindowsLibravatar Johannes Sixt1-0/+3
t1002-read-tree-m-u-2way.sh uses 'sum', but it does not rely on the exact form of the sum, only that it is a hash digest. Therefore, we can sneak in 'md5sum' under the name 'sum'. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19test-lib: Work around incompatible sort and find on WindowsLibravatar Johannes Sixt1-0/+13
If the PATH lists the Windows system directories before the MSYS directories, Windows's own incompatible sort and find commands would be picked up. We implement these commands as functions and call the real tools by absolute path. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19t5602: Work around path mangling on MSYSLibravatar Johannes Sixt1-2/+2
MSYS's bash rewrites /something/bin/... into a Windows path that looks like c:/msysgit/something/bin/... before git sees it. But later the test case verifies that the path was used and compares it to the unmangled version. This fails, of course. This make the path relative so that the path mangling is not triggered. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19t5300, t5302, t5303: Do not use /dev/zeroLibravatar Johannes Sixt3-15/+16
We do not have /dev/zero on Windows. This replaces it by data generated with printf, perl, or echo. Most of the cases do not depend on that the data is a stream of zero bytes, so we use something printable; nor is an unlimited stream of data needed, so we produce only as many bytes as the test cases need. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19t2200, t7004: Avoid glob pattern that also matches filesLibravatar Johannes Sixt2-3/+4
On Windows, there is an unfortunate interaction between the MSYS bash and git's command line processing: - Since Windows's CMD does not do the wildcard expansion, but passes arguments like path* through to the programs, the programs must do the expansion themselves. This happens in the startup code before main() is entered. - bash, however, passes the argument "path*" to git, assuming that git will see the unquoted word unchanged as a single argument. But actually git expands the unquoted word before main() is entered. In t2200, not all names that the test case is interested in exist as files at the time when 'git ls-files' is invoked. git expands "path?" to only the subset of files the exist, and only that subset was listed, so that the test failed. We now list all interesting paths explicitly. In t7004, git exanded the pattern "*a*" to "actual" (the file that stdout was redirected to), which is not what the was tested for. We fix it by renaming the output file (and removing any existing files matching *a*). This was originally fixed by Johannes Schindelin. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19t7300: fix clean up on WindowsLibravatar Johannes Schindelin1-3/+3
On Windows, you cannot remove files that are in use, not even with 'rm -rf'. So we need to run 'exec <foo/bar' inside a subshell lest removing the whole test repository fail. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19test-lib: Introduce test_chmod and use it instead of update-index --chmodLibravatar Johannes Sixt7-43/+24
This function replaces sequences of 'chmod +x' and 'git update-index --chmod=+x' in the test suite, whose purpose is to help filesystems that need core.filemode=false. Two places where only 'chmod +x' was used we also use this new function. The function calls 'git update-index --chmod' without checking core.filemode (unlike some of the call sites did). We do this because the call sites *expect* that the executable bit ends up in the index (ie. it is not the purpose of the call sites to *test* whether git treats 'chmod +x' and 'update-index --chmod=+x' correctly). Therefore, on filesystems with core.filemode=true the 'git update-index --chmod' is a no-op. The function uses --add with update-index to help one call site in t6031-merge-recursive. It makes no difference for the other callers. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19test-lib: Simplify test counting.Libravatar Johannes Sixt3-11/+5
Since the test case counter was incremented very late, there were a few users of the counter had to do their own incrementing. Now we increment it early and simplify these users. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19test-lib: Replace uses of $(expr ...) by POSIX shell features.Libravatar Johannes Sixt1-12/+11
In particular: - Test case counting can be achieved by arithmetic expansion. - The name of the test, e.g. t1234, can be computed with ${0%%} and ${0##}. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19Call 'say' outside test_expect_successLibravatar Johannes Sixt3-19/+22
There were some uses of 'say' inside test_expect_success. But if the tests were not run in verbose mode, this message went to /dev/null. Pull them out of test_expect_success. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-19test suite: Use 'say' to say something instead of 'test_expect_success'Libravatar Johannes Sixt10-15/+15
Some tests report that some tests will be skipped. They used 'test_expect_success' with a trivially successful test. Nowadays we have the helper function 'say' for this purpose. In on case, 'say_color skip' is replaced by 'say' because the former is not intended as a public API. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-18t9400, t9401: Do not force hard-linked cloneLibravatar Johannes Sixt2-3/+3
The tests do not depend on that the clones are hard-linked, but used --local only as an optimization: At the time that --local was used first in t9400 hard-linked clones were not the default, yet. By removing --local, we help filesystems that do not support hard-links. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2009-03-17Update draft release notes to 1.6.3Libravatar Junio C Hamano1-3/+32
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17Merge branch 'jc/maint-1.6.0-read-tree-overlay'Libravatar Junio C Hamano2-3/+34
* jc/maint-1.6.0-read-tree-overlay: read-tree A B C: do not create a bogus index and do not segfault
2009-03-17Merge branch 'db/maint-missing-origin'Libravatar Junio C Hamano3-8/+20
* db/maint-missing-origin: Remove total confusion from git-fetch and git-push Give error when no remote is configured
2009-03-17Merge branch 'js/sideband-stderr'Libravatar Junio C Hamano5-17/+26
* js/sideband-stderr: winansi: support ESC [ K (erase in line) recv_sideband: Bands #2 and #3 always go to stderr
2009-03-17Merge branch 'js/rsync-local'Libravatar Junio C Hamano2-27/+35
* js/rsync-local: rsync transport: allow local paths, and fix tests
2009-03-17Merge branch 'rs/color-grep'Libravatar Junio C Hamano5-42/+205
* rs/color-grep: grep: prefer builtin over external one when coloring results grep: cast printf %.*s "precision" argument explicitly to int grep: add support for coloring with external greps grep: color patterns in output grep: add pmatch and eflags arguments to match_one_pattern() grep: remove grep_opt argument from match_expr_eval() grep: micro-optimize hit collection for AND nodes
2009-03-17Merge branch 'js/remote-improvements'Libravatar Junio C Hamano17-330/+820
* js/remote-improvements: (23 commits) builtin-remote.c: no "commented out" code, please builtin-remote: new show output style for push refspecs builtin-remote: new show output style remote: make guess_remote_head() use exact HEAD lookup if it is available builtin-remote: add set-head subcommand builtin-remote: teach show to display remote HEAD builtin-remote: fix two inconsistencies in the output of "show <remote>" builtin-remote: make get_remote_ref_states() always populate states.tracked builtin-remote: rename variables and eliminate redundant function call builtin-remote: remove unused code in get_ref_states builtin-remote: refactor duplicated cleanup code string-list: new for_each_string_list() function remote: make match_refs() not short-circuit remote: make match_refs() copy src ref before assigning to peer_ref remote: let guess_remote_head() optionally return all matches remote: make copy_ref() perform a deep copy remote: simplify guess_remote_head() move locate_head() to remote.c move duplicated ref_newer() to remote.c move duplicated get_local_heads() to remote.c ... Conflicts: builtin-clone.c
2009-03-17Merge branch 'tr/maint-1.6.0-send-email-irt'Libravatar Junio C Hamano2-1/+12
* tr/maint-1.6.0-send-email-irt: send-email: test --no-thread --in-reply-to combination send-email: respect in-reply-to regardless of threading Conflicts: t/t9001-send-email.sh
2009-03-17Merge branch 'kb/checkout-optim'Libravatar Junio C Hamano15-170/+296
* kb/checkout-optim: Revert "lstat_cache(): print a warning if doing ping-pong between cache types" checkout bugfix: use stat.mtime instead of stat.ctime in two places Makefile: Set compiler switch for USE_NSEC Create USE_ST_TIMESPEC and turn it on for Darwin Not all systems use st_[cm]tim field for ns resolution file timestamp Record ns-timestamps if possible, but do not use it without USE_NSEC write_index(): update index_state->timestamp after flushing to disk verify_uptodate(): add ce_uptodate(ce) test make USE_NSEC work as expected fix compile error when USE_NSEC is defined check_updates(): effective removal of cache entries marked CE_REMOVE lstat_cache(): print a warning if doing ping-pong between cache types show_patch_diff(): remove a call to fstat() write_entry(): use fstat() instead of lstat() when file is open write_entry(): cleanup of some duplicated code create_directories(): remove some memcpy() and strchr() calls unlink_entry(): introduce schedule_dir_for_removal() lstat_cache(): swap func(length, string) into func(string, length) lstat_cache(): generalise longest_match_lstat_cache() lstat_cache(): small cleanup and optimisation
2009-03-17grep: prefer builtin over external one when coloring resultsLibravatar Nguyễn Thái Ngọc Duy1-0/+2
As far as I know, not all grep programs support coloring, so we should rely on builtin grep. If you want external grep, set color.grep.external to empty string. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17config.txt: Describe special 'none' handling in core.gitProxy.Libravatar Emil Sit1-0/+5
Signed-off-by: Emil Sit <sit@emilsit.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17ls-files: require worktree when --deleted is givenLibravatar Jeff King1-0/+1
The code will end up calling lstat() to check whether the file still exists; obviously this doesn't work if we're not in the worktree. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17git-branch.txt: document -f correctlyLibravatar Michael J Gruber1-2/+2
'git branch -f a b' resets a to b when a exists, rather then deleting a. Say so in the documentation. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17pickaxe: count regex matches only onceLibravatar René Scharfe1-2/+4
When --pickaxe-regex is used, forward past the end of matches instead of advancing to the byte after their start. This way matches count only once, even if the regular expression matches their tail -- like in the fixed-string fork of the code. E.g.: /.*/ used to count the number of bytes instead of the number of lines. /aa/ resulted in a count of two in "aaa" instead of one. Also document the fact that regexec() needs a NUL-terminated string as its second argument by adding an assert(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17git-send-email.txt: describe --compose betterLibravatar Stephen Boyd1-7/+6
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17Tests: use test_cmp instead of diff where possibleLibravatar Miklos Vajna7-24/+24
Several old tests were written before test_cmp was introduced, convert these to test_cmp. If were are at it, fix the order of the arguments where necessary to make expected come first, so the command shows how the test result deviates from the correct output. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17Documentation: remove extra quoting/emphasis around literal textsLibravatar Chris Johnsen7-37/+37
If literal text (asciidoc `...`) can be rendered in a differently from normal text for each output format (man, HTML), then we do not need extra quotes or other wrapping around inline literal text segments. config.txt Change '`...`' to `...`. In asciidoc, the single quotes provide emphasis, literal text should be distintive enough. Change "`...`" to `...`. These double quotes do not work if present in the described config value, so drop them. git-checkout.txt Change "`...`" to `...` or `"..."`. All instances are command line argument examples. One "`-`" becomes `-`. Two others are involve curly braces, so move the double quotes inside the literal region to indicate that they might need to be quoted on the command line of certain shells (tcsh). git-merge.txt Change "`...`" to `...`. All instances are used to describe merge conflict markers. The quotes should are not important. git-rev-parse.txt Change "`...`" to `...`. All instances are around command line arguments where no in-shell quoting should be necessary. gitcli.txt Change `"..."` to `...`. All instances are around command line examples or single command arguments. They do not semanticly belong inside the literal text, and they are not needed outside it. glossary-content.txt user-manual.txt Change "`...`" to `...`. All instances were around command lines. Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17git-push.txt: describe how to default to pushing only current branchLibravatar Chris Johnsen1-2/+24
Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17disable post-checkout test on CygwinLibravatar Alex Riesen1-0/+2
It is broken because of the tricks we have to play with lstat to get the bearable perfomance out of the call. Sadly, it disables access to Cygwin's executable attribute, which Windows filesystems do not have at all. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17Revert "lstat_cache(): print a warning if doing ping-pong between cache types"Libravatar Kjetil Barvik1-23/+0
This reverts commit 7734f04873cfaddd0b148074a633f1f824fd961f. I guess that the reverted commit, 7734f048, has been in test long enough, and should now be reverted. I have not received any info regarding any debug output of the reverted commit, so lets hope that the lstat_cache() function do not cause any ping-pong. Signed-off-by: Kjetil Barvik <barvik@broadpark.no> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17MinGW: a hardlink implementationLibravatar Petr Kodl2-2/+22
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-17MinGW: a helper function that translates Win32 API error codesLibravatar Petr Kodl1-0/+113
This function translates many possible Win32 error codes to suitable errno numbers. We will use it in our wrapper functions that need to call into Win32. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-16Remove total confusion from git-fetch and git-pushLibravatar Junio C Hamano1-18/+3
The config file is not the only place remotes are defined, and without consulting .git/remotes and .git/branches, you won't know if "origin" is configured by the user. Don't give up too early and insult the user with a wisecrack "Where do you want to fetch from today?" The only thing the previous patch seems to want to prevent from happening is a lazy "git fetch/push" that does not say where-from/to to produce an error message 'origin not found', and we can do that by not letting add_url_alias() to turn a nickname "origin" literally into a pathname "origin" without changing the rest of the logic. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-15Fix various dead stores found by the clang static analyzerLibravatar Benjamin Kramer5-14/+8
http-push.c::finish_request(): request is initialized by the for loop index-pack.c::free_base_data(): b is initialized by the for loop merge-recursive.c::process_renames(): move compare to narrower scope, and remove unused assignments to it remove unused variable renames2 xdiff/xdiffi.c::xdl_recs_cmp(): remove unused variable ec xdiff/xemit.c::xdl_emit_diff(): xche is always overwritten Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-15Sync with GIT 1.6.2.1Libravatar Junio C Hamano3-8/+3
2009-03-15GIT 1.6.2.1Libravatar Junio C Hamano2-7/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-15checkout bugfix: use stat.mtime instead of stat.ctime in two placesLibravatar Kjetil Barvik2-3/+3
Commit e1afca4fd "write_index(): update index_state->timestamp after flushing to disk" on 2009-02-23 used stat.ctime to record the timestamp of the index-file. This is wrong, so fix this and use the correct stat.mtime timestamp instead. Commit 110c46a909 "Not all systems use st_[cm]tim field for ns resolution file timestamp" on 2009-03-08, has a similar bug for the builtin-fetch-pack.c file. Signed-off-by: Kjetil Barvik <barvik@broadpark.no> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-14test-lib: write test results to test-results/<basename>-<pid>Libravatar Johannes Schindelin1-1/+1
The earlier code meant to attempt to strip everything except the test number, but only stripped the part starting with the last dash. However, there is no reason why we should not use the whole basename. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-14Remove unused assignmentsLibravatar Benjamin Kramer8-10/+4
These variables were always overwritten or the assigned value was unused: builtin-diff-tree.c::cmd_diff_tree(): nr_sha1 builtin-for-each-ref.c::opt_parse_sort(): sort_tail builtin-mailinfo.c::decode_header_bq(): in builtin-shortlog.c::insert_one_record(): len connect.c::git_connect(): path imap-send.c::v_issue_imap_cmd(): n pretty.c::pp_user_info(): filler remote::parse_refspec_internal(): llen Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-14test-suite: Make test script numbers uniqueLibravatar Johannes Sixt9-0/+0
In order to selectively skip tests, the environment variable GIT_SKIP_TESTS can be set like this: $ GIT_SKIP_TESTS='t1301 t4150.18' make test That is, its value can contain only the test script numbers, but not the full script name. Therefore, it is important that the test scripts are uniquely numbered. This makes it so. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-12Merge branch 'maint'Libravatar Junio C Hamano0-0/+0
* maint: