5 ms·
"In 2.9, Git's diff engine learned a new heuristic: it tries to keep hunk boundaries at blank lines, shifting the hunk "up" whenever the bottom of the hunk matc
by neogenix 10y ago
"In 2.9, Git's diff engine learned a new heuristic: it tries to keep hunk boundaries at blank lines, shifting the hunk "up" whenever the bottom of the hunk matches the bottom of the preceding context, until we hit a blank line. "
I like the new diff improvements
- emmelaich 10y agoIn a few (relatively) short years, git's diff has improved on all the other diffs out there.
- darfs 10y agoI didnt even know about the mentioned diff-script: https://github.com/git/git/blob/master/contrib/diff-highlight/diff-highlight https://github.com/git/git/blob/master/contrib/diff-highligh... It gives pretty nice output :-) I should definitely learn more about extending git!
- Spiritus 10y agoThere's also this https://github.com/so-fancy/diff-so-fancy https://github.com/so-fancy/diff-so-fancy
- michaelmior 10y ago+1 for this. I started using it a few months ago for all my git diffs and I quite like the output. The biggest thing for me is being able to easily see partial line changes.
- 0942v8653 10y agoRequires Node though. Not sure that many people have that installed.
- TimWolla 10y agoIt does not: > For convenience, the recommended installation is via NPM. If you'd prefer, you may choose to do a manual installation instead. (highlighting by me) It is written in Perl.
- ymse 10y agoWait, what? A perl app distributed through NPM? What's next, a node app on CPAN? Color me perplexed.
- dietrichepp 10y agoThere are a lot of non-JS packages in NPM. The Closure compiler, for example.
- maverickwoo 10y agoMy favorite git diff extension is the side-by-side diff by cdiff: https://pypi.python.org/pypi/cdiff https://pypi.python.org/pypi/cdiff It also features word-level change highlights and other common flares.
- forrestthewoods 10y agoI still prefer Araxis. http://www.araxis.com/merge/index.en http://www.araxis.com/merge/index.en
- zwieback 10y agoIt's the absolute best, been using it for years.
- tomtheengineer 10y agoBeyond Compare is the best I've found (especially for complex merges): http://www.scootersoftware.com/ http://www.scootersoftware.com/
- philliphaydon 10y agoMe too. I tried ataxia for about 6 months and hated it, got told about beyond compare, paid for a license after only a few days of the trial .
- forrestthewoods 10y agoBeyond Compare is great. I prefer Araxis. I think most people would be very happy with one of the two. Whichever you happen to prefer.
- merb 10y agoI use: http://www.kaleidoscopeapp.com/ http://www.kaleidoscopeapp.com/
- broodbucket 10y agoDoes anyone know if this only works when displaying diffs, or when generating them? It'd definitely be nice if diffs were more readable when sent to mailing lists, i.e. from git format-patch.
- creshal 10y agoI'm fairly sure this applies only to the generating engine. (Otherwise it'd somehow need to reformat old diffs on the fly.)
- avar 10y agoReformat old diffs? If you're under the impression that Git stores diffs you're mistaken. It stores the full file contents and delta-compresses them later. Diffs in Git are purely a presentation format for human consumption.
- creshal 10y ago> Diffs in Git are purely a presentation format for human consumption. git format-patch says hi. Obviously the diff engine changes won't apply to already generated text diffs.
- hibbelig 10y agoYou can pipe an existing diff through diff-so-fancy or diff-highlight: cat foo.diff | diff-so-fancy I've never tried, but that's what the doc says. [time passes] Oh yes, it seems to work. It doesn't do colors when I try it, but that's probably a misconfiguration on my side. It's how this is intended to be used.
- spb 10y agoI don't understand why Git can't just make the [histogram algorithm][1] default, which has better performance than the base Myers algorithm, and is already built to integrate this type of heuristics (without the bugs that caused this patch to get held back). [1]: http://stackoverflow.com/questions/32365271/whats-the-difference-between-git-diff-patience-and-git-diff-histogram http://stackoverflow.com/questions/32365271/whats-the-differ...
- wscott 10y agoCool. BitKeeper internal diff, used for recording history and displaying changes has done this since 2001. https://gist.github.com/wscott/c403526ca19a210c13ad649136c15608 https://gist.github.com/wscott/c403526ca19a210c13ad649136c15... http://bkbits.net/u/bk/bugfix/?PAGE=patch&REV=3bdee65dgEb_uMb7G9RGTpivu4A1tA http://bkbits.net/u/bk/bugfix/?PAGE=patch&REV=3bdee65dgEb_uM...
- Rafert 10y agoDoes anybody know if the new diff heuristic engine takes info from a .gitattributes file in to account? When using git diff to view changes it already makes a difference, see http://urbanautomaton.com/blog/2011/07/28/git-grep-and-language-specific-diffs/ http://urbanautomaton.com/blog/2011/07/28/git-grep-and-langu...