1

Git diff often thinks that minor changes are very great changes and does not correctly identify the minor changed code.

Is there a simple way to help git like by adding some marker that is in the source code, or perhaps some other way?

Jonathan
  • 1,349
  • 1
  • 10
  • 20
  • Git does not think. Can you show some example of what you think is incorrect git behavior? – Roman Susi Dec 25 '17 at 20:14
  • @RomanSusi the file is too large ( on github it does not display the diff since it is too large) even though only 5 lines changed – Jonathan Dec 25 '17 at 20:17
  • Still the question is vague. What are minor changes? 5 lines in 100 line file is minor, but git does not show whole file if those were only changes. So there are other changes? Ends of lines changed? TABs changed to spaces? Etc. – Roman Susi Dec 25 '17 at 20:27

1 Answers1

3

git diff offers various ways to ignore minor changes:

However, that is for a local diff.
For GitHub, there is no native solution for forcing it to display a diff when the file is "too large".

A similar scenario (still on GitHub) was reported here, when seeing

Sorry, we could not display the entire diff because too many files changed

I'm doing workaround by download the diff file to local, but by that way I don't have the diff highlighting feature like what I got in GitHub PR.

Adding .patch at the end of the diff GitHub URL can help a bit.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Really? Now I know at least one way bitbucket is better: One can click and show diff for a specific file. – Roman Susi Dec 25 '17 at 20:25
  • @RomanSusi That should be the case for GitHub as well, except when there are too many file, or if one file is deemed too big. – VonC Dec 25 '17 at 20:26