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

Re: Git generated tarballs and Debian

From
Jeff King <peff@peff.net>
Date
Apr 29, 2026, 07:30 UTC
Message-ID
<20260429073002.GA717507@coredump.intra.peff.net>
In-Reply-To
<20260428115017.GA71700@macsyma-wired.lan>
On Tue, Apr 28, 2026 at 07:50:17AM -0400, Theodore Tso wrote:
Show 12 quoted lines
> I know that in the past, using --format=tgz has broken based on
> different compression parameters used by git (and whether it used an
> external or internal compressor).  I also know that if $commit is a
> tree-id, this can result in the timestamps being not reproduible.  I
> also don't use export-subst.
> 
> There is also the difference in the prefix used by github and gitlab,
> but that's arguably not git's fault.
> 
> What other gotchas are there?  How is this likely to be inconsistent
> in the future?  How much work is there to provide that guarantee in
> the future?

The biggest unexpected change I recall was caused by a bug/compatibility fix. 22f0dcd963 (archive-tar: split long paths more carefully, 2013-01-05) changed how some long paths were represented to be more compatible between GNU tar and NetBSD. Lots of Homebrew recipes, etc, were broken when GitHub deployed a version of Git with that commit.

I think there was a more recent one in 2023-ish caused by some gzip-related changes (but it was after my time and I don't know the details).

I feel like there was one in the middle, too, but I'm having trouble digging it up (I think GitHub reverted 22f0dcd963 at the time and finally reinstated it in 2017 after a warning period, so that might be what I'm thinking of).

But I'm not sure how often we'd do fixes like that. Not a lot, as the tar code is pretty stable. But is 82a46af13e (archive-tar: fix pax extended header length calculation, 2019-08-17), for example, likely to have changed hashes for some repos? Probably.

So I think if you really want byte-for-byte compatibility of git-archive you have to cement the behavior, bugs and all, behind some kind of version flag, and every possible behavior change has to be analyzed for a potential version bump.

Though breaking some obscure cases once every 5-10 years is maybe not _so_ bad, and we can live with it. ;)

-Peff
Previous: brian m. carlson
Message 6 of 6 in “Git generated tarballs and Debian”
  1. Simon RichterApr 28, 2026
  2. brian m. carlsonApr 28, 2026
  3. Simon RichterApr 28, 2026
  4. Theodore TsoApr 28, 2026
  5. brian m. carlsonApr 28, 2026
  6. Jeff KingApr 29, 2026

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.