git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH] import-tars: ignore the global PAX header
Date: Mon, 23 Mar 2020 10:41:20 -0700	[thread overview]
Message-ID: <xmqqh7yf55q7.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <fce519db-5ad4-270f-abcf-0e26549486cb@web.de> ("René Scharfe"'s message of "Mon, 23 Mar 2020 18:09:39 +0100")

René Scharfe <l.s.r@web.de> writes:

> Am 23.03.20 um 14:08 schrieb Johannes Schindelin via GitGitGadget:
>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>>
>> Git's own `git archive` inserts that header, but it often gets into the
>> way of `import-tars.perl` e.g. when a prefix was specified (for example
>> via `--prefix=my-project-1.0.0/`, or when downloading a `.tar.gz` from
>> GitHub releases): this prefix _should_ be stripped.
>>
>> Let's just skip it.
>
> git archive uses a global pax header to pass the ID of the archived
> commit as a comment, and for mtime values after 2242-03-16.  Ignoring it
> in a simple importer seems reasonable for now, but I don't understand
> how this relates to prefixes.  Is it because the header is treated as a
> regular file with the full path "pax_global_header" (independently from
> any prefix for actual files) and can thus be placed outside the expected
> destination directory?

Thanks for asking the question, as I was also curious if we are
throwing away too much (perhaps "prefix is given as a global pax
header, and ignoring all global pax headers is the most expedite
way" was the reason the patch was written that way?).  I agree with
you that for the purpose of simple-minded importer, it probably is
acceptable to take such a short-cut, but it would help future
developers if we clearly documented that it is a short-cut that
throws too much.  That would welcome their effort to enhance the
importer, if they find it more useful to keep some other information
found in global headers, without breaking the intent of this change.

Having said all that, even before "git archive" existed, release
tarballs by many projects had leading prefix so that a tarball
extract would be made inside a versioned directory.  To truly help
users of the importer, doesn't the logic to allow the user to say
"please strip one leading level of directory from all the tarballs I
feed you, as I know they are versioned directories" belong to the
command line option of the importer?


  reply	other threads:[~2020-03-23 17:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 13:08 [PATCH] import-tars: ignore the global PAX header Johannes Schindelin via GitGitGadget
2020-03-23 17:09 ` René Scharfe
2020-03-23 17:41   ` Junio C Hamano [this message]
2020-03-23 21:08     ` Johannes Schindelin
2020-03-23 21:50       ` Junio C Hamano
2020-03-23 21:05   ` Johannes Schindelin
2020-03-23 21:53     ` Junio C Hamano
2020-03-23 23:25 ` brian m. carlson
2020-03-24 13:35   ` Johannes Schindelin
2020-03-24 19:35 ` [PATCH v2] " Johannes Schindelin via GitGitGadget
2020-03-24 21:04   ` Junio C Hamano
2020-03-25 17:59     ` Johannes Schindelin
2020-03-25 18:43       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh7yf55q7.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=l.s.r@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).