Commit graph

11 commits

Author SHA1 Message Date
Rene Scharfe e7d3dd248f [PATCH] Lift path length limits from git-tar-tree.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-06 22:12:08 -07:00
Junio C Hamano 3d0291c450 [PATCH] Do not initialize sha1_file_directory by hand.
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 17:00:20 -07:00
Rene Scharfe d5776d50aa [PATCH] git-tar-tree: add symlink support
Add symlink support to git-tar-tree.
2005-05-06 14:42:59 -07:00
Rene Scharfe 08f09dac01 [PATCH] git-tar-tree: make file contents accessible to write_header()
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 14:42:59 -07:00
Rene Scharfe 71058b1f2b [PATCH] git-tar-tree: add extended header helpers
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 14:42:59 -07:00
Rene Scharfe 03d791ff11 [PATCH] git-tar-tree: add TYPEFLAG_ constants
Add TYPEFLAG_ constants.
2005-05-06 14:42:59 -07:00
Rene Scharfe a90a6e6a78 [PATCH] git-tar-tree: add get_record()
Add get_record() which returns a pointer to the next record in the block.
2005-05-06 14:42:59 -07:00
Linus Torvalds 3c249c9506 Add "get_sha1()" helper function.
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-05-01 16:36:56 -07:00
Rene Scharfe 87fec8fc9e [PATCH] GIT: Create tar archives of tree on the fly
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-29 19:51:04 -07:00
Rene Scharfe db413479f1 [PATCH] Use read_object_with_reference() in tar-tree
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 22:19:02 -07:00
Rene Scharfe 731ab9ccf2 [PATCH] create tar archives of tree on the fly
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>
2005-04-28 12:16:43 -07:00