Commit Graph

37223 Commits

Author SHA1 Message Date
Junio C Hamano
86436c2828 [PATCH] Split external diff command interface to a separate file.
With this patch, the non-core'ish part of show-diff command that
invokes an external "diff" comand to obtain patches is split
into a separate file.  The next patch will introduce a new
command, diff-tree-helper, which uses this common diff interface
to format diff-tree and diff-cache output into a patch form.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-25 18:22:47 -07:00
Linus Torvalds
ab7df1874d fsck-cache: show root objects only with "--root"
This makes the default fsck behaviour be quiet for a repository
that doesn't have any problems. Which is good.
2005-04-25 16:34:13 -07:00
Linus Torvalds
889262eacf fsck-cache: only show tags if asked to do so with "--tags"
Normally we don't care, we just check them for being valid tag
objects.
2005-04-25 16:31:13 -07:00
Linus Torvalds
cd2fb81d11 Add the git-*-script files to the install 2005-04-25 15:29:45 -07:00
Linus Torvalds
65f0d0ee46 Add example "git-tag-script" to show how to create signed tag objects. 2005-04-25 15:23:53 -07:00
Linus Torvalds
56ce69f7af Make "fsck" also show what the name of the tag object is, not just
the name of the object it tags.

You need this if you actually want to build up a list of tags.
2005-04-25 15:21:49 -07:00
Linus Torvalds
ec4465adb3 Add "tag" objects that can be used to sign other objects.
You use "git-mktag" to create them, and fsck-cache knows how to parse them.
2005-04-25 12:07:44 -07:00
Linus Torvalds
f5b913c9cb Fix up the types in write_sha1_file
Use "unsigned long" for the size, like we do everywhere else.
2005-04-25 12:04:55 -07:00
Linus Torvalds
a44c9a5e2e Simplify "write_sha1_file()" interfaces
The write function now adds the header to the file by itself, so there
is no reason to duplicate it among all the users any more.
2005-04-25 10:19:53 -07:00
Linus Torvalds
e6948b6d88 fsck-cache: warn about missing commit dates
Now that we have hopefully converted all old archives, we
can consider it an error.
2005-04-24 16:20:53 -07:00
Linus Torvalds
3f053897b3 Update "convert-cache" to handle git itself.
The git archives have some old-date-format commits with timezones
that the converter didn't recognize. Also, make it be quiet about
already-converted dates.
2005-04-24 15:49:09 -07:00
James Bottomley
c6e007b094 [PATCH] update-cache: add "--ignore-missing" option
This adds an --ignore-missing option to update-cache, which makes it
ignore missing files.  Together with the "-n" option to checkout-cache,
it allows me to do

    checkout-cache -n -f -a && update-cache --ignore-missing --refresh

which only updates and refreshes the files I already have checked out.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-24 15:14:16 -07:00
James Bottomley
32718b6c5e [PATCH] checkout-cache: add "-n" option
This adds the "-n" option to checkout-cache which tells it to not check
out new files, only refresh files already checked out.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-24 15:14:16 -07:00
Linus Torvalds
235ac40772 Don't add references to objects we couldn't find.
That would SIGSEGV.
2005-04-24 14:31:57 -07:00
Linus Torvalds
c35dfe8589 Verify that the object type matches for tree/commit objects even before parsing.
The type doesn't come from the parsing, the type also has to match the usage.
2005-04-24 14:22:09 -07:00
Linus Torvalds
d32987be61 Set object type at object creation time, not object parse time.
Otherwise we can have objects without a type, which is not good.
2005-04-24 14:17:13 -07:00
Linus Torvalds
4728b861ac fsck-cache: notice missing "blob" objects.
We should _not_ mark a blob object "parsed" just because we
looked it up: it gets marked that way only once we've actually
seen it. Otherwise we can never notice a missing blob.
2005-04-24 14:10:55 -07:00
Andreas Gal
da6abf5d9c [PATCH] fix segfault in fsck-cache
Here is how to trigger it:

   echo blob 100 > .git/objects/00/ae4e8d3208e09f2cf7a38202a126f728cadb49

Then run fsck-cache. It will try to unpack after the header to calculate 
the hash, inflate returns total_out == 0 and memcpy() dies.

The patch below seems to work with ZLIB 1.1 and 1.2.

Signed-off-by: Andreas Gal <gal@uci.edu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-24 14:04:13 -07:00
Linus Torvalds
c5b423860d Support a fine-grained diff-tree
This is based on a patch by David Woodhouse, but with the selection
tests much simplified and streamlined.

