summaryrefslogtreecommitdiff
path: root/tar-tree.c
AgeCommit message (Collapse)AuthorFilesLines
2005-10-01Honor extractor's umask in git-tar-tree.Libravatar Junio C Hamano1-0/+2
The archive generated with git-tar-tree had 0755 and 0644 mode bits. This inconvenienced the extractor with umask 002 by robbing g+w bit unconditionally. Just write it out with loose permissions bits and let the umask of the extractor do its job. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-09[PATCH] -Werror fixesLibravatar Timo Sirainen1-2/+2
GCC's format __attribute__ is good for checking errors, especially with -Wformat=2 parameter. This fixes most of the reported problems against 2005-08-09 snapshot.
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-06-21[PATCH] Fix several gcc4 signedness warningsLibravatar Mika Kukkonen1-2/+2
Here is a patch that fixes several gcc4 warnings about different signedness, all between char and unsigned char. I tried to keep the patch minimal so resertod to casts in three places. Signed-off-by: Mika Kukkonen <mikukkon@iki.fi> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-03[PATCH] git-tar-tree: fix write_trailerLibravatar Rene Scharfe1-1/+1
write_trailer() writes the last 10k (a full block) of the tar archive. write_if_needed() writes out a block *if* it is full and then sets the offset to 0. In nine out of ten cases the messed up write_trailer() function didn't manage to fill the block thus not writing anything at all, truncating the archive. I was "lucky" to hit the other case and so my testing ran OK. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-02[PATCH] git-tar-tree: cleanup write_trailer()Libravatar Rene Scharfe1-7/+4
replace open-coded variants of get_record(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-20sparse cleanupLibravatar Linus Torvalds1-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.
2005-05-19[PATCH] cleanup of in-code namesLibravatar Alexey Nezhdanov1-3/+3
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-18[PATCH] Kill a bunch of pointer sign warnings for gcc4Libravatar Brian Gerst1-3/+3
- Raw hashes should be unsigned char. - String functions want signed char. - Hash and compress functions want unsigned char. Signed-off By: Brian Gerst <bgerst@didntduck.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-09Add copyright notice of Rene Scharfe to tar-tree.cLibravatar Petr Baudis1-0/+3
2005-05-06[PATCH] Lift path length limits from git-tar-tree.Libravatar Rene Scharfe1-8/+7
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-06[PATCH] Do not initialize sha1_file_directory by hand.Libravatar Junio C Hamano1-4/+0
Some commands initialize sha1_file_directory by hand. There is no need to do so; sha1_file.c knows how to handle it. The next patch will remove the variable altogether. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-06[PATCH] git-tar-tree: add symlink supportLibravatar Rene Scharfe1-13/+47
Add symlink support to git-tar-tree.
2005-05-06[PATCH] git-tar-tree: make file contents accessible to write_header()Libravatar Rene Scharfe1-10/+13
Pass pointer to filecontents to write_header() and pass pointer to filecontents, its size and some flags to write_exntended_header(). These parameters are not used, yet. They are added in preparation to symlink support.
2005-05-06[PATCH] git-tar-tree: add extended header helpersLibravatar Rene Scharfe1-18/+40
Introduce append_extended_header_prefix(), extended_header_len() and append_extended_header(). These are helper functions that make it easier to handle multiple entries in a pax extended header. append_log() is no longer needed and can go away.
2005-05-06[PATCH] git-tar-tree: add TYPEFLAG_ constantsLibravatar Rene Scharfe1-5/+20
Add TYPEFLAG_ constants.
2005-05-06[PATCH] git-tar-tree: add get_record()Libravatar Rene Scharfe1-13/+13
Add get_record() which returns a pointer to the next record in the block.
2005-05-01Add "get_sha1()" helper function.Libravatar Linus Torvalds1-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.
2005-04-29[PATCH] GIT: Create tar archives of tree on the flyLibravatar Rene Scharfe1-16/+27
Write commit ID to global extended pax header at the beginning of the tar file, if possible. get-tar-commit-id.c is an example program to get the ID back out of such a tar archive. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Use read_object_with_reference() in tar-treeLibravatar Rene Scharfe1-29/+25
This patch replaces the usage of read_tree_with_tree_or_commit_sha1() with read_object_with_reference() in tar-tree. As a result the code that tries to figure out the commit time doesn't need to open the commit object 'by hand' any more. Signed-off-by: Rene Scharfe <lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] create tar archives of tree on the flyLibravatar Rene Scharfe1-0/+363
This is an improved version of tar-tree, a streaming archive creator for GIT. The major added feature is blocking; all write(2) calls now have a size of 10240, just as GNU tar (and tape drives) likes them. The buffering overhead does not seem to degrade performance because most files in the repositories I tested this with are smaller than 10KB, so we need fewer system calls. File names are still restricted to 500 bytes and the archive format currently only allows for files up to 8GB. Both restrictions can be lifted if need be with more pax extended headers. The archive format used is the pax interchange format, i.e. POSIX tar format. It can be read by (and created with) GNU tar. If I read the specs correctly tar-tree should now be standards compliant (modulo bugs). Because it streams the archive (think ls-tree merged with cat-file), tar-tree doesn't need to create any temporary files. That makes it quite fast. It accepts tree IDs and commit IDs as first parameter. In the latter case tar-tree tries to get the commit date out of the committer line. Else all files in the archive are time-stamped with the current time. An optional second parameter is used as a path prefix for all files in the archive. Example: $ tar-tree a2755a80f40e5794ddc20e00f781af9d6320fafb \ linux-2.6.12-rc3 | bzip9 -9 > linux-2.6.12-rc3.tar.bz2 Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>