Added extra commands and switched name to git-repl.cl
authorSaba Saba <saba@sabadev.xyz>
Thu, 9 Feb 2023 17:26:17 +0000 (12:26 -0500)
committerSaba Saba <saba@sabadev.xyz>
Thu, 9 Feb 2023 17:26:17 +0000 (12:26 -0500)
git-repl.cl [new file with mode: 0644]
git-skipper-load.cl [deleted file]
git-skipper.cl [deleted file]

diff --git a/git-repl.cl b/git-repl.cl
new file mode 100644 (file)
index 0000000..8517012
--- /dev/null
@@ -0,0 +1,58 @@
+; sbcl --load git-repl.cl
+
+(ql:quickload '("cl-utilities" "str"))
+
+(in-package :cl-user)
+
+(defvar *grep* "findstr")
+
+(defun remove-empty (text)
+  (remove-if #'str:emptyp text))
+
+(defun run-command (command)
+  (remove-empty
+    (mapcar #'str:trim
+            (str:lines
+              (uiop:run-program command :ignore-error-status t :force-shell t :input nil :output :string)
+              :omit-nulls t))))
+
+(defun git (&rest arguments)
+  (run-command (str:join " " (cons "git" arguments))))
+
+(defun status ()
+  (git "status"))
+
+(defun add-all ()
+  (git "add" "."))
+
+(defun commit ()
+  (git "commit" "-v"))
+
+(defun modified-files ()
+  (git "diff" "--name-only"))
+
+(defun skipped-files ()
+  (mapcar (lambda (x) (str:substring 2 t x)) (git "ls-files" "-v" "|" *grep* "^S")))
+
+(defun skip-file (file-path)
+  (git "update-index" "--skip-worktree" file-path))
+
+(defun no-skip-file (file-path)
+  (git "update-index" "--no-skip-worktree" file-path))
+
+(defun skip-modified ()
+  (mapcar #'skip-file (modified-files)))
+
+(defun no-skip-all ()
+  (mapcar #'no-skip-file (skipped-files)))
+
+(defun delete-branch (branch-name)
+  (git "branch" "-d" branch-name))
+
+(defun delete-merged-branches ()
+  (mapcar #'delete-branch (git "branch" "--merged")))
+
+(defun make (executable-name)
+  (progn
+    (load (compile-file "git-repl.cl"))
+    (save-lisp-and-die executable-name :executable t)))
diff --git a/git-skipper-load.cl b/git-skipper-load.cl
deleted file mode 100644 (file)
index 18d8df5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-(load (compile-file "git-skipper.cl"))
-(save-lisp-and-die "git-skipper.exe" :executable t)
-
-; sbcl --load git-skipper.cl
diff --git a/git-skipper.cl b/git-skipper.cl
deleted file mode 100644 (file)
index fbf8290..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-; sbcl --load git-skipper.cl
-
-(ql:quickload '("cl-utilities" "str"))
-
-(in-package :cl-user)
-
-(defvar *grep* "findstr")
-
-(defun remove-empty (text)
-  (remove-if #'str:emptyp text))
-
-(defun run-command (command)
-  (remove-empty
-    (mapcar #'str:trim
-            (str:lines
-              (uiop:run-program command :ignore-error-status t :force-shell t :input nil :output :string)
-              :omit-nulls t))))
-
-(defun git (&rest arguments)
-  (run-command (str:join " " (cons "git" arguments))))
-
-(defun modified-files ()
-  (git "diff" "--name-only"))
-
-(defun skipped-files ()
-  (mapcar (lambda (x) (str:substring 2 t x)) (git "ls-files" "-v" "|" *grep* "^S")))
-
-(defun skip-file (file-path)
-  (git "update-index" "--skip-worktree" file-path))
-
-(defun no-skip-file (file-path)
-  (git "update-index" "--no-skip-worktree" file-path))
-
-(defun skip-modified ()
-  (mapcar #'skip-file (modified-files)))
-
-(defun no-skip-all ()
-  (mapcar #'no-skip-file (skipped-files)))
-
-(defun delete-branch (branch-name)
-  (git "branch" "-d" branch-name))
-
-(defun delete-merged-branches ()
-  (mapcar #'delete-branch (git "branch" "--merged")))
-
-(defun make ()
-  (progn
-    (load (compile-file "git-skipper.cl"))
-    (save-lisp-and-die "git-skipper.exe" :executable t)))