It makes diff-tree take extra arguments, specifying the files or         
directories which should be considered "interesting". Changes in
uninteresting directories are not reported.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 22:08:00 -07:00
James Bottomley
e2b6a9d0bf [PATCH] make file merging respect permissions
1) permissions aren't respected in the merge script (primarily because
they're never passed in to it in the first place).  Fix that and also
check for permission conflicts in the merge

2) the delete of a file in both branches may indeed be just that, but it
could also be the indicator of a rename conflict (file moved to
different locations in both branches), so error out and ask the
committer for guidance.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 20:50:10 -07:00
Daniel Barkalow
58e28af6a4 [PATCH] Allow multiple date-ordered lists
Make pop_most_recent_commit() return the same objects multiple times, but only
if called with different bits to mark.

This is necessary to make merge-base work again.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 20:29:22 -07:00
Linus Torvalds
4056c09114 Don't add parents to the commit list if we have already
seen them.

Otherwise any merges will make the parent list explode.
2005-04-23 19:21:28 -07:00
Linus Torvalds
64745109c4 Add "rev-list" program that uses the new time-based commit listing.
This is probably what you'd want to see for "git log".
2005-04-23 19:04:40 -07:00
Daniel Barkalow
6eb7ed5403 [PATCH] Various transport programs
This patch adds three similar and related programs. http-pull downloads
objects from an HTTP server; rpull downloads objects by using ssh and
rpush on the other side; and rpush uploads objects by using ssh and rpull
on the other side.

The algorithm should be sufficient to make the network throughput required
depend only on how much content is new, not at all on how much content the
repository contains.

The combination should enable people to have remote repositories by way of
ssh login for authenticated users and HTTP for anonymous access.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:47:23 -07:00
Daniel Barkalow
b6b15db3f4 [PATCH] Replace merge-base implementation
The old implementation was a nice algorithm, but, unfortunately, it could
be confused in some cases and would not necessarily do the obvious thing
if one argument was decended from the other. This version fixes that by
changing the criterion to the most recent common ancestor.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:47:23 -07:00
Daniel Barkalow
8237b1854c [PATCH] Additional functions for the objects database
This adds two functions: one to check if an object is present in the local
database, and one to add an object to the local database by reading it
from a file descriptor and checking its hash.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:47:23 -07:00
Daniel Barkalow
08692164e0 [PATCH] Parse tree objects completely
This adds the contents of trees to struct tree.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:47:23 -07:00
Daniel Barkalow
dd97f850c3 [PATCH] Add some functions for commit lists
This adds a function for inserting an item in a commit list, a function
for sorting a commit list by date, and a function for progressively
scanning a commit history from most recent to least recent.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:47:23 -07:00
Jonas Fonseca
90ffd0952f [PATCH] Simplify building of programs
Do not first build .o files when building programs.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:41:48 -07:00
Petr Baudis
65bc81d6fe [PATCH] Fix broken diff-cache output on added files
Added files were errorneously reported with the - prefix by diff-cache,
obviously leading to great confusion.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:05:07 -07:00
Linus Torvalds
93256315b2 Make a hack to convert-cache for missing author dates in old
archives (notably the old sparse one).

Very hacky. But hopefully we can do the conversion once, and never
worry about this ever again.
2005-04-23 16:48:32 -07:00
Linus Torvalds
bfac5d9429 Make "convert-cache" able to handle the really old archive formats
This includes the old-style "flat tree" object, and the old broken
date format. Well, enough of the date format to convert the sparse
archive, at least.
2005-04-23 16:37:31 -07:00
Linus Torvalds
144bde78e9 Use O_NOATIME when opening the sha1 files.
We really don't care about atime, and it sucks to dirty the
inode cache just for it.

This is more than a one-liner only because we need to be able to
clear the O_NOATIME flag in case some of the objects are owned
by others (in which case open will return EPERM), and because not
everybody has the O_NOATIME flag.
2005-04-23 11:09:32 -07:00
Paul Mackerras
a6ef3518f9 [PATCH] PPC assembly implementation of SHA1
Here is a SHA1 implementation with the core written in PPC assembly.
On my 2GHz G5, it does 218MB/s, compared to 135MB/s for the openssl
version or 45MB/s for the mozilla version.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-22 23:08:43 -07:00
Linus Torvalds
b5af910727 New "diff-cache" implementation.
This one is about a million times simpler, and much more likely to be
correct too.

