Missing “git diff” functionality

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I’d like to ask whether adding two, if not three, functionalities
to “git diff” is possible and has any takers.

The first two are relatively straightforward and already exist
in at least GNU diff (as incorporated in GNU CVS, for example).


       -I, --ignore-matching-lines=RE
              ignore changes where all lines match RE

I use this like
	cvs diff -uprOLDTAG -I '[$]OtherBSD:.*[$]'
and missed this in git dearly.


       -x, --exclude=PAT
              exclude files that match PAT

       -X, --exclude-from=FILE
              exclude files that match any pattern in FILE

I used to do 'diff -pruN -x CVS -x .git cvscheckout gitcheckout | less'
but have recently become accustomed to…
  alias cdiff='git diff --color=always --no-index --no-prefix'
  alias cwdiff='git diff --color=always --no-index --no-prefix --word-diff'
  alias cwdiffc='git diff --color=always --no-index --no-prefix --word-diff-regex=.'
… and doing a 'cdiff cvscheckout gitcheckout' lacks this exclusion.


Thirdly, there’s some functionality in GNU diff to make the content
not begin at the second/third column but at the eigth, so tabs don’t
break in the output. The resulting diff is obviously not a valid
unidiff, but…

@@ foo @@
     if (bar)
-	baz(1);
+        baz(2);

… reads different from…

@@ foo @@
	    if (bar)
-		baz(1);
+	        baz(2);

… and while only the first one is unidiff, the second one has its
uses (especially in plaintext files with tab-formatted tables) for
human consumption. Basically, you replace the leading space with
a HT for unchanged lines and add one after the +/- for the others.


Thanks for your consideration,
//mirabilos

PS: https://github.com/mirabilos/git-find still wishes to be
    merged into git.git (I asked for this… years ago?), and
    https://github.com/mirabilos/recvhook/tree/standalone is
    my merge-back-able attempt at improving post-receive-email
    which got neglected upstream and wants back…
-- 
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund,
mksh auf jedem System zu installieren.“
	-- XTaran auf der OpenRheinRuhr, ganz begeistert
(EN: “[…]uhr.gz is a reason to install mksh on every system.”)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux