Browse Source

Added push/pull/reset

pull/198/head
Henk Westhuis 17 years ago
parent
commit
89a3a10a4e
  1. 105
      GitCommands/GitCommands/Git/GitCommands.cs
  2. 42
      GitShellEx/FileHashShellExt.cs
  3. 3
      GitUI/AboutBox.Designer.cs
  4. 5
      GitUI/AboutBox.cs
  5. 2
      GitUI/ApplyPatch.cs
  6. 169
      GitUI/Browse.Designer.cs
  7. 56
      GitUI/Browse.cs
  8. 191
      GitUI/Commit.Designer.cs
  9. 11
      GitUI/Commit.cs
  10. 148
      GitUI/FormPull.Designer.cs
  11. 82
      GitUI/FormPull.cs
  12. 1583
      GitUI/FormPull.resx
  13. 107
      GitUI/FormPush.Designer.cs
  14. 38
      GitUI/FormPush.cs
  15. 120
      GitUI/FormPush.resx
  16. 18
      GitUI/GitUI.csproj
  17. 2
      GitUI/MergePatch.Designer.cs
  18. 8
      GitUI/MergePatch.cs
  19. 1463
      GitUI/MergePatch.resx
  20. 1411
      Setup/Setup.vdproj

105
GitCommands/GitCommands/Git/GitCommands.cs

