Skip to content

Commit

Permalink
Add a TODO about missing setting to configure the name of the origin
Browse files Browse the repository at this point in the history
  • Loading branch information
SRombauts committed May 11, 2020
1 parent 15877de commit 3cd6269
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
11 changes: 7 additions & 4 deletions Source/GitSourceControl/Private/GitSourceControlModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ Written and contributed by Sebastien Rombauts ([email protected])
- migrate an asset between two projects if both are using Git
- solve a merge conflict on a blueprint
- show current branch name in status text
- Sync to Pull (rebase) the current branch if there is no localy modified files
- Sync to Pull (rebase) the current branch
- Git LFS (Github, Gitlab, Bitbucket) is working with Git 2.10+ under Windows
- Git LFS 2 File Locking is working with Git 2.10+ and Git LFS 2.0.0
- Windows, Mac and Linux
### TODO
1. configure the name of the remote instead of default "origin"
### TODO LFS 2.x File Locking
Known issues:
Expand All @@ -51,7 +54,7 @@ Use "TODO LFS" in the code to track things left to do/improve/refactor:
is not working after Git LFS 2 has switched "read-only" flag on files (which needs the Checkout operation to be editable)!
- temporarily deactivating locks may be required if we want to be able to work while not connected (do we really need this ???)
- does Git LFS have a command to do this deactivation ?
- perhaps should we rely on detection of such flags to detect LFS 2 usage (ie the need to do a checkout)
- perhaps should we rely on detection of such flags to detect LFS 2 usage (ie. the need to do a checkout)
- see SubversionSourceControl plugin that deals with such flags
- this would need a rework of the way the "bIsUsingFileLocking" si propagated, since this would no more be a configuration (or not only) but a file state
- else we should at least revert those read-only flags when going out of "Lock mode"
Expand All @@ -64,9 +67,9 @@ Use "TODO LFS" in the code to track things left to do/improve/refactor:
- Configure user name & email ('git config user.name' & git config user.email')
### Known issues
- the Editor does not show deleted files (only when deleted externaly?)
- the Editor does not show deleted files (only when deleted externally?)
- the Editor does not show missing files
- missing localisation for git specific messages
- missing localization for git specific messages
- displaying states of 'Engine' assets (also needs management of 'out of tree' files)
- renaming a Blueprint in Editor leaves a redirector file, AND modify too much the asset to enable git to track its history through renaming
- standard Editor commit dialog asks if user wants to "Keep Files Checked Out" => no use for Git or Mercurial CanCheckOut()==false
Expand Down
11 changes: 9 additions & 2 deletions Source/GitSourceControl/Private/GitSourceControlOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ FName FGitPush::GetName() const

FText FGitPush::GetInProgressString() const
{
// TODO Configure origin
return LOCTEXT("SourceControl_Push", "Pushing local commits to remote origin...");
}

Expand Down Expand Up @@ -187,7 +188,11 @@ bool FGitCheckInWorker::Execute(FGitSourceControlCommand& InCommand)
// git-lfs: push and unlock files
if(InCommand.bUsingGitLfsLocking && InCommand.bCommandSuccessful)
{
InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(TEXT("push origin HEAD"), InCommand.PathToGitBinary, InCommand.PathToRepositoryRoot, TArray<FString>(), TArray<FString>(), InCommand.InfoMessages, InCommand.ErrorMessages);
TArray<FString> Parameters2;
// TODO Configure origin
Parameters2.Add(TEXT("origin"));
Parameters2.Add(TEXT("HEAD"));
InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(TEXT("push"), InCommand.PathToGitBinary, InCommand.PathToRepositoryRoot, Parameters2, TArray<FString>(), InCommand.InfoMessages, InCommand.ErrorMessages);
if(InCommand.bCommandSuccessful)
{
// unlock files: execute the LFS command on relative filenames
Expand Down Expand Up @@ -379,9 +384,10 @@ FName FGitSyncWorker::GetName() const
bool FGitSyncWorker::Execute(FGitSourceControlCommand& InCommand)
{
// pull the branch to get remote changes by rebasing any local commits (not merging them to avoid complex graphs)
// (this cannot work if any local files are modified but not commited)
TArray<FString> Parameters;
Parameters.Add(TEXT("--rebase"));
Parameters.Add(TEXT("--autostash"));
// TODO Configure origin
Parameters.Add(TEXT("origin"));
Parameters.Add(TEXT("HEAD"));
InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(TEXT("pull"), InCommand.PathToGitBinary, InCommand.PathToRepositoryRoot, Parameters, TArray<FString>(), InCommand.InfoMessages, InCommand.ErrorMessages);
Expand Down Expand Up @@ -410,6 +416,7 @@ bool FGitPushWorker::Execute(FGitSourceControlCommand& InCommand)
// (works only if the default remote "origin" is set and does not require authentication)
TArray<FString> Parameters;
Parameters.Add(TEXT("--set-upstream"));
// TODO Configure origin
Parameters.Add(TEXT("origin"));
Parameters.Add(TEXT("HEAD"));
InCommand.bCommandSuccessful = GitSourceControlUtils::RunCommand(TEXT("push"), InCommand.PathToGitBinary, InCommand.PathToRepositoryRoot, Parameters, TArray<FString>(), InCommand.InfoMessages, InCommand.ErrorMessages);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ void SGitSourceControlSettings::Construct(const FArguments& InArgs)
]
]
// Option to configure the URL of the default remote 'origin'
// TODO: option to configure the name of the remote instead of the default origin
+SVerticalBox::Slot()
.AutoHeight()
.Padding(2.0f)
Expand Down

0 comments on commit 3cd6269

Please sign in to comment.