Skip to content

Conversation

chonton
Copy link
Contributor

@chonton chonton commented Feb 22, 2020

setting quiet to true will quiet pre-commit hook
added example profile that executes install-hooks only when pre-commit file is missing

@reda-alaoui
Copy link
Member

reda-alaoui commented Feb 23, 2020

@chonton
Copy link
Contributor Author

chonton commented Feb 23, 2020

'quiet' will prevent maven output during the git pre-commit hook. Without quiet, I see

$ git commit -m "Update dependency versions; reformat to Google code standard" [INFO] Scanning for projects... [INFO] [INFO] -------------------< org.honton.chas.version:semver >------------------- [INFO] Building semver 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-git-code-format:1.40-SNAPSHOT:on-pre-commit (default-cli) @ semver --- [INFO] Executing pre-commit hooks [INFO] Formatting lines [[1..55)] of 'src/main/java/org/honton/chas/version/JarVersions.java' [INFO] Formatted lines [[1..55)] of 'src/main/java/org/honton/chas/version/JarVersions.java' [INFO] Formatting 'src/main/java/org/honton/chas/version/SemVer.java' [INFO] Formatted 'src/main/java/org/honton/chas/version/SemVer.java' [INFO] Formatting 'src/main/java/org/honton/chas/version/VersionExtractor.java' [INFO] Formatted 'src/main/java/org/honton/chas/version/VersionExtractor.java' [INFO] Formatting 'src/main/java/org/honton/chas/version/VersionMatcher.java' [INFO] Formatted 'src/main/java/org/honton/chas/version/VersionMatcher.java' [INFO] Formatting 'src/test/java/org/honton/chas/version/JarVersionsTest.java' [INFO] Formatted 'src/test/java/org/honton/chas/version/JarVersionsTest.java' [INFO] Formatting 'src/test/java/org/honton/chas/version/SemVerTest.java' [INFO] Formatted 'src/test/java/org/honton/chas/version/SemVerTest.java' [INFO] Formatting 'src/test/java/org/honton/chas/version/VersionExtractorTest.java' [INFO] Formatted 'src/test/java/org/honton/chas/version/VersionExtractorTest.java' [INFO] Formatting 'src/test/java/org/honton/chas/version/VersionMatcherTest.java' [INFO] Formatted 'src/test/java/org/honton/chas/version/VersionMatcherTest.java' [INFO] Executed pre-commit hooks [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.739 s [INFO] Finished at: 2020-02-23T12:37:50-08:00 [INFO] ------------------------------------------------------------------------ [master 6021b1d] Update dependency versions; reformat to Google code standard 10 files changed, 201 insertions(+), 140 deletions(-) $ 

With quiet=true, I see

$ git commit -m "Update dependency versions; reformat to Google code standard" [master 26ae09e] Update dependency versions; reformat to Google code standard 10 files changed, 197 insertions(+), 140 deletions(-) $ 
@chonton
Copy link
Contributor Author

chonton commented Feb 23, 2020

The additional log messages during git commit is confusing or noisy to me. Perhaps this is a matter of training or expectations. I prefer to see only information I need to take action on.

An alternative to quiet parameter might be to allow configuration of the pipeline command. A configuration of <pipeline>&gt;/dev/null</pipeline> would produce the behavior in this pull request. To display error lines from the maven output the configuration could be <pipeline>| grep -F '[ERROR]' || exit 0 &amp;&amp; exit 1</pipeline>

Please let me know what your preference would be so that I can modify this pull request.

@reda-alaoui reda-alaoui changed the title Add quiet parameter to install-hooks Add pre-commit hook pipeline parameter to install-hooks Feb 25, 2020
@reda-alaoui reda-alaoui merged commit 466ee47 into Cosium:master Feb 25, 2020
@reda-alaoui
Copy link
Member

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants