1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 08:47:56 +01:00
Commit graph

20 commits

Author SHA1 Message Date
Junio C Hamano
75a46f6b0e write-tree: check extra arguments and die but be a bit more helpful.
"git-write-tree junk" complains and dies, but it does not say
what option it supports.  Die with the usage string in such a
case.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-05 22:31:18 -08:00
Junio C Hamano
53228a5fb8 Make the rest of commands work from a subdirectory.
These commands are converted to run from a subdirectory.

    commit-tree convert-objects merge-base merge-index mktag
    pack-objects pack-redundant prune-packed read-tree tar-tree
    unpack-file unpack-objects update-server-info write-tree

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Petr Baudis
0b124bb4bf [PATCH] Trivial tidyups
Simple whitespace-related tidyups ensuring style consistency.

This is carried over from my old git-pb branch.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-29 17:21:49 -07:00
Bryan Larsen
9c1fa70aaa [PATCH] add --missing-ok option to write-tree
This option allows a write-tree even if the referenced objects are not
in the database.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-11 10:20:53 -07:00
Jan Harkes
7323aa11af [PATCH] git-write-tree doesn't check alternate directories
git-write-tree failed when referenced objects only exist in the
GIT_ALTERNATE_OBJECT_DIRECTORIES path.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Acked-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-25 13:41:10 -07:00
Alexey Nezhdanov
667bb59b2d [PATCH] cleanup of in-code names
Fixes all in-code names that leaved during "big name change".

Signed-off-by: Alexey Nezhdanov <snake@penza-gsm.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-19 10:52:00 -07:00
Petr Baudis
f1a7eb36b0 Merge with http://members.cox.net/junkio/git-jc.git 2005-05-11 02:00:49 +02:00
Petr Baudis
c899350e9d write-tree is now willing to write empty tree
Cogito wants to be able to do some initial commit at the time of cg-init,
which may be empty in case when cg-init is called in an empty tree.
2005-05-08 16:15:59 +02:00
Junio C Hamano
8eef4d3ed1 Notice index that has path and path/file and refuse to write such a tree.
Kay Sievers noticed that you can have both path and path/file in
the cache and write-tree happily creates a tree object from such
a state.  Since a merge can result in such situation and the
user should be able to see the situation by looking at the
cache, rather than forbidding add_cache_entry() to create such
conflicts, fix it by making write-tree refuse to write such an
nonsensical tree.  Here is a test case.

-- test case --

$ ls -a
./  ../
$ git-init-db
defaulting to local storage area
$ date >path
$ git-update-cache --add path
$ rm path
$ mkdir path
$ date >path/file
$ git-update-cache --add path/file
$ git-ls-files --stage
100644 1738f2536b1201218c41153941da065cc26174c9 0 path
100644 620c72f1c1de15f56ff9d63d6d7cdc69e828f1e3 0 path/file
$ git-ls-tree $(git-write-tree)                     ;# using old one
100644	blob	1738f2536b1201218c41153941da065cc26174c9	path
040000	tree	ec116937f223e3df95aeac9f076902ae1618ae98	path
$ ../git-write-tree                                 ;# using new one
You have both path and path/file
fatal: write-tree: not able to write tree
$ exit

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-05-07 12:22:02 -07:00
Christopher Li
812666c8e6 [PATCH] introduce xmalloc and xrealloc
Introduce xmalloc and xrealloc to die gracefully with a descriptive
message when out of memory, rather than taking a SIGSEGV. 

Signed-off-by: Christopher Li<chrislgit@chrisli.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-26 12:00:58 -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
Brad Roberts
7223a88ce7 [PATCH] fix for memory leak in write-tree.c
Fix a memory leak in write-tree.c, not freeing the directory buffer.
2005-04-17 10:55:12 -07:00
Linus Torvalds
c347ea5d6f write-tree: refuse to write out trees with unmerged index entries.
Of course, we can't even generate such an index yet, but give me
some time. This is a cunning plan. Let's see if it actually works.

(I feel like Wile E Coyote, waiting for the big rock to fall).
2005-04-15 22:04:54 -07:00
Linus Torvalds
ccc4feb579 Convert the index file reading/writing to use network byte order.
This allows using a git tree over NFS with different byte order, and
makes it possible to just copy a fully populated repository and have
the end result immediately usable (needing just a refresh to update
the stat information).
2005-04-15 10:44:27 -07:00
Petr Baudis
2de381f919 [PATCH] Consolidate the error handling
Now there is error() for "library" errors and die() for fatal "application"
errors. usage() is now used strictly only for usage errors.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-04-13 02:28:48 -07:00
Linus Torvalds
121481abf8 Make "update-cache" a bit friendlier to use (and harder to mis-use).
It now requires the "--add" flag before you add any new files, and
a "--remove" file if you want to mark files for removal. And giving
it the "--refresh" flag makes it just update all the files that it
already knows about.
2005-04-10 11:32:54 -07:00
Linus Torvalds
d6d3f9d012 This implements the new "recursive tree" write-tree.
It's got some debugging printouts etc still in it, but testing on the
kernel seems to show that it does indeed fix the issue with huge tree
files for each commit.
2005-04-09 17:09:34 -07:00
Linus Torvalds
19b2860cba Use "-Wall -O2" for the compiler to get more warnings.
And fix up the warnings that it pointed out. Let's keep the tree
clean from early on.

Not that the code is very beautiful anyway ;)
2005-04-08 09:59:28 -07:00
Linus Torvalds
8bc9a0c769 Add copyright notices.
The tool interface sucks (especially "committing" information, which is just
me doing everything by hand from the command line), but I think this is in
theory actually a viable way of describing the world. So copyright it.
2005-04-07 15:16:10 -07:00
Linus Torvalds
e83c516331 Initial revision of "git", the information manager from hell 2005-04-07 15:13:13 -07:00