Skip to content

Commit 84f99e7

Browse files
committed
Merge branch 'master' into release/1.1
2 parents a6b4645 + 1f0b169 commit 84f99e7

File tree

8 files changed

+56
-55
lines changed

8 files changed

+56
-55
lines changed

README.md

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
# GitExtensions Plugin Template
2-
An example/empty repository for building a GitExtensions plugin that can be installed using [GitExtensions.PluginManager](https://github.com/gitextensions/gitextensions.pluginmanager).
3-
4-
The package is going to be published on [NuGet.org](https://www.nuget.org/packages/GitExtensions.PluginTemplate) feed.
5-
6-
## Files to keep an eye on
7-
- [Plugin.cs](src/GitExtensions.PluginTemplate/Plugin.cs)
8-
- [GitExtensions.PluginTemplate.csproj](src/GitExtensions.PluginTemplate/GitExtensions.PluginTemplate.csproj)
9-
- [GitExtensions.PluginTemplate.nuspec](src/GitExtensions.PluginTemplate/GitExtensions.PluginTemplate.nuspec)
10-
11-
### Nuspec
12-
- Place all content under lib folder. Custom nested folders are supported and path is preserved.
13-
- Add dependency on "virtual" package GitExtensions.Extensibility and target version `[3.0,3.1)` *.
14-
- Real package dependencies are not supported, so everything should be packed with the plugin.
15-
- Keep in mind that sharing common libraries can be cumbersome as these must match across all plugins and also Git Extensions itself. So my current recommendation is not to do so.
16-
17-
_* This is just my own eperience. Git Extensions follow SemVer, but it's public plugin API is not so rich that sometimes you need to kind a hack it using APIs that are not ment to be public. For these reasons its better to check compatibility with every single feature update._
18-
19-
### Csproj
20-
21-
- I'm using powershell script to download a selected version of Git Extensions from GitHub releases. This script runs before every build and checks if Git Extensions binaries are donwloaded.
22-
- CSproj references selected binaries from the downloaded Git Extensions.
23-
- After build a newly created binaries of the plugin is copied to Git Extensions plugins directory.
24-
- F5 is setup to start downloaded `GitExtensions.exe` for easy debugging.
25-
26-
### Plugin.cs
27-
- Nothing special, but ordinary Git Extensions plugin :-)
28-
29-
## Icons
30-
31-
Some icons by Yusuke [Kamiyamane](http://p.yusukekamiyamane.com).
1+
2+
# GitExtensions.GerritPlugin
3+
4+
GitExtensions.GerritPlugin is a plugin for GitExtensions to work with a [Gerrit](https://www.gerritcodereview.com/) as Git server.
5+
6+
## Features
7+
8+
* Gerrit hook installation
9+
* Patchset publish
10+
* Patchset download
11+
12+
## Usage
13+
14+
The cloned repository requires a `.gitreview` file, which is in use for the plugin to identify the gerrit server.
15+
This file must be located in root foilder of the repository.
16+
Get more information about this file [here](https://docs.openstack.org/infra/git-review/installation.html#gitreview-file-format)
17+
18+
## GitExtensions Plugin Template infomration
19+
20+
The [GitExtensions Plugin Template](https://github.com/gitextensions/gitextensions.plugintemplate) gives additional information about the pluign development.

contributors.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,5 @@ YYYY/MM/DD, github id, Full name, email
112112
2019/12/25, dfev77, Florin Daneliuc, [email protected]
113113
2020/01/02, c3er, Christian Dreier, flipper.x3r(at)googlemail.com
114114
2020/01/04, MarkJ74, Mark Jackson, markj74(at)outlook.com
115-
2020/01/07, asherber, Aaron Sherber, aaron(at)sherber.com
115+
2020/01/07, asherber, Aaron Sherber, aaron(at)sherber.com
116+
2021/01/17, thimmy687, Ricardo Krause, [email protected]

src/GitExtensions.GerritPlugin/FormGerritDownload.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Threading.Tasks;
55
using System.Windows.Forms;
66
using GitCommands;
7+
using GitCommands.Git.Commands;
78
using GitUI;
89
using GitUIPluginInterfaces;
910
using Newtonsoft.Json.Linq;
@@ -126,7 +127,7 @@ private async Task<bool> DownloadChangeAsync(IWin32Window owner)
126127
return;
127128
}
128129

129-
e.IsError = false;
130+
e = new GitRemoteCommandCompletedEventArgs(e.Command, false, e.Handled);
130131
}
131132
}
132133
};
@@ -223,7 +224,7 @@ private void FormGerritDownloadLoad(object sender, EventArgs e)
223224

224225
private void AddRemoteClick(object sender, EventArgs e)
225226
{
226-
UICommands.StartRemotesDialog();
227+
UICommands.StartRemotesDialog(this);
227228
_NO_TRANSLATE_Remotes.DataSource = Module.GetRemoteNames();
228229
}
229230
}

