git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Christian Brabandt <cblists@256bit.org>,
	Christian Brabandt <cb@256bit.org>
Cc: git@vger.kernel.org
Subject: Re: Mark trailing whitespace error in del lines of diff
Date: Mon, 25 May 2015 22:22:16 +0000	[thread overview]
Message-ID: <20150525222215.GI26436@vauxhall.crustytoothpaste.net> (raw)
In-Reply-To: <9b8e349e223dc9cd871fc5f7915e590548322932.1432585659.git.cb@256bit.org>

[-- Attachment #1: Type: text/plain, Size: 1959 bytes --]

On Mon, May 25, 2015 at 11:11:34PM +0200, Christian Brabandt wrote:
> Here is my use case: I have been working in a team repository,
> reformatting the source and wondered, why my reformatting did introduce
> some trailing whitespace. I suspected a bug in Vim and started to debug
> it, until I found out, that git-diff simply does not show trailing
> whitespace in the deleted lines. Therefore, I'd like to have an option,
> to also show trailing whitespace in the deleted lines of a diff. So here
> is the patch.

I like this idea.  My use case is determining whether a patch to a
pristine-tar repository introduced trailing whitespace (which is not
okay) or just left it there (which is okay).

> As far as I can see, this does not break any tests and also the
> behaviour of git-diff --check does not change.

Perhaps you'd care to implement a test or two to make sure that this
continues to work properly?

>  Documentation/config.txt | 2 ++
>  cache.h                  | 1 +
>  diff.c                   | 8 +++++++-
>  ws.c                     | 8 ++++++--
>  4 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 0f668bb..f73f0f7 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -670,6 +670,8 @@ core.whitespace::
>  +
>  * `blank-at-eol` treats trailing whitespaces at the end of the line
>    as an error (enabled by default).
> +* `blank-at-eol-old` like `blank-at-eol`, but for the deleted lines

You might want to insert "works" before "like" so that it's a complete
sentence.

> +  of a patch (i.e. those preceeded with a '-') (not enabled by default)

I believe this should be "preceded".
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-05-25 22:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 21:11 Mark trailing whitespace error in del lines of diff Christian Brabandt, Christian Brabandt
2015-05-25 22:22 ` brian m. carlson [this message]
2015-05-25 23:27   ` Junio C Hamano
2015-05-25 23:52     ` brian m. carlson
2015-05-26 16:29     ` Christian Brabandt
2015-05-26 17:26       ` Junio C Hamano
2015-05-26 17:34         ` Junio C Hamano
2015-05-26 17:39           ` Christian Brabandt
2015-05-26 17:48             ` Junio C Hamano
2015-05-26 18:21               ` Christian Brabandt
2015-05-26 19:46               ` [PATCH v2 0/5] showing existing ws breakage Junio C Hamano
2015-05-26 19:46                 ` [PATCH v2 1/4] t4015: modernise style Junio C Hamano
2015-05-26 19:46                 ` [PATCH v2 2/4] t4015: separate common setup and per-test expectation Junio C Hamano
2015-05-26 19:46                 ` [PATCH v2 3/4] diff.c: add emit_del_line() and update callers of emit_line_0() Junio C Hamano
2015-05-26 19:46                 ` [PATCH v2 4/4] diff.c: --ws-check-deleted option Junio C Hamano
2015-05-27  6:30                 ` [PATCH v3 0/4] showing existing ws breakage Junio C Hamano
2015-05-27  6:30                   ` [PATCH v3 1/4] t4015: modernise style Junio C Hamano
2015-05-27  6:30                   ` [PATCH v3 2/4] t4015: separate common setup and per-test expectation Junio C Hamano
2015-05-27  6:30                   ` [PATCH v3 3/4] diff.c: add emit_del_line() and emit_context_line() Junio C Hamano
2015-05-27  6:30                   ` [PATCH v3 4/4] diff.c: --ws-error-highlight=<kind> option Junio C Hamano
2015-05-27  7:22                   ` [PATCH v3 0/4] showing existing ws breakage Jeff King
2015-05-27 18:57                     ` Junio C Hamano
2015-05-27 20:36                       ` Jeff King
2015-05-27 20:46                         ` Junio C Hamano
2015-05-27 20:48                           ` Jeff King
2015-05-27 20:53                             ` Junio C Hamano
2015-05-27 20:51                     ` Jeff King
2015-05-26  0:24 ` Mark trailing whitespace error in del lines of diff Junio C Hamano
2015-05-26 16:31   ` Christian Brabandt
2015-05-26 17:33     ` Junio C Hamano

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=20150525222215.GI26436@vauxhall.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=cb@256bit.org \
    --cc=cblists@256bit.org \
    --cc=git@vger.kernel.org \
    /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).