You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/07/17 13:08:54 UTC

[GitHub] [lucene] mocobeta opened a new pull request #215: LUCENE-10028: Add git pre-commit hook that runs precommit task.

mocobeta opened a new pull request #215:
URL: https://github.com/apache/lucene/pull/215


   This adds git pre-commit hook for Lucene precommit check.
   
   (Usage)
   
   Install pre-commit hook (opt-in)
   ```
   ./gradlew precommitHook
   ```
   
   After installing, precommit will be automatically performed before every commit.
   
   ```
   git commit -m "commit attempt that doesn't pass spotless check"
   ......
   > Task :lucene:luke:spotlessJavaCheck FAILED
   
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':lucene:luke:spotlessJavaCheck'.
   > The following files had format violations:
   ......
   // commit fails.
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] mocobeta closed pull request #215: LUCENE-10028: Add git pre-commit hook that runs precommit task.

Posted by GitBox <gi...@apache.org>.
mocobeta closed pull request #215:
URL: https://github.com/apache/lucene/pull/215


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] mocobeta commented on pull request #215: LUCENE-10028: Add git pre-commit hook that runs precommit task.

Posted by GitBox <gi...@apache.org>.
mocobeta commented on pull request #215:
URL: https://github.com/apache/lucene/pull/215#issuecomment-882058333


   It surely won't fit everyone's (especially git experts') use-cases, and it's a local setup anyway; devs should be able to set up `pre-commit` or `pre-push` hook without the help of Gradle if they'd like. I threw in this since I would like to make sure all linters are locally run before pushing changes to the remote repo (and I almost always forget that) though, I don't intend to force or recommend others to do so.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on a change in pull request #215: LUCENE-10028: Add git pre-commit hook that runs precommit task.

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #215:
URL: https://github.com/apache/lucene/pull/215#discussion_r671789348



##########
File path: dev-tools/git/hooks/pre-commit
##########
@@ -0,0 +1,7 @@
+#!/usr/bin/sh
+#
+# Run precommit check
+#
+
+## TODO: Windows support

Review comment:
       I think the precommitHook task could detect the OS it's running on and copy an appropriate implementation (or fail if there is none available).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] mocobeta commented on pull request #215: LUCENE-10028: Add git pre-commit hook that runs precommit task.

Posted by GitBox <gi...@apache.org>.
mocobeta commented on pull request #215:
URL: https://github.com/apache/lucene/pull/215#issuecomment-884688832


   It's a local setup anyway. ("pre-push" hook seems to fit my usecase.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org