grunt-gitinfo icon indicating copy to clipboard operation
grunt-gitinfo copied to clipboard

git formatted output with quotes

Open sickOscar opened this issue 8 years ago • 4 comments

First of all, thank you for your work.

The output of all the commands with --format option (lastCommitTime, lastCommitMessage, lastCommitAuthor) is surrounded with double quotes. Is there any specific reason? I mean, the format option in git doesn't need double quotes, and it is giving me some troubles using it with preprocess/usemin while putting in an html attribute.

If I can suggest a change, it would simply be to remove double quotes from the option

'local.branch.current.lastCommitTime' : ['log', '--format=%ai', '-n1', 'HEAD'], 'local.branch.current.lastCommitMessage' : ['log', '--format=%B', '-n1', 'HEAD'], 'local.branch.current.lastCommitAuthor' : ['log', '--format=%aN', '-n1', 'HEAD'],

If you agree I can submit a PR.

Cheers

sickOscar avatar Jan 13 '17 11:01 sickOscar

I'm having the same problem.
I had opened PR #21 which got closed as cannot reproduce after 1.5 years (it was not a good solution, though).

drasive avatar Jan 13 '17 22:01 drasive

Good to know. @drasive do you agree with my solution? I'm using the npm published version of this package for building in a production env now. If @damkraw can't reproduce this issue, I will definitely fork and use my version. It would be unfortunate though.

sickOscar avatar Jan 14 '17 11:01 sickOscar

Yes I absolutely agree with your solution. @damkraw said he only tried to reproduce it on Mac OS and Linux, maybe it only affects Windows? I would be unfortunate but I would use your fork, as it is a requirement for me.

drasive avatar Jan 15 '17 13:01 drasive

This issue also occurs for me on macOS, at least for local.branch.current.lastCommitTime (have not tested the other properties).

greenc avatar Feb 20 '17 20:02 greenc