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

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 25, 2020, 17:59 UTC
Message-ID
<nycvar.QRO.7.76.6.2003251859070.46@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqd0911n3b.fsf@gitster.c.googlers.com>
Hi Junio,
On Tue, 24 Mar 2020, Junio C Hamano wrote:
Show 42 quoted lines
> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> >      +    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.

Too many of such in-code comments added by me became stale. I'd rather keep this in the commit message where it explains the reasoning for the current change.

Thanks, Dscho

Show 9 quoted lines
>
> Thanks.
>
> >  		my $path;
> >  		if ($prefix) {
> >  			$path = "$prefix/$name";
> >
> > base-commit: b4374e96c84ed9394fed363973eb540da308ed4f
>
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 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.