Re: [PATCH] contrib: add 'git difftool' for launching common merge tools
- From
David Aguilar <davvid@gmail.com>
- Date
- Jan 19, 2009, 00:34 UTC
- Message-ID
- <402731c90901181634u32b39c87t6e88d9efef0d3485@mail.gmail.com>
- In-Reply-To
- <200901182025.24045.markus.heidelberg@web.de>
On Sun, Jan 18, 2009 at 11:25 AM, Markus Heidelberg <markus.heidelberg@web.de> wrote:
Show 7 quoted lines
> David Aguilar, 16.01.2009: > >> +# 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
Thanks for catching that.
Show 6 quoted lines
>> +sub usage
>> +{
>> + print << 'USAGE';
>> +
>
> Why the leading empty line?Fixed.
Show 6 quoted lines
>> +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.
Done.
Show 13 quoted lines
>> + 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
Very cool. When you have unstaged changes git diff sends the local filename as the 2nd argument so I changed the vim command to "wincmd r" so that vim places the cursor on the right hand side.
> 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.
I was wondering about that. I think I tried to follow the lead from the git-diff.txt documentation, but "diff" is a builtin and thus doesn't have an actual git-diff, so I see why they should be different.
I've changed the docs as you suggested -- 'git-difftool' is used to name the script while 'git difftool' is used in the SYNOPSIS section.
Show 14 quoted lines
>> +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]
Oops, I don't know how that happened.
Show 5 quoted lines
> > Works fine for me, thanks. > > Markus >
Thanks again for your help.
--
David