You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The feature to infer sub-package tags introduced in #161 and released in 2.1.0 breaks the default behaviour of the tool on Windows systems.
The features compares the root of the git repo to the current directory, and if they are not the same sets --pattern and --prefix defaults automatically to compensate.
However it appears that the git cli and the go os library return representations of the same path using different path separators, so the comparison always returns false, and the absolute path of the repo is set as the pattern.
The issue occurs both in the root of a git repo and in a subdirectory, and causes all tag parsing to fail. Normal behaviour can be restored by adding the old defaults back in on the CLI:
svu --pattern="" --prefix="v"
I think that using filepath.Clean() on both paths before using them should normalise the slashes and resolve this issue, though I can't test as I don't have a working golang setup on my Windows machine, and testing on Linux is inconclusive as filepath.Clean behaviour is platform-dependent.
This results in the following help text showing the defaults when running svu:
> svu -h
usage: svu [<flags>] <command> [<args> ...]
...snip....
--pattern="C:\\Users\\Doug\\Code\\myrepo/*"
limits calculations to be based on tags
matching the given pattern
--prefix="C:\\Users\\Doug\\Code\\myrepo/v"
set a custom prefix
The text was updated successfully, but these errors were encountered:
The feature to infer sub-package tags introduced in #161 and released in
2.1.0
breaks the default behaviour of the tool on Windows systems.The features compares the root of the git repo to the current directory, and if they are not the same sets
--pattern
and--prefix
defaults automatically to compensate.However it appears that the
git
cli and the goos
library return representations of the same path using different path separators, so the comparison always returnsfalse
, and the absolute path of the repo is set as thepattern
.The issue occurs both in the root of a git repo and in a subdirectory, and causes all tag parsing to fail. Normal behaviour can be restored by adding the old defaults back in on the CLI:
I think that using
filepath.Clean()
on both paths before using them should normalise the slashes and resolve this issue, though I can't test as I don't have a working golang setup on my Windows machine, and testing on Linux is inconclusive asfilepath.Clean
behaviour is platform-dependent.Example:
This results in the following help text showing the defaults when running
svu
:The text was updated successfully, but these errors were encountered: