Cosium/git-code-format-maven-plugin

Possible improvement

VladRoscaDev opened this issue · 5 comments

Hello,
I noticed that after the commit faze (meaning that the staged files have been formatted), the files appear as staged again so this requires a second commit in order to unstage the files.
It would be nice if the hook could prevent this drawback of a double commit.

And thank you for this great plugin!

Hello,

I need more details.
What version are using?
Please provide a repository and a reproduction scenario.

Sorry, for the lack of information. I am using version 2.4.
Because I am using a personal server for Gitlab I can't provide any repository for test.

But the issue doesn't concern any repository issue. I was just suggesting if the files that are commited and formatted could not pe staged again (because they appear as modified, because of the formatting.)
What I mean is that the hook should first format the code and then add (git add) the modified files. Only after this the commit has to be done.

If there is anything else i can help, please ask.

The plugin is already supposed to do that. It does that for my team.
What OS are you using?
I think it may be related to your repository or patch you are trying to apply. Without a reproduction case I can't help.

I'm on Windows version 1903.
I will dig deeper, and try to put up some usefull information.
Another information is that in the IDE, or gitbash i can see the message: The contents of the files are identical, even if it is staged. This is after it is formatted.

@VladRoscaDev , please reopen when you have more information.