git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: Git Diff feature request

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Dec 30, 2021, 12:26 UTC
Message-ID
<00dd01d7fd78$7e69e150$7b3da3f0$@nexbridge.com>
In-Reply-To
<52591f5d-d4b5-90ea-e84e-32b99803a3e6@gmail.com>
On December 30, 2021 6:33 AM, Nick Gearls wrote:
Show 8 quoted lines
> 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
Previous: Nick GearlsNext: Erik Cervin Edin
Message 2 of 5 in “Git Diff feature request”
  1. Nick GearlsDec 30, 2021
  2. rsbecker@nexbridge.comDec 30, 2021
  3. Erik Cervin EdinDec 31, 2021
  4. Nick GearlsJan 3, 2022
  5. Erik Cervin EdinJan 3, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.