From: Junio C Hamano <gitster@pobox.com>
To: Jonathon Mah <me@JonathonMah.com>
Cc: git@vger.kernel.org, Dan McGee <dpmcgee@gmail.com>,
David Aguilar <davvid@gmail.com>
Subject: Re: [PATCH] mergetool: Use args as pathspec to unmerged files
Date: Fri, 16 Sep 2011 13:17:10 -0700 [thread overview]
Message-ID: <7vaaa4fdix.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <C5AD8BFC-DA48-4CE9-B821-D0076825F33C@JonathonMah.com> (Jonathon Mah's message of "Thu, 15 Sep 2011 19:12:10 -0700")
Jonathon Mah <me@JonathonMah.com> writes:
> Mergetool now treats its path arguments as a pathspec (like other git
> subcommands), restricting action to the given files and directories.
> Files matching the pathspec are filtered so mergetool only acts on
> unmerged paths; previously it would assume each path argument was in an
> unresolved state, and get confused when it couldn't check out their
> other stages.
>
> Running "git mergetool subdir" will prompt to resolve all conflicted
> blobs under subdir.
>
> Signed-off-by: Jonathon Mah <me@JonathonMah.com>
It looks like this simplifies the code quote a bit and make the result
easier to follow ;-) Nicely done.
As nobody reads from a pipe in while loop and runs merge_file or prompt
inside, there no longer is a reason to redirect the original standard
input and make it available, hence we could perhaps add this patch on top
of your change.
Ack from mergetool/difftool folks?
Thanks.
git-mergetool.sh | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 83551c7..0a06bde 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -362,20 +362,18 @@ if test -z "$files" ; then
exit 0
fi
-# Save original stdin
-exec 3<&0
-
printf "Merging:\n"
printf "$files\n"
IFS='
-'; for i in $files
+'
+for i in $files
do
if test $last_status -ne 0; then
- prompt_after_failed_merge <&3 || exit 1
+ prompt_after_failed_merge || exit 1
fi
printf "\n"
- merge_file "$i" <&3
+ merge_file "$i"
last_status=$?
if test $last_status -ne 0; then
rollup_status=1
next prev parent reply other threads:[~2011-09-16 20:17 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-12 20:16 What's cooking in git.git (Sep 2011, #04; Mon, 12) Junio C Hamano
2011-09-12 21:48 ` Junio C Hamano
2011-09-12 21:51 ` Junio C Hamano
2011-09-12 23:27 ` Jeff King
2011-09-13 0:09 ` Junio C Hamano
2011-09-13 9:24 ` Nguyen Thai Ngoc Duy
2011-09-12 21:53 ` Junio C Hamano
2011-09-13 7:32 ` [PATCH v2] Documentation: basic configuration of notes.rewriteRef Thomas Rast
2011-09-13 17:16 ` Junio C Hamano
2011-09-13 17:18 ` Jeff King
2011-09-12 21:55 ` What's cooking in git.git (Sep 2011, #04; Mon, 12) Junio C Hamano
2011-09-12 21:59 ` Junio C Hamano
2011-09-14 2:34 ` Jonathon Mah
2011-09-14 20:57 ` Junio C Hamano
2011-09-16 2:12 ` [PATCH] mergetool: Use args as pathspec to unmerged files Jonathon Mah
2011-09-16 20:17 ` Junio C Hamano [this message]
2011-09-25 0:45 ` David Aguilar
2011-09-26 16:40 ` Junio C Hamano
2011-09-12 22:02 ` What's cooking in git.git (Sep 2011, #04; Mon, 12) Junio C Hamano
2011-09-12 23:15 ` Sverre Rabbelier
2011-09-12 22:56 ` Junio C Hamano
2011-09-13 9:46 ` Erik Faye-Lund
2011-09-29 12:03 ` Pascal Obry
2011-09-12 22:58 ` Junio C Hamano
2011-09-13 12:05 ` Michael J Gruber
[not found] ` <7vk49d5t8u.fsf@alter.siamese.dyndns.org>
2011-09-12 23:15 ` Eric Sunshine
2011-09-12 23:25 ` Junio C Hamano
2011-09-12 23:33 ` Jeff King
2011-09-12 23:53 ` Jeff King
2011-09-13 15:15 ` Brandon Casey
2011-09-13 16:05 ` Jeff King
2011-09-13 16:22 ` Brandon Casey
2011-09-13 7:51 ` John Szakmeister
2011-09-13 15:04 ` Eric Sunshine
2011-09-13 17:20 ` Jeff King
2011-09-12 23:35 ` 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=7vaaa4fdix.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=davvid@gmail.com \
--cc=dpmcgee@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@JonathonMah.com \
/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.