]> git.ipfire.org Git - thirdparty/git.git/commit - object-file.c
Bigfile: teach "git add" to send a large file straight to a pack
authorJunio C Hamano <gitster@pobox.com>
Sun, 8 May 2011 08:47:35 +0000 (01:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 May 2011 23:11:18 +0000 (16:11 -0700)
commit4dd1fbc7b1df0030f813a05cee19cad2c7a9cbf9
tree6672594f53e8688c10ccff922d8d52c16385ed36
parent7b41e1e15b2cce13deaafc0aab10580036346a5a
Bigfile: teach "git add" to send a large file straight to a pack

When adding a new content to the repository, we have always slurped
the blob in its entirety in-core first, and computed the object name
and compressed it into a loose object file.  Handling large binary
files (e.g.  video and audio asset for games) has been problematic
because of this design.

At the middle level of "git add" callchain is an internal API
index_fd() that takes an open file descriptor to read from the
working tree file being added with its size. Teach it to call out to
fast-import when adding a large blob.

The write-out codepath in entry.c::write_entry() should be taught to
stream, instead of reading everything in core. This should not be so
hard to implement, especially if we limit ourselves only to loose
object files and non-delta representation in packfiles.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c
t/t1050-large.sh [new file with mode: 0755]