From: <rsbecker@nexbridge.com>
To: <nickgearls@gmail.com>, <git@vger.kernel.org>
Subject: RE: Git Diff feature request
Date: Thu, 30 Dec 2021 07:26:33 -0500 [thread overview]
Message-ID: <00dd01d7fd78$7e69e150$7b3da3f0$@nexbridge.com> (raw)
In-Reply-To: <52591f5d-d4b5-90ea-e84e-32b99803a3e6@gmail.com>
On December 30, 2021 6:33 AM, Nick Gearls wrote:
> On top of the option ignore-all-space, it would be very handy (for several
> programming languages) to have an additional option ignore-all-space-and-
> eol where the following snippets would be equivalent:
>
> if (...) a = 1
>
> if (...)
> a = 1
One interesting technique I have seen used is to set up a pre-commit hook and/or clean filter to format code according to corporate/team standards. Reprocessing code prior to the commit would allow a normalization of coding standards and removing of EOL or space/tab concerns. So even if a developer did
if (...) a= 1
By the time it reaches the repo, it looks like
if (...)
a = 1
We use a similar technique (enforced only by policy right now, not a hook), which is to require code to run through standard IDE source formatting. Improperly formatted code hitting pull requests gets a decline until the code is properly formatted. A pull request diff might not include an above suggested diff option.
--Randall
next prev parent reply other threads:[~2021-12-30 12:26 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 [this message]
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
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='00dd01d7fd78$7e69e150$7b3da3f0$@nexbridge.com' \
--to=rsbecker@nexbridge.com \
--cc=git@vger.kernel.org \
--cc=nickgearls@gmail.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).