#925288 please package diff-highlight executable

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Mo Zhou
Date:
2023-05-15 08:51:13 UTC
Severity:
wishlist
Tags:
#925288#5
Date:
2019-03-22 13:46:33 UTC
From:
To:
* Package name    : diff-so-fancy
  Version         : 1.2.5
  Upstream Author :
* URL             : https://github.com/so-fancy/diff-so-fancy
* License         : MIT
  Programming Lang: Perl
  Description     : Good-lookin' diffs. Actually… nah… The best-lookin' diffs.

This is a pager that colorizes patch like the way github renders a diff.

It makes my life very much easier as I heavily depend on git and diff;
and should definitely enter the archive as I cannot find any alternative.

#925288#10
Date:
2019-03-22 14:34:37 UTC
From:
To:
♥ the short desc.  Please keep it for the archive :)

Highlighting changes inside the line is a massive improvement.

There's an implementation of this in "git" itself already, named
diff-highlight.  Alas, either I'm a complete idiot, or its documentation is
not quite adequate -- some time ago I wasted over an hour trying to get that
implementation to work, without success.

So... if this fancy version is better and/or is equipped with working basic
instructions, it'd be great to have it!


Meow.

#925288#15
Date:
2019-03-22 15:06:10 UTC
From:
To:
On Fri, Mar 22, 2019 at 03:34:37PM +0100, Adam Borowski wrote:
[snip]

[roam@straylight ~]$ cat ~/bin/hdiff
#!/bin/sh

: "${DIFF_HIGHLIGHT:=/usr/share/doc/git/contrib/diff-highlight}"

exec perl -I "$DIFF_HIGHLIGHT" -MDiffHighlight -- "$DIFF_HIGHLIGHT/diff-highlight.perl" | exec less -r
[roam@straylight ~]$ cat ~/bin/git-hdiff
#!/bin/sh

exec git diff --color "$@" | exec hdiff
[roam@straylight ~]$ cat ~/bin/git-hshow
#!/bin/sh

exec git show --color "$@" | exec hdiff
[roam@straylight ~]$

You're welcome... and thanks for bringing diff-highlight to my attention so
that I could whip these up :)  Now only to figure out how to get the colors
more similar to the ones that Vim uses (I use a ~/bin/vdiff script that
pipes stuff through `vim -c 'set ft=diff' -` and I really, really like its
colors)...

G'luck,
Peter

#925288#20
Date:
2019-03-22 15:16:07 UTC
From:
To:
[snip shell snippets]

Uh, well, please note that this is in no way meant to say that there is
no need for this ITP; on the contrary, if there is an external, configurable
tool that can be used for other stuff, too, please go ahead and package it!

G'luck,
Peter

#925288#25
Date:
2019-03-23 07:41:06 UTC
From:
To:
Hello guys,

To my surprise multiple people expressed their interest in
productivity-friendly diff highlighting.  So let me write a brief
summary on this topic, after some investigation.

Mattia told me privately about the alternative of diff-so-fancy:

  diff a b | colordiff | diff-highlight | less -R

where

* colordiff does the same thing as 'diff --color'. For older
  Debian systems, diffutils doesn't support the '--color'.
  Sid users don't need this package.

* diff-highlight is the script shipped in git package, quite easy to use
  1. cd /usr/share/doc/git/contrib/diff-highlight/
  2. sudo make
  3. use the resulting executable as a filter:
     git config --global core.pager "XXX/diff-highlight | less --tabs=4 -RFX"

Now let's look at diff-so-fancy. In fact the diff-highlight (denoted
as 'DH' below, not your favorite debhelper) shipped in the git package
is able to produce similar result compared to diff-so-fancy (denoted as 'DSF'
below), except for

* DH doesn't mangle standard notations of the patch format; while
  DSF mangles them. See example below.

I started to doubt why git upstream doesn't enable such a
useful productivity feature by default? Who will be aware of
the existence of diff-highlight if he/she doesn't look into
the source tree?

======================= DH example

diff --git a/dotfile/gitconfig b/dotfile/gitconfig
index 90a5ee6f..7c7633e7 100644
--- a/dotfile/gitconfig
+++ b/dotfile/gitconfig
@@ -1,5 +1,5 @@
 [core]
