Skip to content
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-jcheck: add support for multiple pre-push hooks #474

Closed
wants to merge 2 commits into from

Conversation

edvbld
Copy link
Member

@edvbld edvbld commented Feb 25, 2020

Hi all,

please review this patch that adds support for multiple kinds of pre-push hooks
to git-jcheck. A user can now set up either the "branches" pre-push hook
and/or the "commits" pre-push hook via git jcheck --setup-pre-push-hooks=commits,branches. The "commits" pre-push hook will run
all commits about to pushed throught git-jcheck. The "branches"
pre-push hook will check that you are not pushing to a branch in your personal
fork that is also present in the upstream repository (rarely a good idea).

Testing:

  • Manual testing of pre-push hooks and git-jcheck on Linux x64

Thanks,
Erik


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed

Reviewers

Download

$ git fetch https://git.openjdk.java.net/skara pull/474/head:pull/474
$ git checkout pull/474

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Feb 25, 2020

👋 Welcome back ehelin! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 25, 2020

Webrevs

Copy link
Member

@rwestberg rwestberg left a comment

Looks good!

@openjdk
Copy link

@openjdk openjdk bot commented Feb 26, 2020

@edvbld This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

git-jcheck: add support for multiple pre-push hooks

Reviewed-by: rwestberg
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /solves command.

Since the source branch of this PR was last updated there have been 4 commits pushed to the master branch. Since there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate 8f13965cea4c60550896055ca3fedf8995c3329d.

➡️ To integrate this PR with the above commit message, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Feb 26, 2020
@edvbld
Copy link
Member Author

@edvbld edvbld commented Feb 26, 2020

@rwestberg thanks! I just realized that git-sync will not work if the "branches" pre-push hook is used 😃 I just pushed a new commit that fixes this with a slightly hacky workaround, please have a look!

@edvbld edvbld requested a review from rwestberg Feb 26, 2020
Copy link
Member

@rwestberg rwestberg left a comment

Looks good, perhaps would be cleaner to pass the state with an environment variable (to avoid leaving marker files in case the process is killed), but should hopefully not be an issue.

@edvbld
Copy link
Member Author

@edvbld edvbld commented Feb 26, 2020

Yeah, I wanted to use environment variables, but it became so ugly to pass it all down through Repository::push for this one thing...

@edvbld
Copy link
Member Author

@edvbld edvbld commented Feb 26, 2020

/integrate

@openjdk openjdk bot closed this Feb 26, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Feb 26, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Feb 26, 2020

@edvbld The following commits have been pushed to master since your change was applied:

  • 8f13965: Improve rate limit logging
  • d435e27: Adhere to GitHub's search rate limit
  • f806af1: Implement shared caching for rest requests
  • d451a26: Handle links already deleted

Your commit was automatically rebased without conflicts.

Pushed as commit 5016be2.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 26, 2020

Mailing list message from Erik Helin on skara-dev:

Changeset: 5016be2
Author: Erik Helin <ehelin at openjdk.org>
Date: 2020-02-26 10:05:13 +0000
URL: https://git.openjdk.java.net/skara/commit/5016be29

git-jcheck: add support for multiple pre-push hooks

Reviewed-by: rwestberg

! cli/src/main/java/org/openjdk/skara/cli/GitFork.java
! cli/src/main/java/org/openjdk/skara/cli/GitJCheck.java
! cli/src/main/java/org/openjdk/skara/cli/GitSync.java
! cli/src/main/java/org/openjdk/skara/cli/pr/GitPrCreate.java

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