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
51 public bool shouldIgnore()
54 // vim.. what a seriously brain dead program..
55 if (this.name == "4913") {
56 GLib.debug("ignore name = 4913");
61 if (this.name[0] == '.') {
63 if (this.name == ".htaccess") {
67 if (this.name == ".gitignore") {
70 GLib.debug("ignore name starts with dot %s", this.name);
75 if (this.name[this.name.length -1] == '~') {
76 GLib.debug("ignore name ends with ~");
79 // netbeans / android studio.. silly temp files..
81 if (Regex.match_simple("___jb_old___$", this.name)) {
82 GLib.debug("ignore name includes jb_old");
85 if (Regex.match_simple("___jb_bak___$", this.name)) {
86 GLib.debug("ignore name includes jb_bkc");
89 //if (f.name.match(/^nbproject/)) {
92 // ignore anything in top level!!!!
93 if (this.gitpath.length < 1) {
94 GLib.debug("ignore gitpath length is empty");
103 public static int indexOfAdd( Gee.ArrayList<GitMonitorQueue> add_files, string add)
105 for(var i =0; i < add_files.size; i++) {
106 if (add_files.get(i).vname == add) {
112 public static int indexOfMessage(Gee.ArrayList<GitMonitorQueue> messages, string message) {
113 for(var i =0; i < messages.size; i++) {
114 if (messages.get(i).message == message) {
120 public static string messageToString(Gee.ArrayList<GitMonitorQueue> messages ) {
122 for(var i =0; i < messages.size; i++) {
123 ret+= messages.get(i).message;
125 return string.joinv("\n",ret);
127 public static string queueArrayToString(Gee.ArrayList<GitMonitorQueue> list) {
129 for(var i =0; i < list.size; i++) {
131 ret += (ret.length > 0 ? ", " : "") + list.get(i).vname;
137 public static bool queueHas(Gee.ArrayList<GitMonitorQueue> list , GitMonitorQueue cmd_s, string action) {
138 for(var i =0; i < list.size; i++) {
139 var test = list.get(i);
140 if (list.get(i).gitpath != cmd_s.gitpath) {
143 if (list.get(i).vname != cmd_s.vname) {
146 if (list.get(i).action != action) {
153 public string fullpath()
155 return this.gitpath + "/" + this.vname;