1
0
mirror of https://github.com/git/git.git synced 2024-10-01 02:32:27 +02:00
Commit Graph

167 Commits

Author SHA1 Message Date
Fredrik Kuivinen
72d1216a04 New test case: merge with directory/file conflicts
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03 12:29:05 -08:00
Fredrik Kuivinen
d3bfdb755e test-lib.sh: Add new function, test_expect_code
The test is considered OK if it exits with code $1

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03 12:28:57 -08:00
Junio C Hamano
57ae0d09ed t3100: add ls-tree -t and -d tests.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01 22:49:52 -08:00
Junio C Hamano
5401f3040b Merge branches 'jc/apply', 'lt/ls-tree', 'lt/bisect' and 'lt/merge' 2005-11-30 11:05:48 -08:00
Alex Riesen
8bf2c69c2d [PATCH] Add tests for git-mv in subdirectories
Junio C Hamano, Sat, Nov 26, 2005 03:45:52 +0100:

> I haven't seriously used git-mv myself, so
> somebody needs to test it, and if it actually works and Ack on
> it, please.

It actually works in subdirs.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 15:43:20 -08:00
Junio C Hamano
246cc52f38 ls-tree: match the test to the new semantics.
The diff for this commit is a good illustration of what changed
in ls-tree behaviour.

 - With -r, tree nodes themselves are not shown anymore, but
   blobs in subtrees are shown.

 - The order of paths parameters do not matter, since they are
   not like arguments to /bin/ls, but are filter patterns.

 - When filter patterns overlap, unintuitive things happen.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:06:29 -08:00
Johannes Schindelin
ee72aeaf00 Rename git-config-set to git-repo-config
... and adjust all references.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-24 11:10:40 -08:00
Johannes Schindelin
b17e659dd4 Allow hierarchical section names
A .git/config like follows becomes valid with this patch:

	[remote.junio]
		url = git://git.kernel.org/pub/scm/git/git.git
		pull = master:junio todo:todo +pu:pu

	[remote.ibook]
		url = ibook:git/
		pull = master:ibook
		push = master:quetzal

(This patch only does the ini file thing, git-fetch and friends still
ignore these values).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-21 14:04:28 -08:00
Johannes Schindelin
f98d863d21 git-config-set: support selecting values by non-matching regex
Extend the regex syntax of value_regex so that prepending an exclamation
mark means non-match:

	[core]
		quetzal = "Dodo" for Brainf*ck
		quetzal = "T. Rex" for Malbolge
		quetzal = "cat"

You can match the third line with

	git-config-set --get quetzal '! for '

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-20 10:53:06 -08:00
Johannes Schindelin
4ddba79db7 git-config-set: add more options
... namely

--replace-all, to replace any amount of matching lines, not just 0 or 1,
--get, to get the value of one key,
--get-all, the multivar version of --get, and
--unset-all, which deletes all matching lines from .git/config

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-19 23:15:07 -08:00
Junio C Hamano
fbba222f5d tests: binary diff application.
This adds more tests to cover cases where binary diff
application succeeds.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 16:20:41 -08:00
Junio C Hamano
011f4274bb apply: allow-binary-replacement.
A new option, --allow-binary-replacement, is introduced.

When you feed a diff that records full SHA1 name of pre- and
post-image blob on its index line to git-apply with this option,
the post-image blob replaces the path if what you have in the
working tree matches the pre-image _and_ post-image blob is
already available in the object directory.

Later we _might_ want to enhance the diff output to also include
the full binary data of the post-image, to make this more
useful, but this is good enough for local rebasing application.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 16:20:40 -08:00
Junio C Hamano
92927ed0aa git-apply: fail if a patch cannot be applied.
Recently we fixed 'git-apply --stat' not to barf on a binary
differences.  But it accidentally broke the error detection when
we actually attempt to apply them.

This commit fixes the problem and adds test cases.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 14:12:56 -08:00
Johannes Schindelin
a0fa2a10b4 Fix tests with new git in C
GIT_EXEC_PATH *has* to be set.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 22:10:58 -08:00
Junio C Hamano
d7bba81575 Update topo-order test.
The recently we updated rev-list --topo-order to show the heads
in date order, but we had a test that expected to see the old
behaviour.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 18:15:30 -08:00
Alex Riesen
08db81a9f1 allow git-update-ref create refs with slashes in names
Make git-update-ref create references with slashes in them. git-branch
and git-checkout already support such reference names.

