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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alex Riesen
Date: Wednesday, June 25, 2008 - 11:14 am

Christian Holtje, Tue, Jun 24, 2008 21:21:22 +0200:

Your patch has long lines wrapped.


You coud just strip the trailing (cr)lf, instead of chomp:

  	if (s/^\+//) {
  	    $lineno++;
- 	    chomp;
+	    s/\r?\n$//so;
 	    if (/\s$/) {
 		bad_line("trailing whitespace", $_);

Makes for a shorter patch and less code.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v2] pre-commit hook should ignore carriage returns ..., Christian Holtje, (Tue Jun 24, 12:21 pm)
Re: [PATCH v2] pre-commit hook should ignore carriage retu ..., Alex Riesen, (Wed Jun 25, 11:14 am)
Re: [PATCH v2] pre-commit hook should ignore carriage retu ..., Christian Holtje, (Wed Jun 25, 11:47 am)
[PATCH 2/5] check_and_emit_line(): rename and refactor, Junio C Hamano, (Thu Jun 26, 3:35 pm)
[PATCH 3/5] checkdiff: pass diff_options to the callback, Junio C Hamano, (Thu Jun 26, 3:36 pm)
[PATCH 5/5] diff --check: detect leftover conflict markers, Junio C Hamano, (Thu Jun 26, 3:37 pm)
</