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

Add GJF code style pre commit hook support. #656

Merged
merged 1 commit into from May 16, 2018
Merged

Conversation

raviagarwal7
Copy link
Collaborator

@raviagarwal7 raviagarwal7 commented May 16, 2018

Runs only on changed java files

@artem-zinnatullin
Copy link
Contributor

Have you checked if it works with -a?

ie:

# Do some changes.
$ git commit -am 'commit message'

I was doing pretty much same thing to autoformat code, but faced problem with committing with -a flag.

I don't remember the details exactly, but I think -a creates secondary temporary .git/index and if you try to add something to git index in the hook, it breaks its internal state and both index files remain and git starts erroring

@raviagarwal7
Copy link
Collaborator Author

@artem-zinnatullin, verified that git commit -am 'commit message' commits with formatted changes.

@raviagarwal7 raviagarwal7 merged commit 584202d into master May 16, 2018
@raviagarwal7 raviagarwal7 deleted the ravi/gjf branch May 16, 2018 19:05
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.

None yet

3 participants