Re: Git Diff feature request

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

 



On Mon, Jan 3, 2022 at 8:43 AM Nick Gearls <nickgearls@xxxxxxxxx> wrote:
>
> When you want to compare 2 versions of a repo you don't own, you don't have the option to apply a formatting standard ...

You may try
https://git-scm.com/docs/diff-options#Documentation/diff-options.txt---word-diff-regexltregexgt

  printf 'if (xyz) biz()\n' > bar
  git commit -m 1 bar
  printf 'if (xyz)\n  biz()\n' > bar
  git commit -m 2 bar
  git diff --word-diff-regex='[^[:space:]]' HEAD~

yields a diff with differences hidden

diff --git a/bar b/bar
index 49d380e..05c8e60 100644
--- a/bar
+++ b/bar
@@ -1 +1,2 @@
if (xyz)
  biz()

But from gits perspective, the files are different and the lines are different.
This is the reason having an adhering to a formatting standard is advised,
and something IMHO every serious project should adhere to.



[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