git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Phillip Wood <phillip.wood@talktalk.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Oliver Joseph Ash <oliverjash@gmail.com>,
	git@vger.kernel.org, martin.agren@gmail.com, mqudsi@neosmart.net,
	phillip.wood@dunelm.org.uk
Subject: Re: Regression in patch add?
Date: Fri, 11 May 2018 19:23:42 +0100	[thread overview]
Message-ID: <9a7d35c7-2889-05e4-f6f3-5706c710d327@talktalk.net> (raw)
In-Reply-To: <xmqqzi16hpr4.fsf@gitster-ct.c.googlers.com>

On 11/05/18 03:47, Junio C Hamano wrote:
> Phillip Wood <phillip.wood@talktalk.net> writes:
> 
>> Yes, I think it probably makes sense to do that. Originally I didn't
>> count empty lines as context lines in case the user accidentally added
>> some empty lines at the end of the hunk but if 'git apply' does then I
>> think 'git add -p' should as well
> 
> I am not sure if "adding to the tail" should be tolerated, but in
> any case, newer GNU diff can show an empty unaffected line as an
> empty line (unlike traditional unified context format in which such
> a line is expressed as a line with a lone SP on it), which is
> allowed as "implementation defined" by POSIX.1 [*1*]. Modern "git
> apply" knows about this.

Thanks for the reference, I hadn't realized the space was optional.

> If "add -p" parses a patch, it should learn to do so, too.

I'm about to go off line for a while, I'll send a fix when I'm back up
and running at next month (unfortunately the reroll of pw/add-p-select
will have to wait until then as well)

Best Wishes

Phillip


> 
> [Reference]
> 
> *1* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html
> 
>>
>>> Meanwhile, I can easily configure my editor not to do this for `*.diff` files.
>>>
>>> Thanks for your help, Phillip and Martin!
>>
>> Thanks for posting an example so we could test it, it makes it much
>> easier to track the problem down
>>
>> Best Wishes
>>
>> Phillip
>>
>>> Mahmoud, does this also explain your problem as per your original post?
>>>


  reply	other threads:[~2018-05-11 18:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-15 12:21 Regression in patch add? mqudsi
2018-04-15 13:59 ` Martin Ågren
2018-04-16 10:01   ` Phillip Wood
2018-04-16 10:00 ` Phillip Wood
2018-05-10 10:41 ` Oliver Joseph Ash
2018-05-10 12:17   ` Martin Ågren
2018-05-10 13:16     ` Oliver Joseph Ash
2018-05-10 13:54       ` Martin Ågren
2018-05-10 13:49     ` Phillip Wood
2018-05-10 14:11       ` Oliver Joseph Ash
2018-05-10 17:58         ` Phillip Wood
2018-05-11  2:47           ` Junio C Hamano
2018-05-11 18:23             ` Phillip Wood [this message]
2018-05-10 13:15 ` Oliver Joseph Ash
2018-06-01 17:46 ` [PATCH] add -p: fix counting empty context lines in edited patches Phillip Wood
2018-06-01 19:07   ` Jacob Keller
2018-06-01 20:03   ` Eric Sunshine
2018-06-04 10:08     ` Phillip Wood
2018-06-04 17:21       ` Eric Sunshine
2018-06-11  9:46   ` [PATCH v2] " Phillip Wood
2018-07-11 20:27     ` Jeff Felchner
2018-07-11 20:50       ` 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=9a7d35c7-2889-05e4-f6f3-5706c710d327@talktalk.net \
    --to=phillip.wood@talktalk.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.agren@gmail.com \
    --cc=mqudsi@neosmart.net \
    --cc=oliverjash@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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).