]> gitweb.factorcode.org Git - factor.git/commitdiff
git-tool: Don't monitor the '.git' directory (git-status changes files there. git...
authorEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Wed, 14 Jan 2009 08:51:03 +0000 (02:51 -0600)
committerEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Wed, 14 Jan 2009 08:51:03 +0000 (02:51 -0600)
extra/git-tool/git-tool.factor

index 0ef7f88d3fb4ce90586fe1f657bd9243701dc14a..314bddb19a9eb7ce8144f6d940c06ad86afa225b 100644 (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 ;