All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Zickus <dzickus@redhat.com>
To: git@vger.kernel.org
Subject: git-apply quirks
Date: Tue, 10 Jun 2008 15:40:00 -0400	[thread overview]
Message-ID: <20080610194000.GD9304@redhat.com> (raw)

Hi.

I work with a lot of backporting of patches and there are times when
people combine multiple patches together such that the resulting patch can
have multiple chunks changing the same file.  I have noticed git-apply
does not handle this case correctly.  It usually ignores all previous
chunks and only applies the last one.

The same scenario can also cause git-apply to fail if a later patch chunk
depends on changes from an earlier patch chunk.

The traditional 'patch' command seems to handle the successfully.  Is this
git-apply behaviour intended or is it a bug?

The following example summarizes the problem:

#cd <some git repo>
# cat > dummy << EOF
This is
a
test
of
git-apply
doing
something
incorrectly.

Please
help.

EOF
#git-add dummy
#git commit -m 'test'
#git-apply <attached patch below>

You will notice in the git-diff output the first chunk is ignored and only
the second applies.

Cheers,
Don


diff a/dummy b/dummy
--- a/dummy
+++ b/dummy
@@ -1,5 +1,5 @@
 This is
-a
+the first
 test
 of
 git-apply

diff a/dummy b/dummy
--- a/dummy
+++ b/dummy
@@ -6,6 +6,8 @@ git-apply
 doing
 something
 incorrectly.
+Now here is the
+second test.
 
 Please
 help.

                 reply	other threads:[~2008-06-10 19:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080610194000.GD9304@redhat.com \
    --to=dzickus@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.