summaryrefslogtreecommitdiff
path: root/checkout-cache.c
AgeCommit message (Collapse)AuthorFilesLines
2005-08-13[PATCH] fix git-checkout-cache segfault on pariscLibravatar James Bottomley1-1/+2
The index cleanup code is executed via atexit() which is *after* main has completed, so the stack allocated cache_file has gone out of scope. Parisc seems to use stack in the destructor functions, so cache_file gets partially overwritten leading to the predictable disastrous consequences. [jc: Just to make sure, I audited other users of the function hold_index_file_for_update() to make sure they do not have this problem; everybody else uses non-stack cache_file structure and is fine. Thanks, James.] Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-29[PATCH] Unify usage strings declarationLibravatar Petr Baudis1-1/+1
All usage strings are now declared as static const char []. 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-13[PATCH] checkout-cache: add usage string.Libravatar Junio C Hamano1-0/+5
This adds the usage string to checkout-cache and you can say "--help" to get it. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05Make fiel checkout function available to the git libraryLibravatar Linus Torvalds1-173/+20
The merge stuff will want it soon, and we don't want to duplicate all the work..
2005-05-24[PATCH] Allow symlinks in the leading path in checkout-cache --prefix=Libravatar Junio C Hamano1-13/+15
This is what Linus wrote, improving what David Greaves originally submitted. I just added a test case and verified the patch works. Author: David Greaves <david@dgreaves.com> Author: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-19[PATCH] cleanup of in-code namesLibravatar Alexey Nezhdanov1-12/+12
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[PATCH] Implement git-checkout-cache -u to update stat information in the cache.Libravatar Junio C Hamano1-1/+34
With -u flag, git-checkout-cache picks up the stat information from newly created file and updates the cache. This removes the need to run git-update-cache --refresh immediately after running git-checkout-cache. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-15Rename cache_match_stat() to ce_match_stat()Libravatar Brad Roberts1-1/+1
Signed-off-by: Brad Roberts <braddr@puremagic.com> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-12[PATCH] checkout-cache fixLibravatar Junio C Hamano1-3/+46
Fix checkout-cache when existing work tree interferes with the checkout. This is essentially the same one as the last one I sent to the GIT list, except that the patch is rebased to the current tip of the git-pb tree, and an unnecessary call to create_directories() removed. The checkout-cache command gets confused when checking out a file in a subdirectory and the work tree has a symlink to the subdirectory. Also it fails to check things out when there is a non-directory in the work tree when cache expects a directory there, and vice versa. This patch fixes the first problem by making sure all the leading paths in the file being checked out are indeed directories, and also fixes directory vs non-directory conflicts when '-f' is specified by removing the offending paths. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-11[patch] git: fix memory leak #2 in checkout-cache.cLibravatar Ingo Molnar1-0/+2
this patch fixes another (very rare) memory leak in checkout-cache. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-05-07Date: Thu Apr 14 08:26:38 2005 +0200Libravatar Ingo Molnar1-0/+1
Author: Ingo Molnar <mingo@elte.hu> [patch] git: fix memory leak in checkout-cache.c this patch fixes a memory leak in checkout-cache. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Petr Baudis <pasky@ucw.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-05-05[PATCH] create subdirs for symlinksLibravatar Kay Sievers1-0/+1
We may need to create subdirectories, before we can create a symlink. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-05[PATCH] git and symlinks as tracked contentLibravatar Kay Sievers1-10/+28
Allow to store and track symlink in the repository. A symlink is stored the same way as a regular file, only with the appropriate mode bits set. The symlink target is therefore stored in a blob object. This will hopefully make our udev repository fully functional. :) Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-26[PATCH] introduce xmalloc and xreallocLibravatar Christopher Li1-1/+1
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-24[PATCH] checkout-cache: add "-n" optionLibravatar James Bottomley1-2/+7
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-21Add support for a "GIT_INDEX_FILE" environment variable.Libravatar Linus Torvalds1-2/+0
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-21Add the ability to prefix something to the pathname to "checkout-cache.c"Libravatar Linus Torvalds1-16/+28
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-17Ignore any unmerged entries for "checkout-cache -a".Libravatar Linus Torvalds1-0/+2
They don't "exist" yet, and you need to merge them first.
2005-04-17[PATCH] Better error message from checkout-cache for unmerged files.Libravatar Junio C Hamano1-2/+9
The checkout-cache command says "file is not in the cache" when an unmerged path is given. This patch adds code to distinguish the unmerged and the nonexistent cases and gives an appropriate error message. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17Fix total permission bogosity in "checkout-cache.c".Libravatar Linus Torvalds1-3/+1
Use the proper octal mode naming instead of random decimal crud, and don't reset the mode after the create with fchmod: the whole point was to let "umask" do its thing. Duh.
2005-04-16Be much more liberal about the file mode bits.Libravatar Linus Torvalds1-2/+13
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.
2005-04-15Convert the index file reading/writing to use network byte order.Libravatar Linus Torvalds1-1/+1
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-13[PATCH] Consolidate the error handlingLibravatar Petr Baudis1-11/+7
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-12Make "checkout-cache" silently skip up-to-date files.Libravatar Linus Torvalds1-5/+7
It used to always overwrite them if forced. Now it just realizes that they are already ok, and don't need to be touched.
2005-04-11Make the default directory permissions more lax.Libravatar Linus Torvalds1-1/+1
After all, if you want to not allow others to read your stuff, set your "umask" appropriately or make sure the parent directories aren't readable/executable.
2005-04-09Make "read-tree" read the tree into the current directory cache.Libravatar Linus Torvalds1-1/+29
It will no longer update the actual working directory, just the cache. To update the working directory, you need to use "checkout-cache".
2005-04-09Fix "checkout-cache.c" mis-use of read_sha1_file() interface.Libravatar Linus Torvalds1-2/+3
It's supposed to test the returned file type, not think that read_sha1_file() tests it. Confusion from "cat-file" command line usage.
2005-04-09Fix up "checkout-cache" a bitLibravatar Linus Torvalds1-10/+8
Make the warnings have newlines, and don't stop "checkout-cache -a" just because a file already exists.
2005-04-09Add a "checkout-cache" command which does what the name suggests.Libravatar Linus Torvalds1-0/+140
I'll also eventually change "read-tree" to only update the cache information, instead of doing a checkout of the tree. Much nicer.