From: Cristian Le <cristian.le@mpsd.mpg.de>
To: "René Scharfe" <l.s.r@web.de>, git@vger.kernel.org
Subject: Re: Bug in git archive + .gitattributes + relative path
Date: Sat, 4 Mar 2023 16:11:15 +0100 [thread overview]
Message-ID: <566c2d09-5e18-49c9-fc7c-7b92d1d7c198@mpsd.mpg.de> (raw)
In-Reply-To: <70f10864-2cc7-cb9e-f868-2ac0011cad58@web.de>
[-- Attachment #1: Type: text/plain, Size: 2503 bytes --]
> I suppose that means e.g. for Git's own repo that
> Tito would allow creating a separate RPM file for e.g. git-gui.
Indeed, that pretty much sums the main idea of why they need sub
directories there. Ideally we don't want different special cases, and
instead use as much native behaviour as possible. The main issue here is
just making it work with `export-subst`, and if it can be achieved with
both `strip-components` and `prefix`, that might work, even though
`--transform` would be more flexible.
> However we cannot use the `tar` directly because that would affect
> the timestamps and permissions of the file that are set by `git
> archive`.
I should have explained more thoroughly, I have tried to work around by
doing a `git archive` and then extracting and re-compressing after
fixing the paths, but this does not preserve the owner and timestamp of
the original `git archive`, nor can I use the current implementation of
their tar fixer to correct these since the headers are different. I do
not have enough expertise to know what headers need to be set, how to
set the timestamps and so on. I don't know if the `gzip -n -c` could do
a better job at that, but we would still not be able to use it as is
because we would want the correctly generate `export-subst` files, for
example for a project built with `setuptools_scm` that injects the
version of the python package from the last tag:
https://github.com/pypa/setuptools_scm#git-archives
> There it was introduced along with a script that changes the mtime
> of archive entries from the current time to the commit timestamp by
> https://github.com/spacewalkproject/spacewalk/commit/34267e39d472.
Thanks for pointing me to this. From your understanding, if we only use
the git commit directly, we would in principle not need the whole tar
fixer
(https://github.com/rpm-software-management/tito/blob/91ef962220ec5154722760dbbd982bed032ee484/src/tito/tar.py#L28-L60
and
https://github.com/rpm-software-management/tito/blob/91ef962220ec5154722760dbbd982bed032ee484/src/tito/common.py#L871-L890)?
If there is no crucial information in the header that is different
between the `git archive` and the `tar`/`gzip` with appropriate `mtime`,
`mode` and maybe others, maybe there is some hope in fixing this locally.
I'll be looking forward to `--strip-components`, but just to confirm my
reading of the email, the intent is to have it working with
`export-subst` right?
Cheers and thanks for your intuitive answers.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4273 bytes --]
next prev parent reply other threads:[~2023-03-04 15:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 10:25 Bug in git archive + .gitattributes + relative path Cristian Le
2023-03-03 15:19 ` René Scharfe
2023-03-03 15:38 ` Cristian Le
2023-03-04 13:58 ` René Scharfe
2023-03-04 15:11 ` Cristian Le [this message]
2023-03-05 9:32 ` René Scharfe
2023-03-06 16:56 ` Junio C Hamano
2023-03-06 17:51 ` René Scharfe
2023-03-06 17:27 ` Junio C Hamano
2023-03-06 18:28 ` René Scharfe
2023-03-06 18:59 ` Junio C Hamano
2023-03-06 21:32 ` René Scharfe
2023-03-06 22:34 ` Junio C Hamano
2023-03-11 20:47 ` René Scharfe
2023-03-12 21:25 ` Junio C Hamano
2023-03-18 21:30 ` René Scharfe
2023-03-20 16:16 ` Junio C Hamano
2023-03-20 20:02 ` [PATCH] archive: improve support for running in a subdirectory René Scharfe
2023-03-21 22:59 ` Junio C Hamano
2023-03-24 22:26 ` René Scharfe
2023-03-24 22:27 ` [PATCH v2] archive: improve support for running in subdirectory René Scharfe
2023-03-27 16:09 ` 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=566c2d09-5e18-49c9-fc7c-7b92d1d7c198@mpsd.mpg.de \
--to=cristian.le@mpsd.mpg.de \
--cc=git@vger.kernel.org \
--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).