Re: [PATCH] contrib: add 'git difftool' for launching common merge tools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 18, 2009 at 11:25 AM, Markus Heidelberg
<markus.heidelberg@xxxxxx> wrote:
> 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.


>> +sub usage
>> +{
>> +     print << 'USAGE';
>> +
>
> Why the leading empty line?

Fixed.


>> +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.


>> +     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.



>> +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.


>
> Works fine for me, thanks.
>
> Markus
>

Thanks again for your help.

-- 
    David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux