Skip to content

Instantly share code, notes, and snippets.

@maio
Last active September 1, 2019 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maio/2836cc459e33559c9ce851a7a876ff93 to your computer and use it in GitHub Desktop.
Save maio/2836cc459e33559c9ce851a7a876ff93 to your computer and use it in GitHub Desktop.
(defn git-log-commits [s]
"Split standard git log output to commits"
(setv items (.split s "\ncommit "))
(if (< (len items) 2)
items
(+ [(first items)]
(lfor item (rest items) f"commit {item}"))))

hylang utils

...

(defn sh [cmd]
(import [subprocess [getoutput]])
(getoutput cmd))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment