-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcdiff
More file actions
executable file
·30 lines (27 loc) · 742 Bytes
/
cdiff
File metadata and controls
executable file
·30 lines (27 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# cdiff
# File ID: 45f660ac-fa5f-11dd-9262-0001805bf4b1
# Latskapen lenge leve. Kjører en svn eller cvs diff og stripper bort alle
# ukjente filer.
git log HEAD..HEAD >/dev/null 2>&1
if [ "$?" = "0" ]; then
git diff "$@"
exit
fi
if [ -d .svn/. ]; then
if [ "$1" = "-s" ]; then
shift
svn diff $* 2>/dev/null | grep -v '^\? ' | egrep '^[+\-]' | less -S
else
svn diff $* 2>/dev/null | grep -v '^\? ' | less -S
fi
elif [ -d CVS/. ]; then
if [ "$1" = "-s" ]; then
shift
cvs -n diff -u $* 2>/dev/null | grep -v '^\? ' | egrep '^[+\-]' | less -S
else
cvs -n diff -u $* 2>/dev/null | grep -v '^\? ' | less -S
fi
else
git diff --color "$@"
fi