rebase instead of merge
This commit is contained in:
parent
38891fc8ed
commit
de18760314
|
@ -216,22 +216,22 @@ namespace SparkleShare {
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Changes fetched.");
|
Console.WriteLine ("[Git][" + Name + "] Changes fetched.");
|
||||||
if (!Output.Contains ("up to date"))
|
if (!Output.Contains ("up to date"))
|
||||||
Merge ();
|
Rebase ();
|
||||||
// SparkleUI.NotificationIcon.SetIdleState ();
|
// SparkleUI.NotificationIcon.SetIdleState ();
|
||||||
FetchTimer.Start ();
|
FetchTimer.Start ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merges the fetched changes
|
// Merges the fetched changes
|
||||||
public void Merge () {
|
public void Rebase () {
|
||||||
// Watcher.EnableRaisingEvents = false;
|
Watcher.EnableRaisingEvents = false;
|
||||||
Console.WriteLine ("[Git][" + Name + "] Merging fetched changes... ");
|
Console.WriteLine ("[Git][" + Name + "] Rebasing fetched changes... ");
|
||||||
Process.StartInfo.Arguments = "merge origin/master";
|
Process.StartInfo.Arguments = "rebase origin";
|
||||||
Process.Start();
|
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Changes merged.");
|
Process.Start();
|
||||||
|
Console.WriteLine ("[Git][" + Name + "] Changes rebased.");
|
||||||
string Output = Process.StandardOutput.ReadToEnd().Trim ();
|
string Output = Process.StandardOutput.ReadToEnd().Trim ();
|
||||||
// Show notification if there are updates
|
// Show notification if there are updates
|
||||||
if (!Output.Equals ("Already up-to-date.")) {
|
if (!Output.Contains ("up to date")) {
|
||||||
|
|
||||||
// Get the last committer e-mail
|
// Get the last committer e-mail
|
||||||
Process.StartInfo.Arguments = "log --format=\"%ae\" -1";
|
Process.StartInfo.Arguments = "log --format=\"%ae\" -1";
|
||||||
|
@ -252,14 +252,17 @@ namespace SparkleShare {
|
||||||
SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath,
|
SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath,
|
||||||
"sparkleshare.notify");
|
"sparkleshare.notify");
|
||||||
|
|
||||||
|
Console.WriteLine ("[Git][" + Name + "] Showing notification.");
|
||||||
|
|
||||||
if (File.Exists (NotifySettingFile))
|
if (File.Exists (NotifySettingFile))
|
||||||
ShowEventBubble (LastCommitUserName + " " + LastCommitMessage,
|
ShowEventBubble (LastCommitUserName + " " + LastCommitMessage,
|
||||||
SparkleHelpers.GetAvatar (LastCommitEmail, 48),
|
SparkleHelpers.GetAvatar (LastCommitEmail, 48),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watcher.EnableRaisingEvents = true;
|
Watcher.EnableRaisingEvents = true;
|
||||||
Console.WriteLine ("[Git][" + Name + "] Nothing going on... ");
|
Console.WriteLine ("[Git][" + Name + "] Nothing going on... ");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue