Added some initial definitions for git helper methods.
authorSaba Saba <saba@sabadev.xyz>
Thu, 9 Feb 2023 17:26:16 +0000 (12:26 -0500)
committerSaba Saba <saba@sabadev.xyz>
Thu, 9 Feb 2023 17:26:16 +0000 (12:26 -0500)
git-skipper.cl

index 66a0c18..c50c084 100644 (file)
@@ -5,3 +5,15 @@
 (defmacro git (&rest arguments)
   `(mapcar (lambda (x) (string-trim " " x))
            (cl-utilities:split-sequence #\newline (uiop:run-program (list "git" ,@arguments) :input nil :output :string))))
+
+(defun modified-files ()
+  (git "diff" "--name-only"))
+
+(defun skipped-files ()
+  (git "ls-files" "-v"))
+
+(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))