/// <summary> /// Configure a given application helper to be a Git diff utility /// </summary> public static void Configure(AppHelper app) { // Configure application only if it is valid if (app.Name != string.Empty) { string path = app.Path.Replace('\\', '/'); string usr = app.Args. Replace("%1", "$LOCAL"). Replace("%2", "$REMOTE"); string arg = "'" + path + "' " + usr; ClassConfig.SetGlobal("difftool." + app.Name + ".path", path); ClassConfig.SetGlobal("difftool." + app.Name + ".cmd", arg); // TODO: This might be an option: Set our default tool to be the Git gui tool? // ClassConfig.SetGlobal("diff.guitool", app.Name); } }
/// <summary> /// Configure a given application helper to be a Git merge utility /// </summary> public static void Configure(AppHelper app) { // Configure application only if it is valid if (app.Name != string.Empty) { string path = app.Path.Replace('\\', '/'); string usr = app.Args. Replace("%1", "$BASE"). Replace("%2", "$LOCAL"). Replace("%3", "$REMOTE"). Replace("%4", "$MERGED"); string arg = "'" + path + "' " + usr; ClassConfig.SetGlobal("mergetool." + app.Name + ".path", path); ClassConfig.SetGlobal("mergetool." + app.Name + ".cmd", arg); ClassConfig.SetGlobal("mergetool." + app.Name + ".trustExitCode", "false"); // Set the default merge tool ClassConfig.SetGlobal("merge.tool", app.Name); ClassConfig.SetGlobal("mergetool.keepBackup", "false"); } }