-
Notifications
You must be signed in to change notification settings - Fork 518
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
git_resource: ignore stderr in get_patch_count when calling git rev-list #2654
git_resource: ignore stderr in get_patch_count when calling git rev-list #2654
Conversation
Would it make sense to actually detect and surface the warning to the end user so they know the type of ref they chose is ambiguous? |
2b68822
to
fafa86c
Compare
Amended, now with the git warning forwarded to the user. |
Hold on, there seems to be an issue with the patch. It appears that |
…ount/2 In a situation after `git checkout -b <TAG>`, When rebar_git_resource:get_patch_count/2 is called, the cloned repo is in a state where it has a branch and a tag of the same name. This causes `git rev-list <TAG>..HEAD` to print "warning: refname '<TAG>' is ambiguous." to stdout, which in turn confuses the list_to_integer at the end of that function and causes a badarg. Redirecting stderr to /dev/null is sufficient to deal with this issue. print the warning from git rev-list, if any
fafa86c
to
c537205
Compare
Amended again, on account of
(note the inconsistency in handling the
|
Yeah that's a thing that can be set. https://www.erlang.org/doc/man/string.html#split-2 mentions supporting default arguments with |
When trying to build one of our projects on dockerhub, we saw the automatic build failing with a badarg:
It appears that in a situation after
git checkout -b <TAG>
, whenrebar_git_resource:get_patch_count/2
is called, the cloned repo is in a state where it has a branch and a tag of the same name. This causesgit rev-list <TAG>..HEAD
to print "warning: refname '' is ambiguous." to stderr, which in turn confuses a list_to_integer at the end of that function and causes a badarg. Redirecting stderr to /dev/null seems to be a sufficient and harmless way to deal with this issue.