fix: separate pseudo-version commit id #11

Merged
misaka00251 merged 1 commits from Jvlegod/go2spec:fix-pseudo-version-commit-id into master 2026-07-16 07:11:34 +00:00
Contributor

修复 go2spec 在指定 git commit 打包时生成错误 tarball 文件名的问题

修复前输出中会包含换行和 %define commit_id

$ ls /tmp/go2spec-output-original-B1t0sk
 go-github-shopify-logrus-bugsnag  'go-github-shopify-logrus-bugsnag_0+git20260716.d55aa3c'$'\n''%define commit_id d55aa3c8353b164fb7e3bc0e0b3aa1b83b3a4fde.orig.tar.xz'
$ ls /tmp/go2spec-output-fixed-kqwfBw
go-github-shopify-logrus-bugsnag  go-github-shopify-logrus-bugsnag_0+git20260716.d55aa3c.orig.tar.xz

其他spec的样式不变

样例来源

  • github.com/Shopify/logrus-bugsnag

  • commit_id: d55aa3c8353b164fb7e3bc0e0b3aa1b83b3a4fde

测试方法

go build -o /tmp/go2spec .
mkdir -p /tmp/go2spec-repro-original
cd /tmp/go2spec-repro-original

/tmp/go2spec pack \
  -git_revision d55aa3c8353b164fb7e3bc0e0b3aa1b83b3a4fde \
  -type library \
  github.com/Shopify/logrus-bugsnag
修复 go2spec 在指定 git commit 打包时生成错误 tarball 文件名的问题 修复前输出中会包含换行和 %define commit_id ```bash $ ls /tmp/go2spec-output-original-B1t0sk go-github-shopify-logrus-bugsnag 'go-github-shopify-logrus-bugsnag_0+git20260716.d55aa3c'$'\n''%define commit_id d55aa3c8353b164fb7e3bc0e0b3aa1b83b3a4fde.orig.tar.xz' $ ls /tmp/go2spec-output-fixed-kqwfBw go-github-shopify-logrus-bugsnag go-github-shopify-logrus-bugsnag_0+git20260716.d55aa3c.orig.tar.xz ``` 其他spec的样式不变 ## 样例来源 - github.com/Shopify/logrus-bugsnag - commit_id: d55aa3c8353b164fb7e3bc0e0b3aa1b83b3a4fde ## 测试方法 ```bash go build -o /tmp/go2spec . mkdir -p /tmp/go2spec-repro-original cd /tmp/go2spec-repro-original /tmp/go2spec pack \ -git_revision d55aa3c8353b164fb7e3bc0e0b3aa1b83b3a4fde \ -type library \ github.com/Shopify/logrus-bugsnag ```
Jvlegod added 1 commit 2026-07-16 04:07:06 +00:00
misaka00251 merged commit 540faa9f51 into master 2026-07-16 07:11:34 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: misaka00251/go2spec#11