John Florenadded /rce028bd313 years agoHistory
45 lines · 681 B · Text
RawDownload
#!/bin/rc# patch/diff [-w] patch-namerfork efn usage {	echo 'usage: patch/diff [-bmnwz] patch-name' >[1=2]	exit usage} dopts=(-c)while (! ~ $#* 0 && ~ $1 -*) {	switch ($1) {	case -[bmnw]		dopts=($dopts $1)	case -z		dopts=()	case *		usage	}	shift}if(! ~ $#* 1)	usage if(! test -d /n/sources/patch){	rfork n	9fs sources} if(! test -d /n/sources/patch/$1){	echo 'no such patch' /n/sources/patch/$1 >[1=2]	exit nopatch} builtin cd /n/sources/patch/$1 || exit nopatchif(! patch/okay .){	echo 'bad patch: '$status >[1=2]	exit badpatch} d=/n/sources/patch/$1fn xxx {	echo $1	diff $dopts $2.orig $d/$2 | sed 's/^/	/'}cat files | sed 's/^/xxx /' | rc

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t