5de0fef33bc7

Yax
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 19 Feb 2014 15:40:37 -0500
parents 88e2c4dcdb52
children 1e885626f656
branches/tags (none)
files fish/functions/eatshit.fish gitconfig

Changes

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fish/functions/eatshit.fish	Wed Feb 19 15:40:37 2014 -0500
@@ -0,0 +1,7 @@
+function eatshit
+    if test "$argv[1]" = '-u'
+        echo -n 'http://bit.ly/eat-shit' | pbcopy
+    else
+        echo -n '≣:D ⊃-' | pbcopy
+    end
+end
--- a/gitconfig	Fri Feb 14 17:51:45 2014 -0500
+++ b/gitconfig	Wed Feb 19 15:40:37 2014 -0500
@@ -77,15 +77,32 @@
     addremove = !git add . && git add -u
     addrem = !git addremove
 
+    ; Find all commits in the given ref that aren't also in master
+    ; TODO: Make this take a second optional argument
+    find-unmerged-commits = "!sh -c 'git log $1 --format='''%H''' --not master --' -"
+
+    ; ksdiff is the bare kaleidoscope difftool alias
+    ; ksdiffid is the one that expects $KSID to be set
     ksdiff = difftool -y -t Kaleidoscope
-    ksshow = "!sh -c 'git ksdiff $1^..$1;' -"
+    ksdiffid = difftool -y -t KaleidoscopeWithId
+
+    ; ksdiffwith opens a diff of (current revision)->(given revision)
+    ksdiffwith = "!sh -c 'git ksdiff HEAD..$1' -"
+
+    ; ksshow will open a single specific commit in kaleidoscope
+    ; it includes the commit log info as a separate file
+    ksshow = "!sh -c 'export KSID=`uuid`; git log -n1 $1 > .git/LOG_MESSAGE; ksdiff --partial-changeset --UUID $KSID -- /dev/null .git/LOG_MESSAGE; git ksdiffid $1^..$1; ksdiff --mark-changeset-as-closed $KSID' -"
+
+    ; ksreview takes a branch, finds all commits in that branch that aren't
+    ; merged into master, and opens them one-by-one with ksshow.  It's good for
+    ; reviewing pull requests.
+    ksreview = "!sh -c 'git find-unmerged-commits $1 | xargs -n1 git ksshow' -"
 
     sl = "!sh -c 'git show --color=always $1 | less -R' -"
 
     find-merge = "!sh -c 'git log $1..master --merges -n1' -"
 
     fuck-up-history-from = pull --rebase
-
 [push]
     default = current
 
@@ -95,8 +112,11 @@
     interactive = auto
     status = auto
 
+[difftool "KaleidoscopeWithId"]
+	cmd = ksdiff --partial-changeset --UUID \"$KSID\" --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
+
 [difftool "Kaleidoscope"]
-    cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
+	cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
 
 [difftool]
     prompt = false
@@ -112,7 +132,8 @@
     trustExitCode = true
 
 [mergetool "Kaleidoscope"]
-    cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
+	cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
+	trustExitCode = true
 
 [web]
     browser = open