summaryrefslogtreecommitdiff
path: root/write-tree.c
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH] Trivial tidyupsPetr Baudis2005-07-291-2/+2
| | | | | | | | | 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>
* [PATCH] add --missing-ok option to write-treeBryan Larsen2005-07-111-1/+13
| | | | | | | | 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>
* [PATCH] git-write-tree doesn't check alternate directoriesJan Harkes2005-06-251-5/+4
| | | | | | | | | 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>
* [PATCH] cleanup of in-code namesAlexey Nezhdanov2005-05-191-4/+4
| | | | | | | 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>
* Merge with http://members.cox.net/junkio/git-jc.gitPetr Baudis2005-05-111-4/+31
|\
| * Notice index that has path and path/file and refuse to write such a tree.Junio C Hamano2005-05-071-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | write-tree is now willing to write empty treePetr Baudis2005-05-081-4/+4
|/ | | | | 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.
* [PATCH] introduce xmalloc and xreallocChristopher Li2005-04-261-2/+2
| | | | | | | | 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>
* Simplify "write_sha1_file()" interfacesLinus Torvalds2005-04-251-19/+3
| | | | | 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.
* [PATCH] fix for memory leak in write-tree.cBrad Roberts2005-04-171-4/+2
| | | | | Fix a memory leak in write-tree.c, not freeing the directory buffer.
* write-tree: refuse to write out trees with unmerged index entries.Linus Torvalds2005-04-151-0/+18
| | | | | | | 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).
* Convert the index file reading/writing to use network byte order.Linus Torvalds2005-04-151-2/+2
| | | | | | | 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).
* [PATCH] Consolidate the error handlingPetr Baudis2005-04-131-2/+2
| | | | | | | 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>
* Make "update-cache" a bit friendlier to use (and harder to mis-use).Linus Torvalds2005-04-101-2/+0
| | | | | | | 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.
* This implements the new "recursive tree" write-tree.Linus Torvalds2005-04-091-18/+63
| | | | | | 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.
* Use "-Wall -O2" for the compiler to get more warnings.Linus Torvalds2005-04-081-1/+1
| | | | | | | 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 ;)
* Add copyright notices.Linus Torvalds2005-04-071-0/+5
| | | | | | 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.
* Initial revision of "git", the information manager from hellinitialLinus Torvalds2005-04-071-0/+66