summaryrefslogtreecommitdiff
path: root/Git/RefLog.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-21 16:41:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-21 16:41:46 -0400
commitc06cf8f140f2c5f461ce38d709777f1390503aa2 (patch)
treee17b771b26125f5959445c6e1413b9e28b3b422d /Git/RefLog.hs
parentafe0cc0bb4fbe3876c35462dece4670617263877 (diff)
add reflog
Diffstat (limited to 'Git/RefLog.hs')
-rw-r--r--Git/RefLog.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Git/RefLog.hs b/Git/RefLog.hs
new file mode 100644
index 000000000..7502f14b3
--- /dev/null
+++ b/Git/RefLog.hs
@@ -0,0 +1,23 @@
+{- git reflog interface
+ -
+ - Copyright 2013 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Git.RefLog where
+
+import Common
+import Git
+import Git.Command
+import Git.Sha
+import Git.CatFile
+
+{- Gets the reflog for a given branch. -}
+get :: Branch -> Repo -> IO [Sha]
+get b = mapMaybe extractSha . lines <$$> pipeReadStrict
+ [ Param "log"
+ , Param "-g"
+ , Param "--format=%H"
+ , Param (show b)
+ ]