Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit b0d59da

Browse files
Merge remote-tracking branch 'remotes/origin/master' into features/octorun-js
# Conflicts: # src/GitHub.Api/Application/ApplicationManagerBase.cs
2 parents 6a96354 + d416f7e commit b0d59da

40 files changed

+821
-546
lines changed

docs/process/roadmap.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# The roadmap
2+
3+
## The road to 1.0
4+
5+
### 1.0-RC ETA
6+
7+
March 2018
8+
9+
### 1.0 ETA
10+
11+
May 2018
12+
13+
### Feature list
14+
15+
- Windows and Mac support
16+
- Unity 5.4 and above
17+
- Initialize new repository in existing project
18+
- Configure yaml merge tool
19+
- Configure project serialization for source control
20+
- Configure git and lfs
21+
- Publish to GitHub
22+
- Authentication
23+
- Login with user/password and 2FA if needed
24+
- Invoked when doing git operations
25+
- https support
26+
- Local repository management
27+
- List changed files
28+
- Commit selectively
29+
- Discard file changes
30+
- Repository history and network operations
31+
- List of commits
32+
- Individual commit detail
33+
- Revert commit
34+
- List of local branches
35+
- List of remote branches
36+
- Create branch
37+
- Delete branch
38+
- Fetch
39+
- Push
40+
- Pull
41+
- File locking
42+
- Lock and unlock files
43+
- Visual locking indicators in file UIs
44+
- List locked files
45+
- Notification when file is locked by someone else
46+
- Git management
47+
- User and email configuration
48+
- Git remote configuration
49+
- Git installation path configuration
50+
- Misc
51+
- Notification of new releases

src/GitHub.Api/Application/ApplicationManagerBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void Run(bool firstRun)
5050
Logger.Trace("Using octorunScriptPath: {0}", octorunScriptPath);
5151

