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

Re: [PATCH v2] import-tars: ignore the global PAX header

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2020, 21:04 UTC
Message-ID
<xmqqd0911n3b.fsf@gitster.c.googlers.com>
In-Reply-To
<pull.577.v2.git.1585078545448.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 26 quoted lines
>      +    Note: this global header might contain useful information. For example,
>      +    in the output of `git archive`, it lists the original commit, which _is_
>      +    useful information. A future improvement to the `import-tars.perl`
>      +    script might be to include that information in the commit message, or do
>      +    other things with the information (e.g. use `mtime` information
>      +    contained in the global header as date of the commit). This patch does
>      +    not prevent any future patch from making that happen, it only prevents
>      +    the header from being treated as if it was a regular file.
>       
>           Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>       
>
>
>  contrib/fast-import/import-tars.perl | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
> index e800d9f5c9c..d50ce26d5d9 100755
> --- a/contrib/fast-import/import-tars.perl
> +++ b/contrib/fast-import/import-tars.perl
> @@ -139,6 +139,8 @@
>  			print FI "\n";
>  		}
>  
> +		next if ($typeflag eq 'g'); # ignore global header
> +

Yeah, it is more like "don't create a phony file out of global header" which is exactly the point of this fix, rather than "ignore global header", and if the contents of the header is used for any other purpose (e.g. metadata that will be added to the log message or mode bits that is forced on all files), that can be handled before this line. And the current code structure is already prepared for it: all that remains in the block after this point is to create a file at $path and store its contents.

So, this makes sense. I suspect that with an update to the comment in the direction, there probably is no need for the huge "Note" in the log message.

Thanks.
Show 5 quoted lines
>  		my $path;
>  		if ($prefix) {
>  			$path = "$prefix/$name";
>
> base-commit: b4374e96c84ed9394fed363973eb540da308ed4f
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 11 of 13 in “import-tars: ignore the global PAX header”
  1. import-tars: ignore the global PAX headerJohannes Schindelin via GitGitGadget, Mar 23, 2020
  2. René ScharfeMar 23, 2020
  3. Junio C HamanoMar 23, 2020
  4. Johannes SchindelinMar 23, 2020
  5. Junio C HamanoMar 23, 2020
  6. Johannes SchindelinMar 23, 2020
  7. Junio C HamanoMar 23, 2020
  8. brian m. carlsonMar 23, 2020
  9. Johannes SchindelinMar 24, 2020
  10. import-tars: ignore the global PAX headerJohannes Schindelin via GitGitGadget, Mar 24, 2020
  11. Junio C HamanoMar 24, 2020
  12. Johannes SchindelinMar 25, 2020
  13. Junio C HamanoMar 25, 2020

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.