Git的自动检测脚本是否在某些Git可执行文件中? [英] Is Git's auto-detection scripted or is it within some Git executable?

查看:172
本文介绍了Git的自动检测脚本是否在某些Git可执行文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是基于VonC在线程

This question is based on VonC's comment at the thread.

Git的difftool或mergetool脚本自动检测,还是Git可执行文件? p>

Is Git's auto-detection for difftool or mergetool scripted or is it within some Git executable?

推荐答案

它在git-mergetool中编写脚本。我发现这在我的副本344行。

It's scripted in git-mergetool. I found this at line 344 of my copy.

if test -z "$merge_tool"; then
    merge_tool=`git config merge.tool`
    if test -n "$merge_tool" && ! valid_tool "$merge_tool"; then
        echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
        echo >&2 "Resetting to default..."
        unset merge_tool
    fi
fi

if test -z "$merge_tool" ; then
    if test -n "$DISPLAY"; then
        merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff"
        if test -n "$GNOME_DESKTOP_SESSION_ID" ; then
            merge_tool_candidates="meld $merge_tool_candidates"
        fi
        if test "$KDE_FULL_SESSION" = "true"; then
            merge_tool_candidates="kdiff3 $merge_tool_candidates"
        fi
    fi
    if echo "${VISUAL:-$EDITOR}" | grep 'emacs' > /dev/null 2>&1; then
        merge_tool_candidates="$merge_tool_candidates emerge"
    fi
(snip)

这篇关于Git的自动检测脚本是否在某些Git可执行文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