3 public class GitMonitorQueue : MonitorNamePathDir {
9 public string vdir; // relative path (within git)
10 public string vname; // relative filename (within git)
11 public string message ; // for commit
12 public bool commit_all;
15 public GitMonitorQueue(MonitorNamePathDir f) {
17 base(f.name, f.path, f.dir);
20 this.commit_all = false;
22 var vpath_ar = this.dir.substring(GitMonitor.gitlive.length +1).split("/", 0);
24 if (vpath_ar.length < 1 || vpath_ar[0].length < 1) {
33 this.gitpath = GitMonitor.gitlive + "/" + vpath_ar[0];
36 for (var i = 1; i< vpath_ar.length; i++) {
40 this.vdir = string.joinv("/", vpath);
42 this.vname = this.vdir + (this.vdir.length > 0 ? "/" : "") + this.name;
44 this.repo = GitRepo.get(this.gitpath);
46 // trigger the suggestion to start a new branch
48 NewBranch.show(this.repo);
52 public bool shouldIgnore()
55 // vim.. what a seriously brain dead program..
56 if (this.name == "4913") {
57 GLib.debug("ignore name = 4913");
62 if (this.name[0] == '.') {
64 if (this.name == ".htaccess") {
68 if (this.name == ".gitignore") {
71 GLib.debug("ignore name starts with dot %s", this.name);
76 if (this.name[this.name.length -1] == '~') {
77 GLib.debug("ignore name ends with ~");
80 // netbeans / android studio.. silly temp files..
82 if (Regex.match_simple("___jb_old___$", this.name)) {
83 GLib.debug("ignore name includes jb_old");
86 if (Regex.match_simple("___jb_bak___$", this.name)) {
87 GLib.debug("ignore name includes jb_bkc");
90 //if (f.name.match(/^nbproject/)) {
93 // ignore anything in top level!!!!
94 if (this.gitpath.length < 1) {
95 GLib.debug("ignore gitpath length is empty");
104 public static int indexOfAdd( Array<GitMonitorQueue> add_files, string add)
106 for(var i =0; i < add_files.length; i++) {
107 if (add_files.index(i).vname == add) {
113 public static int indexOfMessage(Array<GitMonitorQueue> messages, string message) {
114 for(var i =0; i < messages.length; i++) {
115 if (messages.index(i).message == message) {
121 public static string messageToString(Array<GitMonitorQueue> messages ) {
123 for(var i =0; i < messages.length; i++) {
124 ret+= messages.index(i).message;
126 return string.joinv("\n",ret);
128 public static string queueArrayToString(Array<GitMonitorQueue> list) {
130 for(var i =0; i < list.length; i++) {
132 ret += (ret.length > 0 ? ", " : "") + list.index(i).vname;
138 public static bool queueHas(Array<GitMonitorQueue> list , GitMonitorQueue cmd_s, string action) {
139 for(var i =0; i < list.length; i++) {
140 var test = list.index(i);
141 if (list.index(i).gitpath != cmd_s.gitpath) {
144 if (list.index(i).vname != cmd_s.vname) {
147 if (list.index(i).action != action) {
154 public string fullpath()
156 return this.gitpath + "/" + this.vname;