git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Erik Cervin Edin <erik@cervined.in>
To: nickgearls@gmail.com
Cc: rsbecker@nexbridge.com, git@vger.kernel.org
Subject: Re: Git Diff feature request
Date: Mon, 3 Jan 2022 11:14:02 +0100	[thread overview]
Message-ID: <CA+JQ7M-3sswuYzuXy+bs=e26o3btDoK9z3A0j4WVvELoHG5A-Q@mail.gmail.com> (raw)
In-Reply-To: <83d398ce-caba-34f7-3727-3e7f5d396127@gmail.com>

On Mon, Jan 3, 2022 at 8:43 AM Nick Gearls <nickgearls@gmail.com> 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.

      parent reply	other threads:[~2022-01-03 10:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 11:33 Git Diff feature request Nick Gearls
2021-12-30 12:26 ` rsbecker
2021-12-31 11:15   ` Erik Cervin Edin
2022-01-03  7:53     ` Nick Gearls
     [not found]     ` <83d398ce-caba-34f7-3727-3e7f5d396127@gmail.com>
2022-01-03 10:14       ` Erik Cervin Edin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+JQ7M-3sswuYzuXy+bs=e26o3btDoK9z3A0j4WVvELoHG5A-Q@mail.gmail.com' \
    --to=erik@cervined.in \
    --cc=git@vger.kernel.org \
    --cc=nickgearls@gmail.com \
    --cc=rsbecker@nexbridge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).