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

Re: [PATCH v2] pre-commit hook should ignore carriage returns at EOL

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 26, 2008, 22:33 UTC
Message-ID
<7vk5gbq10p.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<635350D7-2CC0-4FA6-BB74-CE9ED930ECE8@gmail.com>
Christian Holtje <docwhat@gmail.com> writes:
Show 9 quoted lines
>> I suggested using "diff --check" (and possibly teaching "diff --check"
>> other things the scripted example checks, such as conflict markers),
>> which would know to honor the line endings specified per path via
>> gitattributes(5), instead of building on top of the big Perl script,
>> and I
>> had an impression that you agreed to the approach.
>
> I'm completely confused how gitattributes and core.autocrlf interact,
> etc.

Here is a series I just cooked up so that we can remove the whole Perl script and replace it by adding --check to "diff-index" used there.

The first three are code clean-ups and the last two implements necessary new features to "diff --check". The whole series somewhat depend on the fix to 'maint' not to lose the exit status I sent earlier.

[PATCH 1/5] diff --check: explain why we do not care whether old side is binary [PATCH 2/5] check_and_emit_line(): rename and refactor [PATCH 3/5] checkdiff: pass diff_options to the callback [PATCH 4/5] Teach "diff --check" about a new blank lines at end [PATCH 5/5] diff --check: detect leftover conflict markers

Previous: Christian HoltjeNext: Junio C Hamano
Message 6 of 14 in “pre-commit hook should ignore carriage returns at EOL”
  1. pre-commit hook should ignore carriage returns at EOLChristian Holtje, Jun 24, 2008
  2. Alex RiesenJun 25, 2008
  3. Christian HoltjeJun 25, 2008
  4. Junio C HamanoJun 25, 2008
  5. Christian HoltjeJun 26, 2008
  6. Junio C HamanoJun 26, 2008
  7. 1/5 diff --check: explain why we do not care whether old side is binaryJunio C Hamano, Jun 26, 2008
  8. 2/5 check_and_emit_line(): rename and refactorJunio C Hamano, Jun 26, 2008
  9. 3/5 checkdiff: pass diff_options to the callbackJunio C Hamano, Jun 26, 2008
  10. 4/5 Teach "diff --check" about a new blank lines at endJunio C Hamano, Jun 26, 2008
  11. 5/5 diff --check: detect leftover conflict markersJunio C Hamano, Jun 26, 2008
  12. Junio C HamanoJun 26, 2008
  13. Junio C HamanoJun 26, 2008
  14. Jeff KingJun 27, 2008

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.