-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Samir L. Boulema
committed
Jul 29, 2021
1 parent
41c8e7f
commit 6746a97
Showing
79 changed files
with
1,729 additions
and
1,953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[*.cs] | ||
|
||
# VSTHRD200: Use "Async" suffix for async methods | ||
dotnet_diagnostic.VSTHRD200.severity = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.AddContext)] | ||
internal sealed class AddFileCommand : BaseCommand<AddFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "add"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.BlameContext)] | ||
internal sealed class BlameFileCommand : BaseCommand<BlameFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "blame", $"/line:{await FileHelper.GetActiveDocumentCurrentLine()}"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using EnvDTE; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.CommitContext)] | ||
internal sealed class CommitFileCommand : BaseCommand<CommitFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
var options = (OptionPageGrid)Package.GetDialogPage(typeof(OptionPageGrid)); | ||
var commitMessage = await GitHelper.GetCommitMessage(options.CommitMessage); | ||
var bugId = await GitHelper.GetCommitMessage(options.BugId); | ||
var gitConfig = await GitHelper.GetGitConfig(); | ||
|
||
var args = $"{(string.IsNullOrEmpty(commitMessage) ? string.Empty : $"/logmsg:\"{commitMessage}\"")} " + | ||
$"{(!string.IsNullOrEmpty(bugId) && !string.IsNullOrEmpty(gitConfig.BugTraqMessage) ? $"/bugid:\"{bugId}\"" : string.Empty)}"; | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "commit", args); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.DeleteContext)] | ||
internal sealed class DeleteFileCommand : BaseCommand<DeleteFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "remove"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.DeleteKeepContext)] | ||
internal sealed class DeleteKeepFileCommand : BaseCommand<DeleteKeepFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "remove", "/keep"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.DiffContext)] | ||
internal sealed class DiffFileCommand : BaseCommand<DiffFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "diff"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.DiskBrowserContext)] | ||
internal sealed class DiskBrowserFileCommand : BaseCommand<DiskBrowserFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
ProcessHelper.Start(await FileHelper.GetActiveDocumentFilePath()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.FetchContext)] | ||
internal sealed class FetchFileCommand : BaseCommand<FetchFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "fetch"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.MergeContext)] | ||
internal sealed class MergeFileCommand : BaseCommand<MergeFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "merge"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using System.IO; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.PrefDiffContext)] | ||
internal sealed class PrefDiffFileCommand : BaseCommand<PrefDiffFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
var filePath = await FileHelper.GetActiveDocumentFilePath(); | ||
var exactFilePath = FileHelper.GetExactFileName(filePath); | ||
|
||
var revisions = await ProcessHelper.GitResult(Path.GetDirectoryName(filePath), $"log -2 --pretty=format:%h {exactFilePath}"); | ||
|
||
if (!revisions.Contains(",")) | ||
{ | ||
await VS.MessageBox.ShowErrorAsync("Could not determine the last committed revision!"); | ||
return; | ||
} | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "diff", $"/startrev:{revisions.Split(',')[0]} /endrev:{revisions.Split(',')[1]}", exactFilePath); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.PullContext)] | ||
internal sealed class PullFileCommand : BaseCommand<PullFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "pull"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.RepoBrowserContext)] | ||
internal sealed class RepoBrowserFileCommand : BaseCommand<RepoBrowserFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "repobrowser"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.RevGraphContext)] | ||
internal sealed class RevGraphFileCommand : BaseCommand<RevGraphFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "revisiongraph"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using System.ComponentModel.Design; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.RevertContext)] | ||
internal sealed class RevertFileCommand : BaseCommand<RevertFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await KnownCommands.File_SaveSelectedItems.ExecuteAsync(); | ||
|
||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "revert"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Community.VisualStudio.Toolkit; | ||
using Microsoft.VisualStudio.Shell; | ||
using SamirBoulema.TGit.Helpers; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace SamirBoulema.TGit.Commands | ||
{ | ||
[Command(GuidList.GuidTgitCmdSetString, PkgCmdIDList.ShowLogContext)] | ||
internal sealed class ShowLogFileCommand : BaseCommand<ShowLogFileCommand> | ||
{ | ||
protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) | ||
{ | ||
await ProcessHelper.RunTortoiseGitFileCommand(Package, "log"); | ||
} | ||
} | ||
} |
Oops, something went wrong.