Use case or problem
The default git diff is based on the line break. If there is no line break at the end of the file, when more lines are appended to the file, git diff will treat the last line of the previous version as edited, which is annoying.
Besides, according to POSIX, every text file should end with a \n , or “newline ” character. Break this rule may cause warnings or even errors at some cases.