git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Robert Fitzsimons <robfitz@273k.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] Fix the processing of multiple patch files with --check in git-apply.
Date: Tue, 06 Sep 2005 17:54:22 -0700	[thread overview]
Message-ID: <7vslwhbsu9.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20050905123445.GA27107@localhost> (Robert Fitzsimons's message of "Mon, 5 Sep 2005 12:34:45 +0000")

Robert Fitzsimons <robfitz@273k.net> writes:

> No problem I know it's a controversial change.

Not really controversial anymore, as long as --ignore-applied is
used only when appropriate.

>>> Yes my change has a bug with a copy patch which modifies the same file.
> I'll send on a fix now.

Here is another one that the patch seems to regress.

Unfortunately this turns out to be a death sentence to the
'multiple patch touching the same file' patch.

Note that patches from a single 'git-diff-*' run are supposed to
be independent, so the second one that copy-edits from frotz to
rezrov copies frotz _before_ it is modified and then makes its
modification.

On the other hand, we can have one 'git-diff-*' run that
modifies frotz in place, and then a separate 'git-diff-*' run
that copies frotz to rezrov and then modifies rezrov, and feed
the concatenation of the two to git-apply.  That would look very
similar to a single run that edits frotz and copy-edits rezrov,
but the pre-image to create rezrov would use the post-edit image
of frotz from the first patch.  Without an explicit "here an
output from the next git-diff-*' run begins" marker, we cannot
tell these two apart.

This means that applying multiple-patches concatenated in a
single file does not make much sense.  There is no guarantee
that we can detect where the first 'git-diff-*' output ends, at
which point we need to reset the status of 'frotz' to
post-modification image of the first patch.  And if we can
detect reliably where one 'git-diff-*' output ends and the next
one begins, we could just split the input there and run
git-apply independently.  So my conclusion is to just drop this
patch, and instead tell people not to feed overlapping outputs
from multiple git-diff-* runs to a single invocation of
git-apply.

I personally do not mind considering --ignore-applied
independently from the multiple-patch-files changes, though.

------------
echo frotz >frotz
git-apply --check <<\EOF
diff --git a/frotz b/frotz
--- a/frotz
+++ b/frotz
@@ -1 +1 @@
-frotz
+frottz
diff --git a/frotz b/rezrov
similarity index 64%
copy from frotz
copy to rezrov
--- a/frotz
+++ b/rezrov
@@ -1 +1 @@
-frotz
+frotttz
EOF

      parent reply	other threads:[~2005-09-07  0:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-30  0:01 [PATCH 1/3] Fix the processing of a patch file which modifies the same file in git-apply Robert Fitzsmons
2005-08-30  0:01 ` [PATCH 2/3] Fix the processing of multiple patch files with --check " Robert Fitzsmons
2005-08-30  0:01   ` [PATCH 3/3] New option --ignore-applied for git-apply Robert Fitzsmons
     [not found]   ` <7vll2ccs4k.fsf@assigned-by-dhcp.cox.net>
     [not found]     ` <20050905123445.GA27107@localhost>
2005-09-07  0:54       ` Junio C Hamano [this message]

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=7vslwhbsu9.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=robfitz@273k.net \
    /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).