Skip to content

Commit

Permalink
Reduce the size of the installer
Browse files Browse the repository at this point in the history
A comprehensive list of candidate files to remove from the installer was
obtained by running the tests with GIT_TEST_INSTALLED=/mingw64/bin/
after starting Sysinternals' Process Monitor, filtering the output by
the path of the portable Git, then saving the output as CSV and
post-processing it with

	sed -n "2,\$s/\([^,]*,\)\{4\}\"\([^\"]*\).*/\2/p" /c/Logfile.CSV |
	uniq |
	tr \\\\ / |
	sed -n "s/^C:\/minimize-portable-git\///p" |
	sort |
	uniq |
	tee /c/min.paths

then -- once -- running

	(cd / && find -xdev -type f) |
	grep -v "^\\./\(bin\|tmp\)/" |
	sed -n "s/^\\.\\///p" |
	tee /c/cur.paths

in the portable Git directory, and then determining which files have not
been used by the test suite with

	cat /c/cur.paths /c/min.paths /c/min.paths |
	sort |
	uniq -u |
	tee /c/unneeded.paths

Of course this was followed by a very careful analysis in order to avoid
overzealous culling (e.g. file(1)'s `/usr/share/misc/magic.mgc` file is
still needed, even if the test suite does not use the file tool).

To allow dropping the entire terminfo file tree *except* for the
required "dumb" and "xterm" family, we use an extra grep call using GNU
grep's `--perl-regexp` option to switch to Perl-style regular
expressions, allowing negative look-ahead to be used (we cannot just
turn the entire grep call into a single `--perl-regexp` call, though,
because that option allows only one pattern).

In this developer's tests, this patch reduced the size of the installer
from around 43MB to 27MB.

This fixes git-for-windows/git#262.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Aug 9, 2015
1 parent ce8785e commit ed79a9d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion make-file-list.sh
Expand Up @@ -43,7 +43,25 @@ grep -v -e '\.[acho]$' -e '\.l[ao]$' -e '/aclocal/' \
-e '^/mingw../lib/gettext/' -e '^/mingw../share/gettext/' \
-e '^/usr/include/' -e '^/mingw../include/' \
-e '^/usr/share/doc/' \
-e '^/usr/share/info/' -e '^/mingw../share/info/' |
-e '^/usr/share/info/' -e '^/mingw../share/info/' \
-e '^/mingw../share/git-doc/technical/' \
-e '^/mingw../itcl/' \
-e '^/mingw../t\(cl\|k\)[^/]*/\(demos\|msgs\|encoding\|tzdata\)/' \
-e '^/mingw../bin/\(autopoint\|[a-z]*-config\)$' \
-e '^/mingw../bin/lib\(asprintf\|gettext\|gnutlsxx\|pcre[0-9a-z]\|quadmath\|stdc++\)[^/]*\.dll$' \
-e '^/mingw../bin/\(asn1\|gnutls\|idn\|mini\|msg\|nettle\|ngettext\|ocsp\|pcre\|rtmp\|xgettext\)[^/]*\.exe$' \
-e '^/mingw../.*/git-\(remote-testsvn\|shell\)\.exe$' \
-e '^/mingw../lib/tdbc' \
-e '^/mingw../share/git\(k\|-gui\)/lib/msgs/' \
-e '^/mingw../share/locale/' \
-e '^/usr/bin/msys-\(db\|icu\|gfortran\|stdc++\|quadmath\)[^/]*\.dll$' \
-e '^/usr/bin/dumper\.exe$' \
-e '^/usr/share/locale/' \
-e '^/usr/share.*/magic$' \
-e '^/usr/share/perl5/core_perl/Unicode/Collate/Locale/' \
-e '^/usr/share/perl5/core_perl/pods/' \
-e '^/usr/share/vim/vim74/lang/' |
grep --perl-regexp -v -e '^/usr/(lib|share)/terminfo/(?!.*/(dumb|xterm.*)$)' |
sed 's/^\///'

cat <<EOF
Expand Down

0 comments on commit ed79a9d

Please sign in to comment.