summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2008-07-05Fix apply --recount handling of no-EOL lineLibravatar Thomas Rast5-0/+28
If a patch modifies the last line of a file that previously had no terminating '\n', it looks like -old text \ No newline at end of file +new text Hence, a '\' line does not signal the end of the hunk. This modifies 'git apply --recount' to take this into account. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-04Merge branch 'maint'Libravatar Junio C Hamano2-0/+0
* maint: GIT 1.5.6.2 Fix executable bits in t/ scripts Work around gcc warnings from curl headers
2008-07-04Fix executable bits in t/ scriptsLibravatar Junio C Hamano2-0/+0
Pointed out by Ramsay Jones. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-04t4127-apply-same-fn: Avoid sed -iLibravatar Johannes Sixt1-11/+16
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02Merge branch 'maint'Libravatar Junio C Hamano1-0/+2
* maint: Fix describe --tags --long so it does not segfault
2008-07-02Merge branch 'jc/maint-reset' into maintLibravatar Junio C Hamano1-0/+47
* jc/maint-reset: Allow "git-reset path" when unambiguous
2008-07-02Fix describe --tags --long so it does not segfaultLibravatar Shawn O. Pearce1-0/+2
If we match a lightweight (non-annotated tag) as the name to output and --long was requested we do not have a tag, nor do we have a tagged object to display. Instead we must use the object we were passed as input for the long format display. Reported-by: Mark Burton <markb@ordern.com> Backtraced-by: Mikael Magnusson <mikachu@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01Merge branch 'js/apply-recount'Libravatar Junio C Hamano1-35/+27
* js/apply-recount: Allow git-apply to recount the lines in a hunk (AKA recountdiff)
2008-07-01Merge branch 'jc/checkdiff'Libravatar Junio C Hamano2-0/+20
* jc/checkdiff: Fix t4017-diff-retval for white-space from wc Update sample pre-commit hook to use "diff --check" diff --check: detect leftover conflict markers Teach "diff --check" about new blank lines at end checkdiff: pass diff_options to the callback check_and_emit_line(): rename and refactor diff --check: explain why we do not care whether old side is binary
2008-07-01Merge branch 'jc/maint-reset'Libravatar Junio C Hamano1-0/+47
* jc/maint-reset: Allow "git-reset path" when unambiguous
2008-07-01Merge branch 'dz/apply-again'Libravatar Junio C Hamano1-0/+85
* dz/apply-again: git-apply: handle a patch that touches the same path more than once better
2008-06-30Add test results directory to t/.gitignoreLibravatar Brian Gernhardt1-0/+1
We don't need test results to be committed if we're fixing a test. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29t9700: skip when Test::More is not availableLibravatar Junio C Hamano1-0/+5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29Fix t4017-diff-retval for white-space from wcLibravatar Brian Gernhardt1-1/+1
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28Allow git-apply to recount the lines in a hunk (AKA recountdiff)Libravatar Johannes Schindelin1-35/+27
Sometimes, the easiest way to fix up a patch is to edit it directly, even adding or deleting lines. Now, many people are not as divine as certain benevolent dictators as to update the hunk headers correctly at the first try. So teach the tool to do it for us. [jc: with tests] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-27git-apply: handle a patch that touches the same path more than once betterLibravatar Don Zickus1-0/+85
When working with a lot of people who backport patches all day long, every once in a while I get a patch that modifies the same file more than once inside the same patch. git-apply either fails if the second change relies on the first change or silently drops the first change if the second change is independent. The silent part is the scary scenario for us. Also this behaviour is different from the patch-utils. I have modified git-apply to create a table of the filenames of files it modifies such that if a later patch chunk modifies a file in the table it will buffer the previously changed file instead of reading the original file from disk. Logic has been put in to handle creations/deletions/renames/copies. All the relevant tests of git-apply succeed. A new test has been added to cover the cases I addressed. The fix is relatively straight-forward. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26diff --check: detect leftover conflict markersLibravatar Junio C Hamano1-0/+14
This teaches "diff --check" to detect and complain if the change adds lines that look like leftover conflict markers. We should be able to remove the old Perl script used in the sample pre-commit hook and modernize the script with this facility. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26Teach "diff --check" about new blank lines at endLibravatar Junio C Hamano1-0/+6
When a patch adds new blank lines at the end, "git apply --whitespace" warns. This teaches "diff --check" to do the same. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26test-lib.sh: show git init output when in verbose modeLibravatar Lea Wiemann1-1/+1
Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26Merge branch 'maint'Libravatar Junio C Hamano1-0/+8
* maint: GIT 1.5.5.5 GIT 1.5.4.6 git-shell: accept "git foo" form diff --check: do not discard error status upon seeing a good line
2008-06-26diff --check: do not discard error status upon seeing a good lineLibravatar Junio C Hamano1-0/+8
"git diff --check" should return non-zero when there was any whitespace error but the code only paid attention to the error status of the last new line in the patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26improve for-each-ref test scriptLibravatar Jeff King1-17/+70
Previously, we did a sanity check by doing for-each-ref using each possible format atom. However, we never checked the actual output produced by that atom, which recently let an obvious bug go undetected for some time. While we're at it, also clean up a few '!' into test_must_fail. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-25Allow "git-reset path" when unambiguousLibravatar Junio C Hamano1-0/+47
Resetting a selected set of index entries is done with "git reset -- paths" syntax, but we did not allow -- to be omitted even when the command is unambiguous. This updates the command to follow the general rule: * When -- appears, revs come before it, and paths come after it; * When there is no --, earlier ones are revs and the rest are paths, and we need to guess. When lack of -- marker forces us to guess, we protect from user errors and typoes by making sure what we treat as revs do not appear as filenames in the work tree, and what we treat as paths do appear as filenames in the work tree, and by erroring out if that is not the case. We tell the user to disambiguate by using -- in such a case. which is employed elsewhere in the system. When this rule is applied to "reset", because we can have only zero or one rev to the command, the check can be slightly simpler than other programs. We have to check only the first one or two tokens after the command name and options, and when they are: -- A: no explicit rev given; "A" and whatever follows it are paths. A --: explicit rev "A" given and whatever follows the "--" are paths. A B: "A" could be rev or path and we need to guess. "B" could be missing but if exists that (and everything that follows) would be paths. So we apply the guess only in the last case and only to "A" (not "B" and what comes after it). * As long as "A" is unambiguously a path, index entries for "A", "B" (and everything that follows) are reset to the HEAD revision. * If "A" is unambiguously a rev, on the other hand, the index entries for "B" (and everything that follows) are reset to the "A" revision. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-25Fix use of "perl -i" on WindowsLibravatar Alex Riesen2-6/+6
The perldiag(1) has following to say about this: "Can't do inplace edit without backup" (F) You're on a system such as MS-DOS that gets confused if you try reading from a deleted (but still opened) file. You have to say -i.bak, or some such. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-25Merge branch 'sb/rebase'Libravatar Junio C Hamano1-9/+34
* sb/rebase: t3404: stricter tests for git-rebase--interactive api-builtin.txt: update and fix typo
2008-06-25Merge branch 'sr/tests'Libravatar Junio C Hamano3-4/+57
* sr/tests: Hook up the result aggregation in the test makefile. A simple script to parse the results from the testcases Modify test-lib.sh to output stats to t/test-results/* Conflicts: t/test-lib.sh
2008-06-25Merge branch 'jh/clone-packed-refs'Libravatar Junio C Hamano1-3/+6
* jh/clone-packed-refs: Teach "git clone" to pack refs Prepare testsuite for a "git clone" that packs refs Move pack_refs() and friends into libgit Incorporate fetched packs in future object traversal
2008-06-25Merge branch 'lw/perlish'Libravatar Junio C Hamano3-0/+197
* lw/perlish: Git.pm: add test suite t/test-lib.sh: add test_external and test_external_without_stderr
2008-06-25clone: create intermediate directories of destination repoLibravatar Jeff King1-0/+22
The shell version used to use "mkdir -p" to create the repo path, but the C version just calls "mkdir". Let's replicate the old behavior. We have to create the git and worktree leading dirs separately; while most of the time, the worktree dir contains the git dir (as .git), the user can override this using GIT_WORK_TREE. We can reuse safe_create_leading_directories, but we need to make a copy of our const buffer to do so. Since merge-recursive uses the same pattern, we can factor this out into a global function. This has two other cleanup advantages for merge-recursive: 1. mkdir_p wasn't a very good name. "mkdir -p foo/bar" actually creates bar, but this function just creates the leading directories. 2. mkdir_p took a mode argument, but it was completely ignored. Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-24verify-pack: test for detection of index v2 object CRC mismatchLibravatar Nicolas Pitre1-0/+14
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-24clone: create intermediate directories of destination repoLibravatar Jeff King1-0/+22
The shell version used to use "mkdir -p" to create the repo path, but the C version just calls "mkdir". Let's replicate the old behavior. We have to create the git and worktree leading dirs separately; while most of the time, the worktree dir contains the git dir (as .git), the user can override this using GIT_WORK_TREE. We can reuse safe_create_leading_directories, but we need to make a copy of our const buffer to do so. Since merge-recursive uses the same pattern, we can factor this out into a global function. This has two other cleanup advantages for merge-recursive: 1. mkdir_p wasn't a very good name. "mkdir -p foo/bar" actually creates bar, but this function just creates the leading directories. 2. mkdir_p took a mode argument, but it was completely ignored. Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-23test case for pack resilience against corruptionsLibravatar Nicolas Pitre1-0/+194
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-23Merge branch 'maint'Libravatar Junio C Hamano1-0/+32
* maint: git-svn: make rebuild respect rewriteRoot option Workaround for AIX mkstemp()
2008-06-23git-svn: make rebuild respect rewriteRoot optionLibravatar Jan Krüger1-0/+32
Suppose someone fetches git-svn-ified commits from another repo and then attempts to use 'git-svn init --rewrite-root=foo bar'. Using git svn rebase after that will fail badly: * For each commit tried by working_head_info, rebuild is called indirectly. * rebuild will iterate over all commits and skip all of them because the URL does not match. Because of that no rev_map file is generated at all. * Thus, rebuild will run once for every commit. This takes ages. * In the end there still isn't any rev_map file and thus working_head_info fails. Addressing this behaviour fixes an apparently not too uncommon problem with providing git-svn mirrors of Subversion repositories. Some repositories are accessed using different URLs depending on whether the user has push privileges or not. In the latter case, an anonymous URL is often used that differs from the push URL. Providing a mirror that is usable in both cases becomes a lot more possible with this change. Signed-off-by: Jan Krüger <jk@jk.gs> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-23t9301-fast-export.sh: Remove debug lineLibravatar Michele Ballabio1-1/+0
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-22Merge branch 'maint'Libravatar Junio C Hamano2-8/+110
* maint: Extend parse-options test suite api-parse-options.txt: Introduce documentation for parse options API parse-options.c: fix documentation syntax of optional arguments api-builtin.txt: update and fix typo
2008-06-22Extend parse-options test suiteLibravatar Stephan Beyer1-7/+109
This patch serves two purposes: 1. test-parse-option.c should be a more complete example for the parse-options API, and 2. there have been no tests for OPT_CALLBACK, OPT_DATE, OPT_BIT, OPT_SET_INT and OPT_SET_PTR before. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-22parse-options.c: fix documentation syntax of optional argumentsLibravatar Michele Ballabio1-1/+1
When an argument for an option is optional, short options don't need a space between the option and the argument, and long options need a "=". Otherwise, arguments are misinterpreted. Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-22t3404: stricter tests for git-rebase--interactiveLibravatar Stephan Beyer1-9/+34
Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-22Merge branch 'rs/archive-ignore'Libravatar Junio C Hamano1-0/+9
* rs/archive-ignore: Teach new attribute 'export-ignore' to git-archive
2008-06-22Merge branch 'jk/test'Libravatar Junio C Hamano15-151/+145
* jk/test: enable whitespace checking of test scripts avoid trailing whitespace in zero-change diffstat lines avoid whitespace on empty line in automatic usage message mask necessary whitespace policy violations in test scripts fix whitespace violations in test scripts
2008-06-22Merge branch 'pb/fast-export'Libravatar Junio C Hamano1-0/+24
* pb/fast-export: builtin-fast-export: Add importing and exporting of revision marks
2008-06-22Merge branch 'mo/status-untracked'Libravatar Junio C Hamano1-0/+98
* mo/status-untracked: Add configuration option for default untracked files mode Add argument 'no' commit/status option -u|--untracked-files Add an optional <mode> argument to commit/status -u|--untracked-files option Conflicts: Documentation/git-commit.txt
2008-06-22Merge branch 'kh/update-ref'Libravatar Junio C Hamano1-0/+8
* kh/update-ref: Make old sha1 optional with git update-ref -d Clean up builtin-update-ref's option parsing
2008-06-21t/README: Add 'Skipping Tests' section below 'Running Tests'Libravatar Jakub Narebski1-0/+28
Add description of GIT_SKIP_TESTS variable, taken almost verbatim (adjusting for conventions in t/README) from the commit message in 04ece59 (GIT_SKIP_TESTS: allow users to omit tests that are known to break) Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19Merge branch 'maint'Libravatar Junio C Hamano1-1/+5
* maint: Documentation: fix formatting in git-svn t7502-commit.sh: test_must_fail doesn't work with inline environment variables completion: add --graph to log command completion git-merge.sh: fix typo in usage message: sucesses --> succeeds
2008-06-19t7502-commit.sh: test_must_fail doesn't work with inline environment variablesLibravatar Brandon Casey1-1/+5
When the arguments to test_must_fail() begin with a variable assignment, test_must_fail() attempts to execute the variable assignment as a command. This fails, and so test_must_fail returns with a successful status value without running the command it was intended to test. For example, the following script: #!/bin/sh test_must_fail () { "$@" test $? -gt 0 -a $? -le 129 } foo='wo adrian' test_must_fail foo='yo adrian' sh -c 'echo foo: $foo' always exits zero and prints the message: test.sh: line 3: foo=yo adrian: command not found Test 16 calls test_must_fail in such a way and therefore has not been testing whether git 'do[es] not fire editor in the presence of conflicts'. A workaround is to set and export the variable in a normal way, not using one-shot notation. Because this would affect the remainder of the process, the test is done inside a subshell. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19Prepare testsuite for a "git clone" that packs refsLibravatar Johan Herland1-3/+6
t5515-fetch-merge-logic removes many, but not all, refs between each test. This is done by removing the corresponding refs/foo/* files in the .git/refs hierarchy. However, once "git clone" starts producing packed refs, these refs will no longer be in the .git/refs hierarchy, but rather listed in .git/packed-refs. This patch teaches t5515-fetch-merge-logic to remove the refs using "git update-ref -d" which properly handles packed refs. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19builtin-fast-export: Add importing and exporting of revision marksLibravatar Pieter de Bie1-0/+24
This adds the --import-marks and --export-marks to fast-export. These import and export the marks used to for all revisions exported in a similar fashion to what fast-import does. The format is the same as fast-import, so you can create a bidirectional importer / exporter by using the same marks file on both sides. Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19Git.pm: add test suiteLibravatar Lea Wiemann2-0/+139
Add a shell script (t/t9700-perl-git.sh) that sets up a git repository and a perl script (t/t9700/test.pl) that runs the actual tests. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>