From: Markus Heidelberg <markus.heidelberg@web.de>
To: David Aguilar <davvid@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] contrib: add 'git difftool' for launching common merge tools
Date: Sun, 18 Jan 2009 20:25:23 +0100 [thread overview]
Message-ID: <200901182025.24045.markus.heidelberg@web.de> (raw)
In-Reply-To: <1232092802-30838-1-git-send-email-davvid@gmail.com>
David Aguilar, 16.01.2009:
> diff --git a/contrib/difftool/git-difftool b/contrib/difftool/git-difftool
> new file mode 100755
> index 0000000..1fc087c
> --- /dev/null
> +++ b/contrib/difftool/git-difftool
> @@ -0,0 +1,74 @@
> +#!/usr/bin/env perl
> +# Copyright (c) 2009 David Aguilar
> +#
> +# This is a wrapper around the GIT_EXTERNAL_DIFF-compatible
> +# git-difftool-helper script. This script exports
> +# GIT_EXTERNAL_DIFF and GIT_PAGER for use by git, and
> +# GIT_NO_PROMPT and GIT_MERGE_TOOL for use by git-difftool-helper.
GIT_DIFFTOOL_NO_PROMPT
> +sub usage
> +{
> + print << 'USAGE';
> +
Why the leading empty line?
> +usage: git difftool [--no-prompt] [--tool=tool] ["git diff" options]
--tool=<tool>
Swap the order of --no-prompt and --tool for consistency with
git-difftool.txt and git-mergetool.
> diff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper
> new file mode 100755
> index 0000000..0b266e3
> --- /dev/null
> +++ b/contrib/difftool/git-difftool-helper
> + meld|vimdiff)
> + "$merge_tool_path" "$LOCAL" "$REMOTE"
> + ;;
> +
> + gvimdiff)
> + "$merge_tool_path" -f "$LOCAL" "$REMOTE"
> + ;;
Maybe use '-c "wincmd l"' for Vim as in my patch for git-mergetool to
automatically place the cursor in the editable file? Useful for editing,
if git-difftool is used to diff a file from the working tree.
See http://thread.gmane.org/gmane.comp.version-control.git/106109
> diff --git a/contrib/difftool/git-difftool.txt b/contrib/difftool/git-difftool.txt
> new file mode 100644
> index 0000000..3940c70
> --- /dev/null
> +++ b/contrib/difftool/git-difftool.txt
You have deleted all the '-' chars from git-command, but when using it as the
name I think it's the preferred method, only when used as command then without
slash.
> +DESCRIPTION
> +-----------
> +'git difftool' is a git command that allows you to compare and edit files
If for example 'git difftool' is used as the name of the tool and not
the command, I think the dash should be kept.
> +between revisions using common merge tools. At its most basic level,
> +'git difftool' does what 'git mergetool' does but its use is for non-merge
Keep the dash.
> +situations such as when preparing commits or comparing changes against
> +the index.
> +
> +'git difftool' is a frontend to 'git diff' and accepts the same
Keep the dash.
> +arguments and options.
> +
> +See linkgit:git-diff[7] for the full list of supported options.
[1]
> +
> +OPTIONS
> +-------
> +-t <tool>::
> +--tool=<tool>::
> + Use the merge resolution program specified by <tool>.
> + Valid merge tools are:
> + kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff
> ++
> +If a merge resolution program is not specified, 'git difftool'
Keep the dash.
> +situations such as when preparing commits or comparing changes against
> +will use the configuration variable `merge.tool`. If the
> +configuration variable `merge.tool` is not set, 'git difftool'
Keep the dash.
> +situations such as when preparing commits or comparing changes against
> +will pick a suitable default.
> ++
> +You can explicitly provide a full path to the tool by setting the
> +configuration variable `mergetool.<tool>.path`. For example, you
> +can configure the absolute path to kdiff3 by setting
> +`mergetool.kdiff3.path`. Otherwise, 'git difftool' assumes the
Keep the dash.
> +situations such as when preparing commits or comparing changes against
> +tool is available in PATH.
> ++
> +Instead of running one of the known merge tool programs,
> +'git difftool' can be customized to run an alternative program
Keep the dash.
> +situations such as when preparing commits or comparing changes against
> +by specifying the command line to invoke in a configuration
> +variable `mergetool.<tool>.cmd`.
> ++
> +When 'git difftool' is invoked with this tool (either through the
Keep the dash.
> +--no-prompt::
> + Do not prompt before launching a merge tool.
the diff tool
> +SEE ALSO
> +--------
> +linkgit:git-diff[7]::
[1]
> + Show changes between commits, commit and working tree, etc
> +
> +linkgit:git-mergetool[1]::
> + Run merge conflict resolution tools to resolve merge conflicts
> +
> +linkgit:git-config[7]::
[1]
Works fine for me, thanks.
Markus
next prev parent reply other threads:[~2009-01-18 19:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 8:00 [PATCH] contrib: add 'git difftool' for launching common merge tools David Aguilar
2009-01-18 19:25 ` Markus Heidelberg [this message]
2009-01-19 0:25 ` [PATCH v2] contrib: add 'git-difftool' for launching common diff tools David Aguilar
2009-01-19 4:45 ` Markus Heidelberg
2009-01-19 0:34 ` [PATCH] contrib: add 'git difftool' for launching common merge tools David Aguilar
2009-01-19 5:03 ` Markus Heidelberg
2009-01-19 5:32 ` David Aguilar
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=200901182025.24045.markus.heidelberg@web.de \
--to=markus.heidelberg@web.de \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.