diff --git a/SparkleLib/SparkleCommit.cs b/SparkleLib/SparkleCommit.cs index 77449b30..cc8b8e3c 100644 --- a/SparkleLib/SparkleCommit.cs +++ b/SparkleLib/SparkleCommit.cs @@ -26,6 +26,7 @@ namespace SparkleLib { public string UserEmail; public DateTime DateTime; public string Hash; + public bool IsMerge; public List Added; public List Deleted; diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index a3ece0f0..12991c68 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -771,7 +771,7 @@ namespace SparkleLib { git.WaitForExit (); _CurrentHash = Head.CurrentCommit.Hash; - + Console.WriteLine ("!!!!" + LocalPath + ": " + GetCommits (1).Count); if (NewCommit != null) NewCommit (GetCommits (1) [0], LocalPath); @@ -976,12 +976,30 @@ namespace SparkleLib { foreach (string log_entry in entries) { + + Regex regex; + bool is_merge_commit = false; + + if (log_entry.Contains ("\nMerge: ")) { + + regex = new Regex (@"commit ([a-z0-9]{40})\n" + + "Merge: .+ .+\n" + + "Author: (.+) <(.+)>\n" + + "Date: ([0-9]{4})-([0-9]{2})-([0-9]{2}) " + + "([0-9]{2}):([0-9]{2}):([0-9]{2}) \\+([0-9]{4})\n" + + "*"); + + is_merge_commit = true; - Regex regex = new Regex (@"commit ([a-z0-9]{40})\n" + - "Author: (.+) <(.+)>\n" + - "Date: ([0-9]{4})-([0-9]{2})-([0-9]{2}) " + - "([0-9]{2}):([0-9]{2}):([0-9]{2}) \\+([0-9]{4})\n" + - "*"); + } else { + + regex = new Regex (@"commit ([a-z0-9]{40})\n" + + "Author: (.+) <(.+)>\n" + + "Date: ([0-9]{4})-([0-9]{2})-([0-9]{2}) " + + "([0-9]{2}):([0-9]{2}):([0-9]{2}) \\+([0-9]{4})\n" + + "*"); + + } Match match = regex.Match (log_entry); @@ -989,9 +1007,10 @@ namespace SparkleLib { SparkleCommit commit = new SparkleCommit (); - commit.Hash = match.Groups [1].Value; - commit.UserName = match.Groups [2].Value; - commit.UserEmail = match.Groups [3].Value; + commit.Hash = match.Groups [1].Value; + commit.UserName = match.Groups [2].Value; + commit.UserEmail = match.Groups [3].Value; + commit.IsMerge = is_merge_commit; commit.DateTime = new DateTime (int.Parse (match.Groups [4].Value), int.Parse (match.Groups [5].Value), int.Parse (match.Groups [6].Value), diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 7eb2a4fb..b7d990e1 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -317,7 +317,9 @@ namespace SparkleShare { } } - + + if (change_set.IsMerge) + event_entry += "
Merged a branch
"; if (change_set.Added.Count > 0) { diff --git a/SparkleShare/SparkleShare.cs b/SparkleShare/SparkleShare.cs index fa180f50..6549bf09 100644 --- a/SparkleShare/SparkleShare.cs +++ b/SparkleShare/SparkleShare.cs @@ -103,7 +103,7 @@ namespace SparkleShare { } - if (!hide_ui) { + if (Controller != null) { UI = new SparkleUI (); UI.Run (); diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 638d80bc..4198bd44 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -51,7 +51,7 @@ namespace SparkleShare { StatusIcon = new SparkleStatusIcon (); // Keep track of which event logs are open - SparkleUI.OpenLogs = new List (); + OpenLogs = new List (); if (SparkleShare.Controller.FirstRun) {