RE: Git Diff feature request

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

 



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




[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