An open API service indexing awesome lists of open source software.

https://github.com/hxhb/gitcontrollerue


https://github.com/hxhb/gitcontrollerue

git unreal-engine

Last synced: 7 days ago
JSON representation

Awesome Lists containing this project

README

        

## What is this?

This is an Unreal Engine 4 Plugin that you can operator Git Repository. Support C++ and Blueprint.

![](https://imgs.imzlp.com/imgs/zlp/blog/notes/ue/index/UE4/git-diff-in-ue4-no-runtime.png)

## How do use?

Wrapper Interface:

```cpp
UCLASS()
class GITSOURCECONTROLEX_API UFlibSourceControlHelper : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "GitSourceControlEx|Flib")
static FString GetGitBinary();

UFUNCTION(BlueprintCallable, Category = "GitSourceControlEx|Flib")
static bool RunGitCommandWithFiles(const FString& InCommand, const FString& InPathToGitBinary, const FString& InRepositoryRoot, const TArray& InParameters, const TArray& InFiles, TArray& OutResults, TArray& OutErrorMessages);
UFUNCTION(BlueprintCallable, Category = "GitSourceControlEx|Flib")
static bool RunGitCommand(const FString& InCommand, const FString& InPathToGitBinary, const FString& InRepositoryRoot, const TArray& InParameters, TArray& OutResults, TArray& OutErrorMessages);

UFUNCTION(BlueprintCallable, Category = "GitSourceControlEx|Flib")
static bool DiffVersion(const FString& InGitBinaey, const FString& InRepoRoot, const FString& InBeginCommitHash, const FString& InEndCommitHash, TArray& OutResault, TArray& OutErrorMessages);
UFUNCTION(BlueprintCallable, Category = "GitSourceControlEx|Flib")
static bool GitLog(const FString& InGitBinaey, const FString& InRepoRoot, TArray& OutCommitInfo);

UFUNCTION(BlueprintCallable, Category = "GitSourceControlEx|Flib")
static bool GetBranchName(const FString& InPathToGitBinary, const FString& InRepositoryRoot, FString& OutBranchName);
UFUNCTION(BlueprintCallable, Category = "GitSourceControlEx|Flib")
static bool GetRemoteUrl(const FString& InPathToGitBinary, const FString& InRepositoryRoot, FString& OutRemoteUrl);

/**
* Run a Git "log" command and parse it.
*
* @param InPathToGitBinary The path to the Git binary
* @param InRepositoryRoot The Git repository from where to run the command - usually the Game directory
* @param InFile The file to be operated on
* @param bMergeConflict In case of a merge conflict, we also need to get the tip of the "remote branch" (MERGE_HEAD) before the log of the "current branch" (HEAD)
* @param OutErrorMessages Any errors (from StdErr) as an array per-line
* @param OutHistory The history of the file
* @param InHistoryDepth return history depth default is MAX_Int32
*/
UFUNCTION(BlueprintCallable,Category="GitSourceControlEx|Flib")
static bool RunGetHistory(const FString& InPathToGitBinary, const FString& InRepositoryRoot, const FString& InFile, bool bMergeConflict, TArray& OutErrorMessages, TArray& OutHistory,int32 InHistoryDepth);

UFUNCTION(BlueprintCallable, Category = "GitSourceControlEx|Flib")
static bool GetFileLastCommit(const FString& InPathToGitBinary, const FString& InRepositoryRoot, const FString& InFile, bool bMergeConflict, TArray& OutErrorMessages, FGitSourceControlRevisionData& OutHistory);

};
```