Skip to content

task: Sanitize git log output when building COMMIT variable #1344

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

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

ardnew
Copy link
Contributor

@ardnew ardnew commented Jul 1, 2021

This PR fixes a bug in Taskfile.yml.

If the user has configured git to always show commit signatures in git log, then task could emit malformed arguments to the go build command generated from task build.

For example, in my git config file:

[log]
  showSignature = true

And then running task build you will see rather confusing output:

arduino-cli $ task build
task: [build] go build -v -ldflags ' -X github.com/arduino/arduino-cli/version.versionString=git-snapshot -X github.com/arduino/arduino-cli/version.commit=gpg: Signature made Thu Jul  1 12:22:24 2021 CDT
gpg:                using RSA key 4AEE18F83AFDEB23
gpg: Can't check signature: No public key
1b055e5e -X github.com/arduino/arduino-cli/version.date=2021-07-01T22:25:11Z '

task: Failed to run task "build": 4:78: reached EOF without closing quote '

This PR adds an argument to suppress signature output from the offending git log command in Taskfile.yml.

Now running task build completes as expected:

arduino-cli $ task build
task: [build] go build -v -ldflags ' -X github.com/arduino/arduino-cli/version.versionString=git-snapshot -X github.com/arduino/arduino-cli/version.commit=892a2ba1 -X github.com/arduino/arduino-cli/version.date=2021-07-01T23:10:16Z '

arduino-cli $ ./arduino-cli version
arduino-cli alpha Version: git-snapshot Commit: 892a2ba1 Date: 2021-07-01T23:10:16Z

@CLAassistant
Copy link

CLAassistant commented Jul 1, 2021

CLA assistant check
All committers have signed the CLA.

@rsora rsora requested a review from silvanocerza July 2, 2021 07:25
Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! We surely never stumbled upon this but it's nonetheless a nice fix.
Thanks!

@silvanocerza
Copy link
Contributor

Don't worry about the integration tests failing, they're kinda flaky when running on GH. 😕
I'll handle the merge when they're all green.

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

Successfully merging this pull request may close these issues.

3 participants