GitMonitor.vala
[gitlive] / GitMonitor.vala
1
2  
3
4 public class GitMonitorQueue : MonitorNamePathDir {
5                 // name = basename
6                 // path = full path..
7                 // dir = dir path
8         
9                 public string gitpath;
10                 public string vdir;  // relative path (within git)
11                 public string vname;  // relative filename (within git)
12                 public string message ; // for commit
13                 public bool commit_all;
14                  
15                 public GitMonitorQueue(MonitorNamePathDir f) {
16
17                         base(f.name, f.path, f.dir);
18  
19                         this.message = "";
20                         this.commit_all = false;
21                         
22                         var vpath_ar = this.dir.substring(GitMonitor.gitlive.length +1).split("/", 0);
23                         
24                         if (vpath_ar[0].length < 1) {
25
26                                 this.gitpath = "";
27                                 this.vdir = "";
28                                 this.vname = "";
29                         }        
30
31
32                         this.gitpath = GitMonitor.gitlive + "/" + vpath_ar[0];
33                         
34                         string[]  vpath = {};
35                         for (var i = 1; i< vpath_ar.length; i++) {
36                                 vpath += vpath_ar[i];
37                         }
38
39                         this.vdir =  string.joinv("/", vpath);
40
41                         this.vname =  this.vdir + (this.vdir.length > 0 ? "/" : "") + this.name;
42                         
43                          
44 /*
45                         stdout.printf(
46                                         "NEW GitMonitorQueue\nname: %s\npath: %s\ndir: %s\n" + 
47                                         "gitpath: %s\nvdir: %s\nvname: %s\n",
48                                         this.name, this.path, this.dir,
49                                         this.gitpath, this.vdir, this.vname
50                         );
51 */
52
53                         //f.repo = new imports.Scm.Git.Repo({ repopath: f.gitpath })
54                 
55                 
56                 }
57
58                 public bool shouldIgnore()
59                 {
60                         
61                  
62                         // vim.. what a seriously brain dead program..
63                         if (this.name == "4913") {
64                                 return true;
65                         }
66                         
67                         if (this.name[0] == '.') {
68                                 // except!
69                                 if (this.name == ".htaccess") {
70                                         return false;
71                                 }
72                                 if (this.name == ".gitignore") {
73                                         return false;
74                                 }
75                                 return true;
76                         }
77                         
78                         
79                         if (this.name[this.name.length -1] == '~') {
80                                 return true;
81                         }
82                         // netbeans / android studio.. silly temp files..
83                         
84                         if (Regex.match_simple("___jb_old___$", this.name)) {
85                             return true;
86                         }
87                         if (Regex.match_simple("___jb_bak___$", this.name)) {
88                             return true;
89                         }
90                         //if (f.name.match(/^nbproject/)) {
91                         //    return true;
92                         //}
93                         // ignore anything in top level!!!!
94                         if (this.gitpath.length < 1) {
95                                 return true;
96                         }
97                         
98                         return false;
99                 }
100                 
101                 /** -- statics --*/
102                 
103                 public static int indexOfAdd( Array<GitMonitorQueue> add_files, string add)
104                 {
105                         for(var i =0; i < add_files.length; i++) {
106                                 if (add_files.index(i).vname == add) {
107                                         return i;
108                                 }
109                         }
110                         return -1;
111                 }
112                 public static  int indexOfMessage(Array<GitMonitorQueue> messages, string message)  {
113                         for(var i =0; i < messages.length; i++) {
114                                 if (messages.index(i).message == message) {
115                                         return i;
116                                 }
117                         }
118                         return -1;
119                 }
120                 public static string messageToString(Array<GitMonitorQueue> messages ) {
121                         string[] ret = {};
122                         for(var i =0; i < messages.length; i++) {
123                                 ret+= messages.index(i).message;
124                         }
125                         return string.joinv("\n",ret);
126                 }
127                 public static string queueArrayToString(Array<GitMonitorQueue> list) {
128                         var ret = "";
129                         for(var i =0; i < list.length; i++) {
130                                 
131                                 ret += (ret.length > 0 ? ", " : "") + list.index(i).vname;
132                         }
133                         return ret;
134                         
135                 }
136                 
137                 public static bool  queueHas(Array<GitMonitorQueue> list , GitMonitorQueue cmd_s, string action) {
138                         for(var i =0; i < list.length; i++) {
139                                 var test = list.index(i);
140                                 if (list.index(i).gitpath != cmd_s.gitpath) {
141                                         continue;
142                                 }
143                                 if (list.index(i).vname != cmd_s.vname) {
144                                         continue;
145                                 }
146                                 if (list.index(i).action != action) {
147                                         continue;
148                                 }
149                                 return true;
150                         }
151                         return false;
152                 }
153                 public string fullpath()
154                 {
155                         return this.gitpath + "/" + this.vname;
156                 }
157                 
158                         
159                         
160 }
161
162
163
164 public class GitMonitor : Monitor
165 {
166
167         public static GitMonitor gitmonitor;
168         /**
169          * @property {String} the "gitlive" directory, normally ~/gitlive
170          *  dset by OWNER... - we should do this as a CTOR.
171          *  
172          */
173         public static string gitlive;
174         
175         
176         public Array<GitMonitorQueue> queue ;
177         public bool queueRunning = false;
178         
179         public DateTime lastAdd;
180
181         public GitMonitor () {
182                 this.queue = new Array<GitMonitorQueue>();
183                 GitMonitor.gitmonitor = this;
184                 
185                 Timeout.add_full(Priority.LOW, 1000, () => {
186                         
187                         //print("TIMEOUT queue length = %d, is_runing = %s\n", (int)this.queue.length , this.queueRunning ? "Y" : "N");
188
189                         //stdout.printf("QL %u: QR: %d\n", this.queue.length, this.queueRunning ? 1 : 0);
190                         if (this.queue.length < 1  || this.queueRunning) {
191                                 return true;
192                         }
193                         
194                         var last = -1 * this.lastAdd.difference(new DateTime.now(new TimeZone.local()));
195  
196                         // stdout.printf("LAST RUN: %s (expect %s) \n" ,
197                         //         last.to_string(),   (5 * TimeSpan.SECOND).to_string() );
198  
199                         if (last < 5 * TimeSpan.SECOND) { // wait 5 seconds before running. ????
200                                 return true;
201                         }
202                         //_this.lastAdd = new Date();
203                         //return 1;
204                 
205                         this.runQueue();
206                         return true; //
207                 });
208                 
209                 
210         }
211
212         public new void pauseError(string failure) 
213         {
214         
215                 var notification = new Notify.Notification(
216                           "Git Live ERROR!!",
217                         failure,
218                         "dialog-information"
219                         
220                 );
221                         
222                 notification.set_timeout(60); // show errros for longer
223                 notification.show();
224                 
225                 
226
227                         
228         
229                 this.paused = true;
230                 this.queueRunning = false;
231                 // what does this do to the old one...
232                 this.queue = new Array<GitMonitorQueue> ();
233                 this.stop();
234                 StatusIconA.statusicon.pauseError();
235                 
236                 var m = new Gtk.MessageDialog(null, Gtk.DialogFlags.MODAL,Gtk.MessageType.ERROR,Gtk.ButtonsType.CLOSE,
237                         "A Serious problem occured running git, you will probably have to resolve this manually\n" + 
238                         "Committing is paused now, so fix the problem, close this window, then press start again\n\n\n" + 
239                         failure
240                 );
241                 m.set_keep_above(true);
242                 m.show();
243                 m.set_position(Gtk.WindowPosition.CENTER);
244                 m.response.connect( (id_pressed) => {
245                         m.hide();
246                 });
247                 
248         }
249  
250         public new void pause() {
251                 this.paused = true;
252                 // what does this do to the old one...
253                 this.queue = new Array<GitMonitorQueue> ();
254                 StatusIconA.statusicon.pause();
255
256         }
257         
258         /*
259         public new void resume () {
260                 this.paused = false;
261                 this.queue = new Array<GitMonitorQueue> ();
262                 StatusIconA.statusicon.resume();
263                 
264                 
265         }
266         */
267         /**
268          * Start the monitoring
269          * and run the queue every 500 milliseconds..
270          *
271          */
272         public new void start() 
273         {
274                 StatusIconA.statusicon.refreshing();
275                 
276                  
277                 this.lastAdd = new DateTime.now(new TimeZone.local()); 
278                 
279                 Timeout.add_full(Priority.LOW, 500, () => {
280                         //stdout.printf("GitMonitor.start :: top.length = %u\n", this.top.length);
281                         // call this.monitor on each of 'top'
282                         for(int i = 0; i < this.top.length ; i++) {
283
284                                 this.monitor(this.top.index(i) );
285                         }
286                         StatusIconA.statusicon.resume();
287                     this.paused = false;
288                    
289                         
290                         try {
291
292                           
293                                 var notification = new Notify.Notification(
294                                         "Git Live",
295                                         "%s\nMonitoring %u Directories".printf(GitMonitor.gitlive, this.monitors.length), 
296                                          "dialog-information"
297                                 );
298                 
299                                 notification.set_timeout(5);
300                                 notification.show();
301                         } catch(Error e) {
302                                 GLib.debug("Error sending notification to screen: %s\n",e.message);
303                         }
304                         return false; // do not keep doing this..
305
306                 });
307                 
308
309                 
310                  
311         }
312
313
314         public new void stop() {
315                 StatusIconA.statusicon.pause();
316                 base.stop();
317         }
318         
319         
320         public new void monitor (string path,  int depth = 0)
321         {
322                 
323                 //var depth = typeof(depth) == 'number'  ? depth *1 : 0;
324                 
325                  
326                 // if we are not at top level.. and there is a .git directory  (it's a submodule .. ignore) 
327                 if (depth > 1 && FileUtils.test(path + "/.git" , FileTest.IS_DIR)) {
328                         return;
329                 }
330                 
331                 if (depth == 1) {
332                         // FIXME - check if repo is flagged as not autocommit..
333                         //var repo = imports.Scm.Repo.Repo.get(path);
334                         //if (!repo || !repo.autocommit()) {
335                         //    return;
336                         //} 
337                 }
338                 
339                 
340                 // check if the repo is to be monitored.
341                 //print("PATH : " + path);
342                 
343                 
344                 base.monitor(path, depth);
345         }
346
347         
348
349         /**
350          * run the queue.
351          * - pulls the items off the queue 
352          *    (as commands run concurrently and new items may get added while it's running)
353          * - runs the queue items
354          * - pushes upstream.
355          * 
356          */
357         public void runQueue()
358         {
359                 
360                 if (this.paused) {
361                         return;
362                 }
363                 GLib.debug("GitMonitor.runQueue\n");
364
365                 this.queueRunning = true;
366
367                 var cmds = new Array<GitMonitorQueue>();
368
369                 for(var i = 0; i < this.queue.length; i++) {
370                         cmds.append_val(this.queue.index(i));
371                 }
372
373                 this.queue = new Array<GitMonitorQueue>();// empty queue!
374
375                 
376                 string[] success = {};
377                 string[] failure = {};
378            //var repos = new Array<GitRepo>(); //??
379                 //var done = new Array<GitMonitorQueue>();
380                 
381                 // first build a array of repo's to work with
382                 var repo_list = new Array<GitRepo>();
383                 
384                 // pull and group.
385                 
386                 //print(JSON.stringify(cmds));
387                 // make sure nothing get's added to the queue where we are doing this..
388
389                 this.paused = true;
390
391                 GLib.debug("GitMonitor.runQueue - creating repos\n");
392                 
393                 for(var i = 0; i < cmds.length; i++) {
394                    
395                         var cmd = cmds.index(i);
396                 
397                         var gitpath = cmd.gitpath; 
398                         GLib.debug("GitMonitor.runQueue - finding %s\n", cmd.gitpath);
399                 
400                         var ix  = GitRepo.indexOf(repo_list,  cmd.gitpath);
401                         if (ix < 0) {
402                                 repo_list.append_val(new GitRepo( gitpath ));
403                                 ix = GitRepo.indexOf(repo_list,  cmd.gitpath);
404                         }
405                         GLib.debug("GitMonitor.runQueue - adding to repolist %d\n", ix);
406
407                         //if (typeof(repo_list[gitpath]) == 'undefined') {
408                         //    repo_list[gitpath] = new imports.Scm.Git.Repo.Repo( { repopath : gitpath });
409                         //    repo_list[gitpath].cmds = [];
410                          //   repo_list[gitpath].pull();
411                         //}
412                         repo_list.index(ix).cmds.append_val(cmd);
413
414                 }
415                 this.paused = false;
416                 // build add, remove and commit message list..
417
418                 GLib.debug("GitMonitor.runQueue - creating actions\n");
419                 
420                 for(var i = 0;i < repo_list.length;i++) {
421          
422                         var repo = repo_list.index(i);
423
424                         var add_files = new Array<GitMonitorQueue>();
425                         var add_files_f = new Array<GitMonitorQueue>();
426                         var remove_files = new Array<GitMonitorQueue>();
427                         var messages = new Array<GitMonitorQueue>();
428                         //print(JSON.stringify(repo.cmds,null,4));
429                         
430                         for(var ii = 0;ii < repo.cmds.length;ii++) {
431                                 var cmd = repo.cmds.index(ii);
432         
433                                 if (repo.is_ignore(cmd.vname)) {
434                                         continue;
435                                 }
436         
437                                 
438                                 switch(cmd.action) {
439                                         case "add" :
440                                                 
441                                                 if (GitMonitorQueue.indexOfAdd(add_files, cmd.vname) > -1) {
442                                                    break;
443                                                 }
444                                                 
445                                                 add_files.append_val(cmd);
446                                                 break;
447                                         
448                                         case "rm":
449                                                 if (GitMonitorQueue.indexOfAdd(remove_files, cmd.vname) > -1 ) {
450                                                    break;
451                                                 }
452                                                 
453                                                 // if file exists, do not try and delete it.
454                                                 if (FileUtils.test(cmd.fullpath(), FileTest.EXISTS)) {
455                                                         break;
456                                                 }
457                                                 
458                                                 remove_files.append_val(cmd);
459                                                 break;
460                                         
461                                         case "commit" :
462                                                 if (GitMonitorQueue.indexOfMessage(messages, cmd.message) > -1 ) {
463                                                    break;
464                                                 }
465                                                 messages.append_val(cmd);
466                                                 
467                                                 break;
468                                         default:
469                                                 stdout.printf("Opps unmatched action %s\n", cmd.action);
470                                                 break;
471                                 } 
472                         }
473                         GLib.debug( "ADD : %s\n", GitMonitorQueue.queueArrayToString(add_files));
474                         GLib.debug( "REMOVE FILES: %s\n", GitMonitorQueue.queueArrayToString(remove_files));
475                         
476                         //repo.debug = 1;
477                         // these can fail... at present... as we wildcard stuff.
478                    
479                         // make sure added files do not get removed.. ?? 
480                         /*
481                         var remove_files_f = new Array<GitMonitorQueue>();
482                         for(var ii = 0;ii < remove_files.length;ii++) {
483                                 if (GitMonitorQueue.indexOfAdd(add_files,  remove_files.index(ii).vname) > -1 ) {
484                                          continue;
485                                 }
486                                 remove_files_f.append_val(remove_files.index(ii));
487                         };
488                         stdout.printf("REMOVE : %u files\n"  , remove_files_f.length);
489                         */
490                         
491                         // if file was added, then removed, 
492                         var remove_files_f = new Array<GitMonitorQueue>();
493                         for(var ii = 0;ii < remove_files.length;ii++) {
494                                 
495                                 
496                                 
497                                 if (GitMonitorQueue.indexOfAdd(add_files,  remove_files.index(ii).vname) > -1 ) {
498                                         // in add and remove - do not remvove
499                                         continue;
500                                 }
501                                 remove_files_f.append_val(remove_files.index(ii));
502                         };
503                         for(var ii = 0;ii < add_files.length;ii++) {
504                                 if (GitMonitorQueue.indexOfAdd(remove_files,  add_files.index(ii).vname) > -1 ) {
505                                         // the add file is in the remove list, and it does not exist - do not add it..
506                                         print("check exists ? %s\n",add_files.index(ii).fullpath());
507                                         
508                                         if (!FileUtils.test(add_files.index(ii).fullpath(), FileTest.EXISTS)) {
509                                                         continue;
510                                         }
511                                          
512                                 }
513                                 
514                                 
515                                 
516                                 add_files_f.append_val(add_files.index(ii));
517                         };
518                         
519                         GLib.debug( "ADD : %s\n", GitMonitorQueue.queueArrayToString(add_files_f));
520                         GLib.debug( "REMOVE FILES: %s\n", GitMonitorQueue.queueArrayToString(remove_files_f));
521                     
522                     if (add_files_f.length < 1 && remove_files_f.length < 1) {
523                                 continue;
524                     }
525                     
526                         // make sure monitoring is paused so it does not recursively pick up
527                         // deletions
528                         this.paused = true; 
529                           
530                           
531                         try {
532                                 
533                                 repo.pull();
534                         } catch(Error e) {
535                                 this.pauseError(e.message);
536                                 //failure +=  e.message;
537                                 //print("Pull failed:\n");
538                                 return;
539                         }
540                                                                         
541                         // -- DO STUFF..            
542                         try {
543                                 repo.add(add_files_f);
544                         } catch(Error e) {
545                                 this.pauseError(e.message);
546                                 return;
547                                 failure +=  e.message;
548                                 GLib.debug("Add failed:\n");
549                         }  
550                         try {
551                                  repo.remove(remove_files_f);
552                         } catch(Error e) {
553                                 this.pauseError(e.message);
554                                 return;
555                                 failure +=  e.message;
556                                 GLib.debug("Remove failed:\n");
557                         }  
558
559
560                         try { 
561                                 success += repo.commit(
562                                         GitMonitorQueue.messageToString(messages),
563                                         add_files_f
564                                 );
565                                 success += repo.push();
566
567                         } catch(Error e) {
568                         
569                                 // if the error is 'nothing to commit, working tree clean'
570                                 // then it's not an error, - just continue;
571                                 if (/nothing to commit, working tree clean/.match(e.message)) {
572                                         GLib.debug("%s\n",e.message);
573                                         success += e.message;
574                                         this.paused = false; 
575                                         continue;
576                                 }
577                                 
578                         
579                         
580                                 this.paused = false;                    
581                                 this.pauseError(e.message);
582                                 
583                                 return;
584                                 //failure += e.message;
585                                 //print("Push failed:\n");
586                                 
587                         }   
588                         this.paused = false;                                            
589                 }
590                 
591                 
592                 // finally merge all the commit messages.
593                  
594                 try {
595                         // catch notification failures.. so we can carry on..
596                         if (success.length > 0) {
597
598                                 
599                                 var notification = new Notify.Notification(
600                                         "Git Live Commited",
601                                         string.joinv("\n",success),
602                                          "dialog-information"
603                                         
604                                 );
605         
606                                 notification.set_timeout(5);
607                                 notification.show();   
608                         }
609                         
610                         //if (failure.length > 0) {
611
612                                 // should never get this far...
613                         //      this.pauseError();   
614                         //}
615                 } catch(Error e) {
616                         GLib.debug(e.message);
617                         
618                 }
619                 this.queueRunning = false;
620         }
621         
622
623
624         
625
626         //string[] just_created;
627  
628  
629
630
631
632    
633
634
635         public override  void onChanged(MonitorNamePathDir src) 
636         { 
637                 //print("GitMonitor.onChanged\n");        
638                 return; // always ignore this..?
639                 //this.parsePath(src);
640         }
641         
642
643  
644         /**
645          *  results in  git add  + git commit..
646          *
647          */
648         public override void onChangesDoneHint(MonitorNamePathDir src)  
649         { 
650
651                 if (this.paused) {
652                         return;
653                 }
654                 GLib.debug("GitMonitor.onChangedHint\n");                               
655
656                 this.lastAdd = new DateTime.now(new TimeZone.local()); 
657                 var cmd = new GitMonitorQueue(src);
658                 if (cmd.shouldIgnore()) {
659                         return;
660                 }
661                 
662            
663                 //var add_it = false;
664                 /*
665                 if (this.is_just_created(cmd.path)) {
666                         
667                 if (typeof(this.just_created[src.path]) !='undefined') {
668                         delete this.just_created[src.path];
669                         
670                         this.queue.push( 
671                                 [ src.gitpath,  'add', src.vpath ],
672                                 [ src.gitpath,  'commit',    { message: src.vpath} ] 
673                                 
674                         );
675                  
676                         return;
677                 }
678                 */
679                 cmd.action = "add";
680                 this.queue.append_val(cmd);
681
682                 cmd = new GitMonitorQueue(src);
683                 cmd.action = "commit";
684                 cmd.message = cmd.vname;
685                 this.queue.append_val(cmd);
686  
687                  
688         }
689         public override  void onDeleted(MonitorNamePathDir src) 
690    { 
691
692                 if (this.paused) {
693                         return;
694                 }
695                 GLib.debug("GitMonitor.onDeleted\n");                   
696                 this.lastAdd = new DateTime.now(new TimeZone.local()); 
697                 var cmd = new GitMonitorQueue(src);
698                 if (cmd.shouldIgnore()) {
699                         return;
700                 }
701                 // should check if monitor needs removing..
702                 // it should also check if it was a directory.. - so we dont have to commit all..
703                 cmd.action = "rm";
704                 this.queue.append_val(cmd);
705
706                 cmd = new GitMonitorQueue(src);
707                 cmd.action = "commit";
708                 cmd.message = cmd.vname;
709                 cmd.commit_all = true;
710
711                 this.queue.append_val(cmd);
712  
713         }
714         public override  void onCreated(MonitorNamePathDir src) {
715
716                 if (this.paused) {
717                         return;
718                 }
719                 GLib.debug("GitMonitor.onCreated\n");                   
720                 this.lastAdd = new DateTime.now(new TimeZone.local()); 
721                 var cmd = new GitMonitorQueue(src);
722                 if (cmd.shouldIgnore()) {
723                         return;
724                 }
725
726                 if (!FileUtils.test(src.path, GLib.FileTest.IS_DIR)) {
727                    // this.just_created[src.path] = true;
728                         return; // we do not handle file create flags... - use done hint.
729                 }
730                 // directory has bee created
731                 this.monitor(src.path);
732                 //this.top.append_val(src.path);
733                 //this.monitor(src.path );
734
735
736 // -- no point in adding a dir.. as git does not handle them...
737 //        this.queue.push( 
738   //          [ src.gitpath, 'add' , src.vpath,  { all: true } ],
739  //           [ src.gitpath, 'commit' , { all: true, message: src.vpath} ]
740   //          
741    //     );
742
743         }
744
745         public  override void onAttributeChanged(MonitorNamePathDir src) { 
746
747                 if (this.paused) {
748                         return;
749                 }
750                 GLib.debug("GitMonitor.onAttributeChanged\n");                  
751                 if (src.dir == GitMonitor.gitlive) {
752                    return; // attribute on top level..
753                 }
754                 
755                 this.lastAdd = new DateTime.now(new TimeZone.local()); 
756                 var cmd = new GitMonitorQueue(src);
757                 if (cmd.shouldIgnore()) {
758                         return;
759                 }
760                 cmd.action = "add";
761                 this.queue.append_val(cmd);
762
763                 cmd = new GitMonitorQueue(src);
764                 cmd.action = "commit";
765                 cmd.message = "Attribute changed " + cmd.vname;
766                 this.queue.append_val(cmd);
767         }
768  
769    public  override void onMoved(MonitorNamePathDir src,MonitorNamePathDir dest)  
770         { 
771
772                 if (this.paused) {
773                         return;
774                 }
775                 GLib.debug("GitMonitor.onMoved\n");                     
776                 this.lastAdd = new DateTime.now(new TimeZone.local()); 
777                 var cmd_s = new GitMonitorQueue(src);
778
779                 var cmd_d = new GitMonitorQueue(dest);
780    
781                 
782                 if (cmd_d.gitpath != cmd_s.gitpath) {
783                         this.onDeleted(src);
784                         this.onCreated(dest);
785                         this.onChangesDoneHint(dest);
786                         return;
787                 }
788                 // needs to handle move to/from unsupported types..
789                 
790                 if (cmd_s.shouldIgnore()) {
791                         this.onCreated(dest);
792                         this.onChangesDoneHint(dest);
793                         return;
794
795                 }
796                 if (cmd_d.shouldIgnore()) {
797                         
798                         this.onDeleted(src);
799  
800
801                         return;
802                 }
803                 
804                 
805                 GLib.debug("RM: %s\n", cmd_s.vname);
806                 cmd_s.action = "rm";
807                 this.queue.append_val(cmd_s);
808
809                 
810                 
811                 GLib.debug("ADD: %s\n", cmd_d.vname);
812                 cmd_d.action = "add";
813                 this.queue.append_val(cmd_d);
814
815
816                 var cmd = new GitMonitorQueue(dest);
817                 cmd.action = "commit";
818                 cmd.message = "MOVED " + cmd_s.vname + " to " + cmd_d.vname;
819                 if (GitMonitorQueue.queueHas(this.queue, cmd_s, "add")) {
820                         cmd.message = cmd_d.vname;
821                 }
822                 
823                 this.queue.append_val(cmd);
824
825
826                  
827         }
828            
829 }