git: plan9front

Download patch

ref: 0956f48633d152d1d9313e87ee535402e29f18a1
parent: 338e78a0247c9df1b93116c983472ef7f2b37bbd
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Jul 18 09:13:42 EDT 2024

git/commit: filter to changed files for git/save

while rehashing the same files over and over will work
just fine, it can be slow with a large number of large
files; this makes 'git/comit .' perform much better in
repos with a large number of large binary blobs.

--- a/sys/src/cmd/git/commit
+++ b/sys/src/cmd/git/commit
@@ -119,7 +119,7 @@
 if(test -f .git/merge-parents)
 	files=`$nl{git/query -c `{cat .git/merge-parents} | sed 's/^..//'}
 if(! ~ $#* 0)
-	files=($files `$nl{git/walk -c `$nl{cleanname -d $gitrel $*}})
+	files=($files `$nl{git/walk -fRMA -c `$nl{cleanname -d $gitrel $*}})
 if(~ $status '' || ~ $#files 0 && ! test -f .git/merge-parents && ~ $#revise 0)
 	die 'nothing to commit'
 @{
--