Skip to content

builtin-difftool-v6

This patch series converts the difftool from a Perl script into a
builtin, for three reasons:

1. Perl is really not native on Windows. Not only is there a performance
   penalty to be paid just for running Perl scripts, we also have to deal
   with the fact that users may have different Perl installations, with
   different options, and some other Perl installation may decide to set
   PERL5LIB globally, wreaking havoc with Git for Windows' Perl (which we
   have to use because almost all other Perl distributions lack the
   Subversion bindings we need for `git svn`).

2. As the Perl script uses Unix-y paths that are not native to Windows,
   the Perl interpreter has to go through a POSIX emulation layer (the
   MSYS2 runtime). This means that paths have to be converted from
   Unix-y paths to Windows-y paths (and vice versa) whenever crossing
   the POSIX emulation barrier, leading to quite possibly surprising path
   translation errors.

3. Perl makes for a rather large reason that Git for Windows' installer
   weighs in with >30MB. While one Perl script less does not relieve us
   of that burden, it is one step in the right direction.

Changes since v5:

- reworded the commit message of 2/3 to account for the change in v4
  where we no longer keep both scripted and builtin difftool working
  (with the switch difftool.useBuiltin deciding which one is used).

Johannes Schindelin (3):
  difftool: add a skeleton for the upcoming builtin
  difftool: implement the functionality in the builtin
  Retire the scripted difftool

 Makefile                                           |   2 +-
 builtin.h                                          |   1 +
 builtin/difftool.c                                 | 692 +++++++++++++++++++++
 .../examples/git-difftool.perl                     |   0
 git.c                                              |   1 +
 t/t7800-difftool.sh                                |  92 +--
 6 files changed, 741 insertions(+), 47 deletions(-)
 create mode 100644 builtin/difftool.c
 rename git-difftool.perl => contrib/examples/git-difftool.perl (100%)

base-commit: ffac48d093d4b518a0cc0e8bf1b7cb53e0c3d7a2

Submitted-As: https://public-inbox.org/git/cover.1484857756.git.johannes.schindelin@gmx.de
In-Reply-To: https://public-inbox.org/git/cover.1483373635.git.johannes.schindelin@gmx.de
In-Reply-To: https://public-inbox.org/git/cover.1479938494.git.johannes.schindelin@gmx.de
In-Reply-To: https://public-inbox.org/git/cover.1479834051.git.johannes.schindelin@gmx.de
In-Reply-To: https://public-inbox.org/git/cover.1480019834.git.johannes.schindelin@gmx.de
In-Reply-To: https://public-inbox.org/git/cover.1484668473.git.johannes.schindelin@gmx.de
Assets 2