summaryrefslogtreecommitdiff
path: root/ls-tree.c
AgeCommit message (Collapse)Author
2005-05-01Add "get_sha1()" helper function.Linus Torvalds
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.
2005-04-28[PATCH] Rename and extend read_tree_with_tree_or_commit_sha1Junio C Hamano
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>
2005-04-21[PATCH] Teach ls-tree about commit objectsJunio C Hamano
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-16[PATCH] Un unoptimize ls-tree behaviourJunio C Hamano
ls-tree unconditionally called read_sha1_file() for all paths even when not needed, which was a mistake introduced by me. Rectify this by first checking S_ISDIR(mode) and read the tree contents only when it is a tree and we are recursive. There is no need to read it in any other cases. The patch also removes the confusing comment that led to this incorrect implementation. Thanks to Peter Baudis for noticing this problem. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-15[PATCH] ls-tree enhancementsJunio C Hamano
This adds '-r' (recursive) option and '-z' (NUL terminated) option to ls-tree. I need it so that the merge-trees (formerly known as git-merge.perl) script does not need to create any temporary dircache while merging. It used to use show-files on a temporary dircache to get the list of files in the ancestor tree, and also used the dircache to store the result of its automerge. I probably still need it for the latter reason, but with this patch not for the former reason anymore. It is relative to bb95843a5a0f397270819462812735ee29796fb4 Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-13[PATCH] Consolidate the error handlingPetr Baudis
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[PATCH] ls-tree for listing treesPetr Baudis
ls-tree tool provides just a way to export the binary tree objects to a usable text format. This is bound to be useful in variety of scripts, although none of those I have currently uses it. But e.g. the simple script I've sent to HPA for purging the object database uses it. Signed-off-by: Petr Baudis <pasky@ucw.cz>