git-annex/Utility
Joey Hess 1558e03014
Refuse to upgrade direct mode repositories when git is older than 2.22
That git fixed a memory leak that could cause an OOM during the upgrade.

Most git-annex builds have a new enough git already.
OSX git was upgraded with brew.

Linux i386ancient build's git was too old. Upgrading it to a fixed
git didn't work (due to the newer git not working with the old ssh,
https://bugs.chromium.org/p/git/issues/detail?id=7 )

Choices to deal with that were:

* Somehow make direct mode upgrade work with the old git, avoiding its
  OOM problem. One way would be to switch the repo to indirect mode
  first, and so upgrade to a repo with locked files. Not good when
  the filesystem does not support symlinks.
* backport the OOM fix from git 2.22
  (And do what about the version number so git-annex knows it's fixed?)
* backport openssh (and possibly more stuff)
* move the i386ancient build to at least Debian stretch (still backporting git)
  But this will make it no longer work with some of the ancient kernels it
  targets.

Of those, backporting the OOM fix seemed the best approach. Put "oomfix"
in the git version number to indicate it.

I have not automated building the git backport, so here's the patch I
used:

diff -ur orig/git-2.1.4/convert.c git-2.1.4/convert.c
--- orig/git-2.1.4/convert.c	2014-12-18 18:42:18.000000000 +0000
+++ git-2.1.4/convert.c	2019-08-29 20:05:04.371872338 +0100
@@ -404,7 +404,7 @@
 	if (start_async(&async))
 		return 0;	/* error was already reported */

-	if (strbuf_read(&nbuf, async.out, len) < 0) {
+	if (strbuf_read(&nbuf, async.out, 0) < 0) {
 		error("read from external filter %s failed", cmd);
 		ret = 0;
 	}
diff -ur orig/git-2.1.4/GIT-VERSION-GEN git-2.1.4/GIT-VERSION-GEN
--- orig/git-2.1.4/GIT-VERSION-GEN	2014-12-18 18:42:18.000000000 +0000
+++ git-2.1.4/GIT-VERSION-GEN	2019-08-29 20:06:39.132743228 +0100
@@ -1,7 +1,7 @@
 #!/bin/sh

 GVF=GIT-VERSION-FILE
-DEF_VER=v2.1.4
+DEF_VER=v2.1.4.oomfix

 LF='
 '
diff -ur orig/git-2.1.4/configure git-2.1.4/configure
--- orig/git-2.1.4/configure	2014-12-18 18:42:19.000000000 +0000
+++ git-2.1.4/configure	2019-08-29 20:27:45.896380015 +0100
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='git'
 PACKAGE_TARNAME='git'
-PACKAGE_VERSION='2.1.4'
-PACKAGE_STRING='git 2.1.4'
+PACKAGE_VERSION='2.1.4.oomfix'
+PACKAGE_STRING='git 2.1.4.oomfix'
 PACKAGE_BUGREPORT='git@vger.kernel.org'
 PACKAGE_URL=''

diff -ur orig/git-2.1.4/version git-2.1.4/version
--- orig/git-2.1.4/version	2014-12-18 18:42:19.000000000 +0000
+++ git-2.1.4/version	2019-08-29 20:06:17.572545210 +0100
@@ -1 +1 @@
-2.1.4
+2.1.4.oomfix
2019-08-29 15:24:41 -04:00
..
Directory add streamDirectoryContents 2018-04-26 13:38:36 -04:00
DirWatcher remove many old version ifdefs 2019-07-05 15:09:37 -04:00
Env fix unused module import warnings when building on windows 2019-08-08 12:18:53 -04:00
LockFile strict bytestring encoders and decoders 2019-01-01 14:55:15 -04:00
LockPool add DebugLocks build flag 2018-11-19 15:02:43 -04:00
Path fix unused module import warnings when building on windows 2019-08-08 12:18:53 -04:00
Process fixed processTranscript hang problem 2018-03-15 16:14:22 -04:00
Scheduled reorg quickcheck to a separate module 2015-11-17 15:49:22 -04:00
Tmp avoid conflicting definitions of Template type 2018-12-30 15:03:31 -04:00
Aeson.hs switch MetaValue to ByteString and MetaField to Text 2019-01-07 14:18:24 -04:00
Android.hs avoid unused imports warning on non-linux 2018-08-07 15:06:33 -04:00
Applicative.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
AuthToken.hs comment typo 2019-01-03 00:22:05 -04:00
Base64.hs switch MetaValue to ByteString and MetaField to Text 2019-01-07 14:18:24 -04:00
Batch.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Bloom.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
CoProcess.hs Always use filesystem encoding for all file and handle reads and writes. 2016-12-24 14:46:31 -04:00
CopyFile.hs small optimisation to file copying 2019-07-17 14:22:21 -04:00
Daemon.hs terminateProcessId renamed 2017-10-25 19:46:28 -04:00
Data.hs disable horrible tab warning, needed in every file that Setup.hs pulls in 2015-05-10 16:31:50 -04:00
DataUnits.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
DBus.hs Revert "When listing DBus services, also list activatable services." 2015-06-02 14:38:24 -04:00
DebugLocks.hs add DebugLocks build flag 2018-11-19 15:02:43 -04:00
Directory.hs finally really add back custom-setup stanza 2017-12-31 16:36:39 -04:00
DirWatcher.hs disable closingTracked on OSX 2017-06-09 14:18:58 -04:00
DiskFree.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Dot.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
DottedVersion.hs Refuse to upgrade direct mode repositories when git is older than 2.22 2019-08-29 15:24:41 -04:00
Env.hs finally really add back custom-setup stanza 2017-12-31 16:36:39 -04:00
Exception.hs removed the old Android app 2018-10-13 01:41:11 -04:00
FileMode.hs Make test suite work better when the temp directory is on NFS. 2018-12-19 12:44:56 -04:00
FileSize.hs matchexpression: New plumbing command to check if a preferred content expression matches some data. 2016-01-25 16:16:18 -04:00
FileSystemEncoding.hs slight optimisation more 2019-01-11 19:56:31 -04:00
Format.hs fix failing quickcheck properties 2017-06-17 16:48:00 -04:00
FreeDesktop.hs use System.Directory not Utility.Directory 2016-09-22 11:34:55 -04:00
GitLFS.hs add exports useful if using this module to write a git-lfs server 2019-08-05 15:40:36 -04:00
Glob.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
Gpg.hs fix unused module import warnings when building on windows 2019-08-08 12:18:53 -04:00
Hash.hs Add BLAKE2BP512 and BLAKE2BP512E backends 2019-07-05 15:30:03 -04:00
HtmlDetect.hs fix regression in addurl --file caused by youtube-dl support 2017-12-06 13:22:31 -04:00
HttpManagerRestricted.hs merge from http-client-restricted 2019-07-17 16:48:50 -04:00
HumanNumber.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
HumanTime.hs Estimated time to completion display shortened from eg "1h1m1s" to "1h1m" 2019-01-21 00:04:35 -04:00
InodeCache.hs fix unused module import warnings when building on windows 2019-08-08 12:18:53 -04:00
IPAddress.hs add back support for ftp urls 2019-05-30 14:51:34 -04:00
libkqueue.c update my email address and homepage url 2015-01-21 12:50:09 -04:00
libkqueue.h
LinuxMkLibs.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
LockFile.hs use lock pools throughout git-annex 2015-05-19 14:09:52 -04:00
LockPool.hs Fix shared lock file FD leak. 2016-03-01 15:31:39 -04:00
LogFile.hs finally really add back custom-setup stanza 2017-12-31 16:36:39 -04:00
Lsof.hs removed the old Android app 2018-10-13 01:41:11 -04:00
MagicWormhole.hs fix p2p --pair 2018-07-04 15:14:03 -04:00
Matcher.hs avoid list lookup by parseToken 2019-05-14 13:11:29 -04:00
MD5.hs Corrected some license statements 2019-07-28 14:27:33 -04:00
Metered.hs followup and display rsync exit status 2019-08-15 14:47:22 -04:00
Misc.hs finally really add back custom-setup stanza 2017-12-31 16:36:39 -04:00
Monad.hs disable horrible tab warning, needed in every file that Setup.hs pulls in 2015-05-10 16:31:50 -04:00
Mounts.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Network.hs more {-# OPTIONS_GHC -fno-warn-tabs #-} ... Forcing people who have what is merely a difference of opinion to you to do this is a bit of an asshole move. Just saying. 2015-05-10 16:38:49 -04:00
NotificationBroadcaster.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
OptParse.hs I've been not documenting these import Preludes used to deal with the AMP transition 2015-09-15 11:32:47 -04:00
OSX.hs disable horrible tab warning, needed in every file that Setup.hs pulls in 2015-05-10 16:31:50 -04:00
Parallel.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
PartialPrelude.hs moved module and relicensed 2018-10-29 23:13:36 -04:00
Path.hs finally really add back custom-setup stanza 2017-12-31 16:36:39 -04:00
Percentage.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
PID.hs Revert "Revert "remove dep on Win32-extras"" 2017-11-13 12:55:23 -04:00
Process.hs fix bogus ghc 8.6.3 build warning 2018-12-30 14:43:27 -04:00
QuickCheck.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
RawFilePath.hs use ByteStrings when reading annex symlinks and pointers 2019-01-14 15:37:08 -04:00
Rsync.hs followup and display rsync exit status 2019-08-15 14:47:22 -04:00
SafeCommand.hs Revert "fix comment" 2018-11-06 17:26:20 -04:00
Scheduled.hs add dropFromEnd 2018-11-23 11:24:05 -04:00
Shell.hs removed the old Android app 2018-10-13 01:41:11 -04:00
SimpleProtocol.hs clean P2P protocol shutdown on EOF 2018-09-13 10:46:37 -04:00
Split.hs add dropFromEnd 2018-11-23 11:24:05 -04:00
SshConfig.hs redundant import 2015-09-22 12:31:54 -04:00
SshHost.hs avoid the dashed ssh hostname class of security holes 2017-08-17 22:11:31 -04:00
Su.hs finally really add back custom-setup stanza 2017-12-31 16:36:39 -04:00
SystemDirectory.hs Fix build with directory-1.3. 2016-12-20 15:23:59 -04:00
Tense.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
ThreadLock.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
ThreadScheduler.hs removed the old Android app 2018-10-13 01:41:11 -04:00
TimeStamp.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
TList.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Tmp.hs use relatedTempate in viaTmp 2019-03-04 14:12:00 -04:00
Tor.hs Support building with socks-0.6 and persistant-template-2.7 2019-07-30 12:50:48 -04:00
Touch.hs remove unused import 2018-10-30 13:38:29 -04:00
Tuple.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
Url.hs fix display of http exceptions 2019-08-10 11:09:25 -04:00
UserInfo.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Verifiable.hs Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. 2015-04-19 11:05:32 -04:00
WebApp.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Yesod.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00