git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mergetool merge/skip/abort at prompt

From
David Aguilar <davvid@gmail.com>
Date
Jan 28, 2009, 08:04 UTC
Message-ID
<402731c90901280004l29382eaanedfdfcca75529468@mail.gmail.com>
In-Reply-To
<81bfc67a0901272256t726bf206k351bb6c8b2778bd5@mail.gmail.com>
Hi Caleb
On Tue, Jan 27, 2009 at 10:56 PM, Caleb Cushing <xenoterracide@gmail.com> wrote:
Show 21 quoted lines
> 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?

Show 26 quoted lines
> +           "$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
Previous: Caleb CushingNext: Caleb Cushing
Message 3 of 6 in “mergetool merge/skip/abort at prompt”
  1. mergetool merge/skip/abort at promptCaleb Cushing, Jan 28, 2009
  2. Caleb CushingJan 28, 2009
  3. David AguilarJan 28, 2009
  4. Caleb CushingJan 28, 2009
  5. Charles BaileyJan 28, 2009
  6. Caleb CushingJan 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.