-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore the global PAX header in import-tars.perl
#577
Conversation
/submit |
Submitted as pull.577.git.1584968924555.gitgitgadget@gmail.com |
On the Git mailing list, René Scharfe wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, "brian m. carlson" wrote (reply to this):
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
The tar importer in `contrib/fast-import/import-tars.perl` has a very convenient feature: if _all_ paths stored in the imported `.tar` start with a common prefix, e.g. `git-2.26.0/` in the tar at https://github.com/git/git/archive/v2.26.0.tar.gz, then this prefix is stripped. This feature makes a ton of sense because it is relatively common to import two or more revisions of the same project into Git, and obviously we don't want all files to live in a tree whose name changes from revision to revision. Now, the problem with that feature is that it breaks down if there is a `pax_global_header` "file" located outside of said prefix, at the top of the tree. This is the case for `.tar` files generated by Git's very own `git archive` command: it inserts that header, and `git archive` allows specifying a common prefix (that the header does _not_ share with the other files contained in the archive) via `--prefix=my-project-1.0.0/`. Let's just skip any global header when importing `.tar` files into Git. 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>
718bde8
to
842dabe
Compare
/submit |
Submitted as pull.577.v2.git.1585078545448.gitgitgadget@gmail.com |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This patch series was integrated into pu via git@23e2136. |
This branch is now known as |
This patch series was integrated into pu via git@81c4a47. |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This patch series was integrated into pu via git@6e7eabb. |
This patch series was integrated into pu via git@3e46cf1. |
This patch series was integrated into pu via git@83e80d8. |
This patch series was integrated into pu via git@ca36de0. |
This patch series was integrated into pu via git@bb47c37. |
This patch series was integrated into pu via git@0cfcc49. |
This patch series was integrated into pu via git@8313701. |
This patch series was integrated into pu via git@9ecbccd. |
This patch series was integrated into next via git@408afae. |
This patch series was integrated into pu via git@64e90de. |
This patch series was integrated into pu via git@384c1a0. |
This patch series was integrated into pu via git@8633f21. |
This patch series was integrated into next via git@8633f21. |
This patch series was integrated into master via git@8633f21. |
Closed via 8633f21. |
This problem came up in Pacman-related work, where
PKGBUILD
definitions would reference the tarballs downloaded from GitHub, and patches would be applied on top. To work on those patches efficiently (e.g. when an upgrade to a new version of the project no longer lets those patches apply), I need to be able to import those tarballs into playground worktrees and work on them. I like to usecontrib/fast-import/import-tars.perl
for that purpose, but it really needs to strip the prefix, otherwise it is too tedious to work with it.Changes since v1:
import-tars.perl
in the commit message; Without that context, it is really hard to understand the motivation for this patch.Cc: René Scharfe l.s.r@web.de, brian m. carlson sandals@crustytoothpaste.net, Junio C Hamano gitster@pobox.com