-(ql:quickload "cl-utilities")
+(ql:quickload '("cl-utilities" "str"))
(in-package :cl-user)
(defun remove-empty (seq)
- (remove-if (cl-utilities:compose #'zerop #'length) seq))
+ (remove-if #'str:emptyp seq))
-(defmacro git (&rest arguments)
+(defmacro git (input &rest arguments)
`(remove-empty
- (mapcar (lambda (x) (string-trim " " x))
- (cl-utilities:split-sequence #\newline (uiop:run-program (list "git" ,@arguments) :input nil :output :string)))))
+ (mapcar #'str:trim (str:lines (uiop:run-program (list "git" ,@arguments) :force-shell t :input ,input :output :string) :omit-nulls t))))
(defun modified-files ()
- (git "diff" "--name-only"))
+ (git nil "diff" "--name-only"))
(defun skipped-files ()
- (git "ls-files" "-v"))
+ (git nil "ls-files" "-v" "|" "findstr" "^S"))
(defun skip-file (file-path)
- (git "update-index" "--skip-worktree" file-path))
+ (git nil "update-index" "--skip-worktree" file-path))
(defun no-skip-file (file-path)
- (git "update-index" "--no-skip-worktree" file-path))
+ (git nil "update-index" "--no-skip-worktree" file-path))
+
+(defun status ()
+ (git nil "status"))
+
+(no-skip-file "git-skipper.cl")
+(skip-file "git-skipper.cl")
+(modified-files)
+(skipped-files)
+(status)
+(git nil "commit" "-av")