-   pager = less
+   pager = diff-so-fancy | less --tabs=4 -RFX
    editor = vim
    quotepath = false
 [pager]

======================= DSF example

──────────────────────────────────────────────────────────────
modified: dotfile/gitconfig
──────────────────────────────────────────────────────────────
@ dotfile/gitconfig:2 @
[core]
	pager = less
	pager = diff-so-fancy | less --tabs=4 -RFX
	editor = vim
	quotepath = false
[pager]

#925288#30
Date:
2019-03-23 10:51:14 UTC
From:
To:
It sounds as though a binary package for diff-highlight might be a more
useful thing to do than packaging diff-so-fancy...

    smcv

#925288#35
Date:
2019-03-23 10:59:00 UTC
From:
To:
control: reassign -1 git
control: severity -1 wishlist
control: retitle -1 please privde separated binary package for diff-highlight

#925288#44
Date:
2019-04-06 04:49:20 UTC
From:
To:
Hi,

Yah, finding single character diff in long line is pain.

As for the pin pointing diff feature, an old curses program imediff2 was
updated to support wdiff like display and interactively swichable diff
display style by me recently.  (Also now it support merging with diff2
and diff3 case renamed old package to imediff.

(It was originally supposed to python2 to python3 updates but ...)

Osamu

#925288#59
Date:
2023-01-07 05:57:32 UTC
From:
To:
Hi maintainers, any update? Is there any plan to include the diff-highlight executable in the “git” package?
#925288#64
Date:
2023-01-08 16:08:49 UTC
From:
To:

im not a maintainer, but it is in
in /usr/share/doc/git/contrib/diff-highlight/

....just needs to be made executable and put in /usr/bin (i would also like
this "feature")

see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827292

#925288#75
Date:
2023-01-15 03:16:27 UTC
From:
To:
Thanks, Richard. I checked all the other three bugs merged with this bug, and I noticed that the bug 868871 has the latest status (from the package maintainer in 2020). I’ll post there.

Richard Lewis <richard.lewis.debian@googlemail.com<mailto:richard.lewis.debian@googlemail.com>> 於 2023年1月8日 上午8:08 寫道:

On Sat, 7 Jan 2023, 06:00 Franklin Yu, <franklinyu@hotmail.com<mailto:franklinyu@hotmail.com>> wrote:
Hi maintainers, any update? Is there any plan to include the diff-highlight executable in the “git” package?

im not a maintainer, but it is in in /usr/share/doc/git/contrib/diff-highlight/

....just needs to be made executable and put in /usr/bin (i would also like this "feature")

see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827292

#925288#80
Date:
2023-02-24 09:08:57 UTC
From:
To:
Hi,

+1 for this because the files under /usr/share/doc will not be
installed on Debian-slim docker containers. So I don't have a way to
install diff-highlight to the system via "git" package. It would be
very helpful to me if "diff-highlight" command will be provided as an
independent package.

#925288#85
Date:
2023-05-12 14:42:45 UTC
From:
To:
Good morning,

 Attached please find your PDF account statement and invoice as of 05/11/2023. Please notice you have a past due balance  for invoice IN0099203.

 Please provide payment as soon as possible.




 Best Regards,
 Shawneen Chisholm
 Accounts Receivable Coordinator

 UNITED RENTALS, INC.
Branch L02 BONNYVILLE
4920 56TH AVE
BONNYVILLE AB T9N 2N8 CA
780-826-7610


 CONFIDENTIALITY NOTICE: The contents of this email message and any attachments are intended solely for the addressee(s). This may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message, please alert the sender immediately by reply email and then delete this message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited

#925288#90
Date:
2023-05-12 14:43:00 UTC
From:
To:
Good morning,

 Attached please find your PDF account statement and invoice as of 05/11/2023. Please notice you have a past due balance  for invoice IN0099203.

 Please provide payment as soon as possible.




 Best Regards,
 Shawneen Chisholm
 Accounts Receivable Coordinator

 UNITED RENTALS, INC.
Branch L02 BONNYVILLE
4920 56TH AVE
BONNYVILLE AB T9N 2N8 CA
780-826-7610


 CONFIDENTIALITY NOTICE: The contents of this email message and any attachments are intended solely for the addressee(s). This may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message, please alert the sender immediately by reply email and then delete this message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited