Subject: Re: git-archive and tar options

From: Jakub Narebski <[email-masked]>
Date: Thu, 14 Jul 2011 14:38:05 -0700 (PDT)

Junio C Hamano <[email-masked]> writes:

> Jeff King <[email-masked]> writes:
> 
> > Couldn't you also do:
> >
> >   git archive --prefix=$prefix HEAD:$subdir >my.tar
> >
> > ? I guess that loses the pax header with the commit sha1 in it, though,
> > because you are feeding a straight tree instead of a commit.
> >
> > We didn't when git-archive was written, but these days we have
> > get_sha1_with_context to remember incidental things about an object we
> > look up. It should perhaps remember the commit (if any) we used to reach
> > a treeish, and then the above command line could still insert the pax
> > header.
> 
> Why?
> 
> The tree you are writing out that way look very different from what is
> recorded in the commit object. What's the point of introducing confusion
> by allowing many tarballs with different contents written from the same
> commits with such tweaks all labelled with the same pax header?
 
Perhaps pax header should contain <commit-id>:<subdir> then?
Just a thought.

-- 
Jakub Narebski