Instead of trying to match up a tree object against the index, we just
read in the tree object side-by-side into the index, and just walk the
resulting index file. This was what all the read-tree cleanups were
all getting to.
2005-04-22 17:15:28 -07:00
Linus Torvalds
94537c78a8 Move "read_tree()" to "tree.c" to be used as a generic helper function.
Next step: make "diff-cache" use it.
2005-04-22 16:42:37 -07:00
Linus Torvalds
aba0668247 Clean up and simplify read-tree a bit.
This is preparation for moving parts of it into "tree.c" to be used
as a library function.
2005-04-22 16:35:06 -07:00
Linus Torvalds
cef661fc79 Add support for alternate SHA1 library implementations.
This one includes the Mozilla SHA1 implementation sent in by Edgar Toernig.
It's dual-licenced under MPL-1.1 or GPL, so in the context of git, we
obviously use the GPL version. 

Side note: the Mozilla SHA1 implementation is about twice as fast as the
default openssl one on my G5, but the default openssl one has optimized
x86 assembly language on x86. So choose wisely.
2005-04-21 12:33:22 -07:00
Linus Torvalds
cc1ad5c830 Split up Makefile library list handling with separate entries for
zlib and libssl.

I'll start giving people choices here..
2005-04-21 12:14:46 -07:00
Linus Torvalds
b2c0071867 Include <limits.h> in commit.c for ULONG_MAX. Remove old "revision.h".
The old revision.h helper header isn't used any more, but I never noticed
it until I started grepping for ULONG_MAX users.
2005-04-21 11:21:33 -07:00
Linus Torvalds
bb233d690a Add support for a "GIT_INDEX_FILE" environment variable.
We use that to specify alternative index files, which can be useful
if you want to (for example) generate a temporary index file to do
some specific operation that you don't want to mess with your main
one with.

It defaults to the regular ".git/index" if it hasn't been specified.
2005-04-21 10:55:18 -07:00
Linus Torvalds
65bb49144d Add the ability to prefix something to the pathname to "checkout-cache.c"
This basically makes it trivial to use checkout-cache as a "export as
tree" function. Just read the desired tree into the index, and do a

	checkout-cache --prefix=export-dir/ -a

and checkout-cache will "export" the cache into the specified directory.

NOTE! The final "/" is important. The exported name is literally just
prefixed with the specified string, so you can also do something like

	checkout-cache --prefix=.merged- Makefile

to check out the currently cached copy of "Makefile" into the file
".merged-Makefile".
2005-04-21 10:15:02 -07:00
Linus Torvalds
94dfb7f2e3 Fix NSEC compile problem, and properly parse the rev-tree cmd line.
The rev-tree thing just happened to work. It shouldn't have.
2005-04-21 09:58:24 -07:00
Junio C Hamano
c5bac17ad2 [PATCH] Usage-string fixes.
Usage string fixes to make maintenance easier (only one instance
of a string to update not multiple copies).  I've spotted and
corrected inconsistent usage text in diff-tree while doing this.

Also diff-cache and read-tree usage text have been corrected to
match their up-to-date features.  Earlier, neither "--cached"
form of diff-cache nor "-m single-merge" form of read-tree were
described. 

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-20 19:49:16 -07:00
Linus Torvalds
80913d4364 Duh, just make git-export.c use the proper syntax, everything is fine. 2005-04-20 19:19:11 -07:00
Linus Torvalds
860edf7a71 Fix up some problems from the commit->tree helper patch 2005-04-20 18:49:41 -07:00
Linus Torvalds
32347c3752 Fix up git-export to use the lower-level interfaces for diff generation.
The high-level helpers seem to have forgotten what to do with sha1
names.
2005-04-20 18:48:27 -07:00
Junio C Hamano
b12ec373b8 [PATCH] Teach read-tree about commit objects
Updates read-tree to use read_tree_with_tree_or_commit_sha1()
function.  The command can take either tree or commit IDs with
this patch.

The change involves a slight modification of how it recurses down
the tree.  Earlier the caller only supplied SHA1 and the recurser
read the object using it, but now it is the caller's responsibility
to read the object and give it to the recurser.  This matches the
way recursive behaviour is done in other tree- related commands.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-20 18:06:50 -07:00
Junio C Hamano
23b127ed08 [PATCH] Teach ls-tree about commit objects
Updates ls-tree.c to use read_tree_with_tree_or_commit_sha1()
function.  The command can take either tree or commit IDs with
this patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-20 18:06:50 -07:00
Junio C Hamano
c1fdf2a6ab [PATCH] Teach diff-tree about commit objects
Updates diff-tree.c to use read_tree_with_tree_or_commit_sha1()
function.  The command can take either tree or commit IDs with this patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-20 18:06:50 -07:00