Skip to content

Commit ecd5118

Browse files
Merge pull request #644 from tapetersen/main
Escape glob pattern in git describe to avoid shell expansion.
2 parents 0fda16b + b9a754a commit ecd5118

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/setuptools_scm/git.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@
1313
from .utils import trace
1414
from .version import meta
1515

16-
DEFAULT_DESCRIBE = "git describe --dirty --tags --long --match *[0-9]*"
16+
# If testing command in shell make sure to quote the match argument like
17+
# '*[0-9]*' as it will expand before being sent to git if there are any matching
18+
# files in current directory.
19+
DEFAULT_DESCRIBE = [
20+
"git",
21+
"describe",
22+
"--dirty",
23+
"--tags",
24+
"--long",
25+
"--match",
26+
"*[0-9]*",
27+
]
1728

1829

1930
class GitWorkdir(Workdir):

0 commit comments

Comments
 (0)