git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nathan Collins <nathan.collins@gmail.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>, git <git@vger.kernel.org>
Subject: Re: [BUG?] Patches created with 'diff.noprefix=true' don't 'git apply'.
Date: Tue, 06 May 2014 11:10:13 -0700	[thread overview]
Message-ID: <xmqqa9aug4my.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAO8RVveV4SgXmJzWpYnyB3rnQALQkrrLNtLL5Ej5Y9Mjjekmmw@mail.gmail.com> (Nathan Collins's message of "Mon, 5 May 2014 18:33:28 -0700")

Nathan Collins <nathan.collins@gmail.com> writes:

> Hmmm. Maybe a warning that the patch is expected to be in '-p1'
> format, and that setting 'diff.noprefix=true' makes some commands
> generate '-p0' patches?

"some"?  Do you have exceptions in mind?

> But I worry this would just confuse / distract
> the people that don't have 'diff.noprefix=true' set,

Probably.  But that would suggest that the place to improve the doc
is for diff.noprefix configuration variable, no?

> Better I think would be for 'git apply' to be
> smarter, as you suggest below.

As it is a plumbing command behind "add -p", "am", and friends, I
would hate to see "git apply" pretend to be smarter than its users.
When the user tells it to use -p0, it shouldn't guess, and when the
user tells it to use -p1 by not giving any -p$n, it shouldn't guess.

As long as we make it clear "git apply" without any explicit -p$n
means the user is telling it to do -p1 in its documentation, I think
it would be fine.

>> I personally think setting diff.noprefix is not very sane (it also
>> breaks "patch -p1"), and I suppose I should have been louder about
>> that when it was introduced.

I share the same feeling ;-)  But the boat has sailed, so the best
we could do is to warn in its doc (i.e. where diff.noprefix is
described) about its pitfalls.

  parent reply	other threads:[~2014-05-06 18:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01  1:36 [BUG?] Patches created with 'diff.noprefix=true' don't 'git apply' Nathan Collins
2014-05-01  2:40 ` Jonathan Nieder
2014-05-06  1:33   ` Nathan Collins
2014-05-06  1:59     ` Jonathan Nieder
2014-05-06 18:10     ` Junio C Hamano [this message]
2014-05-06 19:36       ` Nathan Collins
2014-05-06 21:12         ` Junio C Hamano
2014-05-07  1:16           ` Nathan Collins
2014-05-07 18:42             ` Junio C Hamano
2014-05-07 23:39               ` Nathan Collins
2014-05-08  4:38                 ` Nathan Collins
2014-05-08  4:53                   ` Nathan Collins
2014-05-08 16:56                 ` 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=xmqqa9aug4my.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=nathan.collins@gmail.com \
    /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).