<story><title>Better Git diff output for Ruby, Python, Elixir, Go</title><url>https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more</url></story><parent_chain></parent_chain><comment><author>duckerude</author><text>I tried to figure out why the extensions aren&amp;#x27;t configured by default.&lt;p&gt;I found a 2011 patch&amp;#x2F;proposal to make it the default, which appears to have stranded: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;lore.kernel.org&amp;#x2F;git&amp;#x2F;20110825204047.GA9948@sigill.intra.peff.net&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;lore.kernel.org&amp;#x2F;git&amp;#x2F;20110825204047.GA9948@sigill.int...&lt;/a&gt;&lt;p&gt;With some discussion by the patch&amp;#x27;s author of possible downsides (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;lore.kernel.org&amp;#x2F;git&amp;#x2F;20110826025913.GC17625@sigill.intra.peff.net&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;lore.kernel.org&amp;#x2F;git&amp;#x2F;20110826025913.GC17625@sigill.in...&lt;/a&gt;):&lt;p&gt;&amp;gt; I think it could be a problem in the future if the builtin userdiff drivers started growing more invasive options, like automatically claiming to be non-binary (i.e., setting diff.cpp.binary = false by default). In other words, I think we have two options:&lt;p&gt;&amp;gt;  1. Builtin drivers like &amp;quot;cpp&amp;quot; can stay minimal, only setting funcname and color-words headers that aren&amp;#x27;t going to produce terrible results if we are wrong about detecting by extension.&lt;p&gt;&amp;gt;  2. We force the user to identify file types manually, so we can&amp;#x27;t be wrong. The &amp;quot;cpp&amp;quot; diff driver means &amp;quot;you are a text C file&amp;quot;, and if a user mis-marks a binary file with that diff driver, they are the one who is wrong.&lt;p&gt;&amp;gt; So if it&amp;#x27;s an either&amp;#x2F;or situation, we should decide not only that extension auto-detection is a good feature, but that it trumps adding more advanced features to the builtin drivers in the future.&lt;p&gt;&amp;gt; Or we could decide that the extensions really are good enough, and if you really do have binary files named &amp;quot;foo.c&amp;quot;, it&amp;#x27;s your problem to override the defaults with &amp;quot;*.c -diff&amp;quot;.&lt;p&gt;There might be more recent discussion that I didn&amp;#x27;t find.</text></comment>
<story><title>Better Git diff output for Ruby, Python, Elixir, Go</title><url>https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more</url></story><parent_chain></parent_chain><comment><author>nikeee</author><text>I use delta as a diff tool:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;dandavison&amp;#x2F;delta&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;dandavison&amp;#x2F;delta&lt;/a&gt;&lt;p&gt;It also offers contextual information as well as side-by-side diffs. For syntax highlighting, it uses the same as bat (the cat clone).</text></comment>