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
[NETBEANS-4108] fixed git -> ignore should add a new line at the end … #2061
Conversation
…of .gitignore file
try { | ||
r = new BufferedReader(new FileReader(file)); | ||
int i; | ||
while((i = r.read()) >-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before "-".
int i; | ||
while((i = r.read()) >-1) | ||
{ | ||
if( i=='\n' || i=='\r') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before '=='
} | ||
} finally { | ||
if (r != null) { | ||
r.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use try-with-resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Just make sure the Travis tests pass... (the failing ones probably just need to be restarted) |
@eirikbakke thank you for taking the time to review it. Changed the code accordingly to your comments. |
Please do not squash-and-merge this - the github account seems not the provide the necessary information. |
@matthiasblaesing How do I confirm, in the GitHub interface, whether the right author/email will end up in the git log upon squash-and-merge? Also, I'm not seeing the usual "restart" button on the Travis tests. Did something change recently? |
Regarding the author information: Have a look at the profile page: For the restart button: Looks as if either github or travis lost access tokens - I was also missing the buttons, logging out of travis and in again fixed it. |
@matthiasblaesing added the info on my profile page.
|
@dmochalov yes the author information of the commits is totally ok. The problem starts if someone chooses the "Squash and merge" button in github to merge. CLI git uses the author information from the commits to create the merged author information, github uses the information from the profile (at least from my observation) and if that is not public, the squashed commit will hold invalid information. In this case there are three options:
|
@matthiasblaesing thank you for the detailed explanation. |
…of .gitignore file
Simple two line changes and added auto test for that. For more information see the issue and recommendations on SO
The GitHub native client handles the new line correctly.