From: Junio C Hamano Date: Sat, 27 Oct 2007 01:02:05 GMT Subject: Re: [PATCH 6/9] git-hash-object: Add --stdin-paths option Message-ID: <7vlk9pv08i.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20071026231902.GC2519@lavos.net> bdowning@lavos.net (Brian Downing) writes: > On Fri, Oct 26, 2007 at 02:00:47PM -0700, Junio C Hamano wrote: >> In addition, if you are enhancing cat-file to spew chunked >> output out, I suspect that there should be a mode of operation >> for hash-object that eats that data format. IOW, this pipe >> >> git-cat-file --batch > git-hash-object --batch >> >> should be an intuitive no-op, shouldn't it? > > I think that's an obviously good thing to do. However, given your > suggested output format (which I also like): > >> * git-cat-file --batch > >> outputs a record of this form >> >> SP SP LF LF >> >> for each of the input lines. > > What should the input behavior be? Obviously the sha1 will probably > not be known on the input side. Should that simply be optional (i.e. > it will accept either " SP SP " or " SP " > or should it only accept the latter, and a dummy sha1 will need to be > filled in if the sha1 is not known (presumably "000...000")? Yeah, you caught me ;-) Either making it optional or requiring a dummy value would work. If a non-dummy value is given, we could use it to validate it. But that would not be a useful application anyway. So perhaps just the sequence of " SP LF LF" would be the most sensible thing to do.