From: Junio C Hamano <gitster@pobox•com>
To: Simon 'corecode' Schubert <corecode@fs•ei.tum.de>
Cc: git <git@vger•kernel.org>
Subject: [PATCH - DONTUSE] git-am: propagate -C/-p as well
Date: Thu, 04 Dec 2008 15:36:12 -0800 [thread overview]
Message-ID: <7vmyfbbjir.fsf_-_@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vy6yvbki6.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 04 Dec 2008 15:14:57 -0800")
Junio C Hamano <gitster@pobox•com> writes:
> I think this fixes the --whitespace=* one, although I obviously haven't
> tried to use it myself extensively.
This one comes on top of it *if* you want to propagate -C/-p as well, but
I think it might be a wrong idea to propagate these to begin with.
Just like --3way is a one-shot option to deal with a single unapplicable
patch (because it was based on an old version) in the whole series, and is
designed not to get propagated, I suspect that people use -C<n> to fix a
single broken patch and they may expect it not to apply to the whole
series.
The breakage --whitespace deals with is an attribute of the submitter (use
of a broken editor and lack of diligence). You most often feed a single
series from the same submitter in the same mbox to "git am", preserving
the --whitespace=fix option during the same "am" run makes sense, and
somewhat more importantly, even though the option indeed modifies what you
received, the change the option causes and the risk of breaking the
semantics of the patch is minimum. I am not sure the breakage --3way
deals with falls into the exactly the same category, but it is similar (if
the first patch in the series was based on an old version, it is very
likely that the subsequent ones are also based on the same old version).
So after all it might be better to propagate --3way as well (which this
patch does not do).
If we decide that propagating --3way is a good thing, then it would be
equally good to propagate -C, -p and --directory options.
I dunno.
git-am.sh | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git c/git-am.sh w/git-am.sh
index 1bf70d4..a35e07a 100755
--- c/git-am.sh
+++ w/git-am.sh
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
prec=4
dotest="$GIT_DIR/rebase-apply"
-sign= utf8=t keep= skip= interactive= resolved= rebasing= abort= ws=
+sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
resolvemsg= resume=
git_apply_opt=
@@ -155,9 +155,7 @@ do
;;
--resolvemsg)
shift; resolvemsg=$1 ;;
- --whitespace)
- ws="--whitespace=$2"; shift ;;
- -C|-p)
+ -C|-p|--whitespace)
git_apply_opt="$git_apply_opt $1$2"; shift ;;
--)
shift; break ;;
@@ -247,10 +245,10 @@ else
exit 1
}
- # -s, -u, -k and --whitespace flags are kept for the
- # resuming session after a patch failure.
+ # -s, -u, -k, --whitespace, -C and -p flags are kept
+ # for the resuming session after a patch failure.
# -3 and -i can and must be given when resuming.
- echo " $ws" >"$dotest/whitespace"
+ echo " $git_apply_opt" >"$dotest/apply_opt_extra"
echo "$sign" >"$dotest/sign"
echo "$utf8" >"$dotest/utf8"
echo "$keep" >"$dotest/keep"
@@ -283,7 +281,7 @@ if test "$(cat "$dotest/keep")" = t
then
keep=-k
fi
-ws=$(cat "$dotest/whitespace")
+apply_opt_extra=$(cat "$dotest/apply_opt_extra")
if test "$(cat "$dotest/sign")" = t
then
SIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '
next prev parent reply other threads:[~2008-12-04 23:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-04 18:48 [PATCH] Allow passing of --directory to git-am Simon 'corecode' Schubert
2008-12-04 18:51 ` Jeff King
2008-12-04 19:27 ` Junio C Hamano
2008-12-04 22:26 ` Simon 'corecode' Schubert
2008-12-04 22:33 ` Junio C Hamano
2008-12-04 23:14 ` Junio C Hamano
2008-12-04 23:36 ` Junio C Hamano [this message]
2008-12-04 23:41 ` Simon 'corecode' Schubert
2008-12-05 0:11 ` Junio C Hamano
2008-12-05 0:16 ` Simon 'corecode' Schubert
2008-12-04 19:35 ` Jakub Narebski
2008-12-04 22:25 ` Simon 'corecode' Schubert
2008-12-04 22:46 ` Jakub Narebski
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=7vmyfbbjir.fsf_-_@gitster.siamese.dyndns.org \
--to=gitster@pobox$(echo .)com \
--cc=corecode@fs$(echo .)ei.tum.de \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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