SYMBOL: cli-git-num-parallel
cli-git-num-parallel [ cpus 2 * ] initialize
+: git-command>string ( quot -- string )
+ utf8 <process-reader> stream-contents [ blank? ] trim-tail ;
+
+: git-command>lines ( quot -- string )
+ utf8 <process-reader> stream-lines ;
+
: git-clone-as ( uri path -- process ) [ { "git" "clone" } ] 2dip 2array append run-process ;
: git-clone ( uri -- process ) [ { "git" "clone" } ] dip suffix run-process ;
: git-pull* ( -- process ) { "git" "pull" } run-process ;
: git-remote-add ( path remote uri -- process ) '[ _ _ git-remote-add* ] with-directory ;
: git-remote-get-url* ( remote -- process ) [ { "git" "remote" "get-url" } ] dip suffix run-process ;
: git-remote-get-url ( path remote -- process ) '[ _ git-remote-get-url* ] with-directory ;
+: git-rev-parse* ( branch -- string ) [ { "git" "rev-parse" } ] dip suffix git-command>string ;
+: git-rev-parse ( path branch -- string ) '[ _ git-rev-parse* ] with-directory ;
+: git-diff-name-only* ( from to -- lines )
+ [ { "git" "diff" "--name-only" } ] 2dip 2array append git-command>lines ;
+: git-diff-name-only ( path from to -- lines )
+ [ git-diff-name-only* ] with-directory ;
: git-repository? ( directory -- ? )
".git" append-path current-directory get prepend-path
: git-current-branch* ( -- name )
! { "git" "rev-parse" "--abbrev-ref" "HEAD" }
- { "git" "name-rev" "--name-only" "HEAD" }
- utf8 <process-reader> stream-contents
- [ blank? ] trim-tail ;
+ { "git" "name-rev" "--name-only" "HEAD" } git-command>string ;
: git-current-branch ( directory -- name )
[ git-current-branch* ] with-directory ;