summaryrefslogtreecommitdiff
path: root/read-tree.c
Commit message (Collapse)AuthorAgeFilesLines
* sparse cleanupLinus Torvalds2005-05-201-1/+1
| | | | | | | | | Fix various things that sparse complains about: - use NULL instead of 0 - make sure we declare everything properly, or mark it static - use proper function declarations ("fn(void)" instead of "fn()") Sparse is always right.
* [PATCH] cleanup of in-code namesAlexey Nezhdanov2005-05-191-1/+1
| | | | | | | 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>
* Fixed a leak in read-treePetr Baudis2005-05-111-1/+4
| | | | unpack_tree() would not free the tree object it has read.
* Add "get_sha1()" helper function.Linus Torvalds2005-05-011-1/+1
| | | | | | | | | | | | This allows the programs to use various simplified versions of the SHA1 names, eg just say "HEAD" for the SHA1 pointed to by the .git/HEAD file etc. For example, this commit has been done with git-commit-tree $(git-write-tree) -p HEAD instead of the traditional "$(cat .git/HEAD)" syntax.
* [PATCH] Rename and extend read_tree_with_tree_or_commit_sha1Junio C Hamano2005-04-281-1/+1
| | | | | | | | | | | | | | | This patch renames read_tree_with_tree_or_commit_sha1() to read_object_with_reference() and extends it to automatically dereference not just "commit" objects but "tag" objects. With this patch, you can say e.g.: ls-tree $tag read-tree -m $(merge-base $tag $HEAD) $tag $HEAD diff-cache $tag diff-tree $tag $HEAD Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Move "read_tree()" to "tree.c" to be used as a generic helper function.Linus Torvalds2005-04-221-63/+3
| | | | Next step: make "diff-cache" use it.
* Clean up and simplify read-tree a bit.Linus Torvalds2005-04-221-7/+6
| | | | | This is preparation for moving parts of it into "tree.c" to be used as a library function.
* Add support for a "GIT_INDEX_FILE" environment variable.Linus Torvalds2005-04-211-8/+11
| | | | | | | | | 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.
* [PATCH] Usage-string fixes.Junio C Hamano2005-04-201-4/+6
| | | | | | | | | | | | | | 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>
* [PATCH] Teach read-tree about commit objectsJunio C Hamano2005-04-201-10/+24
| | | | | | | | | | | | | | | 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>
* Make "read-tree" know how to do a "1-way merge".Linus Torvalds2005-04-191-5/+39
| | | | | This one just reads one tree, but picks up any matching stat information from the old index.
* Make "read-tree" take the 'stat' information for a merge result from theLinus Torvalds2005-04-191-2/+39
| | | | | | | old index state if the result matches. This leaves the stat information in the result tree for any trivial merges, which is just the way we like it.
* Be much more liberal about the file mode bits.Linus Torvalds2005-04-161-1/+1
| | | | | | We only really care about the difference between a file being executable or not (by its owner). Everything else we leave for the user umask to decide.
* Make 'read-tree' do a few more of the trivial merge cases.Linus Torvalds2005-04-161-17/+53
| | | | | | This cuts down the work for the "real merge" to stuff where people might actually disagree on the algorithm. The trivial cases would seem to be totally independent of any policy.
* Make "read-tree" merge the trees it reads by giving them consecutive states.Linus Torvalds2005-04-151-6/+53
| | | | | | | | | Normally you'd use state 0 for the "merged" state, and start out with state 1 being "origin", state 2 being "first tree" and state 3 being "second tree". Once all the index entries are back in state 0, we have a successful merge and can write the result tree back.
* Encode a few extra flags per index entry.Linus Torvalds2005-04-151-1/+1
| | | | | | This will allow us to have the same name in different "states" in the index at the same time. Which in turn seems to be a very simple way to merge.
* 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-5/+5
| | | | | | | 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>
* Rename ".dircache" directory to ".git"Linus Torvalds2005-04-111-3/+3
| | | | I started out calling the tool "dircache". That's clearly moronic.
* Fix stale index.lock file removal using "atexit()".Linus Torvalds2005-04-111-22/+23
| | | | Problem noted by Randy Dunlap.
* Make "update-cache" a bit friendlier to use (and harder to mis-use).Linus Torvalds2005-04-101-1/+1
| | | | | | | 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.
* Teach "fsck" and "read-tree" about recursive tree-nodes.Linus Torvalds2005-04-091-7/+21
| | | | | | This is totally untested, since we can't actually _write_ things that way yet, but I'll get to that next, I hope. That should fix the huge wasted space for kernel-sized tree objects.
* Make "read-tree" read the tree into the current directory cache.Linus Torvalds2005-04-091-49/+53
| | | | | It will no longer update the actual working directory, just the cache. To update the working directory, you need to use "checkout-cache".
* Use "-Wall -O2" for the compiler to get more warnings.Linus Torvalds2005-04-081-1/+0
| | | | | | | 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 ;)
* Make read-tree actually unpack the whole tree.Linus Torvalds2005-04-071-1/+41
| | | | | | | I needed this to make a "sparse" archive conversion from my old BitKeeper tree data. The scripts to do the conversion are just incredibly ugly, but they seem to validate the notion that you can actually use this silly 'git' thing to save your history in.
* 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/+43