git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Caleb Cushing <xenoterracide@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Charles Bailey <charles@hashpling.org>,
	git@vger.kernel.org, Nanako Shiraishi <nanako3@lavabit.com>
Subject: Re: [PATCH] mergetool merge/skip/abort at prompt
Date: Wed, 28 Jan 2009 00:04:22 -0800	[thread overview]
Message-ID: <402731c90901280004l29382eaanedfdfcca75529468@mail.gmail.com> (raw)
In-Reply-To: <81bfc67a0901272256t726bf206k351bb6c8b2778bd5@mail.gmail.com>

Hi Caleb

On Tue, Jan 27, 2009 at 10:56 PM, Caleb Cushing <xenoterracide@gmail.com> wrote:
> previously git mergetool when run with prompt only allowed the user to continue
> merging. This changes git mergetool to allow the option of skipping a file or
> aborting, and includes an addtional key to explicitly select merge.
>
> Signed-off-by: Caleb Cushing <xenoterracide@gmail.com>
> ---
>  git-mergetool.sh |   20 ++++++++++++++++++--
>  1 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/git-mergetool.sh b/git-mergetool.sh
> index 00e1337..575fbb2 100755
> --- a/git-mergetool.sh
> +++ b/git-mergetool.sh
> @@ -177,8 +177,24 @@ merge_file () {
>     describe_file "$local_mode" "local" "$LOCAL"
>     describe_file "$remote_mode" "remote" "$REMOTE"
>     if "$prompt" = true; then
> -       printf "Hit return to start merge resolution tool (%s): " "$merge_tool"
> -       read ans
> +       while true; do
> +           printf "Use (m)erge file or (s)kip file, or (a)bort? (%s): " \


I really like the feature you added here.  I'm sorry to bikeshed on
this conversation, but after trying it I have one tiny suggestion.

Right now the prompt looks like this with your patch:

"""
Merging the files: foo bar baz

Normal merge conflict for 'foo':
  {local}: created
  {remote}: created
Use (m)erge file or (s)kip file, or (a)bort? (xxdiff): m
"""

do you think
"Use merge file or skip file, or abort?"
might be better expressed as:

"""
Merging: foo bar baz

Normal merge conflict for 'foo':
  {local}: created
  {remote}: created
(m)erge, (s)kip, or (q)uit? (xxdiff): m
"""?

I realize that your patch only touches the last line of the prompt
(and not the introductory "Merging the files:" line) so if you agree
then maybe I can throw a patch together for the introductory line.

Also, my example has quit instead of abort for two reasons (the first
one is silly)
1. skip rhymes with quit, so it reads very nicely out loud
2. consistency with git add --interactive
3. less typos (q and s are diagonal on qwerty, s and a are adjacent)
(okay, that last one is silly too)

Some might also mis-associate 'abort' with meaning "abort the merge."

slightly off-topic:
If we're looking at cleaning up mergetool a bit would you all mind a
separate patch to convert it to using hard tabs throughout, just like
git-rebase.sh?


> +           "$merge_tool"
> +           read ans
> +           case "$ans" in
> +               [mM]*|"")
> +                   break
> +                   ;;
> +               [sS]*)
> +                   cleanup_temp_files
> +                   return 0
> +                   ;;
> +               [aA]*)
> +                   cleanup_temp_files
> +                   exit 0
> +                   ;;
> +           esac
> +       done
>     fi
>
>     case "$merge_tool" in
> --
> 1.6.1.1
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
    David

  parent reply	other threads:[~2009-01-28  8:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28  6:56 [PATCH] mergetool merge/skip/abort at prompt Caleb Cushing
2009-01-28  7:01 ` Caleb Cushing
2009-01-28  8:04 ` David Aguilar [this message]
2009-01-28  9:50   ` Caleb Cushing
2009-01-28  8:47 ` Charles Bailey
2009-01-28  9:53   ` Caleb Cushing

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=402731c90901280004l29382eaanedfdfcca75529468@mail.gmail.com \
    --to=davvid@gmail.com \
    --cc=charles@hashpling.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nanako3@lavabit.com \
    --cc=xenoterracide@gmail.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 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).