git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org
Subject: Re: [RFC] refer to post-patch lines in whitespace warnings
Date: Wed, 09 Jan 2008 12:22:48 -0800	[thread overview]
Message-ID: <7vy7ayhhpj.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LNX.1.00.0801091046100.13593@iabervon.org> (Daniel Barkalow's message of "Wed, 9 Jan 2008 10:57:40 -0500 (EST)")

Daniel Barkalow <barkalow@iabervon.org> writes:

> When I rebase series with bad whitespace, I end up with unhelpful messages 
> like:
>
> .dotest/patch:412: trailing whitespace.
> -- 
> .dotest/patch:446: trailing whitespace.
> -- 
>
> These line numbers obviously refer to lines in a file that's been removed 
> by the time I can do anything about it.

The message is more appropriate for a workflow to "git apply --check"
first, fix the patchfile and then applying for real.

> ... if, in the case where it leaves the working tree 
> modified with the non-compliant whitespace, it gave this location rather 
> than the patch's location (because, even if you have the patch still, 
> you'd need to revert it first in order to be able to apply a fixed version 
> anyway).

In such a case, "git diff" will highlight the non-compliant whitespace.

More problematic is if you used whitespace=warn to let it commit anyway.
You can use "git diff $beginning_of_series..HEAD" the same way
to locate the breakages, but you then need to do "rebase -i" to
fix it up (I personally would run "format-patch", fix the problems in
the patch text, and run "am", instead of "rebase -i", mostly
because I am used to working that way).

  reply	other threads:[~2008-01-09 20:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09 15:57 [RFC] refer to post-patch lines in whitespace warnings Daniel Barkalow
2008-01-09 20:22 ` Junio C Hamano [this message]
2008-01-09 21:35   ` Daniel Barkalow
2008-01-09 20:42 ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vy7ayhhpj.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=barkalow@iabervon.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.
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 NNTP newsgroup(s).