As promised, here is the patch series that removes the duplicate code between git-difftool and git-mergetool. This is based on top of Junio's "pu" branch and is a continuation of the recent difftool series. I created a new git-sh-tools shell lib for holding the common functions. If anyone thinks I should have placed the functions in git-sh-setup instead then just let me know. Here's a total diffstat. If it wasn't for the documentation and replacing the mixed spaces/tabs with all-tabs in git-mergetool then we would have seen a lot more happy removals. .gitignore | 1 + Documentation/git-sh-tools.txt | 52 ++++ Makefile | 1 + command-list.txt | 1 + git-difftool-helper.sh | 112 +------- git-mergetool.sh | 639 ++++++++++++++++------------------------ git-sh-tools.sh | 181 ++++++++++++ 7 files changed, 506 insertions(+), 481 deletions(-) GIT: From: David Aguilar <davvid@xxxxxxxxx> Subject: Refactor git-{diff,merge}tool to remove duplicate code In-Reply-To: -- 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