aboutsummaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAge
* Merge branch 'cc/branch-test'Junio C Hamano2006-09-27
|\ | | | | | | | | * cc/branch-test: Remove empty ref directories that prevent creating a ref.
| * Remove empty ref directories that prevent creating a ref.Christian Couder2006-09-25
| | | | | | | | | | | | | | This patch also adds test cases from Linus and Junio. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'sp/void'Junio C Hamano2006-09-27
|\ \ | | | | | | | | | | | | * sp/void: Allow git-checkout when on a non-existant branch.
| * | Allow git-checkout when on a non-existant branch.Shawn Pearce2006-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've seen some users get into situtations where their HEAD symbolic-ref is pointing at a non-existant ref. (Sometimes this happens during clone when the remote repository lacks a 'master' branch.) If this happens the user is unable to use git-checkout to switch branches as there is no prior commit to merge from. So instead of giving the user low-level errors about how HEAD can't be resolved and how not a single revision was given change the type of checkout to be a force and go through with the user's request anyway. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'jc/deprecate-recursive'Junio C Hamano2006-09-27
|\ \ \ | | | | | | | | | | | | | | | | * jc/deprecate-recursive: Deprecate merge-recursive.py
| * | | Deprecate merge-recursive.pyJunio C Hamano2006-09-24
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | This renames merge-recursive written in Python to merge-recursive-old, and makes merge-recur as a synonym to merge-recursive. We do not remove merge-recur yet, but we will remove merge-recur and merge-recursive-old in a few releases down the road. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Corrected copy-and-paste thinko in ignore executable bit test case.Shawn Pearce2006-09-27
| | | | | | | | | | | | | | | | | | | | | | | | This test should be testing update-index --add, not git-add as the latter is implemented in terms of the former. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | An illustration of rev-list --parents --pretty=rawJunio C Hamano2006-09-27
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This script creates two separate histories, A and B, each of which does: (A0, B0): create fileA and subdir/fileB (A1, B1): modify fileA (A2, B2): modify subdir/fileB and then grafts them together to make B0 a child of A2. So the final history looks like (time flows from top to bottom): true parent touches subdir? A0 none yes (creates it) A1 A0 no A2 A1 yes B0 none yes (different from what's in A2) B1 B0 no B2 B1 yes "git rev-list --parents --pretty=raw B2" would give "fake" parents on the "commit " header lines while "parent " header lines show the parent as recorded in the commit object (i.e. B0 appears to have A2 as its parent on "commit " header but there is no "parent A2" header line in it). When you have path limiters, we simplify history to omit commits that do not affect the specified paths. So "git rev-list --parents --pretty=raw B2 subdir" would return "B2 B0 A2 A0" (because B1 and A1 do not touch the path). When it does so, the "commit " header lines have "fake" parents (i.e. B2 appears to have B0 as its parent on "commit " header), but you can still get the true parents by looking at "parent " header. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Ignore executable bit when adding files if filemode=0.Shawn Pearce2006-09-26
|/ | | | | | | | | | | | | | If the user has configured core.filemode=0 then we shouldn't set the execute bit in the index when adding a new file as the user has indicated that the local filesystem can't be trusted. This means that when adding files that should be marked executable in a repository with core.filemode=0 the user must perform a 'git update-index --chmod=+x' on the file before committing the addition. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add test for the default merges in fetch.Santi Béjar2006-09-24
| | | | | | | [jc: with minor fix-ups] Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add t5510 to test per branch configuration affecting git-fetch.Junio C Hamano2006-09-24
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Quote arguments to tr in test-libRobin Rosenberg2006-09-22
| | | | | | | When there are single-character filenames in the test directory, the shell tries to expand regexps meant for tr. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Document receive.denyNonFastforwardsJohannes Schindelin2006-09-20
| | | | | | | | [jc: with a fix to config handling in t5400 test, which took annoyingly long to diagnose.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* apply --unidiff-zero: loosen sanity checks for --unidiff=0 patchesJunio C Hamano2006-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In "git-apply", we have a few sanity checks and heuristics that expects that the patch fed to us is a unified diff with at least one line of context. * When there is no leading context line in a hunk, the hunk must apply at the beginning of the preimage. Similarly, no trailing context means that the hunk is anchored at the end. * We learn a patch deletes the file from a hunk that has no resulting line (i.e. all lines are prefixed with '-') if it has not otherwise been known if the patch deletes the file. Similarly, no old line means the file is being created. And we declare an error condition when the file created by a creation patch already exists, and/or when a deletion patch still leaves content in the file. These sanity checks are good safety measures, but breaks down when people feed a diff generated with --unified=0. This was recently noticed first by Matthew Wilcox and Gerrit Pape. This adds a new flag, --unified-zero, to allow bypassing these checks. If you are in control of the patch generation process, you should not use --unified=0 patch and fix it up with this flag; rather you should try work with a patch with context. But if all you have to work with is a patch without context, this flag may come handy as the last resort. Signed-off-by: Junio C Hamano <junkio@cox.net>
* t1400: make test debuggable.Junio C Hamano2006-09-16
| | | | | | | | | | I had a hard time figuring out why this test was failing with the packed-refs update without running it under "sh -x". This makes output from "sh t1400-update-ref.sh -v" more descriptive. Updating other tests would be a good janitorial task. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make apply --binary a no-op.Junio C Hamano2006-09-07
| | | | | | | | | Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so. This makes the flag a no-op by always allowing binary patch application. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Trace into a file or an open fd and refactor tracing code.Christian Couder2006-09-02
| | | | | | | | | | | | | | | | | | | | | | | If GIT_TRACE is set to an absolute path (starting with a '/' character), we interpret this as a file path and we trace into it. Also if GIT_TRACE is set to an integer value greater than 1 and lower than 10, we interpret this as an open fd value and we trace into it. Note that this behavior is not compatible with the previous one. We also trace whole messages using one write(2) call to make sure messages from processes do net get mixed up in the middle. This patch makes it possible to get trace information when running "make test". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* t5710: fix two thinkos.Junio C Hamano2006-08-31
| | | | | | | | | | | | | | | | | The intention of the test seems to be to build a long chain of clones that locally borrow objects from their parents and see the system give up dereferencing long chains. There were two problems: (1) it did not test the right repository; (2) it did not build a chain long enough to trigger the limitation. I do not think it is a good test to make sure the limitation the current implementation happens to have still exists, but that is a topic at a totally different level. At least this fixes the broken test. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/apply'Junio C Hamano2006-08-27
|\ | | | | | | | | | | | | | | | | | | | | | | * jc/apply: git-apply --reject: finishing touches. apply --reject: count hunks starting from 1, not 0 git-apply --verbose git-apply --reject: send rejects to .rej files. git-apply --reject apply --reverse: tie it all together. diff.c: make binary patch reversible. builtin-apply --reverse: two bugfixes.
| * git-apply --verboseJunio C Hamano2006-08-18
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * git-apply --reject: send rejects to .rej files.Junio C Hamano2006-08-18
| | | | | | | | | | | | | | ... just like everybody else does, instead of sending it to the standard output, which was just silly. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * git-apply --rejectJunio C Hamano2006-08-17
| | | | | | | | | | | | | | | | | | With the new flag "--reject", hunks that do not apply are sent to the standard output, and the usable hunks are applied. The command itself exits with non-zero status when this happens, so that the user or wrapper can take notice and sort the remaining mess out. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * apply --reverse: tie it all together.Junio C Hamano2006-08-16
| | | | | | | | | | | | Add a few tests, usage string, and documentation. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'maint'Junio C Hamano2006-08-21
|\ \ | |/ |/| | | | | | | | | * maint: builtin-mv: readability patch git-mv: fix off-by-one error git-mv: special case destination "."
| * git-mv: special case destination "."Johannes Schindelin2006-08-21
| | | | | | | | | | | | | | | | | | | | Since the normalized basename of "." is "", the check for directory failed erroneously. Noticed by Fredrik Kuivinen. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'maint'Junio C Hamano2006-08-15
|\ \ | |/ | | | | | | | | | | * maint: finish_connect(): thinkofix git-mv: succeed even if source is a prefix of destination Solaris does not support C99 format strings before version 10
| * git-mv: succeed even if source is a prefix of destinationJohannes Schindelin2006-08-15
| | | | | | | | | | | | | | | | | | | | | | As noted by Fredrik Kuivinen, without this patch, git-mv fails on git-mv README README-renamed because "README" is a prefix of "README-renamed". Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | t4116 apply --reverse testJunio C Hamano2006-08-14
| | | | | | | | | | | | | | The binary patch test needs to be made more careful not to have the postimage blob in the repository in which the patch is applied Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'jc/grep'Junio C Hamano2006-08-12
|\ \ | |/ |/|
| * git-grep: show pathnames relative to the current directoryJunio C Hamano2006-08-11
| | | | | | | | | | | | | | | | | | | | | | By default, the command shows pathnames relative to the current directory. Use --full-name (the same flag to do so in ls-files) if you want to see the full pathname relative to the project root. This makes it very pleasant to run in Emacs compilation (or "grep-find") buffer. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | t/t4013: fix futzing with the version string.Junio C Hamano2006-08-12
|/ | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-apply: applying a patch to make a symlink shorter.Junio C Hamano2006-08-09
| | | | | | | | | | | The internal representation of the result is counted string (i.e. char *buf and ulong size), which is fine for writing out to regular file, but throwing the buf at symlink(2) was a no-no. Reported by Willy Tarreau. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix "grep -w"Junio C Hamano2006-08-06
| | | | | | | | | | | | | | | We used to find the first match of the pattern and then if the match is not for the entire word, declared that the whole line does not match. But that is wrong. The command "git grep -w -e mmap" should find that a line "foo_mmap bar mmap baz" matches, by tring the second instance of pattern "mmap" on the same line. Problems an earlier round of "fix" had were pointed out by Morten Welinder, which have been incorporated in the t7002 tests. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add a couple of subdirectory tests.Junio C Hamano2006-08-03
| | | | | | | | We still have too few of them, but we have to start from somewhere. The general rule is to make tests easy to debug when run with -v (notice use of seemingly useless echo everywhere in the new tests). Signed-off-by: Junio C Hamano <junkio@cox.net>
* Remove cmd_usage() routine and re-organize the help/usage code.Ramsay Allan Jones2006-08-02
| | | | | | | | | | | | | | | | The cmd_usage() routine was causing warning messages due to a NULL format parameter being passed in three out of four calls. This is a problem if you want to compile with -Werror. A simple solution is to simply remove the GNU __attribute__ format pragma from the cmd_usage() declaration in the header file. The function interface was somewhat muddled anyway, so re-write the code to finesse the problem. [jc: this incidentally revealed that t9100 test assumed that the output from "git help" to be fixed in stone, but this patch lower-cases "Usage" to "usage". Update the test not to rely on "git help" output.] Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* New tests and en-passant modifications to mktag.Ramsay Allan Jones2006-08-02
| | | | | | | | | | | | | | | | | | | These changes were originally part of the next patch, but have been split out since they were peripheral to the main purpose of that patch. - update comment describing the signature format to reflect the current code. - remove trailing \n in calls to error(), since a \n is already provided by error(). - remove redundant call to get_sha1_hex(). - call sha1_to_hex(sha1) to convert to ascii, rather than attempting to print the raw sha1. The new tests provide a regression suite to support the modifications to git-mktag in this and the next patch. Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix annotate test script; notice when git-annotate fails.Ramsay Allan Jones2006-08-02
| | | | | | | | | The t8001-annotate.sh test claimed all tests pass, when in fact the git-annotate perl script failed to run! (prior to fixing the script to work with perl 5.5). Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'js/mv'Junio C Hamano2006-07-30
|\ | | | | | | | | | | | | * js/mv: builtin git-mv: support moving directories Make git-mv a builtin Extract helper bits from c-merge-recursive work
| * builtin git-mv: support moving directoriesJohannes Schindelin2006-07-26
| | | | | | | | | | | | | | | | | | | | This fixes the builtin mv for the test which Josef provided, and also fixes moving directories into existing directories, as noted by Jon Smirl. In case the destination exists, fail early (this cannot be overridden by -f). Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Display an error from update-ref if target ref name is invalid.Shawn Pearce2006-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alex Riesen (raa.lkml@gmail.com) recently observed that git branch would fail with no error message due to unexpected situations with regards to refs. For example, if .git/refs/heads/gu is a file but "git branch -b refs/heads/gu/fixa HEAD" was invoked by the user it would fail silently due to refs/heads/gu being a file and not a directory. This change adds a test for trying to create a ref within a directory that is actually currently a file, and adds error printing within the ref locking routine should the resolve operation fail. The error printing code probably belongs at this level of the library as other failures within the ref locking, writing and logging code are also currently at this level of the code. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | t4103: fix binary patch application test.Junio C Hamano2006-07-28
| | | | | | | | | | | | | | | | | | The generated binary patch was _not_ binary -- earlier I made the --full-index flag to imply binary patch generation to the diff machinery, but later we made it independent from --binary (although the latter implies the former). Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Teach git-apply about '-R'Johannes Schindelin2006-07-28
|/ | | | | Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* t7001: add test for git-mv dir1 dir2/Johannes Schindelin2006-07-26
| | | | | | | | If dir2 already exists, git-mv should move dir1 _into_dir2/. Noticed by Jon Smirl. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* t4112: simplify the test and remove unneeded working tree file.Junio C Hamano2006-07-26
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Extend testing git-mv for renaming of subdirectoriesJosef Weidendorfer2006-07-26
| | | | | Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'ew/apply'Junio C Hamano2006-07-25
|\ | | | | | | | | | | | | | | | | * ew/apply: Fix t4114 on cygwin apply: handle type-changing patch correctly. apply: split out removal and creation into different phases. apply: check D/F conflicts more carefully. typechange tests for git apply (currently failing)
| * typechange tests for git apply (currently failing)Eric Wong2006-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've found that git apply is incapable of handling patches involving object type changes to the same path. Of course git itself is perfectly capable of making commits that generate these changes, as it only tracks trees states. It's just that the diffs between them are less useful if they can't be applied. Some of these are rare, but I've hit one of them (file becoming a symlink) recently in real-world usage, and was inspired to find more potential breakages :) I'm not sure when I'll have time to fix these myself and I'm not very familiar with the apply code. So if someone could get some or all of these cases working, they would be my hero :) Some of these are what I would refer to as corner-cases from hell. Most (if not all) other systems fail some of these. In fact, they aren't even capable of representing most of these changes in their histories; much less being able to handle patches to that effect. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Trivial path optimization testAlex Riesen2006-07-24
|/ | | | | | | | | | | | | | Linus: get_pathspec() does turn '.' into an empty string (which is correct - git internally does _not_ ever understand the notion of "." as the current working directory), but it doesn't ever do the optimization of noticing that a pathspec that consists solely of an empty string is "equivalent" to an empty pathspec. The test is to ensure that this behaviour stays. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Adjust t4013 tests to corrected format-patch.Junio C Hamano2006-07-13
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* t4013 diff format tests updateJunio C Hamano2006-07-13
| | | | | | | | | | This changes one test commit in the sequence to have more than one lines of commit log. A few output formats (--pretty=email aka format-patch and --pretty=oneline) need to behave differently on single and multi-line log, and this change will help catching breakages. Signed-off-by: Junio C Hamano <junkio@cox.net>