shithub: git9

Download patch

ref: c5c45f287d855c721e03018086a17e5bf2fc1dd2
parent: f9cb8f8bffc32bb26b7a5b1ccc48d344c4544d15
author: Ori Bernstein <[email protected]>
date: Mon Mar 2 23:14:46 EST 2020

switch to '-c' for commits, fix help string

	this makes diff consistent with most other
	git/* commands.

--- a/diff
+++ b/diff
@@ -3,8 +3,7 @@
 . /sys/lib/git/common.rc
 
 usage='
-	git/diff [-b branch] [file ...]
-		-b        diff relative to branch "branch" 
+	git/diff [-c branch] [-s ] [file ...]
 '
 
 gitup
@@ -14,7 +13,7 @@
 summarize=()
 while(~ $1 -* && ! ~ $1 --){
 	switch($1){
-	case -b; branch=`{git/query $2}; shift
+	case -c; branch=`{git/query -p $2}; shift
 	case -s; summarize=1
 	case *; usage
 	}
@@ -25,13 +24,13 @@
 if(! ~ $#* 0)
 	files=`{cleanname $gitrel/$*}
 if(~ $#branch 0)
-	branch=`{git/branch}
+	branch=`{git/query -p HEAD}
 if(~ $summarize 1){
 	git/walk -fMAR $files
 	exit
 }
-for(f in `{git/walk -cfMAR $files}){
-	orig=/mnt/git/branch/$branch/tree/$f
+for(f in `{git/walk -c $files}){
+	orig=$branch/tree/$f
 	if(! test -f $orig)
 		orig=/dev/null
 	if(! test -f $f)