summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2009-08-07Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano1-3/+8
* maint-1.6.0: verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used
2009-08-07t5510: harden the way verify-pack is usedLibravatar Junio C Hamano1-3/+8
The test ignored the exit status from verify pack command, and also relied on not seeing any delta chain statistics. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-03Merge branch 'jc/maint-1.6.0-keep-pack' into maint-1.6.1Libravatar Junio C Hamano1-0/+61
* jc/maint-1.6.0-keep-pack: pack-objects: don't loosen objects available in alternate or kept packs t7700: demonstrate repack flaw which may loosen objects unnecessarily Remove --kept-pack-only option and associated infrastructure pack-objects: only repack or loosen objects residing in "local" packs git-repack.sh: don't use --kept-pack-only option to pack-objects t7700-repack: add two new tests demonstrating repacking flaws is_kept_pack(): final clean-up Simplify is_kept_pack() Consolidate ignore_packed logic more has_sha1_kept_pack(): take "struct rev_info" has_sha1_pack(): refactor "pretend these packs do not exist" interface git-repack: resist stray environment variable
2009-05-03Merge branch 'jc/maint-1.6.0-diff-borrow-carefully' into maint-1.6.1Libravatar Junio C Hamano1-0/+8
* jc/maint-1.6.0-diff-borrow-carefully: diff --cached: do not borrow from a work tree when a path is marked as assume-unchanged
2009-05-03Merge branch 'bs/maint-1.6.0-tree-walk-prefix' into maint-1.6.1Libravatar Junio C Hamano2-0/+14
* bs/maint-1.6.0-tree-walk-prefix: match_tree_entry(): a pathspec only matches at directory boundaries tree_entry_interesting: a pathspec only matches at directory boundary
2009-04-29Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano1-0/+39
* maint-1.6.0: diff -c -p: do not die on submodules
2009-04-29diff -c -p: do not die on submodulesLibravatar Junio C Hamano1-0/+39
The combine diff logic knew only about blobs (and their checked-out form in the work tree, either regular files or symlinks), and barfed when fed submodules. This "externalizes" gitlinks in the same way as the normal patch generation codepath does (i.e. "Subproject commit Xxx\n") to fix the issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-28Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano1-0/+4
* maint-1.6.0: grep: fix segfault when "git grep '('" is given Documentation: fix a grammatical error in api-builtin.txt builtin-merge: fix a typo in an error message
2009-04-27grep: fix segfault when "git grep '('" is givenLibravatar Linus Torvalds1-0/+4
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-18Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano1-0/+9
* maint-1.6.0: doc/git-daemon: add missing arguments to options init: Do not segfault on big GIT_TEMPLATE_DIR environment variable
2009-04-18init: Do not segfault on big GIT_TEMPLATE_DIR environment variableLibravatar Frank Lichtenheld1-0/+9
Signed-off-by: Frank Lichtenheld <flichtenheld@astaro.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-17Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano1-1/+8
* maint-1.6.0: Fix buffer overflow in config parser
2009-04-17Fix buffer overflow in config parserLibravatar Thomas Jarosch1-1/+8
When interpreting a config value, the config parser reads in 1+ space character(s) and puts -one- space character in the buffer as soon as the first non-space character is encountered (if not inside quotes). Unfortunately the buffer size check lacks the extra space character which gets inserted at the next non-space character, resulting in a crash with a specially crafted config entry. The unit test now uses Java to compile a platform independent .NET framework to output the test string in C# :o) Read: Thanks to Johannes Sixt for the correct printf call which replaces the perl invocation. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-08Merge branch 'bc/maint-1.6.1-branch-deleted-was' into maint-1.6.1Libravatar Junio C Hamano1-1/+1
* bc/maint-1.6.1-branch-deleted-was: git-branch: display "was sha1" on branch deletion rather than just "sha1"
2009-04-01match_tree_entry(): a pathspec only matches at directory boundariesLibravatar Junio C Hamano1-0/+6
Previously the code did a simple prefix match, which means that a path in a directory "frotz/" would have matched with pathspec "f". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-01tree_entry_interesting: a pathspec only matches at directory boundaryLibravatar Björn Steinbrink1-0/+8
Previously the code did a simple prefix match, which means that a path in a directory "frotz/" would have matched with pathspec "f". Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-28test-lib: Clean up comments and Makefile.Libravatar Emil Sit2-9/+1
Bring documentation in test-lib and clean target in Makefile in-line with abc5d372. Signed-off-by: Emil Sit <sit@emilsit.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-22diff --cached: do not borrow from a work tree when a path is marked as ↵Libravatar Junio C Hamano1-0/+8
assume-unchanged When the index says that the file in the work tree that corresponds to the blob object that is used for comparison is known to be unchanged, "diff" reads from the file and applies convert_to_git(), instead of inflating the object, to feed the internal diff engine with, because an earlier benchnark found that it tends to be faster to use this optimization. However, the index can lie when the path is marked as assume-unchanged. Disable the optimization for such paths. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-21Merge branch 'js/maint-1.6.0-path-normalize' into maint-1.6.1Libravatar Junio C Hamano2-19/+20
* js/maint-1.6.0-path-normalize: Remove unused normalize_absolute_path() Test and fix normalize_path_copy() Fix GIT_CEILING_DIRECTORIES on Windows Move sanitary_path_copy() to path.c and rename it to normalize_path_copy() Make test-path-utils more robust against incorrect use
2009-03-21Merge branch 'jc/maint-1.6.0-pack-directory' into maint-1.6.1Libravatar Junio C Hamano1-0/+17
* jc/maint-1.6.0-pack-directory: Fix odb_mkstemp() on AIX Make sure objects/pack exists before creating a new pack Conflicts: wrapper.c
2009-03-21pack-objects: don't loosen objects available in alternate or kept packsLibravatar Brandon Casey1-1/+1
If pack-objects is called with the --unpack-unreachable option then it will unpack (i.e. loosen) all unreferenced objects from local not-kept packs, including those that also exist in packs residing in an alternate object database or a locally kept pack. The only user of this option is git-repack. In this case, repack will follow the call to pack-objects with a call to prune-packed, which will delete these newly loosened objects, making the act of loosening a waste of time. The unnecessary loosening can be avoided by checking whether an object exists in a non-local pack or a locally kept pack before loosening it. This fixes the 'local packed unreachable obs that exist in alternate ODB are not loosened' test in t7700. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-21t7700: demonstrate repack flaw which may loosen objects unnecessarilyLibravatar Brandon Casey1-0/+17
If an unreferenced object exists in both a local pack and in either a pack residing in an alternate object database or a local kept pack, then the pack-objects call made by repack will loosen that object only to have it immediately pruned by repack's call to prune-packed. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-21git-branch: display "was sha1" on branch deletion rather than just "sha1"Libravatar Brandon Casey1-1/+1
Make it more pleasant to read about a branch deletion by adding "was". Jeff King suggested this, and I ignored it. He was right. Update t3200 test again to match the change in output. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-20pack-objects: only repack or loosen objects residing in "local" packsLibravatar Brandon Casey1-1/+1
These two features were invented for use by repack when repack will delete the local packs that have been made redundant. The packs accessible through alternates are not deleted by repack, so the objects contained in them are still accessible after the local packs are deleted. They do not need to be repacked into the new pack or loosened. For the case of loosening they would immediately be deleted by the subsequent prune-packed that is called by repack anyway. This fixes the test 'packed unreachable obs in alternate ODB are not loosened' in t7700. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-20git-repack.sh: don't use --kept-pack-only option to pack-objectsLibravatar Brandon Casey1-1/+1
The --kept-pack-only option to pack-objects treats all kept packs as equal. This results in objects that reside in an alternate pack that has a .keep file, not being packed into a newly created pack when the user specifies the -a option to repack. Since the user may not have any control over the alternate database, git should not refrain from repacking those objects even though they are in a pack with a .keep file. This fixes the 'packed obs in alternate ODB kept pack are repacked' test in t7700. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-20t7700-repack: add two new tests demonstrating repacking flawsLibravatar Brandon Casey1-0/+44
1) The new --kept-pack-only mechansim of rev-list/pack-objects has replaced --unpacked=. This new mechansim does not operate solely on "local" packs now. The result is that objects residing in an alternate pack which has a .keep file will not be repacked with repack -a. This flaw is only apparent when a commit object is the one residing in an alternate kept pack. 2) The 'repack unpacked objects' and 'loosen unpacked objects' mechanisms of pack-objects, i.e. --keep-unreachable and --unpack-unreachable, now do not operate solely on local packs. The --keep-unreachable option no longer has any callers, but --unpack-unreachable is used when repack is called with '-A -d' and the local repo has existing packs. In this case, objects residing in alternate, not-kept packs will be loosened, and then immediately deleted by repack's call to prune-packed. The test must manually call pack-objects to avoid the call to prune-packed that is made by repack when -d is used. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-12Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano2-1/+33
* maint-1.6.0: bisect: fix another instance of eval'ed string bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped Support "\" in non-wildcard exclusion entries Conflicts: git-bisect.sh
2009-03-12Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.0Libravatar Junio C Hamano21-2/+209
* ks/maint-1.6.0-mailinfo-folded: mailinfo: tests for RFC2047 examples mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)' mailinfo: 'From:' header should be unfold as well mailinfo: correctly handle multiline 'Subject:' header
2009-03-12Merge branch 'cc/maint-1.6.0-bisect-fix' into maint-1.6.0Libravatar Junio C Hamano1-0/+25
* cc/maint-1.6.0-bisect-fix: bisect: fix another instance of eval'ed string bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped
2009-03-12Merge branch 'fg/maint-1.6.0-exclude-bq' into maint-1.6.0Libravatar Junio C Hamano1-1/+8
* fg/maint-1.6.0-exclude-bq: Support "\" in non-wildcard exclusion entries
2009-03-12Merge branch 'js/maint-1.6.1-remote-remove-mirror' into maint-1.6.1Libravatar Junio C Hamano1-0/+26
* js/maint-1.6.1-remote-remove-mirror: builtin-remote: make rm operation safer in mirrored repository builtin-remote: make rm() use properly named variable to hold return value
2009-03-12Merge branch 'ek/maint-1.6.1-filter-branch-bare' into maint-1.6.1Libravatar Junio C Hamano1-1/+3
* ek/maint-1.6.1-filter-branch-bare: filter-branch: Fix fatal error on bare repositories
2009-03-12Merge branch 'jc/maint-1.6.1-add-u-remove-conflicted' into maint-1.6.1Libravatar Junio C Hamano1-1/+49
* jc/maint-1.6.1-add-u-remove-conflicted: add -u: do not fail to resolve a path as deleted
2009-03-12Merge branch 'js/maint-1.6.1-rebase-i-submodule' into maint-1.6.1Libravatar Junio C Hamano1-0/+26
* js/maint-1.6.1-rebase-i-submodule: Fix submodule squashing into unrelated commit rebase -i squashes submodule changes into unrelated commit
2009-03-12Merge branch 'jc/maint-1.6.1-allow-uninteresting-missing' into maint-1.6.1Libravatar Junio C Hamano1-0/+37
* jc/maint-1.6.1-allow-uninteresting-missing: revision traversal: allow UNINTERESTING objects to be missing
2009-03-12Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.1Libravatar Junio C Hamano21-2/+209
* ks/maint-1.6.0-mailinfo-folded: mailinfo: tests for RFC2047 examples mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)' mailinfo: 'From:' header should be unfold as well mailinfo: correctly handle multiline 'Subject:' header
2009-03-12Merge branch 'jc/maint-1.6.0-split-diff-metainfo' into maint-1.6.0Libravatar Junio C Hamano1-0/+18
* jc/maint-1.6.0-split-diff-metainfo: diff.c: output correct index lines for a split diff
2009-03-07builtin-revert.c: release index lock when cherry-picking an empty commitLibravatar Chris Johnsen1-0/+33
When a cherry-pick of an empty commit is done, release the lock held on the index. The fix is the same as was applied to similar code in 4271666046. Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-27bisect: fix quoting TRIED revs when "bad" commit is also "skip"pedLibravatar Christian Couder1-0/+25
When the "bad" commit was also "skip"ped and when more than one commit was skipped, the "filter_skipped" function would have printed something like: bisect_rev=<hash1>|<hash2> (where <hash1> and <hash2> are hexadecimal sha1 hashes) and this would have been evaled later as piping "bisect_rev=<hash1>" into "<hash2>", which would have failed. So this patch makes the "filter_skipped" function properly quote what it outputs, so that it will print something like: bisect_rev='<hash1>|<hash2>' which will be properly evaled later. The caller was not stopping properly because the scriptlet this function returned to be evaled was not strung together with && and because of this, an error in an earlier part of the output was simply ignored. A test case is added to the test suite. And while at it, we also initialize the VARS, FOUND and TRIED variables, so that we protect ourselves from environment variables the user may have with these names. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-25Make sure objects/pack exists before creating a new packLibravatar Junio C Hamano1-0/+17
In a repository created with git older than f49fb35 (git-init-db: create "pack" subdirectory under objects, 2005-06-27), objects/pack/ directory is not created upon initialization. It was Ok because subdirectories are created as needed inside directories init-db creates, and back then, packfiles were recent invention. After the said commit, new codepaths started relying on the presense of objects/pack/ directory in the repository. This was exacerbated with 8b4eb6b (Do not perform cross-directory renames when creating packs, 2008-09-22) that moved the location temporary pack files are created from objects/ directory to objects/pack/ directory, because moving temporary to the final location was done carefully with lazy leading directory creation. Many packfile related operations in such an old repository can fail mysteriously because of this. This commit introduces two helper functions to make things work better. - odb_mkstemp() is a specialized version of mkstemp() to refactor the code and teach it to create leading directories as needed; - odb_pack_keep() refactors the code to create a ".keep" file while create leading directories as needed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-18tests: fix "export var=val"Libravatar Junio C Hamano2-3/+3
Some shells do not like "export var=val"; the right way to write it is to do an assignment and then export just the variable name. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-18Skip timestamp differences for diff --no-indexLibravatar Michael Spang2-0/+7
We display empty diffs for files whose timestamps have changed. Usually, refreshing the index makes those empty diffs go away. However, when not using the index they are not very useful and there is no option to suppress them. This forces on the skip_stat_unmatch option for diff --no-index, suppressing any empty diffs. This option is also used for diffs against the index when "diff.autorefreshindex" is set, but that option does not apply to diff --no-index. Signed-off-by: Michael Spang <mspang@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-12Support "\" in non-wildcard exclusion entriesLibravatar Finn Arne Gangstad1-1/+8
"\" was treated differently in exclude rules depending on whether a wildcard match was done. For wildcard rules, "\" was de-escaped in fnmatch, but this was not done for other rules since they used strcmp instead. A file named "#foo" would not be excluded by "\#foo", but would be excluded by "\#foo*". We now treat all rules with "\" as wildcard rules. Another solution could be to de-escape all non-wildcard rules as we read them, but we would have to do the de-escaping exactly as fnmatch does it to avoid inconsistencies. Signed-off-by: Finn Arne Gangstad <finnag@pvv.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11Merge branch 'maint-1.5.6' into maintLibravatar Junio C Hamano1-0/+39
* maint-1.5.6: revision traversal and pack: notice and die on missing commit
2009-02-11Merge branch 'maint-1.5.5' into maint-1.5.6Libravatar Junio C Hamano1-0/+39
* maint-1.5.5: revision traversal and pack: notice and die on missing commit Conflicts: revision.c
2009-02-11Merge branch 'maint-1.5.4' into maint-1.5.5Libravatar Junio C Hamano1-0/+39
* maint-1.5.4: revision traversal and pack: notice and die on missing commit
2009-02-11revision traversal and pack: notice and die on missing commitLibravatar Junio C Hamano1-0/+39
cc0e6c5 (Handle return code of parse_commit in revision machinery, 2007-05-04) attempted to tighten error checking in the revision machinery, but it wasn't enough. When get_revision_1() was asked for the next commit to return, it tries to read and simplify the parents of the commit to be returned, but an error while doing so was silently ignored and reported as a truncated history to the caller instead. This resulted in an early end of "git log" output or a pack that lacks older commits from "git pack-objects", without any error indication in the exit status from these commands, even though the underlying parse_commit() issues an error message to the end user. Note that the codepath in add_parents_list() that paints parents of an UNINTERESTING commit UNINTERESTING silently ignores the error when parse_commit() fails; this is deliberate and in line with aeeae1b (revision traversal: allow UNINTERESTING objects to be missing, 2009-01-27). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07Test and fix normalize_path_copy()Libravatar Johannes Sixt1-16/+17
This changes the test-path-utils utility to invoke normalize_path_copy() instead of normalize_absolute_path() because the latter is about to be removed. The test cases in t0060 are adjusted in two regards: - normalize_path_copy() more often leaves a trailing slash in the result. This has no negative side effects because the new user of this function, longest_ancester_length(), already accounts for this behavior. - The function can fail. The tests uncover a flaw in normalize_path_copy(): If there are sufficiently many '..' path components so that the root is reached, such as in "/d1/s1/../../d2", then the leading slash was lost. This manifested itself that (assuming there is a repository at /tmp/foo) $ git add /d1/../tmp/foo/some-file reported 'pathspec is outside repository'. This is now fixed. Moreover, the test case descriptions of t0060 now include the test data and expected outcome. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07Fix GIT_CEILING_DIRECTORIES on WindowsLibravatar René Scharfe1-3/+3
Using git with GIT_CEILING_DIRECTORIES crashed on Windows due to a failed assertion in normalize_absolute_path(): This function expects absolute paths to start with a slash, while on Windows they can start with a drive letter or a backslash. This fixes it by using the alternative, normalize_path_copy() instead, which can handle Windows-style paths just fine. Secondly, the portability macro PATH_SEP is used instead of expecting colons to be used as path list delimiter. The test script t1504 is also changed to help MSYS's bash recognize some program arguments as path list. (MSYS's bash must translate POSIX-style path lists to Windows-style path lists, and the heuristic did not catch some cases.) Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05Merge branch 'sg/maint-gitdir-in-subdir' into maintLibravatar Junio C Hamano1-0/+7
* sg/maint-gitdir-in-subdir: Fix gitdir detection when in subdir of gitdir