From: Alan Knowles Date: Tue, 30 Oct 2018 08:37:22 +0000 (+0800) Subject: GitBranch.vala X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=7d3842447c40398c6f51dea9d52c2368a423ebcd GitBranch.vala --- diff --git a/GitBranch.vala b/GitBranch.vala index 483c9fc3..1b94f7fa 100644 --- a/GitBranch.vala +++ b/GitBranch.vala @@ -1,5 +1,27 @@ /** 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 + */ @@ -10,7 +32,7 @@ public class GitBranch : Object public bool active = false; public string lastrev = ""; public string name = ""; - public string remote = "": + public string remote = ""; public string remoterev = ""; public GitBranch(GitRepo repo) @@ -18,15 +40,15 @@ public class GitBranch : Object this.repo = repo; } - public bool parseBranchListItem(str) + public bool parseBranchListItem(string str) { - if (!str.length) { + if (str.length < 1) { return false; } this.active = str[0] == '*'; - var bits = Regex.split_simple ("[ \t]+", str.substring(2).strip()); - if (bits[1] == "->") { // it's an alias.. eg. remotes/origin/HEAD -> origin/master.. + 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; } @@ -38,10 +60,16 @@ public class GitBranch : Object } return true; } - function realName() + public string realName() + { + return this.name == "" ? this.remote : this.name; + } + + public create() { - return this.name = "" ? this.remote : this.name; + } + } \ No newline at end of file