git-tool: Don't monitor the '.git' directory (git-status changes files there. git-tool tries to refresh and calls git-status...)

db4
Eduardo Cavazos 2009-01-14 02:51:03 -06:00
parent e9888fdf63
commit 318bd98b21
1 changed files with 41 additions and 2 deletions
extra/git-tool

View File

@ -425,6 +425,39 @@ TUPLE: <git-status>
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! :: git-tool ( REPO -- )
! <pile> 1 >>fill
! "Repository: " REPO [ current-directory get ] with-directory append
! <label>
! add-gadget
! [let | STATUS [ REPO git-status ]
! PILE [ <pile> 1 >>fill ] |
! [
! [
! [let | MONITOR [ REPO t <monitor> ] |
! [ MONITOR next-change 2drop STATUS PILE refresh-status-pile t ]
! loop
! ]
! ]
! with-monitors
! ]
! in-thread
! STATUS PILE refresh-status-pile
! PILE add-gadget ]
! ! REPO git-status <pile> 1 >>fill tuck refresh-status-pile add-gadget
! REPO <pile> 1 >>fill tuck refresh-remotes-pile add-gadget
! "Git" open-window ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
:: git-tool ( REPO -- )
<pile> 1 >>fill
@ -439,7 +472,14 @@ TUPLE: <git-status>
[
[
[let | MONITOR [ REPO t <monitor> ] |
[ MONITOR next-change 2drop STATUS PILE refresh-status-pile t ]
[
[let | PATH [ MONITOR next-change drop ] |
".git" PATH subseq? ! Ignore git internal operations
[ ]
[ STATUS PILE refresh-status-pile ]
if
t ]
]
loop
]
]
@ -456,7 +496,6 @@ TUPLE: <git-status>
"Git" open-window ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: factor-git-tool ( -- ) "resource:" git-tool ;