aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-03-29 21:30:05 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-03-30 22:42:41 -0400
commitf6d13c69e521c6d94eb695c05d4f8f4091bd0172 (patch)
treea1ad4f0d27a6b14b647300ab4be4f54508d958da
parentd0d22f4dede8707f6fcf3414ca6a9b391d784742 (diff)
downloadmeson-f6d13c69e521c6d94eb695c05d4f8f4091bd0172.zip
meson-f6d13c69e521c6d94eb695c05d4f8f4091bd0172.tar.gz
meson-f6d13c69e521c6d94eb695c05d4f8f4091bd0172.tar.bz2
fix regression that broken git-based wraps with dirty contents
In commit 8da060706c2c34fbea91898509123cb190894f3e we fixed an issue where stashing would ignore untracked files, potentially conflicting with what we reset to. Unfortunately in the process it broke the functionality entirely, by producing an invalid git command... according to some versions of git. This is actually a git bug, fixed upstream in git 2.37.0 via commit b02fdbc80a41f73ceb6c99e8e27b22285243a335. It causes git itself to re-synthesize the command line for a negation pathspec with a "." rather than "", as that's what is needed to make it match all files other than the negation. For backwards compatibility to older versions of git, we manually pass the dot pathspec ourselves.
-rwxr-xr-xmesonbuild/msubprojects.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
index 61ba3a4..dd9f125 100755
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -216,7 +216,8 @@ class Runner:
# Note: `--all` is used, and not `--include-untracked`, to prevent
# a potential error if `.meson-subproject-wrap-hash.txt` matches a
# gitignore pattern.
- self.git_verbose(['stash', 'push', '--all', ':!/.meson-subproject-wrap-hash.txt'])
+ # We must add the dot in addition to the negation, because older versions of git have a bug.
+ self.git_verbose(['stash', 'push', '--all', ':!/.meson-subproject-wrap-hash.txt', '.'])
def git_show(self) -> None:
commit_message = self.git_output(['show', '--quiet', '--pretty=format:%h%n%d%n%s%n[%an]'])