Commit Graph

20 Commits

Author SHA1 Message Date
Ingo Molnar
aceedfe32e [patch] git: fix memory leak #2 in checkout-cache.c
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-11 23:05:47 +02:00
Ingo Molnar
36997b45ad Date: Thu Apr 14 08:26:38 2005 +0200
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-07 01:32:24 -07:00
Kay Sievers
d5f415e6f5 [PATCH] create subdirs for symlinks
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 16:51:46 -07:00
Kay Sievers
8ae0a8c514 [PATCH] git and symlinks as tracked content
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-05-05 08:23:01 -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
James Bottomley
32718b6c5e [PATCH] checkout-cache: add "-n" option
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-24 15:14:16 -07:00
Linus Torvalds
bb233d690a Add support for a "GIT_INDEX_FILE" environment variable.
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-21 10:55:18 -07:00
Linus Torvalds
65bb49144d Add the ability to prefix something to the pathname to "checkout-cache.c"
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-21 10:15:02 -07:00
Linus Torvalds
d9f98eebcd Ignore any unmerged entries for "checkout-cache -a".
They don't "exist" yet, and you need to merge them first.
2005-04-17 18:39:14 -07:00
Junio C Hamano
a38800fde2 [PATCH] Better error message from checkout-cache for unmerged files.
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-17 10:02:21 -07:00
Linus Torvalds
fa06d442c6 Fix total permission bogosity in "checkout-cache.c".
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-17 09:55:36 -07:00
Linus Torvalds
e44794706e Be much more liberal about the file mode bits.
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-16 22:26:31 -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
29d76d4b05 Make "checkout-cache" silently skip up-to-date files.
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-12 14:17:28 -07:00
Linus Torvalds
cfd88e2b7a Make the default directory permissions more lax.
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-11 10:24:41 -07:00
Linus Torvalds
83adac3c57 Make "read-tree" read the tree into the current directory cache.
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-09 12:11:25 -07:00
Linus Torvalds
8d3af1d532 Fix "checkout-cache.c" mis-use of read_sha1_file() interface.
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-09 11:24:41 -07:00
Linus Torvalds
f7391ce3bd Fix up "checkout-cache" a bit
Make the warnings have newlines, and don't stop "checkout-cache -a"
just because a file already exists.
2005-04-09 09:59:44 -07:00
Linus Torvalds
33db5f4d90 Add a "checkout-cache" command which does what the name suggests.
I'll also eventually change "read-tree" to only update the cache
information, instead of doing a checkout of the tree. Much nicer.
2005-04-09 09:53:05 -07:00