]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/git/diff
git/{diff,import}: make it easier to handle manually-asembled patch emails
[plan9front.git] / sys / src / cmd / git / diff
index 075ea3ee920f623297f1fbb5bd21abd0d36a3e09..64206c4a72d200fef08d8f60ab412a5f62e9517a 100644 (file)
@@ -26,12 +26,16 @@ fn lsdirty {
                git/query -c $commit HEAD | subst '^..'
 }
 
+mntgen /mnt/scratch
+bind $branch/tree/ /mnt/scratch/a
+bind . /mnt/scratch/b
+echo diff `{git/query $commit} uncommitted
 for(f in `$nl{lsdirty | sort | uniq}){
-       orig=$branch/tree/$f
-       if(! test -f $orig)
+       cd /mnt/scratch
+       if(! test -f a/$f)
                orig=/dev/null
-       if(! test -f $f)
+       if(! test -f b/$f)
                f=/dev/null
-       diff -u $orig $f
+       diff -u a/$f b/$f
 }
 exit ''