Implemented config-diff
authorSaba Saba <saba@sabadev.xyz>
Thu, 9 Feb 2023 17:26:19 +0000 (12:26 -0500)
committerSaba Saba <saba@sabadev.xyz>
Thu, 9 Feb 2023 17:26:19 +0000 (12:26 -0500)
git-repl.cl

index 0e1c6b3..00e3784 100644 (file)
        ,@body
        (write-line "You have modified files. Please stash or commit your files before proceeding.")))
 
+(defmacro config-do (&body body)
+  "Unskips your configuration, executes the provided body, then skips your configuration"
+  `(clean-working-directory
+     (progn
+       (no-skip-all)
+       ,@body
+       (skip-modified))))
+
 (defun add-quotes (text)
   (format nil "\"~a\"" text))
 
       (write-line "Skipping files...")
       (skip-modified))))
 
+(defun-public config-diff (file-path)
+  "Saves the current configuration to the specified file"
+  (config-do (mapcar #'write-line (git "diff"))))
+
 (defun-public delete-branch (branch-name)
   "Deletes the given local branch name"
   (git "branch" "-d" branch-name))