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

Improve error message when a tag is not found and match is set. #77

Merged

Conversation

jenshnielsen
Copy link
Contributor

If match is set and you do not have any tags matching this but you do have other tags the error shown is git describe could not find a tag` which is slightly confusing since there are tags and running git describe at the command line will return a tag. This just tweaks the error message to include the match argument in such a case.

Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.67%. Comparing base (4d090c1) to head (20f6952).

❗ Current head 20f6952 differs from pull request most recent head d07ffbf. Consider uploading reports for the commit d07ffbf to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #77   +/-   ##
=======================================
  Coverage   97.67%   97.67%           
=======================================
  Files          17       17           
  Lines        1246     1249    +3     
  Branches      211      212    +1     
=======================================
+ Hits         1217     1220    +3     
  Misses         15       15           
  Partials       14       14           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jenshnielsen jenshnielsen force-pushed the better_error_message_on_missing_tag branch from 292c18f to 274a78a Compare March 13, 2024 12:55
@jenshnielsen
Copy link
Contributor Author

It was not obvious from a few mins of looking how to best update the test data depending on if match is used or not

@jwodder jwodder added method:git Relating to the "git" vcs method vcs:git Relating to Git support UX Relating to the user experience method:git-archive Relating to the "git-archive" vcs method step:vcs Relating to the "vcs" step labels Mar 16, 2024
@jwodder jwodder marked this pull request as draft March 16, 2024 17:06
@jwodder jwodder force-pushed the better_error_message_on_missing_tag branch from a9e9121 to 7e902bd Compare March 16, 2024 17:31
@jwodder jwodder force-pushed the better_error_message_on_missing_tag branch from 02bd4d4 to 225e243 Compare March 16, 2024 17:50
jwodder added a commit to jwodder/versioningit-test-case-factory that referenced this pull request Mar 16, 2024
@jwodder
Copy link
Owner

jwodder commented Mar 16, 2024

@jenshnielsen I've taken care of the tests, as well as various improvements to ensure that all mentions of git describe include not only --match but all other options passed as well.

@jwodder jwodder marked this pull request as ready for review March 16, 2024 18:29
@jenshnielsen
Copy link
Contributor Author

Thanks @jwodder that looks like a great improvement and much more useful than my original contribution

@jwodder
Copy link
Owner

jwodder commented Mar 16, 2024

@jenshnielsen This has just been released in versioningit v3.1.0.

@jenshnielsen jenshnielsen deleted the better_error_message_on_missing_tag branch March 16, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
method:git Relating to the "git" vcs method method:git-archive Relating to the "git-archive" vcs method step:vcs Relating to the "vcs" step UX Relating to the user experience vcs:git Relating to Git support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants