git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Guthrie <gmane@colin.guthr.ie>
To: Drew Northup <drew.northup@maine.edu>
Cc: git@vger.kernel.org
Subject: Re: [BUG] git-am silently applying patches incorrectly
Date: Fri, 04 Mar 2011 16:41:29 +0000	[thread overview]
Message-ID: <4D711639.4070706@colin.guthr.ie> (raw)
In-Reply-To: <1299255471.22002.15.camel@drew-northup.unet.maine.edu>

'Twas brillig, and Drew Northup at 04/03/11 16:17 did gyre and gimble:
> 
> On Fri, 2011-03-04 at 13:40 +0000, Colin Guthrie wrote:
>> Hi,
>>
>> We recently found a bug in git-am 1.7.4.1 while working on PulseAudio.
>>
>> It seems that it mis-applied a patch and did so silently without
>> generating any warnings. It is reproducible and has been confirmed on
>> different distros.
>>
>> I make reference to the bug here:
>> http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/8840/focus=8857
>>
>> In order to reproduce:
>>
>> git clone http://git.0pointer.de/repos/pulseaudio.git
>> git co -b misapply 0ce3017b7407ab1c4094f7ce271bb68319a7eba7
>> git am 0002-alsa-mixer-add-required-any-and-required-for-enum-op.patch
>>
>> (I've attached the patch here for convenience).
> 
>> For reference, applying the patch manually with patch works fine and
>> does not result in an error:
>>
>> $ cat 0002-alsa-mixer-add-required-any-and-required-for-enum-op.patch |
>> patch -p1
>> patching file src/modules/alsa/alsa-mixer.c
>> Hunk #1 succeeded at 1121 (offset 103 lines).
>> Hunk #2 succeeded at 1325 (offset 103 lines).
>> Hunk #3 succeeded at 1356 (offset 103 lines).
>> Hunk #4 succeeded at 1613 (offset 103 lines).
>> Hunk #5 succeeded at 1640 (offset 103 lines).
>> Hunk #6 succeeded at 1913 (offset 103 lines).
>> Hunk #7 succeeded at 1997 (offset 105 lines).
>> Hunk #8 succeeded at 2242 (offset 106 lines).
>> Hunk #9 succeeded at 2261 (offset 106 lines).
>> Hunk #10 succeeded at 2312 (offset 106 lines).
>> patching file src/modules/alsa/alsa-mixer.h
>> Hunk #1 succeeded at 112 (offset 1 line).
>> Hunk #2 succeeded at 133 (offset 1 line).
>> Hunk #3 succeeded at 169 (offset 1 line).
>> patching file src/modules/alsa/mixer/paths/analog-output.conf.common
> 
> Did you try removing the first line from the patch mbox file?
> It seems to work just fine if you do that. 

Do you mean the line:

>From ae83e51c82a747332494bf10c245281e49343fe3 Mon Sep 17 00:00:00 2001

?

If so, I removed that line and it still failed to apply correctly with
git am.

> If you just send the output of "git format-patch" untouched as an
> attachment you can expect problems.

Wow! I've never heard of this before... So you're saying it's actually
invalid to do a git format-patch and then a git am on the files it
generates?

If that's the case, then I need to rethink a whole lot of things,
including the way several distros deal with patch management in their
package VCSs.... I'm quite shocked by this! Can you point me to
somewhere in the docs that discusses this?


I'd like to point out that "patch" is able to apply the exact same patch
fine as noted above. To me this seems like a very serious bug in the way
that git-am deals with the application of the patch, but perhaps I'm
missing something.....


Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

  reply	other threads:[~2011-03-04 16:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04 13:40 [BUG] git-am silently applying patches incorrectly Colin Guthrie
2011-03-04 16:17 ` Drew Northup
2011-03-04 16:41   ` Colin Guthrie [this message]
2011-03-04 17:27     ` Junio C Hamano
2011-03-04 17:49 ` Junio C Hamano
2011-03-04 18:37   ` Junio C Hamano
2011-03-04 19:05     ` Junio C Hamano
2011-03-04 19:18       ` Linus Torvalds
2011-03-04 19:31         ` Junio C Hamano
2011-03-04 20:14           ` Alexander Miseler
2011-03-04 21:33             ` Junio C Hamano
2011-03-04 22:20               ` Colin Guthrie
2011-03-04 22:34                 ` Junio C Hamano
2011-03-04 22:42                 ` Junio C Hamano
2011-03-05 11:51                   ` Colin Guthrie
2011-03-06 22:15                     ` Junio C Hamano
2011-03-06 22:40                       ` Junio C Hamano
2011-03-06 22:56                         ` Jonathan Nieder
     [not found]                           ` <AANLkTikctSrfqKCdeYUyvUmAZjr=i7kaFhPeB-LfwgUz@mail.gmail.com>
2011-03-09 10:31                             ` [RFC/PATCH 0/2] i18n: add ngettext stub Jonathan Nieder
2011-03-09 10:46                               ` [PATCH 1/2] i18n: add stub ngettext implementation Jonathan Nieder
2011-03-09 10:52                               ` [PATCH 2/2] i18n: avoid conflict with ngettext from libintl Jonathan Nieder
2011-03-09 20:43                                 ` Junio C Hamano
2011-03-09 20:51                                   ` Jonathan Nieder
2011-03-09 20:55                                     ` Junio C Hamano
2011-03-10  3:17                                       ` [PATCH v2] i18n: add stub Q_() wrapper for ngettext Jonathan Nieder
2011-03-10  7:59                                         ` Junio C Hamano
2011-03-10  9:24                                           ` Ævar Arnfjörð Bjarmason
2011-03-10  9:21                                     ` [PATCH 2/2] i18n: avoid conflict with ngettext from libintl Ævar Arnfjörð Bjarmason
2011-03-06 22:15                     ` [BUG] git-am silently applying patches incorrectly Junio C Hamano
2011-03-07  9:37                       ` Colin Guthrie
2011-03-04 23:09               ` Alexander Miseler
2011-03-05  0:05                 ` Junio C Hamano
2011-03-04 22:58         ` Junio C Hamano
2011-03-04 21:49       ` Drew Northup

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=4D711639.4070706@colin.guthr.ie \
    --to=gmane@colin.guthr.ie \
    --cc=drew.northup@maine.edu \
    --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).