Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eff1bff375 | ||
|
|
d8a47b7cd3 | ||
|
|
95ce2792d9 | ||
|
|
325e7a30f5 | ||
|
|
9f95e918f7 |
+1
-1
@@ -1 +1 @@
|
|||||||
1.0.83
|
1.0.86
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("JiraTimeBot")]
|
[assembly: AssemblyTitle("JiraTimeBot")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("JiraTimeBot")]
|
[assembly: AssemblyProduct("JiraTimeBot")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")]
|
[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")]
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("1.0.83")]
|
[assembly: AssemblyVersion("1.0.86")]
|
||||||
[assembly: AssemblyFileVersion("1.0.83")]
|
[assembly: AssemblyFileVersion("1.0.86")]
|
||||||
[assembly: AssemblyInformationalVersion("1.0.83")]
|
[assembly: AssemblyInformationalVersion("1.0.86")]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace JiraTimeBot.RepositoryProviders
|
namespace JiraTimeBot.RepositoryProviders
|
||||||
@@ -35,7 +36,7 @@ namespace JiraTimeBot.RepositoryProviders
|
|||||||
date = date.GetValueOrDefault(DateTime.Now.Date);
|
date = date.GetValueOrDefault(DateTime.Now.Date);
|
||||||
|
|
||||||
var workTasks = new List<TaskTimeItem>();
|
var workTasks = new List<TaskTimeItem>();
|
||||||
foreach (var repoDirectory in Directory.GetDirectories(settings.RepositoryPath))
|
foreach (var repoDirectory in Directory.GetDirectories(settings.RepositoryPath, ".git", SearchOption.AllDirectories))
|
||||||
{
|
{
|
||||||
if (cancellationToken.IsCancellationRequested)
|
if (cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
@@ -43,16 +44,15 @@ namespace JiraTimeBot.RepositoryProviders
|
|||||||
}
|
}
|
||||||
|
|
||||||
//var project = new DirectoryInfo(repoDirectory).Name;
|
//var project = new DirectoryInfo(repoDirectory).Name;
|
||||||
if (!Directory.Exists(Path.Combine(repoDirectory, ".git")))
|
var repoRootDirectory = repoDirectory.Replace(".git", "");
|
||||||
|
var directoryInfo = new DirectoryInfo(repoRootDirectory);
|
||||||
|
if (!directoryInfo.Exists)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var directoryInfo = new DirectoryInfo(repoDirectory);
|
|
||||||
|
|
||||||
|
|
||||||
var repo = new LibGit2Sharp.Repository(repoDirectory);
|
|
||||||
|
|
||||||
|
var repo = new LibGit2Sharp.Repository(repoRootDirectory);
|
||||||
if (settings.PullBeforeProcess)
|
if (settings.PullBeforeProcess)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -78,7 +78,11 @@ namespace JiraTimeBot.RepositoryProviders
|
|||||||
var reflog = repo.Refs.Log(repo.Refs.Head);
|
var reflog = repo.Refs.Log(repo.Refs.Head);
|
||||||
foreach (var reflogItem in reflog)
|
foreach (var reflogItem in reflog)
|
||||||
{
|
{
|
||||||
if (reflogItem.Committer.When.Date != date.Value.Date || reflogItem.Committer.Email != settings.MercurialAuthorEmail)
|
|
||||||
|
var dateMatch = date.Value.Date == reflogItem.Committer.When.Date;
|
||||||
|
var userMatch = reflogItem.Committer.Email.Equals(settings.MercurialAuthorEmail, StringComparison.CurrentCultureIgnoreCase);
|
||||||
|
|
||||||
|
if (!dateMatch || !userMatch)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -101,13 +105,20 @@ namespace JiraTimeBot.RepositoryProviders
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var branch = ListBranchesContaininingCommit(repo, commit.Sha).Select(f => f.FriendlyName)
|
var regex = new Regex("[a-zA-Z]{1,4}-[0-9]{1,6}");
|
||||||
.Where(f => f.Contains("-") && !f.Contains("/")).Distinct().FirstOrDefault();
|
var branch = ListBranchesContaininingCommit(repo, commit.Sha)
|
||||||
|
.Select(f => f.FriendlyName)
|
||||||
|
.FirstOrDefault(f => regex.IsMatch(f));
|
||||||
|
|
||||||
|
|
||||||
|
//.Where(f => f.Contains("-") && !f.Contains("/")).Distinct().FirstOrDefault();
|
||||||
if (branch == null)
|
if (branch == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
branch = regex.Match(branch).Value;
|
||||||
|
|
||||||
var commitMessage = commit.MessageShort;
|
var commitMessage = commit.MessageShort;
|
||||||
commitMessage = _technicalInfoSkipper.StripBranchPrefix(branch, commitMessage);
|
commitMessage = _technicalInfoSkipper.StripBranchPrefix(branch, commitMessage);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user