aboutsummaryrefslogtreecommitdiffstats
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2005-10-09Also force LC_ALL in test scripts.Junio C Hamano1-1/+2
Noticed by Junichi Uekawa. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-07Fix wrong filename listing bug in git-ls-tree.robfitz@273k.net1-0/+160
This patch fixes a bug in git-ls-tree in which the wrong filenames are listed if the exact same file and directory contents are present in another location in the tree. Added a new series of test cases for directory and filename handling. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-02[PATCH] Teach git-ls-files about '--' to denote end of options.Fredrik Kuivinen1-0/+69
Useful if you have a file whose name starts with a dash. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-01More portability.Junio C Hamano3-19/+17
- The location of openssl development files got customizable. - The location of iconv development files got customizable. - Pass $TAR down to t5000 test so that the user can override with 'gmake TAR=gtar'. - Solaris 'bc' does not seem to grok "define abs()". There is no reason to use bc there -- expr would do. Signed-off-by: Junio C Hamano <junio@twinsun.com>
2005-10-01Add git-symbolic-refJunio C Hamano1-3/+3
This adds the counterpart of git-update-ref that lets you read and create "symbolic refs". By default it uses a symbolic link to represent ".git/HEAD -> refs/heads/master", but it can be compiled to use the textfile symbolic ref. The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah .git/HEAD' have been converted to use new git-symbolic-ref command, so that they can deal with either implementation. Signed-off-by: Junio C Hamano <junio@twinsun.com>
2005-09-28Update the case table in t/t1000.Junio C Hamano1-31/+12
It still talked about "the proposed alternative semantics" but we have used those alternative semantics for quite some time. Update them to avoid confusion. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-27[PATCH] Make the test more shell generic and fix missing Solaris find optionPeter Eriksen2-2/+3
This is from Peter Eriksen, but further fixed. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-22Retire diff-helper.Junio C Hamano3-169/+0
The textual diff generation with built-in '-p' in diff-* brothers has proven to be useful enough that git-diff-helper outlived its usefulness. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-20Show modified files in git-ls-filesJunio C Hamano1-3/+38
Add -m/--modified to show files that have been modified wrt. the index. [jc: The original came from Brian Gerst on Sep 1st but it only checked if the paths were cache dirty without actually checking the files were modified. I also added the usage string and a new test.] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-17Fix typo in test comment.Junio C Hamano1-1/+1
I do not know why it was spelled git-rev-tree when I meant to say git-read-tree, but the typo was left since day one. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10[PATCH] Add debugging help for case #16 to read-tree.cJunio C Hamano1-0/+16
This will help us detect if real-world example merges have multiple merge-base candidates and one of them matches one head while another matches the other head. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10[PATCH] Rewrite read-treeDaniel Barkalow1-422/+0
Adds support for multiple ancestors, removes --emu23, much simplification. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-09Retire support for old environment variables.Junio C Hamano2-216/+0
We have deprecated the old environment variable names for quite a while and now it's time to remove them. Gone are: SHA1_FILE_DIRECTORIES AUTHOR_DATE AUTHOR_EMAIL AUTHOR_NAME COMMIT_AUTHOR_EMAIL COMMIT_AUTHOR_NAME SHA1_FILE_DIRECTORY Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-08'build' scripts before installing.Junio C Hamano3-7/+7
Earlier we renamed git-foo.sh to git-foo while installing, which was mostly done by inertia than anything else. This however made writing tests to use scripts harder. This patch builds the scripts the same way as we build binaries from their sources. As a side effect, you can now specify non-standard paths you have your Perl binary is in when running the make. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07[PATCH] Do not create bogus branch from flag to git branchAmos Waterland1-0/+27
If you run `git branch --help', you will unexpectedly have created a new branch named "--help". This simple patch adds logic and a usage statement to catch this and similar problems, and adds a testcase for it. Signed-off-by: Amos Waterland <apw@rossby.metr.ou.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07Big tool rename.Junio C Hamano36-321/+321
As promised, this is the "big tool rename" patch. The primary differences since 0.99.6 are: (1) git-*-script are no more. The commands installed do not have any such suffix so users do not have to remember if something is implemented as a shell script or not. (2) Many command names with 'cache' in them are renamed with 'index' if that is what they mean. There are backward compatibility symblic links so that you and Porcelains can keep using the old names, but the backward compatibility support is expected to be removed in the near future. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-04Add copy/rename check for git-apply.Junio C Hamano1-0/+148
The new test pattern is taken from HPA's klibc and klibc-kbuild trees, which has many interesting renames (the commits 001eef5a19219e5b0601068a3d13874b88c0653e and 0037d1bc0deaf7daec3778496656cb04b4e4b9d0). The test pattern exposes problems in the apply.c changes currently in the proposed updates branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-28[PATCH] New git-apply test cases for scanning forwards and backwards.Robert Fitzsimons1-0/+101
Added a new test case for the scanning forwards and backwards for the correct location to apply a patch fragment. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-28[PATCH] New git-apply test cases for patches with mulitple fragments.Robert Fitzsimons1-0/+176
Added a test case for patches with multiple fragments. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-20Create objects/info/ directory in init-db.Junio C Hamano1-3/+4
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-17[PATCH] When copying or renaming, keep the mode, pleaseJohannes Schindelin1-0/+37
Without this patch, git-apply does not retain the mode when renaming or copying files. [jc: Good catch, Johannes. I added a test case to demonstrate the breackage in the original.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-13[PATCH] fix null TZ problems on os/xBrad Roberts2-3/+3
It seems that the localtime() libc routine doesn't care for finding a TZ that's empty. It's ok with TZ not being set. Setting the TZ to GMT allowed these tests to pass. $ uname -v Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Signed-off-by: Brad Roberts <braddr@puremagic.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-11[PATCH] Trapping exit in tests, using return for errors: further fixes.Pavel Roskin1-3/+5
"return" from a test would leave the exit trap set, which could cause a spurious error message if it's the last test in the script or --immediate is used. The easiest solution would be to have a global trap that is set when test-lib.sh is sourced and unset either by test_done(), error() or by test_failure_() with --immediate. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-11[PATCH] Trapping exit in tests, using return for errorsPavel Roskin7-28/+39
I have noticed that "make test" fails without any explanations when the "merge" utility is missing. I don't think tests should be silent in case of failure. It turned out that the particular test was using "exit" to interrupt the test in case of an error. This caused the whole test script to exit. No further tests would be run even if "--immediate" wasn't specified. No error message was printed. This patch does following: All instances of "exit", "exit 1" and "(exit 1)" in tests have been replaced with "return 1". In fact, "(exit 1)" had no effect. File descriptor 5 is duplicated from file descriptor 1. This is needed to print important error messages from tests. New function test_run_() has been introduced. Any "return" in the test would merely cause that function to return without skipping calls to test_failure_() and test_ok_(). The new function also traps "exit" and treats it like a fatal error (in case somebody reintroduces "exit" in the tests). test_expect_failure() and test_expect_success() check both the result of eval and the return value of test_run_(). If the later is not 0, it's always a failure because it indicates the the test didn't complete. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-11[PATCH] Need to set PAGER in testsPavel Roskin1-1/+2
"t5400-send-pack.sh --verbose" stops waiting for user input. It happens because "git log" uses less for output now. To prevent this, PAGER should be set to cat. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-11[PATCH] Missing test_donePavel Roskin4-0/+7
All test scripts should end with test_done, which reports the test results. In the future, it could be used for other purposes, e.g. to distinguish graceful end from "exit" in a test. This patch fixes scripts that don't call test_done. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-11String comparison of test is done with '=', not '=='.Junio C Hamano1-4/+4
Caught this during a test setting /bin/sh to (d)ash. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-10[PATCH] Fix git-rev-parse's parent handlingJohannes Schindelin1-0/+33
git-rev-parse HEAD^1 would fail, because of an off-by-one bug (but HEAD^ would yield the expected result). Also, when the parent does not exist, do not silently return an incorrect SHA1. Of course, this no longer applies to git-rev-parse alone, but every user of get_sha1(). While at it, add a test. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-29Skip --merge-order test when built with NO_OPENSSLJunio C Hamano1-0/+7
When built with NO_OPENSSL, rev-list --merge-order does not work, causing t6001 test to fail. Detect that and skip this test to allow continuing to the rest of the tests. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-29Documentation and tests: ls-files exclude pattern.Junio C Hamano1-5/+18
Update the tests and documentation to match the new "last one determines its fate" semantics. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-29[PATCH] support bc version 1.04Johannes Schindelin1-2/+6
Test t6002 unnecessarily fails when bc is a bit older than average. Signed-off-by: Johannes.Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-26Fix potential send-pack SIGSEGVLinus Torvalds1-0/+54
The check that the source is ahead of the destination incorrectly expects pop_most_recent_commit() to gracefully handle an empty list. Fix by just checking the list itself, rather than the return value of the pop function. [jc: I did the test script that demonstrated the problem] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-26Adjust diff-raw tests to the status letter change.Junio C Hamano18-34/+34
We use 'A' for added files instead of 'N' to make the it visually easier to distinguish from 'M' now. While we are at it, make the test scripts executable. Yes, I know it does not matter because t/Makefile runs them explicitly with "sh tXXXX-blah.sh", but being consistent is always better. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-25git-ls-files: --exclude mechanism updates.Junio C Hamano1-0/+55
Add --exclude-per-directory=<name> option that specifies a file to contain exclude patterns local to that directory and its subdirectories. Update the exclusion logic to be able to say "include files that match this more specific pattern, even though later exclude patterns may match them". Also enhances that a pattern can contain '/' in which case fnmatch is called with FNM_PATHNAME flag to match the entire path. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-22[PATCH] Test framework: prettyprint the failed command.Junio C Hamano1-1/+3
The output from a failure case had the test description message and the first line of the actual test script concatenated on the same line, which was ugly. Correct the output routine a bit to make it more readable. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-22[PATCH] apply.c: handle incomplete lines correctly.Junio C Hamano1-0/+32
The parsing code had a bug that failed to recognize an incomplete line at the end of a fragment, and the fragment application code had a comparison bug to recognize such. Fix them to handle incomplete lines correctly. Add a test script for patches with various combinations of complete and incomplete lines to make sure the fix works. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07[PATCH] Prevent t6000 series from dropping useless sed.script in t/Junio C Hamano5-3/+11
The Makefile in the test suite directory considers any file matching t[0-9][0-9][0-9][0-9]-*.sh as the top-level test script to be executed. Unfortunately this was not documented, and the common test library, t6000-lib.sh was named to match that pattern. This caused t6000-lib.sh to be called from Makefile as the top-level program, causing it to leave t/sed.script file behind. Rename it to t6000lib.sh to prevent this, and document the naming convention a bit more clearly. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Write sed script directly into temp file, rather than a variableJon Seymour4-33/+7
When sed uses \n rather than ; as a separator (for BSD sed(1) compat), it is cleaner to use a file directly, rather than an environment variable containing \n characters. This change changes t/t6000 write to sed.script directly and changes the other tests to remove knowledge of sed.script. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Add t/t6003 with some --topo-order testsJon Seymour1-0/+417
Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Add a t/t6001 test case for a --merge-order bugJon Seymour1-0/+20
This test case demonstrates a problem with --merge-order. A | B |\ C D |/ E | F git-rev-list --merge-order A B doesn't produce the expected output of A B D C E F The problem is fixed by a subsequent patch. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Change the sed seperator in t/t6000-lib.sh.Jon Seymour1-1/+3
This trivial patch removes the semicolon as the sed seperator in the t/t6000-lib.sh test script and replaces it with white space. This makes BSD sed(1) much happier. Signed-off-by: Mark Allen <mrallen1@yahoo.com> Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Introduce unit tests for git-rev-list --bisectJon Seymour1-0/+247
This patch introduces some unit tests for the git-rev-list --bisect functionality. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06[PATCH] Factor out useful test case infrastructure from t/t6001... into ↵Jon Seymour2-111/+106
t/t6000-lib.sh Functions that are useful to other t6xxx testcases are moved into t6000-lib.sh To use these functions in a test case, use a test-case pre-amble like: . ./test-lib.sh . ../t6000-lib.sh # t6xxx specific functions Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-04[PATCH] Fixup t/t5300 unit tests broken by ↵Jon Seymour1-15/+15
5f3de58ff85c49620ae2a1722d8d4d37c881a054 This patch fixes up the t/t5300 unit tests which were broken by the changes in: Make the name of a pack-file depend on the objects packed there-in. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Remove unnecessary sort from t6001 testcaseJon Seymour1-8/+8
This patch removes an unnecessary sort from the t6001 testcase. Sorts were previously necessary when testing non --merge-order cases because the output order wasn't entirely deterministic unless commit date was fixed. However, commit dates are now fixed, so the need for a sort has disappeared. So the sort has been removed. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Fix broken t6001 test caseJon Seymour1-3/+3
This fix fixes a t/t6001 test case break that was hidden by a bug in the test case infrastructure. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Demonstrate broken t6001 test case functionJon Seymour1-3/+2
Junio discovered a problem where an actual test case break was hidden because pipelines are not handled properly by the test infrastructure in t6001. This patch fixes the broken infrastructure (and demonstrates the break explicitly). A subsequent patch in this series will fix the test case so that it doesn't fail. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Fix for git-rev-list --merge-order B ^A (A,B share common base) [rev 2]Jon Seymour1-6/+6
This patch makes --merge-order produce the same list as git-rev-list without --merge-order specified. In particular, if the graph looks like this: A | B |/ C | D The both git-rev-list B ^A and git-rev-list --merge-order will produce B. The unit tests have been changed to reflect the fact that the prune points are now formally part of the start list that is used to perform the --merge-order sort. That is: git-rev-list --merge-order A ^D used to produce = A | C It now produces: ^ A | C Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Test case that demonstrates problem with --merge-order ^ processingJon Seymour1-0/+5
Added a test case that shows that --merge-order doesn't produce the correct result in the following case. A | | B |/ C | D git-rev-list --merge-order A ^B should produce just A. Instead it produces BCD. A subsequent patch will fix this defect. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Adjust t5300 test for unpack-objects changeJunio C Hamano1-2/+4
It now always read from standard input and rejects non-flag arguments. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-29[PATCH] Add git-verify-pack command.Junio C Hamano1-0/+38
Given a list of <pack>.idx files, this command validates the index file and the corresponding .pack file for consistency. This patch also uses the same validation mechanism in fsck-cache when the --full flag is used. During normal operation, sha1_file.c verifies that a given .idx file matches the .pack file by comparing the SHA1 checksum stored in .idx file and .pack file as a minimum sanity check. We may further want to check the pack signature and version when we map the pack, but that would be a separate patch. Earlier, errors to map a pack file was not flagged fatal but led to a random fatal error later. This version explicitly die()s when such an error is detected. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27Fix another test that broke with the recent git-init-db updateLinus Torvalds1-1/+0
t5300-pack-object.sh test 8 expected to have to create the "pack" directory itself, and was unhappy when it already existed.
2005-06-27[PATCH] replace sha1sum with sum in t/t1002Mark Allen1-15/+32
This replaces sha1sum(1) with sum(1) in t/t1002. GNU sum(1) runs in "BSD compatibility" mode by default, and not all systems have GNU coreutils. On any system without GNU coreutils (or sha1sum) t1002 will fail. This patch should make t1002 complete successfully everywhere that sum(1) runs. I've tested this on Darwin and Linux; it works on both platforms. Signed-off-by: Mark Allen <mrallen1@yahoo.com> Acked-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27Fix up test that counted subdirectories in ".git/objects"Linus Torvalds1-3/+3
Now there are 257 of them (256 numeric ones, and the new "pack" directory)
2005-06-27[PATCH] Teach read_sha1_file() and friends about packed git object store.Junio C Hamano1-2/+46
GIT_OBJECT_DIRECTORY and GIT_ALTERNATE_OBJECT_DIRECTORIES can have the "pack" subdirectory that houses "packed GIT" files produced by git-pack-objects (e.g. .git/objects/pack/foo.pack and .git/objects/pack/foo.idx; always store them as pairs). The following functions in sha1_file.c can then read object contents from such packed file: - sha1_object_info() - has_sha1_file() - read_sha1_file() Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27[PATCH] Remove "delta" object representation.Junio C Hamano1-79/+0
Packed delta files created by git-pack-objects seems to be the way to go, and existing "delta" object handling code has exposed the object representation details to too many places. Remove it while we refactor code to come up with a proper interface in sha1_file.c. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-26[PATCH] Finish initial cut of git-pack-object/git-unpack-object pair.Junio C Hamano1-0/+85
This finishes the initial round of git-pack-object / git-unpack-object pair. They are now good enough to be used as a transport medium: - Fix delta direction in pack-objects; the original was computing delta to create the base object from the object to be squashed, which was quite unfriendly for unpacker ;-). - Add a script to test the very basics. - Implement unpacker for both regular and deltified objects. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25[PATCH] Fix oversimplified optimization for add_cache_entry().Junio C Hamano1-5/+20
An earlier change to optimize directory-file conflict check broke what "read-tree --emu23" expects. This is fixed by this commit. (1) Introduces an explicit flag to tell add_cache_entry() not to check for conflicts and use it when reading an existing tree into an empty stage --- by definition this case can never introduce such conflicts. (2) Makes read-cache.c:has_file_name() and read-cache.c:has_dir_name() aware of the cache stages, and flag conflict only with paths in the same stage. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25[PATCH] Add more tests for read-tree --emu23.Junio C Hamano2-14/+150
This adds more tests for --emu23. One is to show how it can carry forward more local changes than the straightforward two-way fast forward, and another is to show the recent overeager optimization of directory/file conflict check broke things, which will be fixed in the next commit. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-22[PATCH] A test case that demonstrates a problem with merges with two roots.Jon Seymour1-0/+61
git-rev-list --merge-order is omitting one of the roots when displaying a merge containing two distinct roots. A subsequent patch will fix the problem. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-22[PATCH] git-apply: tests for --stat and --summary.Junio C Hamano15-0/+2152
This adds tests (which also serves demonstration) for the --stat and --summary flags to the git-apply command. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-19[PATCH] Additional git-rev-list unit tests to demonstrate problems that ↵Jon Seymour1-61/+375
require fixes 1. --merge-order doesn't deal properly with a specified head that has no parent * FAIL 11: head has no parent 2. --merge-order doesn't deal properly with arguments of the form head ^head * FAIL 30: head ^head --merge-order git-rev-list --merge-order --show-breaks a3 ^a3 3. if one of the specified heads is reachable from the other, the head gets printed twice and this causes problems for upcoming versions of gitk. This is true for both --merge-order and non --merge-order style of invocations. * FAIL 24: one specified head reachable from another a4, c3, --merge-order * FAIL 26: one specified head reachable from another a4, c3, no --merge-order * FAIL 27: one specified head reachable from another c3, a4, no --merge-order 4. --merge-order aborts with commits that list the same parent twice...it should handle it more gracefully. * no longer unit testable 5. broken interaction between --merge-order and --max-age previously posted as: "[PATCH 1/2] Test case that demonstrates problem with --merge-order, --max-age interaction" * FAIL 23: --max-age=c3, --merge-order Later patches in this patch set fix these problems. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-19[PATCH] Rework -B output.Junio C Hamano1-21/+15
Patch for a completely rewritten file detected by the -B flag was shown as a pair of creation followed by deletion in earlier versions. This was an misguided attempt to make reviewing such a complete rewrite easier, and unnecessarily ended up confusing git-apply. Instead, show the entire contents of old version prefixed with '-', followed by the entire contents of new version prefixed with '+'. This gives the same easy-to-review for human consumer while keeping it a single, regular modification patch for machine consumption, something that even GNU patch can grok. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-19[PATCH] Make -C less eager.Junio C Hamano4-4/+5
Like diff-tree, this patch makes -C option for diff-* brothers to use only pre-image of modified files as rename/copy detection by default. Give --find-copies-harder to use unmodified files to find copies from as well. This also fixes "diff-files -C" problem earlier noticed by Linus. It was feeding the null sha1 even when the file in the work tree was known to match what is in the index file. This resulted in diff-files showing everything in the project. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-14[PATCH] Unset TZ in t5000Mark Allen1-2/+3
Unset TZ to force GMT in test #4 and add a set of parens around the length function in the awk script. Signed-off-by: Mark Allen <mrallen1@yahoo.com> Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-12[PATCH] read-tree: loosen too strict index requirementsJunio C Hamano1-0/+9
This patch teaches read-tree 3-way merge that, when only "the other tree" changed a path, and if the index file already has the same change, we are not in a situation that would clobber the index and the work tree, and lets the merge succeed; this is case #14ALT in t1000 test. It does not change the result of the merge, but prevents it from failing when it does not have to. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-12[PATCH] Finish making --emu23 equivalent to pure 2-way merge.Junio C Hamano2-16/+36
This adds #3ALT rule (and #2ALT rule for symmetry) to the read-tree 3-way merge logic that collapses paths that are added only in one branch and not in the other internally. This makes --emu23 to succeed in the last remaining case where the pure 2-way merge succeeded and earlier one failed. Running diff between t1001 and t1005 test scripts shows that the only difference between the two is that --emu23 can leave the states into separate stages so that the user can use usual 3-way merge resolution techniques to carry forward the local changes when pure 2-way merge would have refused to run. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-12[PATCH] read-tree: fix too strong index requirement #5ALTJunio C Hamano2-13/+13
This fixes too strong index requirement 3-way merge enforces in one case: the same file is added in both branches. In this case, the original code insisted that if the index file has that path, it must match our branch and be up-to-date. However in this particular case, it only has to match it, and can be dirty. We just need to make sure that we keep the work-tree copy instead of checking out the merge result. The resolution of such a path, however, cannot be left to outside script, because we will not keep the original stage0 entries for unmerged paths when read-tree finishes, and at that point, the knowledge of "if we resolve it to match the new file added in both branches, the merge succeeds and the work tree would not lose information, but we should _not_ update the work tree from the resulting index file" is lost. For this reason, the now code needs to resolve this case (#5ALT) internally. This affects some existing tests in the test suite, but all in positive ways. In t1000 (3-way test), this #5ALT case now gets one stage0 entry, instead of an identical stage2 and stage3 entry pair, for such a path, and one test that checked for merge failure (because the test assumed the "stricter-than-necessary" behaviour) does not have to fail anymore. In t1005 (emu23 test), two tests that involves a case where the work tree already had a change introduced in the upstream (aka "merged head"), the merge succeeds instead of failing. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-12[PATCH] read-tree --emu23.Junio C Hamano1-0/+316
This new flag causes two-way fast forward to internally use the three-way merge mechanism. This behaviour is intended to offer a better fast forward semantics when used in a dirty work tree. The new test t1005 is parallel to the existing t1001 "pure 2-way" tests, but some parts that are commented out would fail. These failures are due to three-way merge enforcing too strict index requirements for cases that could succeed. This problem will be addressed by later patches. Without even changing three-way mechanism, the --emu23 two-way fast forward already gives the user an easier-to-handle merge result when a file that "merged head" updates has local modifications. This is demonstrated as "case 16" test in t1005. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-12[PATCH] Clean up read-tree two-way tests.Junio C Hamano1-35/+42
This is in preparation for "2-way fast-forward emulated with 3-way mechanism" series. It does not change what the tests for pure 2-way do. It only changes how it tests things, to make reviewing of differences of the two tests easier in later steps. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-08[PATCH] Add read-tree -m 3-way merge tests.Junio C Hamano2-12/+366
This adds a set of tests to make sure that requirements on existing cache entries are checked when a read-tree -m 3-way merge is run with an already populated index file. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-08[PATCH] Tests: read-tree -m test updates.Junio C Hamano2-32/+30
This updates t1000 (basic 3-way merge test) to check the merge results for both successful cases (earlier one checked the result for only one of them). Also fixes typos in t1002 that broke '&&' chain, potentially missing a test failure before the chain got broken. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-08[PATCH] three --merge-order bug fixesJon Seymour1-0/+175
This patch fixes three bugs in --merge-order support * mark_ancestors_uninteresting was unnecessarily exponential which caused a problem when a commit with no parents was merged near the head of something like the linux kernel * removed a spurious statement from find_base which wasn't apparently causing problems now, but wasn't correct either. * removed an unnecessarily strict check from find_base_for_list that causes a problem if git-rev-list commit ^parent-of-commit is specified. * added some unit tests which were accidentally omitted from original merge-order patch The fix to mark_ancestors_uninteresting isn't an optimal fix - a full graph scan will still be performed in this case even though it is not strictly required. However, a full graph scan is linear and still no worse than git-rev-list HEAD which runs in less than 2 seconds on a warm cache. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-07[PATCH] read-tree: save more user hassles during fast-forward.Junio C Hamano2-0/+588
This implements the "never lose the current cache information or the work tree state, but favor a successful merge over merge failure" principle in the fast-forward two-tree merge operation. It comes with a set of tests to cover all the cases described in the case matrix found in the new documentation. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05[PATCH] 3-way merge tests for new "git-read-tree -m"?Junio C Hamano1-1/+18
The updated git-tread-tree -m is more strict in that it wants to have the original cache up to date. The initial part of t1000 (merge tests from hell) fails due to it. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05diff 'rename' format change.Linus Torvalds5-10/+10
Clearly even Junio felt git "rename" header lines should say "from/to" instead of "old/new", since he wrote the documentation that way. This way it also matches "copy". git-apply will accept both versions, at least for a while.
2005-06-05[PATCH] pull: gracefully recover from delta retrieval failure.Junio C Hamano1-0/+79
This addresses a concern raised by Jason McMullan in the mailing list discussion. After retrieving and storing a potentially deltified object, pull logic tries to check and fulfil its delta dependency. When the pull procedure is killed at this point, however, there was no easy way to recover by re-running pull, since next run would have found that we already have that deltified object and happily reported success, without really checking its delta dependency is satisfied. This patch introduces --recover option to git-*-pull family which causes them to re-validate dependency of deltified objects we are fetching. A new test t5100-delta-pull.sh covers such a failure mode. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-03[PATCH] git-tar-tree: do only basic tests in t/t5000-git-tar-tree.shRene Scharfe1-20/+7
git-tar-tree: remove tests of long path handling out of t5000-tar-tree.sh and make test script cope with tar programs displaying file modification date as hh:mm (newer variants show it as hh:mm:ss). This makes the test cover only basic functionality that is expected to be handled even by older tar programs. Tests for long filenames (which require pax extended headers) can be added separately. I ran this test successfully with GNU tar 1.13, 1.14 and 1.15.1. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-02[PATCH] git-tar-tree: add a test caseRene Scharfe1-0/+106
add a simple test case. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-31[PATCH] ls-tree: handle trailing slashes in the pathspec properly.Junio C Hamano2-5/+99
This fixes the problem with ls-tree which failed to show "drivers/char" directory when the user asked for "drivers/char/" from the command line. At the same time, if "drivers/char" were a non directory, "drivers/char/" would not show it. This is consistent with the way diffcore-pathspec has been recently fixed. This adds back the diffcore-pathspec test,dropped when my earlier diffcore-pathspec fix was rejected. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-31[PATCH] diff: consolidate test helper script pieces.Junio C Hamano6-83/+43
There were duplicate script pieces to help comparing diff output, which this patch consolidates into the t/diff-lib.sh library. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-30[PATCH] Add -B flag to diff-* brothers.Junio C Hamano1-0/+207
A new diffcore transformation, diffcore-break.c, is introduced. When the -B flag is given, a patch that represents a complete rewrite is broken into a deletion followed by a creation. This makes it easier to review such a complete rewrite patch. The -B flag takes the same syntax as the -M and -C flags to specify the minimum amount of non-source material the resulting file needs to have to be considered a complete rewrite, and defaults to 99% if not specified. As the new test t4008-diff-break-rewrite.sh demonstrates, if a file is a complete rewrite, it is broken into a delete/create pair, which can further be subjected to the usual rename detection if -M or -C is used. For example, if file0 gets completely rewritten to make it as if it were rather based on file1 which itself disappeared, the following happens: The original change looks like this: file0 --> file0' (quite different from file0) file1 --> /dev/null After diffcore-break runs, it would become this: file0 --> /dev/null /dev/null --> file0' file1 --> /dev/null Then diffcore-rename matches them up: file1 --> file0' The internal score values are finer grained now. Earlier maximum of 10000 has been raised to 60000; there is no user visible changes but there is no reason to waste available bits. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-30[PATCH] diff-helper: Fix R/C score parsing under -z flag.Junio C Hamano3-8/+210
The score number that follow R/C status were parsed but the parse pointer was not updated, causing the entire line to become unrecognized. This patch fixes this problem. There was a test missing to catch this breakage, which this commit adds as t4009-diff-rename-4.sh. The diff-raw tests used in related t4005-diff-rename-2.sh (the same test without -z) and t4007-rename-3.sh were stricter than necessarily, despite that the comment for the tests said otherwise. This patch also corrects them. The documentation is updated to say that the status can optionally be followed by a number called "score"; it does not have to stay similarity index forever and there is no reason to limit it only to C and R. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-29[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"Junio C Hamano1-2/+1
This is a complete rewrite of ls-tree to make it behave more like what "/bin/ls -a" does in the current working directory. Namely, the changes are: - Unlike the old ls-tree behaviour that used paths arguments to restrict output (not that it worked as intended---as pointed out in the mailing list discussion, it was quite incoherent), this rewrite uses paths arguments to specify what to show. - Without arguments, it implicitly uses the root level as its sole argument ("/bin/ls -a" behaves as if "." is given without argument). - Without -r (recursive) flag, it shows the named blob (either file or symlink), or the named tree and its immediate children. - With -r flag, it shows the named path, and recursively descends into it if it is a tree. - With -d flag, it shows the named path and does not show its children even if the path is a tree, nor descends into it recursively. This is still request-for-comments patch. There is no mailing list consensus that this proposed new behaviour is a good one. The patch to t/t3100-ls-tree-restrict.sh illustrates user-visible behaviour changes. Namely: * "git-ls-tree $tree path1 path0" lists path1 first and then path0. It used to use paths as an output restrictor and showed output in cache entry order (i.e. path0 first and then path1) regardless of the order of paths arguments. * "git-ls-tree $tree path2" lists path2 and its immediate children but having explicit paths argument does not imply recursive behaviour anymore, hence paths/baz is shown but not paths/baz/b. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-29[PATCH] Move pathspec to the beginning of the diffcore chain.Junio C Hamano1-11/+11
This changes the way how pathspec is used in the three diff-* brothers. Earlier, they tried to grab as much information from the original input and used pathspec to limit the output. This version uses pathspec upfront to narrow the world diffcore operates in, so "git-diff-* <arguments> some-directory" does not look at things outside the specified subtree when finding rename/copy or running pickaxe. Since diff-tree already takes this view and does not feed anything outside the specified directotires to begin with, this patch does not have to touch that command. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-29[PATCH] Fix the way diffcore-rename records unremoved source.Junio C Hamano1-0/+103
Earier version of diffcore-rename used to keep unmodified filepair in its output so that the last stage of the processing that tells renames from copies can make all of rename/copy to copies. However this had a bad interaction with other diffcore filters that wanted to run after diffcore-rename, in that such unmodified filepair must be retained for proper distinction between renames and copies to happen. This patch fixes the problem by changing the way diffcore-rename records the information needed to distinguish "all are copies" case and "the last one is a rename" case. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-26[PATCH] fix and testcase for git-commit-tree optionRene Scharfe1-0/+45
Actually use GIT_COMMITTER_DATE in git-commit-tree. (It used to mistakenly re-use the author date) Add test-case for it. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-26[PATCH] Make ls-* output consistent with diff-* output format.Junio C Hamano3-92/+92
Use SP as the column separator except the ones before path which uses TAB, to make the output format consistent across ls-* and diff-* commands. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-26[PATCH] ls-tree matching multiple pathsJason McMullan1-0/+103
Enhance git-ls-tree to allow optional 'match paths' that restricts the output of git-ls-tree. This is useful to retrieve a single file's SHA1 out of a tree without creating an index. [JC: I added the test case] Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-25[PATCH] Test case portability fix.Mark Allen2-5/+3
This is the remainder of testcase fix by Mark Allen to make them work on his Darwin box. I was using "xargs -r" (GNU) where it was not needed, sed -ne '/^\(author\|committer\)/s|>.*|>|p' where some sed does not know what to do with '\|', and also "cmp - file" to compare standard input with a file, which his cmp does not support. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-25[PATCH] Mode only changes from diff.Junio C Hamano1-0/+34
This fixes another bug. - Mode-only changes were pruned incorrectly from the output. - Added test to catch the above problem. - Normalize rename/copy similarity score in the diff-raw output to per-cent, no matter what scale we internally use. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-25[PATCH] Adjust show-files test for dotfiles.Junio C Hamano1-3/+4
The earlier test was relying on the fact that dotfiles do not appear in the output to prepare expected test results, which inevitably got broken when we started handling dotfiles. Change the test to be honest about what "--other" file it creates. The problem was originally pointed out by Mark Allen. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-24[PATCH] Allow symlinks in the leading path in checkout-cache --prefix=Junio C Hamano1-0/+95
This is what Linus wrote, improving what David Greaves originally submitted. I just added a test case and verified the patch works. Author: David Greaves <david@dgreaves.com> Author: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-24[PATCH] Redo rename/copy detection logic.Junio C Hamano3-24/+24
Earlier implementation had a major screw-up in the memory management area. Rename/copy logic sometimes borrowed a pointer to a structure without any provision for downstream to determine which pointer is shared and which is not. This resulted in the later clean-up code to sometimes double free such structure, resulting in a segfault. This made -M and -C useless. Another problem the earlier implementation had was that it reordered the patches, and forced the logic to differentiate renames and copies to depend on that particular order. This problem was fixed by teaching rename/copy detection logic not to do any reordering, and rename-copy differentiator not to depend on the order of the patches. The diffs will leave rename/copy detector in the same destination path order as the patch that was fed into it. Some test vectors have been reordered to accommodate this change. It also adds a sanity check logic to the human-readable diff-raw output to detect paths with embedded TAB and LF characters, which cannot be expressed with that format. This idea came up during a discussion with Chris Wedgwood. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-23[PATCH] Fix diff-pruning logic which was running prune too early.Junio C Hamano1-4/+3
For later stages to reorder patches, pruning logic and rename detection logic should not decide which delete to discard (because another entry said it will take over the file as a rename) until the very end. Also fix some tests that were assuming the earlier "last one is rename or keep everything else is copy" semantics of diff-raw format, which no longer is true. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-23[PATCH] diff-raw format update take #2.Junio C Hamano4-175/+276
This changes the diff-raw format again, following the mailing list discussion. The new format explicitly expresses which one is a rename and which one is a copy. The documentation and tests are updated to match this change. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-23[PATCH] Rename/copy detection fix.Junio C Hamano2-11/+97
The rename/copy detection logic in earlier round was only good enough to show patch output and discussion on the mailing list about the diff-raw format updates revealed many problems with it. This patch fixes all the ones known to me, without making things I want to do later impossible, mostly related to patch reordering. (1) Earlier rename/copy detector determined which one is rename and which one is copy too early, which made it impossible to later introduce diffcore transformers to reorder patches. This patch fixes it by moving that logic to the very end of the processing. (2) Earlier output routine diff_flush() was pruning all the "no-change" entries indiscriminatingly. This was done due to my false assumption that one of the requirements in the diff-raw output was not to show such an entry (which resulted in my incorrect comment about "diff-helper never being able to be equivalent to built-in diff driver"). My special thanks go to Linus for correcting me about this. When we produce diff-raw output, for the downstream to be able to tell renames from copies, sometimes it _is_ necessary to output "no-change" entries, and this patch adds diffcore_prune() function for doing it. (3) Earlier diff_filepair structure was trying to be not too specific about rename/copy operations, but the purpose of the structure was to record one or two paths, which _was_ indeed about rename/copy. This patch discards xfrm_msg field which was trying to be generic for this wrong reason, and introduces a couple of fields (rename_score and rename_rank) that are explicitly specific to rename/copy logic. One thing to note is that the information in a single diff_filepair structure _still_ does not distinguish renames from copies, and it is deliberately so. This is to allow patches to be reordered in later stages. (4) This patch also adds some tests about diff-raw format output and makes sure that necessary "no-change" entries appear on the output. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-23[PATCH] Be careful with symlinks when detecting renames and copies.Junio C Hamano1-0/+66
Earlier round was not treating symbolic links carefully enough, and would have produced diff output that renamed/copied then edited the contents of a symbolic link, which made no practical sense. Change it to detect only pure renames. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-21[PATCH] The diff-raw format updates.Junio C Hamano3-116/+115
Update the diff-raw format as Linus and I discussed, except that it does not use sequence of underscore '_' letters to express nonexistence. All '0' mode is used for that purpose instead. The new diff-raw format can express rename/copy, and the earlier restriction that -M and -C _must_ be used with the patch format output is no longer necessary. The patch makes -M and -C flags independent of -p flag, so you need to say git-whatchanged -M -p to get the diff/patch format. Updated are both documentations and tests. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-21t/t4003-diff-rename-1: use modern options to "diff"Linus Torvalds1-3/+3
Don't do "-u0", use "--unified=0" which is accepted by modern GNU diff versions.
2005-05-21[PATCH] Diff overhaul, adding the other half of copy detection.Junio C Hamano1-1/+37
This patch extends diff-cache and diff-files to report the unmodified files to diff-core as well when -C (copy detection) is in effect, so that the unmodified files can also be used as the source candidates. The existing test t4003 has been extended to cover this case. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-21[PATCH] Diff overhaul, adding half of copy detection.Junio C Hamano3-3/+96
This introduces the diff-core, the layer between the diff-tree family and the external diff interface engine. The calls to the interface diff-tree family uses (diff_change and diff_addremove) have not changed and will not change. The purpose of the diff-core layer is to provide an infrastructure to transform the set of differences sent from the applications, before sending them to the external diff interface. The recently introduced rename detection code has been rewritten to use the diff-core facility. When applications send in separate creates and deletes, matching ones are transformed into a single rename-and-edit diff, and sent out to the external diff interface as such. This patch also enhances the rename detection code further to be able to detect copies. Currently this happens only as long as copy sources appear as part of the modified files, but there already is enough provision for callers to report unmodified files to diff-core, so that they can be also used as copy source candidates. Extending the callers this way will be done in a separate patch. Please see and marvel at how well this works by trying out the newly added t/t4003-diff-rename-1.sh test script. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-20[PATCH] Fix use of wc in t0000-basicDaniel Barkalow1-1/+1
The version of wc I have (GNU textutils-2.1) puts spaces at the beginning of lines. This patch should work for any version of wc. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Acked-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-20[PATCH] Diff-files fix with more tests.Junio C Hamano1-0/+61
The same check we added earlier to update-cache to catch ENOTDIR turns out to be missing from diff-files. This causes a difference not being reported when you have DF/DF (a file in a subdirectory) in the cache and DF is a file on the filesystem. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-20[PATCH] Add tests for diff-treeJunio C Hamano3-170/+332
This adds and reorganizes some tests for diff-tree Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-19Fix up previous commitLinus Torvalds5-0/+0
Add '-R' flag to diff-tree, and change the test subdirectory shell files to be executable (something that Junio couldn't get me to do through the pure patch with my current patch handling infrastructure).
2005-05-19[PATCH] diff overhaulJunio C Hamano3-1/+9
This cleans up the way calls are made into the diff core from diff-tree family and diff-helper. Earlier, these programs had "if (generating_patch)" sprinkled all over the place, but those ugliness are gone and handled uniformly from the diff core, even when not generating patch format. This also allowed diff-cache and diff-files to acquire -R (reverse) option to generate diff in reverse. Users of diff-tree can swap two trees easily so I did not add -R there. [ Linus' note: I'll add -R to "diff-tree" too, since a "commit diff" doesn't have another tree to switch around: the other tree is always the parent(s) of the commit ] Also -M<digits-as-mantissa> suggestion made by Linus has been implemented. Documentation updates are also included. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-19[PATCH] Implement git-checkout-cache -u to update stat information in the cache.Junio C Hamano1-0/+31
With -u flag, git-checkout-cache picks up the stat information from newly created file and updates the cache. This removes the need to run git-update-cache --refresh immediately after running git-checkout-cache. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-19[PATCH] Detect renames in diff family.Junio C Hamano1-0/+60
This rips out the rename detection engine from diff-helper and moves it to the diff core, and updates the internal calling convention used by diff-tree family into the diff core. In order to give the same option name to diff-tree family as well as to diff-helper, I've changed the earlier diff-helper '-r' option to '-M' (stands for Move; sorry but the natural abbreviation 'r' for 'rename' is already taken for 'recursive'). Although I did a fair amount of test with the git-diff-tree with existing rename commits in the core GIT repository, this should still be considered beta (preview) release. This patch depends on the diff-delta infrastructure just committed. This implements almost everything I wanted to see in this series of patch, except a few minor cleanups in the calling convention into diff core, but that will be a separate cleanup patch. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-19[PATCH] A test case addition for strbuf regressionJunio C Hamano1-0/+9
This test would have caught the strbuf eof condition gotcha, hopefully fixed with my previous patch. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-18[PATCH] Fix diff output take #4.Junio C Hamano1-2/+5
This implements the output format suggested by Linus in <Pine.LNX.4.58.0505161556260.18337@ppc970.osdl.org>, except the imaginary diff option is spelled "diff --git" with double dashes as suggested by Matthias Urlichs. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-16[PATCH 4/4] Trivial test harness fixes.Junio C Hamano1-2/+3
The documentation of the test harness still refer to old numbering and also contains an obvious typo. Also "make test" should be run after making sure we have built all binaries, since test is designed to test the newly built ones. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-15The test of the basic diff functionalityJunio C Hamano1-0/+50
This test comes from "[PATCH 2/2] The core GIT tests: recent additions and fixes" but couldn't be included before since it depended on the modechange diff output changes. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-15[PATCH] Add the merge test Linus called "test script from hell".Junio C Hamano1-0/+313
This is an adaptation to the test framework of a historic test that was used before three way merge form of read-tree was introduced, and subsequently used to validate the read-tree -m merge works correctly. It covers all the tricky cases known back then and also have been updated to cover conflicting files/directories cases since then. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-15Fixed misnamed t/t2010-update-cache-badpath.shPetr Baudis1-0/+0
mv t/t2010-update-cache-badpath.sh t/t2100-update-cache-badpath.sh
2005-05-15[PATCH] Test GIT environment use.Junio C Hamano1-0/+134
This test makes sure that use of deprecated environment variables still works, using both new and old names makes new one take precedence, and GIT_DIR and GIT_ALTERNATE_OBJECT_DIRECTORIES mechanisms work. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-15Rename some test scripts and describe the naming conventionPetr Baudis6-1/+26
First digit: "family", e.g. the absolute basics and global stuff (0), the basic db-side commands (read-tree, write-tree, commit-tree), the basic working-tree-side commands (checkout-cache, update-cache), the other basic commands (ls-files), the diff commands, the pull commands, exporting commands, revision tree commands... Second digit: the particular command we are testing Third digit: (optionally) the particular switch or group of switches we are testing Freeform part: commandname-details Described in the README. mv t1000-checkout-cache.sh t2000-checkout-cache-clash.sh mv t1001-checkout-cache.sh t2001-checkout-cache-clash.sh mv t0200-update-cache.sh t2010-update-cache-badpath.sh mv t0400-ls-files.sh t3000-ls-files-others.sh mv t0500-ls-files.sh t3010-ls-files-killed.sh
2005-05-14[PATCH 2/2] Test framework documentation.Junio C Hamano1-0/+174
This adds instruction for running tests, and writing new tests. Signed-off-by: Junio C Hamano <junkio@cox.net> Updated to the new tidied up output style. Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-14[PATCH 1/2] Test suite fixup.Junio C Hamano3-24/+26
Exposing test_expect_success and test_expect_failure turns out to be enough for the test scripts and there is no need for exposing test_ok or test_failure. This patch cleans it up and fixes the users of test_ok and test_failure. Also test scripts have acquired a new command line flag '--immediate' to cause them to exit upon the first failure. This is useful especially during the development of a new test. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-14Try to make test output look betterPetr Baudis1-2/+2
NO changed to FAIL and ok was right-aligned with it so that it is easier to visually identify the failed tests, and the removal of # should reduce the clutter on the line and aid the eye to spot the test number better.
2005-05-14t/Makefile: OPTS -> GIT_TEST_OPTSPetr Baudis1-2/+3
This way, passing this variable through the environment actually makes sense.
2005-05-14t/Makefile cleanupPetr Baudis1-4/+3
t/Makefile now does not use double-colon rules (why would it?), the rm -fr trash in the all rule is silent, and OPTS aren't set to blank so that they can be taken from the environment.
2005-05-14Fixed t0000-basic.sh and test-lib.sh permissionsPetr Baudis2-0/+0
The +x bit was missing. I applied the original patch three times and set the permissions correctly two times. Guess which was the time I forgot.
2005-05-14[PATCH 2/2] The core GIT tests: recent additions and fixes.Junio C Hamano6-0/+375
This set of scripts are designed to test the features and fixes we recently added to core GIT. The convention to call test helper function has been changed during the framework cleanup (take two), and these tests have been updated to use the cleaned up test-lib.sh interface. Signed-off-by: Junio C Hamano <junkio@cox.net> Note that this does not include the t2000-diff.sh script since it tests a patch which was not applied yet. Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-14[PATCH 1/2] Test framework take two.Junio C Hamano3-0/+336
This adds t/ directory to host test suite, a test helper library and a basic set of tests. Petr Baudis raised many valid points at the earlier attempts in git mailing list. This round, test-lib.sh has been updated to a bit more modern style, and the default output is made easier to read. Also included is one sample test script that tests the very basics. This test has already found one leftover bug missed when we introduced symlink support, which has been fixed since then. The supplied Makefile is designed to run all the available tests. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>