src/GitExtensions.GerritPlugin/FormGerritPublish.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Diagnostics;
43
using System.Linq;
54
using System.Windows.Forms;
65
using GitExtensions.GerritPlugin.Server;
@@ -194,7 +193,7 @@ private void FormGerritPublishLoad(object sender, EventArgs e)
194193

195194
private void AddRemoteClick(object sender, EventArgs e)
196195
{
197-
UICommands.StartRemotesDialog();
196+
UICommands.StartRemotesDialog(this);
198197
_NO_TRANSLATE_Remotes.DataSource = Module.GetRemoteNames();
199198
}
200199
}

src/GitExtensions.GerritPlugin/FormGitReview.Designer.cs

Lines changed: 11 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GitExtensions.GerritPlugin/FormGitReview.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ public sealed partial class FormGitReview : GitExtensionsForm, IGitUICommandsSou
2626
private readonly TranslationString _saveFileQuestionCaption =
2727
new TranslationString("Save changes?");
2828

29+
private readonly TranslationString _description = new TranslationString(@$"Example configuration
30+
31+
[gerrit]
32+
host=review.example.com
33+
port=29418
34+
project=department/project.git
35+
defaultbranch=master
36+
defaultremote=review
37+
defaultrebase=0");
38+
2939
private string _originalGitReviewFileContent = string.Empty;
3040
private IGitModule Module => UICommands.GitModule;
3141

@@ -47,6 +57,7 @@ public FormGitReview(IGitUICommands uiCommands)
4757
: base(true)
4858
{
4959
InitializeComponent();
60+
label1.Text = _description.Text;
5061
InitializeComplete();
5162

5263
UICommands = (GitUICommands)uiCommands;
@@ -158,4 +169,4 @@ private void lnkGitReviewPatterns_LinkClicked(object sender, LinkLabelLinkClicke
158169
Process.Start(@"https://github.com/openstack-infra/git-review#git-review");
159170
}
160171
}
161-
}
172+
}

src/GitExtensions.GerritPlugin/GerritPlugin.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public class GerritPlugin : GitPluginBase, IGitPluginForRepository
5252
// public only because of FormTranslate
5353
public GerritPlugin() : base(true)
5454
{
55-
SetNameAndDescription("Gerrit Code Review");
55+
Id = new Guid("98AC833D-21F0-4FD7-8A0F-5616E093FC59");
56+
Name = "Gerrit Code Review";
5657
Translate();
5758
Icon = Resources.IconGerrit;
5859
}
@@ -154,8 +155,8 @@ private void Initialize(Form form)
154155

155156
// Find the controls we're going to extend.
156157

157-
var menuStrip = form.FindDescendantOfType<MenuStrip>(p => p.Name == "menuStrip1");
158-
var toolStrip = form.FindDescendantOfType<ToolStrip>(p => p.Name == "ToolStrip");
158+
var menuStrip = form.FindDescendantOfType<MenuStrip>(p => p.Name == "mainMenuStrip");
159+
var toolStrip = form.FindDescendantOfType<ToolStrip>(p => p.Name == "ToolStripMain");
159160

160161
if (menuStrip == null)
161162
{

src/GitExtensions.GerritPlugin/GerritUtil.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static async Task<string> RunGerritCommandAsync([NotNull] IWin32Window ow
6868

6969
StartAgent(owner, module, remote);
7070

71-
var sshCmd = GitCommandHelpers.Plink()
71+
var sshCmd = GitSshHelpers.Plink()
7272
? AppSettings.Plink
7373
: SshPathLocatorInstance.Find(AppSettings.GitBinDir);
7474

@@ -79,7 +79,7 @@ public static async Task<string> RunGerritCommandAsync([NotNull] IWin32Window ow
7979

8080
string hostname = fetchUrl.Host;
8181
string username = fetchUrl.UserInfo;
82-
string portFlag = GitCommandHelpers.Plink() ? " -P " : " -p ";
82+
string portFlag = GitSshHelpers.Plink() ? " -P " : " -p ";
8383
int port = fetchUrl.Port;
8484

8585
if (port == -1 && fetchUrl.Scheme == "ssh")
@@ -127,7 +127,7 @@ public static void StartAgent([NotNull] IWin32Window owner, [NotNull] IGitModule
127127
throw new ArgumentNullException(nameof(remote));
128128
}
129129

130-
if (GitCommandHelpers.Plink())
130+
if (GitSshHelpers.Plink())
131131
{
132132
if (!File.Exists(AppSettings.Pageant))
133133
{

0 commit comments

Comments
 (0)