5252
var gitExecutablePath = SystemSettings.Get(Constants.GitInstallPathKey)?.ToNPath();
53-
if (gitExecutablePath != null && gitExecutablePath.FileExists()) // we have a git path
53+
if (gitExecutablePath != null && gitExecutablePath.Value.FileExists()) // we have a git path
5454
{
5555
Logger.Trace("Using git install path from settings: {0}", gitExecutablePath);
5656
InitializeEnvironment(gitExecutablePath, octorunScriptPath);
@@ -59,13 +59,13 @@ public void Run(bool firstRun)
5959
{
6060
Logger.Trace("No git path found in settings");
6161

62-
var initEnvironmentTask = new ActionTask<NPath>(CancellationToken, (b, path) => InitializeEnvironment(path, octorunScriptPath)) { Affinity = TaskAffinity.UI };
62+
var initEnvironmentTask = new ActionTask<NPath>(CancellationToken, (_, path) => InitializeEnvironment(path, octorunScriptPath)) { Affinity = TaskAffinity.UI };
6363
var findExecTask = new FindExecTask("git", CancellationToken)
6464
.FinallyInUI((b, ex, path) => {
6565
if (b && path != null)
6666
{
6767
Logger.Trace("FindExecTask Success: {0}", path);
68-
InitializeEnvironment(gitExecutablePath, octorunScriptPath);
68+
InitializeEnvironment(path, octorunScriptPath);
6969
}
7070
else
7171
{
@@ -74,7 +74,7 @@ public void Run(bool firstRun)
7474
}
7575
});
7676

77-
var installDetails = new GitInstallDetails(Environment.GetSpecialFolder(System.Environment.SpecialFolder.LocalApplicationData).ToNPath(), true);
77+
var installDetails = new GitInstallDetails(Environment.UserCachePath, true);
7878
var gitInstaller = new GitInstaller(Environment, CancellationToken, installDetails);
7979

8080
// if successful, continue with environment initialization, otherwise try to find an existing git installation
@@ -129,7 +129,7 @@ public void RestartRepository()
129129
{
130130
if (Environment.RepositoryPath != null)
131131
{
132-
repositoryManager = Unity.RepositoryManager.CreateInstance(Platform, TaskManager, GitClient, Environment.RepositoryPath);
132+
repositoryManager = Unity.RepositoryManager.CreateInstance(Platform, TaskManager, GitClient, ProcessManager, Environment.FileSystem, Environment.RepositoryPath);
133133
repositoryManager.Initialize();
134134
Environment.Repository.Initialize(repositoryManager);
135135
repositoryManager.Start();
@@ -201,7 +201,7 @@ private void InitializeEnvironment(NPath gitExecutablePath, NPath octorunScriptP
201201
}
202202
else
203203
{
204-
Logger.Warning("No Windows CredentialHeloper found: Setting to wincred");
204+
Logger.Warning("No Windows CredentialHelper found: Setting to wincred");
205205

206206
GitClient.SetConfig("credential.helper", "wincred", GitConfigSource.Global)
207207
.Then(afterGitSetup)

src/GitHub.Api/Events/RepositoryWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private int ProcessEvents(Event[] fileEvents)
169169
var eventDirectory = new NPath(fileEvent.Directory);
170170
var fileA = eventDirectory.Combine(fileEvent.FileA);
171171

172-
NPath fileB = null;
172+
NPath fileB;
173173
if (fileEvent.FileB != null)
174174
{
175175
fileB = eventDirectory.Combine(fileEvent.FileB);

src/GitHub.Api/Git/GitClient.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ ITask<string> Add(IList<string> files,
6969

7070
ITask<string> AddAll(IOutputProcessor<string> processor = null);
7171

72+
ITask<string> Discard(IList<string> files,
73+
IOutputProcessor<string> processor = null);
74+
75+
ITask<string> DiscardAll(IOutputProcessor<string> processor = null);
76+
7277
ITask<string> Remove(IList<string> files,
7378
IOutputProcessor<string> processor = null);
7479

@@ -365,6 +370,37 @@ public ITask<string> Add(IList<string> files,
365370
return last;
366371
}
367372

373+
public ITask<string> Discard( IList<string> files,
374+
IOutputProcessor<string> processor = null)
375+
{
376+
Logger.Trace("Checkout Files");
377+
378+
GitCheckoutTask last = null;
379+
foreach (var batch in files.Spool(5000))
380+
{
381+
var current = new GitCheckoutTask(batch, cancellationToken, processor).Configure(processManager);
382+
if (last == null)
383+
{
384+
last = current;
385+
}
386+
else
387+
{
388+
last.Then(current);
389+
last = current;
390+
}
391+
}
392+
393+
return last;
394+
}
395+
396+
public ITask<string> DiscardAll(IOutputProcessor<string> processor = null)
397+
{
398+
Logger.Trace("Checkout all files");
399+
400+
return new GitCheckoutTask(cancellationToken, processor)
401+
.Configure(processManager);
402+
}
403+
368404
public ITask<string> Remove(IList<string> files,
369405
IOutputProcessor<string> processor = null)
370406
{

src/GitHub.Api/Git/IRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace GitHub.Unity
55
{
66
/// <summary>
7-
/// Represents a repository, either local or retreived via the GitHub API.
7+
/// Represents a repository, either local or retrieved via the GitHub API.
88
/// </summary>
99
public interface IRepository : IEquatable<IRepository>
1010
{
@@ -18,7 +18,7 @@ public interface IRepository : IEquatable<IRepository>
1818
ITask Revert(string changeset);
1919
ITask RequestLock(string file);
2020
ITask ReleaseLock(string file, bool force);
21-
21+
ITask DiscardChanges(GitStatusEntry[] discardEntries);
2222
void CheckLogChangedEvent(CacheUpdateEvent gitLogCacheUpdateEvent);
2323
void CheckStatusChangedEvent(CacheUpdateEvent cacheUpdateEvent);
2424
void CheckStatusEntriesChangedEvent(CacheUpdateEvent cacheUpdateEvent);

src/GitHub.Api/Git/Repository.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ public ITask ReleaseLock(string file, bool force)
112112
return repositoryManager.UnlockFile(file, force);
113113
}
114114

115+
public ITask DiscardChanges(GitStatusEntry[] gitStatusEntry)
116+
{
117+
return repositoryManager.DiscardChanges(gitStatusEntry);
118+
}
119+
115120
public void CheckLogChangedEvent(CacheUpdateEvent cacheUpdateEvent)
116121
{
117122
var managedCache = cacheContainer.GitLogCache;
@@ -834,4 +839,4 @@ public string UpdatedTimeString
834839
private set { updatedTimeString = value; }
835840
}
836841
}
837-
}
842+
}

0 commit comments

Comments
 (0)