git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-archive's wrong documentation: really write pax rather than tar

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Aug 6, 2011, 18:57 UTC
Message-ID
<4E3D8EA9.3000609@lsrfire.ath.cx>
In-Reply-To
<1312482802.68635.YahooMailClassic@web29518.mail.ird.yahoo.com>
Am 04.08.2011 20:33, schrieb Hin-Tak Leung:
Show 39 quoted lines
> --- On Thu, 4/8/11, René Scharfe <rene.scharfe@lsrfire.ath.cx>
> wrote:
> 
>> From: René Scharfe <rene.scharfe@lsrfire.ath.cx>
> <snipped>
>> Ah, here it is:
>> 
>> https://svn.r-project.org/R/trunk/src/library/utils/R/tar.R
>> 
>> It's the ctype handling in function untar2 that rejects unknown
>> entry types.
>> 
>> For reference, the documentation of the pax format including a 
>> suggestion to treat unknown types like regular files can be found
>> here (search for "typename"):
>> 
>> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html
>> 
>>> I think I tried the tree example and the R code also
>> didn't like it
>>> much... may be I'll give it another try.
>> 
>> Did you try adding a ":" to the tree argument, e.g. this:
>> 
>> $ git archive HEAD:
>> 
>> instead of this?
>> 
>> $ git archive HEAD
>> 
>> René
> 
> That's better! With a HEAD: , that code does a lot of:
> 
> Warning in untar2(tarfile, files, list, exdir) : checksum error for
> entry 'file...'
> 
> for each file it tries to extract, but at least it is extracting the
> files. 

That doesn't sound good. Looking at the R source, however, I can see that they use a two different algorithms to compute the checksum than the one specified by POSIX (even though I don't fully understand what it actually is their doing, since I don't know R). So worry too much about the warning; as long e.g. "tar tf <file>" doesn't complain your archive should be intact.

> I wasn't entirely sure about the notation used in the man page
> - is "v1.4.0^{tree}" same as "v1.4.0:" ? "HEAD:" is clearer, as most
> people has a HEAD...

They're a bit different in principle, but point to the same target in this particular case. "<ref>:<path>" gets you an object (blob or tree) of a commit; with an empty <path> you get the root tree. "<ref>^{<type>}" gives you the requested object of <type> (tag, commit or tree) behind the <ref>; with "tree" you get the root tree of the commit.

René
Previous: Hin-Tak LeungNext: Hin-Tak Leung
Message 4 of 6 in “(unknown)”
  1. Hin-Tak LeungAug 4, 2011
  2. René ScharfeAug 4, 2011
  3. Hin-Tak LeungAug 4, 2011
  4. René ScharfeAug 6, 2011
  5. Hin-Tak LeungAug 10, 2011
  6. René ScharfeAug 10, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.