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
I'd like nbgv get-version "" to return an error, like git tag does:
$ git tag hah ""
fatal: Failed to resolve '' as a valid ref.
In nbgv 3.5.108+6e793d63d3, both nbgv get-version and nbgv get-version "" mean the same as nbgv get-version HEAD.
Rationale
To work around nbgv not supporting all the same <commit-ish> syntax as Git, my script preprocessed the argument like nbgv get-version "$(git rev-parse "${rev}")". But when ${rev} was accidentally empty, the script executed nbgv get-version "", which displayed the version information of HEAD instead. If that had returned an error right away, it would have finished faster (nbgv get-version HEAD takes 1500 ms in my repo) and not output misleading information.
Implementation ideas
nbgv treats an empty string as equivalent to null here:
I suppose nbgv get-version "" can be made to error out, provided nbgv get-version still works.
I'd favor rejecting "" at the command parsing level rather than in the command handler.
I'd like
nbgv get-version ""
to return an error, likegit tag
does:In nbgv 3.5.108+6e793d63d3, both
nbgv get-version
andnbgv get-version ""
mean the same asnbgv get-version HEAD
.Rationale
To work around
nbgv
not supporting all the same <commit-ish> syntax as Git, my script preprocessed the argument likenbgv get-version "$(git rev-parse "${rev}")"
. But when${rev}
was accidentally empty, the script executednbgv get-version ""
, which displayed the version information ofHEAD
instead. If that had returned an error right away, it would have finished faster (nbgv get-version HEAD
takes 1500 ms in my repo) and not output misleading information.Implementation ideas
nbgv
treats an empty string as equivalent to null here:Nerdbank.GitVersioning/src/nbgv/Program.cs
Lines 382 to 385 in 6e793d6
Could either tighten that check, or add a validator for the argument here:
Nerdbank.GitVersioning/src/nbgv/Program.cs
Lines 114 to 117 in 6e793d6
The text was updated successfully, but these errors were encountered: