Skip to content
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

ambiguous ifShortSHA #8

Closed
littlecxm opened this issue Mar 13, 2024 · 3 comments · Fixed by #9
Closed

ambiguous ifShortSHA #8

littlecxm opened this issue Mar 13, 2024 · 3 comments · Fixed by #9
Assignees
Labels
enhancement New feature or request

Comments

@littlecxm
Copy link

const printVersion = (ifGitSHA ? await getGitSHA(ifShortSHA, command) : version) as string

如果我想使用 ifShortSHA 那我必须在使用之前设置 ifGitSHA: true
是否考虑 ifGitSHA -> UseGitSHA?

@ZhongxuYang
Copy link
Owner

Indeed, these two attributes can easily cause confusion in their use.

I think ifGitSHA -> UseGitSHA cannot allow existing users to upgrade smoothly.
Therefore it may be a more friendly design to remove the impact of ifGitSHA on ifShortSHA (that is, you can enable ShortSHA by only setting ifShortSHA: true).

According to this, the priority of the modified version field will be: command > ifShortSHA > ifGitSHA > version.


确实这两个属性容易造成使用的困惑。

我认为 ifGitSHA -> UseGitSHA 没办法让现有的使用者平滑升级。
因此去除 ifGitSHA ifShortSHA 的影响可能会是更友好的设计(也就是可以通过只设置 ifShortSHA: true 来启用ShortSHA)。

按照这样,修改后的版本字段的优先级会是:command > ifShortSHA > ifGitSHA > version

@ZhongxuYang ZhongxuYang self-assigned this Mar 13, 2024
@ZhongxuYang ZhongxuYang added the enhancement New feature or request label Mar 13, 2024
@ZhongxuYang
Copy link
Owner

Hi!👋

刚刚已经更新了 v0.0.12,按照上面的回复处理了这个问题。如果有别的想法欢迎继续交流~

感谢建议!🎉

@littlecxm
Copy link
Author

感谢修复~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants