Fix #5560 - Gitlive - branching wip
[gitlive] / GitBranch.vala
index e69de29..0a0a63c 100644 (file)
@@ -0,0 +1,75 @@
+/**
+represent a git branch..
+Branching / Gitlive:
+
+Does repo require branching? - flag in config?
+** list of repo's ?? with ability to turn on/off
+
+Start editing without branch?
+-> show prompt to start branch
+-> flag a ticket? optional ??
+
+Once editing branch...
+-> merge with squash / ticket...
+** show list of repo's with 'working' branches?
+** select some/all to merge with a issue fix..
+
+?? closing ticket in system ??
+-> done by the ui?
+
+need to push all? / fetch all?
+
+
+list of repo's
+
+
+*/
+
+public class GitBranch : Object
+{
+       public GitRepo repo;
+       
+       public bool active = false;
+       public string lastrev = "";
+       public string name = "";
+       public string remote = "";
+       public string remoterev = "";
+       
+       public GitBranch(GitRepo repo)
+       {
+               this.repo = repo;
+       }
+
+       public bool parseBranchListItem(string str)
+       {
+               if (str.length  < 1) {
+                       return false;
+               }
+               this.active = str[0] == '*';
+               
+               var parts = Regex.split_simple ("[ \t]+", str.substring(2).strip());
+               if (parts[1] == "->") { // it's an alias.. eg. remotes/origin/HEAD -> origin/master..
+                       return false;
+               }
+               
+               this.lastrev = parts[1];
+               if (parts[0].has_prefix("remotes/")) {
+                       this.remote = parts[0];
+               } else {
+                       this.name = parts[0];
+               }
+           return true;
+       }
+       public string  realName()
+       {
+               return this.name == "" ? this.remote : this.name;
+       }
+       
+       public void create()
+       {
+       
+       }
+       
+}
+       
+       
\ No newline at end of file