From 5d1d2c58c167493cc9119de3ee37ab8d6d707cc9 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Wed, 11 Oct 2017 20:53:16 -0600
Subject: [PATCH] Add difftool subcommands

---
 cook.sh | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/cook.sh b/cook.sh
index 74660096e..6edce30b0 100755
--- a/cook.sh
+++ b/cook.sh
@@ -25,6 +25,9 @@ function usage {
     echo "  diff" >&2
     echo "  diff_origin" >&2
     echo "  diff_upstream" >&2
+    echo "  difftool" >&2
+    echo "  difftool_origin" >&2
+    echo "  difftool_upstream" >&2
     echo "  fetch" >&2
     echo "  unfetch" >&2
     echo "  prepare" >&2
@@ -176,6 +179,34 @@ function op {
                 fi
             fi
             ;;
+        difftool)
+            if [ -n "$GIT" ]
+            then
+                git -C source difftool -d
+            fi
+            ;;
+        difftool_origin)
+            if [ -n "$GIT" ]
+            then
+                if [ -n "$BRANCH" ]
+                then
+                    git -C source difftool -d "origin/$BRANCH"
+                else
+                    git -C source difftool -d "origin/master"
+                fi
+            fi
+            ;;
+        difftool_upstream)
+            if [ -n "$GIT_UPSTREAM" ]
+            then
+                if [ -n "$BRANCH" ]
+                then
+                    git -C source difftool -d "upstream/$BRANCH"
+                else
+                    git -C source difftool -d "upstream/master"
+                fi
+            fi
+            ;;
         update)
             pushd source > /dev/null
             skip=0
-- 
GitLab