shithub: git9

Download patch

ref: 6adefeebd4153bac5e25c9b6667510a8281863eb
parent: e7587968c45c0171bd7d8b1a0a93e24d5cc6bac9
author: Ori Bernstein <[email protected]>
date: Sat Nov 14 14:54:34 EST 2020

git/export: scale with size of diff, not size of repo

git/export was very slow with large repositories,
becasue it would invoke ape/diff on the entire tree,
rather than just on the files that had changed between
the commits being exported.

This change uses git/query -c to get the list of files
changed between two commits, and only diff those, which
ends up being much faster.

--- a/export
+++ b/export
@@ -26,6 +26,7 @@
 for(c in $commits){
 	cp=`{git/query -p $c}
 	pp=`{git/query -p $c'^'}
+	fc=`$nl{git/query -c $c~ $c | sed 's/^..//'}
 
 	@{
 		rfork n
@@ -56,7 +57,8 @@
 			next
 		}
 		{print; printf "\n"}'
-		ape/diff -urN a b
+		for(f in $fc)
+			ape/diff -urN a/$rel b/$rel
 	} >$patchfile
 	if(~ $#patchdir 0){
 		cat $patchfile