@ -12,11 +12,13 @@ namespace GitCommands
{
public static string FindGitWorkingDir(string startDir)
{
string dir = startDir + "\\";
string dir = startDir;
if (!dir.EndsWith("\\") && !dir.EndsWith("/"))
dir += "\\";
while (dir.LastIndexOf('\\') > 0)
while (dir.LastIndexOfAny(new char[]{'\\', '/'}) > 0)
{
dir = dir.Substring(0, dir.LastIndexOf('\\'));
dir = dir.Substring(0, dir.LastIndexOfAny(new char[] { '\\', '/' }));
if (Directory.Exists(dir + "\\" + ".git"))
return dir + "\\";
@ -48,9 +50,56 @@ namespace GitCommands
process.Start();
process.WaitForExit();
process.Close();
}
public static void RunRealCmdDetatched(string cmd, string arguments)
{
//process used to execute external commands
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.ErrorDialog = false;
process.StartInfo.RedirectStandardOutput = false;
process.StartInfo.RedirectStandardInput = false;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.FileName = cmd;
process.StartInfo.Arguments = arguments;
process.StartInfo.WorkingDirectory = Settings.WorkingDir;
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
process.StartInfo.LoadUserProfile = true;
process.Start();
}
public static void Run(string cmd, string arguments)
{
//process used to execute external commands
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.UseShellExecute = false;
process.StartInfo.ErrorDialog = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = cmd;
process.StartInfo.Arguments = arguments;
process.StartInfo.WorkingDirectory = Settings.WorkingDir;
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
process.StartInfo.LoadUserProfile = true;
process.Start();
//process.WaitForExit();
}
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public static string RunCmd(string cmd, string arguments)
{
@ -61,6 +110,7 @@ namespace GitCommands
process.StartInfo.ErrorDialog = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = cmd;
@ -71,14 +121,59 @@ namespace GitCommands
process.Start();
string output = process.StandardOutput.ReadToEnd();
string output;
string error;
output = process.StandardOutput.ReadToEnd();
error = process.StandardError.ReadToEnd();
process.WaitForExit();
process.Close();
// Read the output stream first and then wait.
if (!string.IsNullOrEmpty(error))
{
output += "\n" + error;
}
return output;
}
static public void RunGui()
{
Run(Settings.GitDir + "git.exe", "gui");
}
static public void RunBash()
{
RunRealCmdDetatched("C:\\Windows\\System32\\cmd.exe", "/c \"" + Settings.GitDir + "sh.exe\" --login -i");
}
static public string Reset()
{
return RunCmd(Settings.GitDir + "git.exe", "reset --hard");
}
static public string Push(string path)
{
Directory.SetCurrentDirectory(Settings.WorkingDir);
string result = GitCommands.RunCmd(Settings.GitDir + "git.exe", "push \"" + path + "\"");
return result;
}
static public string Pull(string path, string branch)
{
Directory.SetCurrentDirectory(Settings.WorkingDir);
string result = GitCommands.RunCmd(Settings.GitDir + "git.exe", "pull \"" + path + "\" \"" + branch + "\"");
return result;
}
static public string Resolved()
{
Directory.SetCurrentDirectory(Settings.WorkingDir);

42
GitShellEx/FileHashShellExt.cs

@ -110,9 +110,12 @@ namespace FileHashShell
AddMenuItem(hMenu, "Init new repository", ++id, 7);
if (fileNames.Count > 0)
AddMenuItem(hMenu, "File history", ++id, 8);
AddMenuItem(hMenu, "Patch", ++id, 9);
AddMenuItem(hMenu, "Push", ++id, 10);
AddMenuItem(hMenu, "Pull", ++id, 11);
AddMenuItem(hMenu, "View patch file", ++id, 9);
AddMenuItem(hMenu, "Apply patch", ++id, 10);
AddMenuItem(hMenu, "Push", ++id, 11);
AddMenuItem(hMenu, "Pull", ++id, 12);
AddMenuItem(hMenu, "Git bash", ++id, 13);
AddMenuItem(hMenu, "Git GUI", ++id, 14);
/*// Add a separator
MENUITEMINFO sep = new MENUITEMINFO();
@ -240,27 +243,40 @@ namespace FileHashShell
}
break;
}
case 9://Patch
case 9://ViewPatch
{
ViewPatch patchapply = new ViewPatch();
patchapply.Show();
break;
}
case 10://Push
case 10://MergePatch
{
GitCommands.Push cmd = new GitCommands.Push(new GitCommands.PushDto());
cmd.Execute();
MessageBox.Show(cmd.Dto.Result);
MergePatch form = new MergePatch();
form.Show();
break;
}
case 11://Pull
case 11://Push
{
GitCommands.Pull cmd = new GitCommands.Pull(new GitCommands.PullDto());
cmd.Execute();
MessageBox.Show(cmd.Dto.Result);
FormPush form = new FormPush();
form.Show();
break;
}
case 12://Pull
{
FormPull form = new FormPull();
form.Show();
break;
}
case 13://Bash
{
GitCommands.GitCommands.RunBash();
break;
}
case 14://Gui
{
GitCommands.GitCommands.RunGui();
break;
}
}
}

3
GitUI/AboutBox.Designer.cs

@ -96,8 +96,9 @@
this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(271, 17);
this.labelVersion.TabIndex = 0;
this.labelVersion.Text = "Version 0.1";
this.labelVersion.Text = "Version 0.4";
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.labelVersion.Click += new System.EventHandler(this.labelVersion_Click);
//
// labelCopyright
//

5
GitUI/AboutBox.cs

@ -21,5 +21,10 @@ namespace GitUI
this.Close();
}
private void labelVersion_Click(object sender, EventArgs e)
{
}
}
}

2
GitUI/ApplyPatch.cs

@ -267,7 +267,7 @@ namespace PatchApply
{
MergePatch form = new MergePatch();
form.SetPatchFile(PatchFileNameEdit.Text);
form.Show();
form.ShowDialog();
}
}
}

169
GitUI/Browse.Designer.cs

@ -37,15 +37,8 @@
this.Commits = new System.Windows.Forms.TabPage();
this.Revisions = new System.Windows.Forms.DataGridView();
this.Graph = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.authorDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.committerDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.gitRevisionBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tabPage4 = new System.Windows.Forms.TabPage();
this.FileChanges = new System.Windows.Forms.DataGridView();
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.guidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.gitItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.FileText = new ICSharpCode.TextEditor.TextEditorControl();
@ -72,10 +65,21 @@
this.pushToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pullToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.patchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.applyPatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gitBashToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gitGUIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.applyPatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.authorDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.committerDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.gitRevisionBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.guidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.gitItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.Workingdir = new System.Windows.Forms.Label();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
@ -85,10 +89,8 @@
this.tabControl2.SuspendLayout();
this.Commits.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Revisions)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gitRevisionBindingSource)).BeginInit();
this.tabPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.FileChanges)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gitItemBindingSource)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
@ -99,6 +101,8 @@
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gitRevisionBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gitItemBindingSource)).BeginInit();
this.SuspendLayout();
//
// GitTree
@ -198,32 +202,6 @@
this.Graph.ReadOnly = true;
this.Graph.Width = 50;
//
// messageDataGridViewTextBoxColumn
//
this.messageDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.messageDataGridViewTextBoxColumn.DataPropertyName = "Message";
this.messageDataGridViewTextBoxColumn.HeaderText = "Message";
this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn";
this.messageDataGridViewTextBoxColumn.ReadOnly = true;
//
// authorDataGridViewTextBoxColumn
//
this.authorDataGridViewTextBoxColumn.DataPropertyName = "Author";
this.authorDataGridViewTextBoxColumn.HeaderText = "Author";
this.authorDataGridViewTextBoxColumn.Name = "authorDataGridViewTextBoxColumn";
this.authorDataGridViewTextBoxColumn.ReadOnly = true;
//
// committerDataGridViewTextBoxColumn
//
this.committerDataGridViewTextBoxColumn.DataPropertyName = "Committer";
this.committerDataGridViewTextBoxColumn.HeaderText = "Committer";
this.committerDataGridViewTextBoxColumn.Name = "committerDataGridViewTextBoxColumn";
this.committerDataGridViewTextBoxColumn.ReadOnly = true;
//
// gitRevisionBindingSource
//
this.gitRevisionBindingSource.DataSource = typeof(GitCommands.GitRevision);
//
// tabPage4
//
this.tabPage4.Controls.Add(this.FileChanges);
@ -256,25 +234,6 @@
this.FileChanges.SelectionChanged += new System.EventHandler(this.FileChanges_SelectionChanged);
this.FileChanges.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.FileChanges_CellContentClick);
//
// nameDataGridViewTextBoxColumn
//
this.nameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
//
// guidDataGridViewTextBoxColumn
//
this.guidDataGridViewTextBoxColumn.DataPropertyName = "Guid";
this.guidDataGridViewTextBoxColumn.HeaderText = "Guid";
this.guidDataGridViewTextBoxColumn.Name = "guidDataGridViewTextBoxColumn";
this.guidDataGridViewTextBoxColumn.ReadOnly = true;
//
// gitItemBindingSource
//
this.gitItemBindingSource.DataSource = typeof(GitCommands.GitItem);
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
@ -365,6 +324,7 @@
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.Workingdir);
this.splitContainer2.Panel1.Controls.Add(this.CurrentBranch);
this.splitContainer2.Panel1.Controls.Add(this.label1);
this.splitContainer2.Panel1.Controls.Add(this.Branches);
@ -379,7 +339,7 @@
// CurrentBranch
//
this.CurrentBranch.AutoSize = true;
this.CurrentBranch.Location = new System.Drawing.Point(314, 14);
this.CurrentBranch.Location = new System.Drawing.Point(314, 12);
this.CurrentBranch.Name = "CurrentBranch";
this.CurrentBranch.Size = new System.Drawing.Size(0, 13);
this.CurrentBranch.TabIndex = 2;
@ -407,6 +367,7 @@
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.commandsToolStripMenuItem,
this.gitToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
@ -526,6 +487,13 @@
this.patchToolStripMenuItem.Text = "View patch file";
this.patchToolStripMenuItem.Click += new System.EventHandler(this.patchToolStripMenuItem_Click);
//
// applyPatchToolStripMenuItem
//
this.applyPatchToolStripMenuItem.Name = "applyPatchToolStripMenuItem";
this.applyPatchToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.applyPatchToolStripMenuItem.Text = "Apply patch";
this.applyPatchToolStripMenuItem.Click += new System.EventHandler(this.applyPatchToolStripMenuItem_Click);
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
@ -533,6 +501,29 @@
this.settingsToolStripMenuItem.Text = "Settings";
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
//
// gitToolStripMenuItem
//
this.gitToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.gitBashToolStripMenuItem,
this.gitGUIToolStripMenuItem});
this.gitToolStripMenuItem.Name = "gitToolStripMenuItem";
this.gitToolStripMenuItem.Size = new System.Drawing.Size(34, 20);
this.gitToolStripMenuItem.Text = "Git";
//
// gitBashToolStripMenuItem
//
this.gitBashToolStripMenuItem.Name = "gitBashToolStripMenuItem";
this.gitBashToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.gitBashToolStripMenuItem.Text = "Git bash";
this.gitBashToolStripMenuItem.Click += new System.EventHandler(this.gitBashToolStripMenuItem_Click_1);
//
// gitGUIToolStripMenuItem
//
this.gitGUIToolStripMenuItem.Name = "gitGUIToolStripMenuItem";
this.gitGUIToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.gitGUIToolStripMenuItem.Text = "Git GUI";
this.gitGUIToolStripMenuItem.Click += new System.EventHandler(this.gitGUIToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -548,12 +539,60 @@
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// applyPatchToolStripMenuItem
// messageDataGridViewTextBoxColumn
//
this.applyPatchToolStripMenuItem.Name = "applyPatchToolStripMenuItem";
this.applyPatchToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.applyPatchToolStripMenuItem.Text = "Apply patch";
this.applyPatchToolStripMenuItem.Click += new System.EventHandler(this.applyPatchToolStripMenuItem_Click);
this.messageDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.messageDataGridViewTextBoxColumn.DataPropertyName = "Message";
this.messageDataGridViewTextBoxColumn.HeaderText = "Message";
this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn";
this.messageDataGridViewTextBoxColumn.ReadOnly = true;
//
// authorDataGridViewTextBoxColumn
//
this.authorDataGridViewTextBoxColumn.DataPropertyName = "Author";
this.authorDataGridViewTextBoxColumn.HeaderText = "Author";
this.authorDataGridViewTextBoxColumn.Name = "authorDataGridViewTextBoxColumn";
this.authorDataGridViewTextBoxColumn.ReadOnly = true;
//
// committerDataGridViewTextBoxColumn
//
this.committerDataGridViewTextBoxColumn.DataPropertyName = "Committer";
this.committerDataGridViewTextBoxColumn.HeaderText = "Committer";
this.committerDataGridViewTextBoxColumn.Name = "committerDataGridViewTextBoxColumn";
this.committerDataGridViewTextBoxColumn.ReadOnly = true;
//
// gitRevisionBindingSource
//
this.gitRevisionBindingSource.DataSource = typeof(GitCommands.GitRevision);
//
// nameDataGridViewTextBoxColumn
//
this.nameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
//
// guidDataGridViewTextBoxColumn
//
this.guidDataGridViewTextBoxColumn.DataPropertyName = "Guid";
this.guidDataGridViewTextBoxColumn.HeaderText = "Guid";
this.guidDataGridViewTextBoxColumn.Name = "guidDataGridViewTextBoxColumn";
this.guidDataGridViewTextBoxColumn.ReadOnly = true;
//
// gitItemBindingSource
//
this.gitItemBindingSource.DataSource = typeof(GitCommands.GitItem);
//
// Workingdir
//
this.Workingdir.AutoSize = true;
this.Workingdir.Location = new System.Drawing.Point(500, 12);
this.Workingdir.Name = "Workingdir";
this.Workingdir.Size = new System.Drawing.Size(10, 13);
this.Workingdir.TabIndex = 3;
this.Workingdir.Text = " ";
this.Workingdir.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// FormBrowse
//
@ -575,10 +614,8 @@
this.tabControl2.ResumeLayout(false);
this.Commits.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.Revisions)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gitRevisionBindingSource)).EndInit();
this.tabPage4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.FileChanges)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gitItemBindingSource)).EndInit();
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
@ -591,6 +628,8 @@
this.splitContainer2.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.gitRevisionBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gitItemBindingSource)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -644,5 +683,9 @@
private System.Windows.Forms.DataGridViewTextBoxColumn committerDataGridViewTextBoxColumn;
private System.Windows.Forms.Label CurrentBranch;
private System.Windows.Forms.ToolStripMenuItem applyPatchToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gitBashToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gitGUIToolStripMenuItem;
private System.Windows.Forms.Label Workingdir;
}
}

56
GitUI/Browse.cs

@ -90,6 +90,8 @@ namespace GitUI
//Branches.SelectedText =
ShowRevisions();
Workingdir.Text = "Working dir: " + GitCommands.Settings.WorkingDir;
}
private void ShowRevisions()
@ -282,7 +284,8 @@ namespace GitUI
private void checkoutToolStripMenuItem_Click(object sender, EventArgs e)
{
FormCheckout form = new FormCheckout();
form.Show();
form.ShowDialog();
Initialize();
}
private void FileText_TextChanged(object sender, EventArgs e)
@ -316,7 +319,7 @@ namespace GitUI
if (((GitItem)item).ItemType == "blob")
{
FormFileHistory form = new FormFileHistory(((GitItem)item).FileName);
form.Show();
form.ShowDialog();
}
@ -325,31 +328,34 @@ namespace GitUI
private void viewDiffToolStripMenuItem_Click(object sender, EventArgs e)
{
FormDiff diff = new FormDiff();
diff.Show();
diff.ShowDialog();
}
private void addFilesToolStripMenuItem_Click(object sender, EventArgs e)
{
FormAddFiles addFiles = new FormAddFiles();
addFiles.Show();
addFiles.ShowDialog();
}
private void branchToolStripMenuItem_Click(object sender, EventArgs e)
{
FormBranch form = new FormBranch();
form.Show();
form.ShowDialog();
Initialize();
}
private void cloneToolStripMenuItem_Click(object sender, EventArgs e)
{
FormClone form = new FormClone();
form.Show();
form.ShowDialog();
Initialize();
}
private void commitToolStripMenuItem_Click(object sender, EventArgs e)
{
FormCommit form = new FormCommit();
form.Show();
form.ShowDialog();
Initialize();
}
private void initNewRepositoryToolStripMenuItem_Click(object sender, EventArgs e)
@ -370,17 +376,22 @@ namespace GitUI
private void pushToolStripMenuItem_Click(object sender, EventArgs e)
{
GitCommands.Push cmd = new GitCommands.Push(new GitCommands.PushDto());
cmd.Execute();
MessageBox.Show(cmd.Dto.Result);
//GitCommands.Push cmd = new GitCommands.Push(new GitCommands.PushDto());
//cmd.Execute();
//MessageBox.Show(cmd.Dto.Result);
//Initialize();
new FormPush().ShowDialog();
Initialize();
}
private void pullToolStripMenuItem_Click(object sender, EventArgs e)
{
GitCommands.Pull cmd = new GitCommands.Pull(new GitCommands.PullDto());
cmd.Execute();
MessageBox.Show(cmd.Dto.Result);
//GitCommands.Pull cmd = new GitCommands.Pull(new GitCommands.PullDto());
//cmd.Execute();
//MessageBox.Show(cmd.Dto.Result);
//Initialize();
new FormPull().ShowDialog();
Initialize();
}
@ -425,25 +436,36 @@ namespace GitUI
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutBox a = new AboutBox();
a.Show();
a.ShowDialog();
}
private void patchToolStripMenuItem_Click(object sender, EventArgs e)
{
ViewPatch applyPatch = new ViewPatch();
applyPatch.Show();
applyPatch.ShowDialog();
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
FormSettigns form = new FormSettigns();
form.Show();
form.ShowDialog();
}
private void applyPatchToolStripMenuItem_Click(object sender, EventArgs e)
{
MergePatch form = new MergePatch();
form.Show();
form.ShowDialog();
}
private void gitBashToolStripMenuItem_Click_1(object sender, EventArgs e)
{
GitCommands.GitCommands.RunBash();
}
private void gitGUIToolStripMenuItem_Click(object sender, EventArgs e)
{
GitCommands.GitCommands.RunGui();
}

191
GitUI/Commit.Designer.cs

@ -35,27 +35,27 @@
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.label2 = new System.Windows.Forms.Label();
this.Untracked = new System.Windows.Forms.DataGridView();
this.nameDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.isChangedDataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.isNewDataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.gitItemStatusBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
this.label3 = new System.Windows.Forms.Label();
this.Tracked = new System.Windows.Forms.DataGridView();
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.isDeletedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.isChangedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.isNewDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Ok = new System.Windows.Forms.Button();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.SelectedDiff = new ICSharpCode.TextEditor.TextEditorControl();
this.AddFiles = new System.Windows.Forms.Button();
this.Scan = new System.Windows.Forms.Button();
this.Commit = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.OutPut = new System.Windows.Forms.RichTextBox();
this.Message = new System.Windows.Forms.RichTextBox();
this.SelectedDiff = new ICSharpCode.TextEditor.TextEditorControl();
this.gitItemStatusBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.isDeletedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.isChangedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.isNewDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.nameDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.isDeletedDataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.isChangedDataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.isNewDataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Reset = new System.Windows.Forms.Button();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
@ -66,6 +66,7 @@
this.splitContainer4.Panel2.SuspendLayout();
this.splitContainer4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Untracked)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gitItemStatusBindingSource)).BeginInit();
this.splitContainer5.Panel1.SuspendLayout();
this.splitContainer5.Panel2.SuspendLayout();
this.splitContainer5.SuspendLayout();
@ -73,7 +74,6 @@
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gitItemStatusBindingSource)).BeginInit();
this.SuspendLayout();
//
// splitContainer1
@ -148,7 +148,6 @@
this.Untracked.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.Untracked.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.nameDataGridViewTextBoxColumn1,
this.isDeletedDataGridViewCheckBoxColumn1,
this.isChangedDataGridViewCheckBoxColumn1,
this.isNewDataGridViewCheckBoxColumn1});
this.Untracked.DataSource = this.gitItemStatusBindingSource;
@ -162,6 +161,34 @@
this.Untracked.TabIndex = 0;
this.Untracked.SelectionChanged += new System.EventHandler(this.Untracked_SelectionChanged);
//
// nameDataGridViewTextBoxColumn1
//
this.nameDataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.nameDataGridViewTextBoxColumn1.DataPropertyName = "Name";
this.nameDataGridViewTextBoxColumn1.HeaderText = "Name";
this.nameDataGridViewTextBoxColumn1.Name = "nameDataGridViewTextBoxColumn1";
this.nameDataGridViewTextBoxColumn1.ReadOnly = true;
//
// isChangedDataGridViewCheckBoxColumn1
//
this.isChangedDataGridViewCheckBoxColumn1.DataPropertyName = "IsChanged";
this.isChangedDataGridViewCheckBoxColumn1.HeaderText = "Change";
this.isChangedDataGridViewCheckBoxColumn1.Name = "isChangedDataGridViewCheckBoxColumn1";
this.isChangedDataGridViewCheckBoxColumn1.ReadOnly = true;
this.isChangedDataGridViewCheckBoxColumn1.Width = 50;
//
// isNewDataGridViewCheckBoxColumn1
//
this.isNewDataGridViewCheckBoxColumn1.DataPropertyName = "IsNew";
this.isNewDataGridViewCheckBoxColumn1.HeaderText = "New";
this.isNewDataGridViewCheckBoxColumn1.Name = "isNewDataGridViewCheckBoxColumn1";
this.isNewDataGridViewCheckBoxColumn1.ReadOnly = true;
this.isNewDataGridViewCheckBoxColumn1.Width = 50;
//
// gitItemStatusBindingSource
//
this.gitItemStatusBindingSource.DataSource = typeof(GitCommands.GitItemStatus);
//
// splitContainer5
//
this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill;
@ -213,6 +240,38 @@
this.Tracked.TabIndex = 0;
this.Tracked.SelectionChanged += new System.EventHandler(this.Tracked_SelectionChanged);
//
// nameDataGridViewTextBoxColumn
//
this.nameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
//
// isDeletedDataGridViewCheckBoxColumn
//
this.isDeletedDataGridViewCheckBoxColumn.DataPropertyName = "IsDeleted";
this.isDeletedDataGridViewCheckBoxColumn.HeaderText = "Delete";
this.isDeletedDataGridViewCheckBoxColumn.Name = "isDeletedDataGridViewCheckBoxColumn";
this.isDeletedDataGridViewCheckBoxColumn.ReadOnly = true;
this.isDeletedDataGridViewCheckBoxColumn.Width = 50;
//
// isChangedDataGridViewCheckBoxColumn
//
this.isChangedDataGridViewCheckBoxColumn.DataPropertyName = "IsChanged";
this.isChangedDataGridViewCheckBoxColumn.HeaderText = "Edit";
this.isChangedDataGridViewCheckBoxColumn.Name = "isChangedDataGridViewCheckBoxColumn";
this.isChangedDataGridViewCheckBoxColumn.ReadOnly = true;
this.isChangedDataGridViewCheckBoxColumn.Width = 50;
//
// isNewDataGridViewCheckBoxColumn
//
this.isNewDataGridViewCheckBoxColumn.DataPropertyName = "IsNew";
this.isNewDataGridViewCheckBoxColumn.HeaderText = "New";
this.isNewDataGridViewCheckBoxColumn.Name = "isNewDataGridViewCheckBoxColumn";
this.isNewDataGridViewCheckBoxColumn.ReadOnly = true;
this.isNewDataGridViewCheckBoxColumn.Width = 50;
//
// Ok
//
this.Ok.Location = new System.Drawing.Point(334, 10);
@ -236,6 +295,7 @@
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.Reset);
this.splitContainer3.Panel2.Controls.Add(this.AddFiles);
this.splitContainer3.Panel2.Controls.Add(this.Scan);
this.splitContainer3.Panel2.Controls.Add(this.Commit);
@ -246,11 +306,20 @@
this.splitContainer3.SplitterDistance = 365;
this.splitContainer3.TabIndex = 0;
//
// SelectedDiff
//
this.SelectedDiff.Dock = System.Windows.Forms.DockStyle.Fill;
this.SelectedDiff.IsReadOnly = false;
this.SelectedDiff.Location = new System.Drawing.Point(0, 0);
this.SelectedDiff.Name = "SelectedDiff";
this.SelectedDiff.Size = new System.Drawing.Size(450, 365);
this.SelectedDiff.TabIndex = 0;
//
// AddFiles
//
this.AddFiles.Location = new System.Drawing.Point(12, 68);
this.AddFiles.Location = new System.Drawing.Point(3, 68);
this.AddFiles.Name = "AddFiles";
this.AddFiles.Size = new System.Drawing.Size(87, 23);
this.AddFiles.Size = new System.Drawing.Size(96, 23);
this.AddFiles.TabIndex = 4;
this.AddFiles.Text = "Add files to git";
this.AddFiles.UseVisualStyleBackColor = true;
@ -258,9 +327,9 @@
//
// Scan
//
this.Scan.Location = new System.Drawing.Point(12, 39);
this.Scan.Location = new System.Drawing.Point(3, 39);
this.Scan.Name = "Scan";
this.Scan.Size = new System.Drawing.Size(87, 23);
this.Scan.Size = new System.Drawing.Size(96, 23);
this.Scan.TabIndex = 3;
this.Scan.Text = "Scan changes";
this.Scan.UseVisualStyleBackColor = true;
@ -268,9 +337,9 @@
//
// Commit
//
this.Commit.Location = new System.Drawing.Point(12, 10);
this.Commit.Location = new System.Drawing.Point(3, 10);
this.Commit.Name = "Commit";
this.Commit.Size = new System.Drawing.Size(87, 23);
this.Commit.Size = new System.Drawing.Size(96, 23);
this.Commit.TabIndex = 2;
this.Commit.Text = "Commit";
this.Commit.UseVisualStyleBackColor = true;
@ -302,82 +371,15 @@
this.Message.TabIndex = 0;
this.Message.Text = "";
//
// SelectedDiff
//
this.SelectedDiff.Dock = System.Windows.Forms.DockStyle.Fill;
this.SelectedDiff.IsReadOnly = false;
this.SelectedDiff.Location = new System.Drawing.Point(0, 0);
this.SelectedDiff.Name = "SelectedDiff";
this.SelectedDiff.Size = new System.Drawing.Size(450, 365);
this.SelectedDiff.TabIndex = 0;
//
// gitItemStatusBindingSource
//
this.gitItemStatusBindingSource.DataSource = typeof(GitCommands.GitItemStatus);
//
// nameDataGridViewTextBoxColumn
//
this.nameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
//
// isDeletedDataGridViewCheckBoxColumn
//
this.isDeletedDataGridViewCheckBoxColumn.DataPropertyName = "IsDeleted";
this.isDeletedDataGridViewCheckBoxColumn.HeaderText = "Delete";
this.isDeletedDataGridViewCheckBoxColumn.Name = "isDeletedDataGridViewCheckBoxColumn";
this.isDeletedDataGridViewCheckBoxColumn.ReadOnly = true;
this.isDeletedDataGridViewCheckBoxColumn.Width = 50;
//
// isChangedDataGridViewCheckBoxColumn
//
this.isChangedDataGridViewCheckBoxColumn.DataPropertyName = "IsChanged";
this.isChangedDataGridViewCheckBoxColumn.HeaderText = "Edit";
this.isChangedDataGridViewCheckBoxColumn.Name = "isChangedDataGridViewCheckBoxColumn";
this.isChangedDataGridViewCheckBoxColumn.ReadOnly = true;
this.isChangedDataGridViewCheckBoxColumn.Width = 50;
//
// isNewDataGridViewCheckBoxColumn
//
this.isNewDataGridViewCheckBoxColumn.DataPropertyName = "IsNew";
this.isNewDataGridViewCheckBoxColumn.HeaderText = "New";
this.isNewDataGridViewCheckBoxColumn.Name = "isNewDataGridViewCheckBoxColumn";
this.isNewDataGridViewCheckBoxColumn.ReadOnly = true;
this.isNewDataGridViewCheckBoxColumn.Width = 50;
//
// nameDataGridViewTextBoxColumn1
//
this.nameDataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.nameDataGridViewTextBoxColumn1.DataPropertyName = "Name";
this.nameDataGridViewTextBoxColumn1.HeaderText = "Name";
this.nameDataGridViewTextBoxColumn1.Name = "nameDataGridViewTextBoxColumn1";
this.nameDataGridViewTextBoxColumn1.ReadOnly = true;
//
// isDeletedDataGridViewCheckBoxColumn1
//
this.isDeletedDataGridViewCheckBoxColumn1.DataPropertyName = "IsDelete";
this.isDeletedDataGridViewCheckBoxColumn1.HeaderText = "Delete";
this.isDeletedDataGridViewCheckBoxColumn1.Name = "isDeletedDataGridViewCheckBoxColumn1";
this.isDeletedDataGridViewCheckBoxColumn1.ReadOnly = true;
this.isDeletedDataGridViewCheckBoxColumn1.Width = 50;
//
// isChangedDataGridViewCheckBoxColumn1
//
this.isChangedDataGridViewCheckBoxColumn1.DataPropertyName = "IsChanged";
this.isChangedDataGridViewCheckBoxColumn1.HeaderText = "Change";
this.isChangedDataGridViewCheckBoxColumn1.Name = "isChangedDataGridViewCheckBoxColumn1";
this.isChangedDataGridViewCheckBoxColumn1.ReadOnly = true;
this.isChangedDataGridViewCheckBoxColumn1.Width = 50;
//
// isNewDataGridViewCheckBoxColumn1
// Reset
//
this.isNewDataGridViewCheckBoxColumn1.DataPropertyName = "IsNew";
this.isNewDataGridViewCheckBoxColumn1.HeaderText = "New";
this.isNewDataGridViewCheckBoxColumn1.Name = "isNewDataGridViewCheckBoxColumn1";
this.isNewDataGridViewCheckBoxColumn1.ReadOnly = true;
this.isNewDataGridViewCheckBoxColumn1.Width = 50;
this.Reset.Location = new System.Drawing.Point(3, 98);
this.Reset.Name = "Reset";
this.Reset.Size = new System.Drawing.Size(95, 23);
this.Reset.TabIndex = 5;
this.Reset.Text = "Reset to HEAD";
this.Reset.UseVisualStyleBackColor = true;
this.Reset.Click += new System.EventHandler(this.Reset_Click);
//
// FormCommit
//
@ -400,6 +402,7 @@
this.splitContainer4.Panel2.ResumeLayout(false);
this.splitContainer4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.Untracked)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gitItemStatusBindingSource)).EndInit();
this.splitContainer5.Panel1.ResumeLayout(false);
this.splitContainer5.Panel1.PerformLayout();
this.splitContainer5.Panel2.ResumeLayout(false);
@ -409,7 +412,6 @@
this.splitContainer3.Panel2.ResumeLayout(false);
this.splitContainer3.Panel2.PerformLayout();
this.splitContainer3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gitItemStatusBindingSource)).EndInit();
this.ResumeLayout(false);
}
@ -442,5 +444,6 @@
private System.Windows.Forms.DataGridViewCheckBoxColumn isDeletedDataGridViewCheckBoxColumn1;
private System.Windows.Forms.DataGridViewCheckBoxColumn isChangedDataGridViewCheckBoxColumn1;
private System.Windows.Forms.DataGridViewCheckBoxColumn isNewDataGridViewCheckBoxColumn1;
private System.Windows.Forms.Button Reset;
}
}

11
GitUI/Commit.cs

@ -123,5 +123,16 @@ namespace GitUI
Initialize();
}
private void Reset_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure you want to reset all changes in the working dir?\nAll changes made to all files in the workin dir will be overwritten by the files from the current HEAD!", "WARNING!", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (MessageBox.Show("Are you really sure you want to DELETE all changes?", "WARNING! WARNING!", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
OutPut.Text = GitCommands.GitCommands.Reset();
}
}
}
}
}

148
GitUI/FormPull.Designer.cs

@ -0,0 +1,148 @@
namespace GitUI
{
partial class FormPull
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormPull));
this.label1 = new System.Windows.Forms.Label();
this.PullSource = new System.Windows.Forms.TextBox();
this.BrowseSource = new System.Windows.Forms.Button();
this.Branches = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.Pull = new System.Windows.Forms.Button();
this.Mergetool = new System.Windows.Forms.Button();
this.Output = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Source";
//
// PullSource
//
this.PullSource.Location = new System.Drawing.Point(105, 10);
this.PullSource.Name = "PullSource";
this.PullSource.Size = new System.Drawing.Size(345, 20);
this.PullSource.TabIndex = 3;
this.PullSource.TextChanged += new System.EventHandler(this.PullSource_TextChanged);
//
// BrowseSource
//
this.BrowseSource.Location = new System.Drawing.Point(457, 7);
this.BrowseSource.Name = "BrowseSource";
this.BrowseSource.Size = new System.Drawing.Size(104, 23);
this.BrowseSource.TabIndex = 4;
this.BrowseSource.Text = "Browse";
this.BrowseSource.UseVisualStyleBackColor = true;
this.BrowseSource.Click += new System.EventHandler(this.BrowseSource_Click);
//
// Branches
//
this.Branches.FormattingEnabled = true;
this.Branches.Location = new System.Drawing.Point(105, 37);
this.Branches.Name = "Branches";
this.Branches.Size = new System.Drawing.Size(345, 21);
this.Branches.TabIndex = 5;
this.Branches.DropDown += new System.EventHandler(this.Branches_DropDown);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 13);
this.label2.TabIndex = 6;
this.label2.Text = "Remote branch";
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// Pull
//
this.Pull.Location = new System.Drawing.Point(459, 35);
this.Pull.Name = "Pull";
this.Pull.Size = new System.Drawing.Size(102, 23);
this.Pull.TabIndex = 7;
this.Pull.Text = "Pull";
this.Pull.UseVisualStyleBackColor = true;
this.Pull.Click += new System.EventHandler(this.Pull_Click);
//
// Mergetool
//
this.Mergetool.Location = new System.Drawing.Point(457, 73);
this.Mergetool.Name = "Mergetool";
this.Mergetool.Size = new System.Drawing.Size(104, 23);
this.Mergetool.TabIndex = 11;
this.Mergetool.Text = "Solve conflicts";
this.Mergetool.UseVisualStyleBackColor = true;
this.Mergetool.Click += new System.EventHandler(this.Mergetool_Click);
//
// Output
//
this.Output.Location = new System.Drawing.Point(8, 73);
this.Output.Name = "Output";
this.Output.Size = new System.Drawing.Size(442, 185);
this.Output.TabIndex = 10;
this.Output.Text = "";
//
// FormPull
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(568, 274);
this.Controls.Add(this.Mergetool);
this.Controls.Add(this.Output);
this.Controls.Add(this.Pull);
this.Controls.Add(this.label2);
this.Controls.Add(this.Branches);
this.Controls.Add(this.BrowseSource);
this.Controls.Add(this.PullSource);
this.Controls.Add(this.label1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FormPull";
this.Text = "Pull";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox PullSource;
private System.Windows.Forms.Button BrowseSource;
private System.Windows.Forms.ComboBox Branches;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button Pull;
private System.Windows.Forms.Button Mergetool;
private System.Windows.Forms.RichTextBox Output;
}
}

82
GitUI/FormPull.cs

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GitUI
{
public partial class FormPull : Form
{
public FormPull()
{
InitializeComponent();
}
private void BrowseSource_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog() == DialogResult.OK)
PullSource.Text = dialog.SelectedPath;
}
private void label2_Click(object sender, EventArgs e)
{
}
private void Mergetool_Click(object sender, EventArgs e)
{
GitCommands.GitCommands.RunRealCmd(GitCommands.Settings.GitDir + "git.exe", "mergetool --tool=kdiff3");
if (MessageBox.Show("Resolved all conflicts? Commit?", "Conflicts solved", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
//Output.Text += "\n";
FormCommit form = new FormCommit();
form.ShowDialog();
}
}
private void PullSource_TextChanged(object sender, EventArgs e)
{
Branches.DataSource = null;
}
private void Branches_DropDown(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(PullSource.Text))
{
Branches.DataSource = null;
return;
}
string realWorkingDir = GitCommands.Settings.WorkingDir;
try
{
GitCommands.Settings.WorkingDir = PullSource.Text;
Branches.DisplayMember = "Name";
Branches.DataSource = GitCommands.GitCommands.GetHeads(false);
}
finally
{
GitCommands.Settings.WorkingDir = realWorkingDir;
}
}
private void Pull_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(PullSource.Text))
{
MessageBox.Show("Please select a source directory");
return;
}
Output.Text = GitCommands.GitCommands.Pull(PullSource.Text, Branches.SelectedText);
}
}
}

1583
GitUI/FormPull.resx
File diff suppressed because it is too large
View File

107
GitUI/FormPush.Designer.cs

@ -0,0 +1,107 @@
namespace GitUI
{
partial class FormPush
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Output = new System.Windows.Forms.RichTextBox();
this.BrowseSource = new System.Windows.Forms.Button();
this.PushDestination = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.Push = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// Output
//
this.Output.Location = new System.Drawing.Point(22, 46);
this.Output.Name = "Output";
this.Output.Size = new System.Drawing.Size(562, 222);
this.Output.TabIndex = 14;
this.Output.Text = "";
//
// BrowseSource
//
this.BrowseSource.Location = new System.Drawing.Point(372, 17);
this.BrowseSource.Name = "BrowseSource";
this.BrowseSource.Size = new System.Drawing.Size(104, 23);
this.BrowseSource.TabIndex = 13;
this.BrowseSource.Text = "Browse";
this.BrowseSource.UseVisualStyleBackColor = true;
this.BrowseSource.Click += new System.EventHandler(this.BrowseSource_Click);
//
// PushDestination
//
this.PushDestination.Location = new System.Drawing.Point(119, 20);
this.PushDestination.Name = "PushDestination";
this.PushDestination.Size = new System.Drawing.Size(247, 20);
this.PushDestination.TabIndex = 12;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(27, 23);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 11;
this.label1.Text = "Destination";
//
// Push
//
this.Push.Location = new System.Drawing.Point(482, 17);
this.Push.Name = "Push";
this.Push.Size = new System.Drawing.Size(104, 23);
this.Push.TabIndex = 15;
this.Push.Text = "Push";
this.Push.UseVisualStyleBackColor = true;
this.Push.Click += new System.EventHandler(this.Push_Click);
//
// FormPush
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(596, 285);
this.Controls.Add(this.Push);
this.Controls.Add(this.Output);
this.Controls.Add(this.BrowseSource);
this.Controls.Add(this.PushDestination);
this.Controls.Add(this.label1);
this.Name = "FormPush";
this.Text = "FormPush";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RichTextBox Output;
private System.Windows.Forms.Button BrowseSource;
private System.Windows.Forms.TextBox PushDestination;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button Push;
}
}

38
GitUI/FormPush.cs

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GitUI
{
public partial class FormPush : Form
{
public FormPush()
{
InitializeComponent();
}
private void BrowseSource_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog() == DialogResult.OK)
PushDestination.Text = dialog.SelectedPath;
}
private void Push_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(PushDestination.Text))
{
MessageBox.Show("Please select a destination directory");
return;
}
Output.Text = GitCommands.GitCommands.Push(PushDestination.Text);
}
}
}

120
GitUI/FormPush.resx

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

18
GitUI/GitUI.csproj

@ -115,6 +115,18 @@
<Compile Include="FormFileHistory.Designer.cs">
<DependentUpon>FormFileHistory.cs</DependentUpon>
</Compile>
<Compile Include="FormPull.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormPull.Designer.cs">
<DependentUpon>FormPull.cs</DependentUpon>
</Compile>
<Compile Include="FormPush.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormPush.Designer.cs">
<DependentUpon>FormPush.cs</DependentUpon>
</Compile>
<Compile Include="FormSettigns.cs">
<SubType>Form</SubType>
</Compile>
@ -160,6 +172,12 @@
<EmbeddedResource Include="FormFileHistory.resx">
<DependentUpon>FormFileHistory.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormPull.resx">
<DependentUpon>FormPull.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormPush.resx">
<DependentUpon>FormPush.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormSettigns.resx">
<DependentUpon>FormSettigns.cs</DependentUpon>
</EmbeddedResource>

2
GitUI/MergePatch.Designer.cs

@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MergePatch));
this.BrowsePatch = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.PatchFile = new System.Windows.Forms.TextBox();
@ -150,6 +151,7 @@
this.Controls.Add(this.PatchFile);
this.Controls.Add(this.label1);
this.Controls.Add(this.BrowsePatch);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MergePatch";
this.Text = "Apply patch";
this.Load += new System.EventHandler(this.MergePatch_Load);

8
GitUI/MergePatch.cs

@ -74,6 +74,12 @@ namespace GitUI
private void Apply_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(PatchFile.Text))
{
MessageBox.Show("Please select a patch file");
return;
}
string result = GitCommands.GitCommands.Patch(PatchFile.Text);
Output.Text = result;
if (result.Contains("Patch failed"))
@ -118,7 +124,7 @@ namespace GitUI
private void AddFiles_Click(object sender, EventArgs e)
{
FormAddFiles form = new FormAddFiles();
form.Show();
form.ShowDialog();
}
private void MergePatch_Load(object sender, EventArgs e)

1463
GitUI/MergePatch.resx
File diff suppressed because it is too large
View File

1411
Setup/Setup.vdproj
File diff suppressed because it is too large
View File

Loading…
Cancel
Save