 : 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


SYMBOL: cli-git-num-parallel
cli-git-num-parallel [ cpus 2 * ] initialize

: git-clone-as ( uri path -- process ) [ { "git" "clone" } ] 2dip 2array append run-process ;
: git-clone ( uri -- process ) [ { "git" "clone" } ] dip suffix run-process ;


: git-current-branch* ( -- name )
     ! { "git" "rev-parse" "--abbrev-ref" "HEAD" }
     { "git" "name-rev" "--name-only" "HEAD" } git-command>string ;

: git-current-branch ( directory -- name )
    [ git-current-branch* ] with-directory ;
