Setting the snapcraft.yaml version field to 'git' produces undocumented and broken magic
Metadata
Current evaluation
Snapcraft 2.42 (2018): setting version: git in snapcraft.yaml substitutes a mangled git describe output; tags with invalid chars (e.g. underscore) yield an invalid version that snap refuses to install, with no error. No maintainer interaction in 8+ years.
Suggested action: close stale
Reason: The issue targets snapcraft 2.42 on Ubuntu 16.04 (both long EOL/superseded) and describes a 2.x-era 'version: git' magic behavior; the current codebase is a complete rewrite (extensions, linters, modern layout) and there has been zero maintainer interaction or labelling across 3000+ days. Repo inspection tools were unavailable (no pinned SHA), so I could not confirm the specific behavior was removed, which caps confidence.
Impact:
40
Quick Win:
24.0
Staleness:
95
Complexity:
40
Confidence:
55
Support Request:
15
Issue body
I've found that if the version: field in snapcraft.yaml is set to 'git', snapcraft does some magic where a mangled form of `git describe` is substituted into the version: field. This seems like a superb feature, although it is missing from the documentation.
However, if the latest tag in the git repository contains invalid characters such as an underscore, the resultant snap will have an invalid version string and snap will refuse to install the package. Snapcraft itself does not produce an error.
I'd suggest this piece of magic is either fixed (perhaps substituting '-' characters for invalid characters) or removed.
(snapcraft version 2.42 on 16.04)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.8-27b |
Impact:
40
Quick Win:
24.0
Staleness:
95
Complexity:
40
Confidence:
55
Support Request:
15
|
close stale | Snapcraft 2.42 (2018): setting version: git in snapcraft.yaml substitutes a mangled git describe output; tags with invalid chars (e.g. underscore) yield an invalid version that snap refuses to install, with no error. No maintainer interaction in 8+ years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
15
Confidence:
85
Support Request:
10
|
close stale | Undocumented version git behavior in snapcraft breaks with invalid git tags. No maintainer response in 8+ years. Original report references snapcraft 2.42. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
100
Complexity:
30
Confidence:
90
Support Request:
0
|
close stale | Bug report regarding 'git' version parsing in snapcraft.yaml causing invalid snap versions with special characters in git tags. Issue is over 8 years old with no activity. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
20
Confidence:
90
Support Request:
10
|
close stale | Setting version to 'git' in snapcraft.yaml triggers undocumented behavior and fails with invalid git tags. The issue is 8 years old, has no maintainer response or labels, and references an obsolete snapcraft version. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
20
Confidence:
90
Support Request:
10
|
close stale | Report of broken version substitution when using 'git' in snapcraft.yaml due to invalid characters in git tags. Issue is 8 years old with no maintainer response. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1849935 Generated 'git describe' based version strings can exceed 32 character version limit | snapcraft (launchpad) | open | 2018 bug report: version: git can generate git-describe strings exceeding snapcraft's 32-character limit (e.g. 38 chars). No maintainer activity in ~6.7 years. The version: git feature has since been deprecated in favor of version-script/craftctl set version. | |
| #1812633 "version: git" can produce version strings too long for snapd | snapcraft (launchpad) | closed | The version: git feature was deprecated in favor of craftctl set version=... to prevent excessively long version strings exceeding snapd's 32-character limit. Users should use version-script: or the new control command instead. | |
| #1777659 Snapcraft version string doesn't allow certain characters | snapcraft (launchpad) | open | Snapcraft rejects version strings containing underscores (e.g. '2018_931-01') even though the version field is described as 'just for humans'. No maintainer response, no labels, 0 comments, ~8 years old. | |
| #1695251 'git' version not expanded in version-script | snapcraft (launchpad) | open | Request to expand 'git' version before running version-script so SNAPCRAFT_PROJECT_VERSION holds the real version. version-script is deprecated/removed in current snapcraft (only docs reference remains), so the feature no longer exists. |