Expanding Context in Diffs
github.com
github.com
This is a very needed feature for projects that work a lot with text files (such as markdown) that do not automatically break on set widths (e.g. [1])
I've already contacted Github support with this request months ago, but no one's stepped up with a fix. Maybe this can get escalated somehow? Heck, I'd even submit a pull request if it was possible for github/github.
http://f.cl.ly/items/0B2T3i1o1A3y062q0K1Z/Image%202013.12.02...
I don't find it too misleading. But long line could be made to look even more different (from multiple short lines) by having distinct color, typography marks etc.
I have a hook in my .emacs that turns on auto-fill-mode whenever I open a .md or .rst file. I'd assume there's something analogous for vim or whichever editor you normally work with.
Also, won't it mess up diffs for wrapped text? If you add a few words in the middle of a paragraph and then re-wrap the text, won't the contents of every single following line be altered and show up as a diff?
http://code.google.com/p/google-diff-match-patch/
Its extremely easy to integrate as well. You can see how it handles a markdown diff at:
http://ny.testdrive.gitsense.com/index?#pid=23&cid=27&trail=
.diff-line-pre { white-space: pre-wrap; }
In your honor, I used an example from the cryptoparty handbook. Cheers!
That said, I also want side-by-side diffs. They're necessary for more complex diffs.
1) Do what Bitbucket does and have the side by side diff be a pop up window. I personally find this to be jarring and unnatural.
2) Combine both elements. It's what I do for my product. To better understand this take a look at
http://ny.testdrive.gitsense.com/index?#pid=22&cid=27&trail=
and switch to the side by side view. If you hover over the line number, you'll be able to see the diff line in unified mode below. With this setup they can provide side by side without having the user to constantly scroll left to right.
No, it's not available on gist.github.com.
Sure, they may (or may not) port it over after some time, but I just don't get why they can't use the same code in the first place. Why is GitHub reinventing the wheel in for its very own sub-site?
(Other than that, this is absolutely great!)
http://philfreo.com/blog/the-problem-with-pull-requests-code...
https://chrome.google.com/webstore/detail/github-enhancement...
Has side-by-side + word wrap + context (somewhat nicer looking than Github's, although could be biased)
Largely inspired by Phabricator's diff viewer.
[1] https://github.com/danielribeiro/github-diff-highlight-exten...
When I talk about code to collaborators in email or chat, I always try to link to the file on github rather than just giving a path. I much prefer to recieve feedback that way. Maybe i'm not good enough with my text editor, but it is just a lot faster to get to the file that way.
Hope it shows up in GH enterprise soon!