git-branch can use git-update-ref to create the references in a more
formal manner now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 17:15:32 -08:00
Junio C Hamano
631ba30907 Merge branches 'jc/sb' and 'jc/mb' 2005-11-11 10:52:59 -08:00
Junio C Hamano
4bc51db0fe t1200: use --topo-order to keep the show-branch output stable.
Because a batch-oriented script creates many commits within a second
on a fast machine, show-branch output of the test results are unstable
without topo-order.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11 10:52:39 -08:00
Junio C Hamano
53de71f88b Add test case for merge-base.
Although it was shown that the "full contamination" was not really full
during the list discussion, the series improves things without incurring
extra parsing cost, and here is a test to check that.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11 10:52:31 -08:00
Alex Riesen
23fc63bf8f make tests ignorable with "make -i"
Allow failed tests to be ignored using make's "-i". The patch also
disables parallel make in t/. This doesn't make the testing any
different as before: the tests were run sequentially before.

It also allows to run more tests, ignoring the ones usually failing
just to figure out if something else broke.  (Or to ignore plainly
uninteresting situations because of the testing being done on say...
cygwin ;)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08 11:26:07 -08:00
Alex Riesen
cb34882bd6 fix t5000-tar-tree.sh when $TAR isn't set
$TAR isn't set everywhere. Provide a default (tar)

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08 11:26:03 -08:00
Junio C Hamano
b52d9f9ba7 test: t4102-apply-rename fails with strict umask.
We checked the result of patch application for full permission bits,
when the only thing we cared about was to make sure the executable
bit was correctly set.

Noticed by Peter Baumann.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-05 13:08:18 -08:00
Alex Riesen
d317e4384a remove CR/LF from .gitignore
For everyone cursed by dos/windows line endings (aka CRLF):

The code reading the .gitignore files (excludes and excludes per
directory) leaves \r in the patterns, which causes fnmatch to fail for
no obvious reason. Just remove a "\r" preceding a "\n"
unconditionally.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-02 16:50:58 -08:00
Johannes Schindelin
8d7d1670a8 make t5501 less annoying
On Linux, "mktemp tmp-XXXX" will not work. Also, redirect stderr on which,
so it does not complain too loudly. After all, this test should only be
executed when old binaries are available.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-28 22:57:01 -07:00
Johannes Schindelin
eebda31d21 Implement an interoperability test for fetch-pack/upload-pack
The next patches will extend the pack protocol. This test assures that this
extension is compatible to earlier versions of git-fetch-pack/git-upload-pack.

All you need to do to take advantage of this test, is to install older
known-to-be-working binaries in the path as "old-git-fetch-pack" and
"old-git-upload-pack".

Note that the warning when testing with old-git-fetch-pack is to be
expected (it just says that the old version was not taking advantage
of all the information which the server sent).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-28 22:56:59 -07:00
Johannes Schindelin
6b17c674aa Implement a test for git-fetch-pack/git-upload-pack
This test provides a minimal example of what went wrong with the old
git-fetch-pack (and now works beautifully).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-28 22:56:58 -07:00
Pavel Roskin
f07a524195 fix testsuite to tolerate spaces in path
This patch allows the testsuite to run properly when the full path to
the git sources contains spaces or other symbols that need to be quoted.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-28 02:59:01 -07:00
Linus Torvalds
9106c097ad Create object subdirectories on demand (phase II)
This removes the unoptimization.  The previous round does not mind
missing fan-out directories, but still makes sure they exist, lest
older versions choke on a repository created/packed by it.

This round does not play that nicely anymore -- empty fan-out
directories are not created by init-db, and will stay removed by
prune-packed.  The prune command also removes empty fan-out directories.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-28 02:01:42 -07:00
Johannes Schindelin
5f93926c3c No funny names on cygwin...
On FAT/NTFS, filenames cannot contain tabs. So t3300-funny-names would
reliably fail already when trying to create such files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-18 11:35:17 -07:00
Junio C Hamano
508c1d1c9b Adjust tests for not quoting SP.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:59 -07:00
Junio C Hamano
4d2060efeb Add tests for funny pathnames.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:57 -07:00
Junio C Hamano
c09a69a83e Disable hooks during tests.
Individual tests for hooks would want to have their own tests when
written.  Also we should not pick up from random templates the user
happens to have.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 00:24:34 -07:00
Junio C Hamano
f51248eb48 Merge branch 'fixes' 2005-10-15 11:19:09 -07:00
Johannes Schindelin
2ae6c70674 Adapt tutorial to cygwin and add test case
Lacking reliable symlinks, the instructions in the tutorial did not work
in a cygwin setup. Also, a few outputs were not correct.

