From: Junio C Hamano <gitster@pobox.com>
To: Jonathon Mah <me@JonathonMah.com>
Cc: git@vger.kernel.org, Charles Bailey <charles@hashpling.org>
Subject: Re: [PATCH 2/2] mergetool: Don't assume paths are unmerged
Date: Wed, 22 Jun 2011 14:26:47 -0700 [thread overview]
Message-ID: <7v62nx5zhk.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <92B6FB42-FE0D-48DC-ABD0-BA1903D842D2@JonathonMah.com> (Jonathon Mah's message of "Tue, 21 Jun 2011 19:46:28 -0700")
Jonathon Mah <me@JonathonMah.com> writes:
> Like commit, mergetool now treats its path arguments as restricting
> operation to the listed paths. Running "git mergetool subdir" will
> prompt to resolve all conflicted blobs under subdir.
>
> Previously mergetool would assume each path was in an unresolved state,
> and get confused when it couldn't check out their other stages.
>
> Signed-off-by: Jonathon Mah <me@JonathonMah.com>
> ---
This does two unrelated things, no?
- Given the name of a file from the command line, current mergetool gets
confused if the given file is not in a conflicted state (bugfix).
- Instead of taking command line arguments as literal filenames, treat
them as pathspec like any sane git subcommand does, allowing the users
more flexibility (new feature).
And the title of the patch advertises only the first point. Using the
command line argument as pathspec may make a lot of sense, and code
reduction in git-mergetool.sh with this patch may also be a good change.
> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
> index 8c79ae8..f1f4e7a 100644
> --- a/Documentation/git-mergetool.txt
> +++ b/Documentation/git-mergetool.txt
> @@ -16,9 +16,10 @@ Use `git mergetool` to run one of several merge utilities to resolve
> merge conflicts. It is typically run after 'git merge'.
>
> If one or more <file> parameters are given, the merge tool program will
> -be run to resolve differences on each file. If no <file> names are
> -specified, 'git mergetool' will run the merge tool program on every file
> -with merge conflicts.
> +be run to resolve differences on each file (skipping those without
> +conflicts). Specifying a directory will include all unresolved files in
> +that path. If no <file> names are specified, 'git mergetool' will run
> +the merge tool program on every file with merge conflicts.
The documentation may also have to reword <file> written back in the days
when they were literal filenames, not pathspecs.
> + matches=$(git ls-files -u -- "$1" | sed -e 's/^[^ ]* //' | sort -u)
Would we want to catch and signal a typo like this?
git mergetool Mkaefile
git mergetool Documentaiton/
when there is a conflict in Makefile and some file in Documentation/
directory, and user obviously wanted to name them but botched typing? I
think you are just letting these typos silently go.
> @@ -392,7 +410,7 @@ test_expect_success 'directory vs modified submodule' '
> test "$(cat submod/file16)" = "not a submodule" &&
> rm -rf submod.orig &&
>
> - git reset --hard &&
> + git reset --hard >/dev/null 2>&1 &&
What is the justification for this change?
Please do not make "sh txxx.sh -v" less useful.
next prev parent reply other threads:[~2011-06-22 21:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 2:46 [PATCH 2/2] mergetool: Don't assume paths are unmerged Jonathon Mah
2011-06-22 21:26 ` Junio C Hamano [this message]
2011-06-22 21:33 ` 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=7v62nx5zhk.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=charles@hashpling.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox