Re: [PATCH v2 4/4] upload-archive: use start_command instead of fork

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 02, 2011 at 06:46:20PM +0200, René Scharfe wrote:

> The output of gzip is not simply always mangled, though (taken from my
> earlier email, all three are working):
> 
> 	$ git archive v1.7.6 | gzip -cn | md5sum
> 	a0ca1c873a533a5fcd41d248fb325a5b *-
> 
> 	$ git archive --format=tar.gz v1.7.6 | md5sum
> 	a0ca1c873a533a5fcd41d248fb325a5b *-
> 
> 	$ git archive v1.7.6 | gzip -cn >a.tgz && md5sum <a.tgz
> 	a0ca1c873a533a5fcd41d248fb325a5b *-
> 
> It's only broken if we call it from git archive:
> 
> 	$ git archive --format=tar.gz v1.7.6 >a.tgz && md5sum <a.tgz
> 	30886283af1aed05ae6a36fc5aeda077 *-
> 
> 	$ git archive -o a.tgz v1.7.6 && md5sum <a.tgz
> 	30886283af1aed05ae6a36fc5aeda077 *-
> 
> But not if we stuff the result into a pipe instead of a file:
> 
> 	$ git archive --format=tar.gz v1.7.6 | cat >a.tgz && md5sum <a.tgz
> 	a0ca1c873a533a5fcd41d248fb325a5b *-
> 
> It _is_ confusing.

Hmm. So it's not _just_ the pipe vs file thing. What's different about
calling it from the shell, versus the way we call it from git-archive?

IOW, the pipe trick you mentioned is one way to fix it; but it may be
more elegant to do whatever it is the shell is doing to get those
results (unless the shell is secretly putting a "cat" into the pipeline
:) ).

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]