This patch fixes these, and adds a test case which follows the
instructions of the tutorial (except git-clone, -fetch and -push, which I
have not done yet).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 11:36:37 -07:00
Sergey Vlasov
9cf6d3357a Add git-index-pack utility
git-index-pack builds a pack index file for an existing packed
archive.  With this utility a packed archive which was transferred
without the corresponding pack index can be added to objects/pack/
without repacking.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-12 18:32:02 -07:00
Johannes Schindelin
0a81552e06 Use git-update-ref and git-symbolic-ref in tests
This makes all tests pass on cygwin.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-11 15:15:15 -07:00
Junio C Hamano
b12bbd5986 Merge branch 'fixes'
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-10 16:03:43 -07:00
Johannes Schindelin
18e410f1ea t5400-send-pack relies on a working cpio
Since cygwin does not install cpio by default, t5400 results in a very
cryptic failure. So, test for cpio explicitely.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-10 14:14:22 -07:00
Junio C Hamano
4769948afe Deal with $(bindir) and friends with whitespaces.
... using HPA's shellquote macro.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-10 13:51:52 -07:00
Junio C Hamano
899460f336 Also force LC_ALL in test scripts.
Noticed by Junichi Uekawa.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-09 21:58:02 -07:00
Linus Torvalds
230f13225d Create object subdirectories on demand
This makes it possible to have a "sparse" git object subdirectory
structure, something that has become much more attractive now that people
use pack-files all the time.

As a result of pack-files, a git object directory doesn't necessarily have
any individual objects lying around, and in that case it's just wasting
space to keep the empty first-level object directories around: on many
filesystems the 256 empty directories will be aboue 1MB of diskspace.

Even more importantly, after you re-pack a project that _used_ to be
unpacked, you could be left with huge directories that no longer contain
anything, but that waste space and take time to look through.

With this change, "git prune-packed" can just do an rmdir() on the
directories, and they'll get removed if empty, and re-created on demand.

This patch also tries to fix up "write_sha1_from_fd()" to use the new
common infrastructure for creating the object files, closing a hole where
we might otherwise leave half-written objects in the object database.

[jc: I unoptimized the part that really removes the fan-out directories
 to ease transition.  init-db still wastes 1MB of diskspace to hold 256
 empty fan-outs, and prune-packed rmdir()'s the grown but empty directories,
 but runs mkdir() immediately after that -- reducing the saving from 150KB
 to 146KB.  These parts will be re-introduced when everybody has the
 on-demand capability.]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-08 15:54:01 -07:00
Junio C Hamano
0d0b7c237a Merge branch 'fixes' 2005-10-07 17:06:21 -07:00
robfitz@273k.net
ab1630a3ed Fix wrong filename listing bug in git-ls-tree.
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-07 16:54:06 -07:00
Junio C Hamano
ec1fcc16af Show original and resulting blob object info in diff output.
This adds more cruft to diff --git header to record the blob SHA1 and
the mode the patch/diff is intended to be applied against, to help the
receiving end fall back on a three-way merge.  The new header looks
like this:

    diff --git a/apply.c b/apply.c
    index 7be5041..8366082 100644
    --- a/apply.c
    +++ b/apply.c
    @@ -14,6 +14,7 @@
     //    files that are being modified, but doesn't apply the patch
     //  --stat does just a diffstat, and doesn't actually apply
    +//  --show-index-info shows the old and new index info for...
    ...

Upon receiving such a patch, if the patch did not apply cleanly to the
target tree, the recipient can try to find the matching old objects in
her object database and create a temporary tree, apply the patch to
that temporary tree, and attempt a 3-way merge between the patched
temporary tree and the target tree using the original temporary tree
as the common ancestor.

The patch lifts the code to compute the hash for an on-filesystem
object from update-index.c and makes it available to the diff output
routine.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-07 03:42:00 -07:00
Fredrik Kuivinen
500b97e4bb [PATCH] Teach git-ls-files about '--' to denote end of options.
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-02 10:31:18 -07:00
Junio C Hamano
455a7f3275 More portability.
- 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-01 23:19:48 -07:00
Junio C Hamano
8098a178b2 Add git-symbolic-ref
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-10-01 23:19:33 -07:00
Junio C Hamano
3e03aaf523 Update the case table in t/t1000.
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-28 12:56:18 -07:00
Peter Eriksen
edde7a8b53 [PATCH] Make the test more shell generic and fix missing Solaris find option
This is from Peter Eriksen, but further fixed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-27 00:16:39 -07:00
Junio C Hamano
5cfcd07c93 Retire diff-helper.
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-22 01:54:13 -07:00