From: Saba Saba Date: Thu, 9 Feb 2023 17:26:16 +0000 (-0500) Subject: Added 'input' as an argument to the git macro. X-Git-Url: http://sabadev.xyz:4321/?a=commitdiff_plain;h=d9ed993e946cc39520d5d1a1e7481f545d9e9229;p=git-repl.git Added 'input' as an argument to the git macro. --- diff --git a/git-skipper.cl b/git-skipper.cl index 92b9ff6..e44d9f1 100644 --- a/git-skipper.cl +++ b/git-skipper.cl @@ -1,23 +1,32 @@ -(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")