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

Re: [PATCH] archive: Store checksum correctly

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2019, 21:21 UTC
Message-ID
<xmqqef2gsb07.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<14410e00-4701-40d0-6960-e481fea50ed0@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 6 quoted lines
>> Wow.  The choice of %07o is as old as the very original of tar-tree
>> implementation in our codebase, starting at ae64bbc1 ("tar-tree:
>> Introduce write_entry()", 2006-03-25).
>
> Actually it's already in 731ab9ccf2 ("[PATCH] create tar archives of
> tree on the fly", 2005-04-28).

Yup, after viewing "git show ae64bbc1" I found out the commit added a new helper to do %07o without touching the existing one that did the same. Problem with relying on "git blame" too much X-<.

Show 7 quoted lines
>> I think the updated behaviour matches Wikipedia [*1*] where it
>> spells out that 6 octal is followed by a NUL and a SP; it also says
>> various implementations do not adhere to this format---perhaps they
>> meant us ;-)
>
> OpenBSD's pax(1) does the same if I read
> https://github.com/openbsd/src/blob/master/bin/pax/tar.c correctly.

What's more interesting is that their verifier in tar_id() compares the ulong value read from textual checksum with the ulong value computed. I agree with you that it would be the more robust way than what is done by squshfs tools (ng).

Previous: David OberhollenzerNext: Jonathan Nieder
Message 7 of 8 in “archive: Store checksum correctly”
  1. archive: Store checksum correctlyMatt Turner, Jul 23, 2019
  2. Junio C HamanoJul 23, 2019
  3. Jeff KingJul 23, 2019
  4. René ScharfeJul 23, 2019
  5. René ScharfeJul 23, 2019
  6. David OberhollenzerJul 23, 2019
  7. Junio C HamanoJul 23, 2019
  8. Jonathan NiederJul 24, 2019

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.