From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fall back to three-way merge when applying a patch.
Date: Tue, 04 Oct 2005 23:58:27 -0700 [thread overview]
Message-ID: <7vslvg1mcs.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0510042155090.31407@g5.osdl.org> (Linus Torvalds's message of "Tue, 4 Oct 2005 21:56:58 -0700 (PDT)")
Linus Torvalds <torvalds@osdl.org> writes:
> For example, I use git-applypatch _only_ through git-applymbox. Ie
> non-interactively. I definitely do _not_ want it to try random other trees
> unless I tell it to, especially when applying a series of 175 patches in
> one go.
My understanding of your workflow, from reading your earlier
posts to the git list, is:
* Read bunch of mails -- mostly concentrating on the
description in the log message and skimming the code -- while
saving the worthy patches into a 'to-apply' mbox.
* Review 'to-aplly' mbox again, perhaps excluding not-so-good
ones. When you need to fix log messages, that is done in
this step.
* Run git-applymbox on the surviving messages in a batch mode,
processing 175 patches in one go.
What is your workflow after seeing that the 47th patch among 175
patches fails to apply? I understand you run git-applymbox
without -q, so it immediately fails and exits there. You would
have split mails, numbered from 0001 to 0175 in the .dotest
directory, with msg, patch and info files from the mail 0047
left behind.
I presume that, if the conflict/fuzz is manageably small, you
would hand edit the file 0047 to make the diff part to apply
cleanly, and then run 'git-applymbox -c .dotest/0047'. I
would understand you would be able to resume and process the
rest 128 patches this way.
Once you mentioned that if the conflict is too great you would
apply the patch to an old version that the patch sender based
her work on, and merge using git (this was the direct
inspiration of the change to git-applypatch).
What I am wondering is how that step fits in your workflow. Do
you do this by the following sequence?
* Temporarily switch to a new throwaway branch for merge from
the known old version with 'git checkout -b test v2.6.12';
* 'git apply --index <.dotest/patch' to apply the patch, and
perhaps 'git commit -F .dotest/msg';
* Switch back to the master branch with 'git checkout master';
* Merge them with 'git resolve master test <some message>',
which may leave conflicts, in which case you would hand
resolve, and say 'git commit -F .dotest/msg'. Then 'git
branch -d test' to get rid of the throwaway branch.
* Resume the patch application with 'git-applymbox -c
.dotest/0048'.
Well, I just noticed that it is not even immediately obvious
that the 47th of the 175 patches failed to apply from the
git-applymbox batch output (it shows how I do not process really
many patches myself X-<). Is there anything I can do to improve
this? For example, after git-applypatch exits with 0 exit
status we could remove the split mail file, like this:
------------
diff --git a/git-applymbox.sh b/git-applymbox.sh
--- a/git-applymbox.sh
+++ b/git-applymbox.sh
@@ -82,7 +82,11 @@ do
do
git-applypatch .dotest/msg-clean .dotest/patch .dotest/info "$signoff"
case "$?" in
- 0 | 2 )
+ 0)
+ # Remove the cleanly applied one to reduce clutter.
+ rm -f .dotest/$i
+ ;;
+ 2)
# 2 is a special exit code from applypatch to indicate that
# the patch wasn't applied, but continue anyway
;;
------------
Or it may not matter at all if your "after failure" workflow is
very different from what I've been imagining. This is the
primarily reason why I would like to understand your workflow
better.
next prev parent reply other threads:[~2005-10-05 6:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-05 0:46 [PATCH] Fall back to three-way merge when applying a patch Junio C Hamano
2005-10-05 4:56 ` Linus Torvalds
2005-10-05 6:58 ` Junio C Hamano [this message]
2005-10-05 14:30 ` Linus Torvalds
2005-10-06 0:03 ` Junio C Hamano
2005-10-06 1:59 ` Eric W. Biederman
2005-10-06 2:18 ` Linus Torvalds
2005-10-06 4:17 ` Junio C Hamano
2005-10-06 5:25 ` Eric W. Biederman
2005-10-06 14:35 ` Linus Torvalds
2005-10-06 14:52 ` Eric W. Biederman
2005-10-06 14:59 ` Linus Torvalds
2005-10-06 17:07 ` Eric W. Biederman
2005-10-07 2:33 ` [PATCH] Show original and resulting blob object info in diff output Junio C Hamano
2005-10-07 4:47 ` Linus Torvalds
2005-10-07 5:16 ` Junio C Hamano
2005-10-06 7:33 ` [PATCH] Fall back to three-way merge when applying a patch 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=7vslvg1mcs.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.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).