From: Luke Kenneth Casson Leighton Date: Sat, 04 Sep 2010 13:14:36 GMT Subject: Re: git pack/unpack over bittorrent - works! Message-ID: In-Reply-To: On Sat, Sep 4, 2010 at 12:58 PM, Luke Kenneth Casson Leighton wrote: > ok, there's one other question i need some info on (thank you to > nguyen for answering about git cat-file): is there a way to make > git-pack-objects _just_ give the index file, rather than go to all the > trouble of creating the pack file as well? > > the reason i ask is because i would like to get the index file, parse > it for objects (as nicolas recommends) then present the contents of > "git cat-file" as files within subdirectories, via this > pseudo-VFS-layer over bittorrent. pack-objects.c - write_pack_file(): ... if (pack_to_stdout) { sha1close(f, sha1, CSUM_CLOSE); } else if (nr_written == nr_remaining) { sha1close(f, sha1, CSUM_FSYNC); } else { int fd = sha1close(f, sha1, 0); fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written, sha1, offset); close(fd); } if (!pack_to_stdout) { struct stat st; const char *idx_tmp_name; char tmpname[PATH_MAX]; idx_tmp_name = write_idx_file(NULL, written_list, nr_written, sha1); .... ahh, whoops. any advances on that? grep write_idx_file *.c */*.c * git-index-pack requires a pack file in order to re-create the index: i don't want that * git-pack-objects appears to have no way of telling it "just gimme index file please" * fast-import.c appears not to be what's needed either. so - any other methods for just getting the index file (exclusively?) any other commands i've missed? if not, are there any other ways of getting a pack's index of objects without err... getting the index file? (i believe the answer to be no, but i'm just making sure) and on that basis i believe it is safe to ask: any objections to a patch which adds "--index-only" to builtin/pack-objects.c? l.