From 4d8a2bab4680a0ded9627115f59e3563c86a1a04 Mon Sep 17 00:00:00 2001 From: Oleg Kaspersky Date: Sun, 17 Nov 2024 04:09:47 +0100 Subject: [PATCH 1/3] Remove redundant API macros I assume that plugin classes aren't supposed to be used anywhere outside of this module since all dependencies are private in Build.cs file --- .../GitSourceControl/Public/GitSourceControlModule.h | 2 +- .../Public/GitSourceControlProvider.h | 4 ++-- .../Public/GitSourceControlSettings.h | 2 +- .../GitSourceControl/Public/GitSourceControlState.h | 2 +- .../GitSourceControl/Public/GitSourceControlUtils.h | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/GitSourceControl/Public/GitSourceControlModule.h b/Source/GitSourceControl/Public/GitSourceControlModule.h index c0fb390f..355d0331 100644 --- a/Source/GitSourceControl/Public/GitSourceControlModule.h +++ b/Source/GitSourceControl/Public/GitSourceControlModule.h @@ -103,7 +103,7 @@ class FGitSourceControlModule : public IModuleInterface return GitSourceControlProvider; } - GITSOURCECONTROL_API static const TArray< FString > & GetEmptyStringArray() + static const TArray< FString > & GetEmptyStringArray() { return EmptyStringArray; } diff --git a/Source/GitSourceControl/Public/GitSourceControlProvider.h b/Source/GitSourceControl/Public/GitSourceControlProvider.h index 30d1dca0..2e5dd823 100644 --- a/Source/GitSourceControl/Public/GitSourceControlProvider.h +++ b/Source/GitSourceControl/Public/GitSourceControlProvider.h @@ -18,7 +18,7 @@ class FGitSourceControlCommand; DECLARE_DELEGATE_RetVal(FGitSourceControlWorkerRef, FGetGitSourceControlWorker) -/// Git version and capabilites extracted from the string "git version 2.11.0.windows.3" +/// Git version and capabilities extracted from the string "git version 2.11.0.windows.3" struct FGitVersion { // Git version extracted from the string "git version 2.11.0.windows.3" (Windows), "git version 2.11.0" (Linux/Mac/Cygwin/WSL) or "git version 2.31.1.vfs.0.3" (Microsoft) @@ -43,7 +43,7 @@ struct FGitVersion } }; -class GITSOURCECONTROL_API FGitSourceControlProvider final : public ISourceControlProvider +class FGitSourceControlProvider final : public ISourceControlProvider { public: /* ISourceControlProvider implementation */ diff --git a/Source/GitSourceControl/Public/GitSourceControlSettings.h b/Source/GitSourceControl/Public/GitSourceControlSettings.h index 75718b9a..c0444146 100644 --- a/Source/GitSourceControl/Public/GitSourceControlSettings.h +++ b/Source/GitSourceControl/Public/GitSourceControlSettings.h @@ -8,7 +8,7 @@ #include "Containers/UnrealString.h" #include "HAL/CriticalSection.h" -class GITSOURCECONTROL_API FGitSourceControlSettings +class FGitSourceControlSettings { public: /** Get the Git Binary Path */ diff --git a/Source/GitSourceControl/Public/GitSourceControlState.h b/Source/GitSourceControl/Public/GitSourceControlState.h index 17f80fcf..9ed99c40 100644 --- a/Source/GitSourceControl/Public/GitSourceControlState.h +++ b/Source/GitSourceControl/Public/GitSourceControlState.h @@ -125,7 +125,7 @@ struct FGitState FString HeadBranch; }; -class GITSOURCECONTROL_API FGitSourceControlState : public ISourceControlState +class FGitSourceControlState : public ISourceControlState { public: explicit FGitSourceControlState(const FString &InLocalFilename) : diff --git a/Source/GitSourceControl/Public/GitSourceControlUtils.h b/Source/GitSourceControl/Public/GitSourceControlUtils.h index 30e21dc6..6b32a4b0 100644 --- a/Source/GitSourceControl/Public/GitSourceControlUtils.h +++ b/Source/GitSourceControl/Public/GitSourceControlUtils.h @@ -176,7 +176,7 @@ bool GetRemoteUrl(const FString& InPathToGitBinary, const FString& InRepositoryR * @param OutErrorMessages Any errors (from StdErr) as an array per-line * @returns true if the command succeeded and returned no errors */ -GITSOURCECONTROL_API bool RunCommand( const FString & InCommand, const FString & InPathToGitBinary, const FString & InRepositoryRoot, const TArray< FString > & InParameters, const TArray< FString > & InFiles, TArray< FString > & OutResults, TArray< FString > & OutErrorMessages ); +bool RunCommand( const FString & InCommand, const FString & InPathToGitBinary, const FString & InRepositoryRoot, const TArray< FString > & InParameters, const TArray< FString > & InFiles, TArray< FString > & OutResults, TArray< FString > & OutErrorMessages ); bool RunCommandInternalRaw(const FString& InCommand, const FString& InPathToGitBinary, const FString& InRepositoryRoot, const TArray& InParameters, const TArray& InFiles, FString& OutResults, FString& OutErrors, const int32 ExpectedReturnCode = 0); /** @@ -219,7 +219,7 @@ bool RunCommit(const FString& InPathToGitBinary, const FString& InRepositoryRoot * @param[out] InResults Results from the "status" command * @param[out] OutStates States of files for witch the status has been gathered (distinct than InFiles in case of a "directory status") */ -GITSOURCECONTROL_API void ParseStatusResults( const FString & InPathToGitBinary, const FString & InRepositoryRoot, const bool InUsingLfsLocking, const TArray< FString > & InFiles, const TMap< FString, FString > & InResults, TMap< FString, FGitSourceControlState > & OutStates ); +void ParseStatusResults( const FString & InPathToGitBinary, const FString & InRepositoryRoot, const bool InUsingLfsLocking, const TArray< FString > & InFiles, const TMap< FString, FString > & InResults, TMap< FString, FGitSourceControlState > & OutStates ); /** * Checks remote branches to see file differences. @@ -332,13 +332,13 @@ void RemoveRedundantErrors(FGitSourceControlCommand& InCommand, const FString& I * Helper function for various commands to update cached states. * @returns true if any states were updated */ -GITSOURCECONTROL_API bool UpdateCachedStates( const TMap< const FString, FGitState > & InResults ); +bool UpdateCachedStates( const TMap< const FString, FGitState > & InResults ); /** * Helper function for various commands to collect new states. * @returns true if any states were updated */ -GITSOURCECONTROL_API bool CollectNewStates( const TMap< FString, FGitSourceControlState > & InStates, TMap< const FString, FGitState > & OutResults ); +bool CollectNewStates( const TMap< FString, FGitSourceControlState > & InStates, TMap< const FString, FGitState > & OutResults ); /** * Helper function for various commands to collect new states. @@ -372,12 +372,12 @@ bool IsFileLFSLockable(const FString& InFile); */ bool CheckLFSLockable(const FString& InPathToGitBinary, const FString& InRepositoryRoot, const TArray& InFiles, TArray& OutErrorMessages); -GITSOURCECONTROL_API bool FetchRemote( const FString & InPathToGitBinary, const FString & InPathToRepositoryRoot, bool InUsingGitLfsLocking, TArray< FString > & OutResults, TArray< FString > & OutErrorMessages ); +bool FetchRemote( const FString & InPathToGitBinary, const FString & InPathToRepositoryRoot, bool InUsingGitLfsLocking, TArray< FString > & OutResults, TArray< FString > & OutErrorMessages ); bool PullOrigin(const FString& InPathToGitBinary, const FString& InPathToRepositoryRoot, const TArray& InFiles, TArray& OutFiles, TArray& OutResults, TArray& OutErrorMessages); -GITSOURCECONTROL_API TSharedPtr< class ISourceControlRevision, ESPMode::ThreadSafe > GetOriginRevisionOnBranch( const FString & InPathToGitBinary, const FString & InRepositoryRoot, const FString & InRelativeFileName, TArray< FString > & OutErrorMessages, const FString & BranchName ); +TSharedPtr< class ISourceControlRevision, ESPMode::ThreadSafe > GetOriginRevisionOnBranch( const FString & InPathToGitBinary, const FString & InRepositoryRoot, const FString & InRelativeFileName, TArray< FString > & OutErrorMessages, const FString & BranchName ); } From e56645b31dd1b23634bf8b32b0d19f67b7da38ba Mon Sep 17 00:00:00 2001 From: Oleg Kaspersky Date: Sun, 17 Nov 2024 04:10:12 +0100 Subject: [PATCH 2/3] Change GitSourceControl module type to Editor --- GitSourceControl.uplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitSourceControl.uplugin b/GitSourceControl.uplugin index c0735f86..0417f611 100644 --- a/GitSourceControl.uplugin +++ b/GitSourceControl.uplugin @@ -16,7 +16,7 @@ "Modules": [ { "Name": "GitSourceControl", - "Type": "UncookedOnly", + "Type": "Editor", "LoadingPhase": "Default" } ] From 4ae4118d36fca2f4afba5bf6ce2b596e31c967c8 Mon Sep 17 00:00:00 2001 From: Oleg Kaspersky Date: Sun, 17 Nov 2024 04:14:58 +0100 Subject: [PATCH 3/3] Fix part of docstrings --- Source/GitSourceControl/Public/GitSourceControlUtils.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/GitSourceControl/Public/GitSourceControlUtils.h b/Source/GitSourceControl/Public/GitSourceControlUtils.h index 6b32a4b0..8473a54c 100644 --- a/Source/GitSourceControl/Public/GitSourceControlUtils.h +++ b/Source/GitSourceControl/Public/GitSourceControlUtils.h @@ -81,7 +81,7 @@ FString FindGitBinaryPath(); /** * Run a Git "version" command to check the availability of the binary. * @param InPathToGitBinary The path to the Git binary - * @param OutGitVersion If provided, populate with the git version parsed from "version" command + * @param OutVersion If provided, populate with the git version parsed from "version" command * @returns true if the command succeeded and returned no errors */ bool CheckGitAvailability(const FString& InPathToGitBinary, FGitVersion* OutVersion = nullptr); @@ -96,14 +96,14 @@ bool CheckGitAvailability(const FString& InPathToGitBinary, FGitVersion* OutVers /** * Check git for various optional capabilities by various means. * @param InPathToGitBinary The path to the Git binary - * @param OutGitVersion If provided, populate with the git version parsed from "version" command + * @param OutVersion If provided, populate with the git version parsed from "version" command */ void FindGitCapabilities(const FString& InPathToGitBinary, FGitVersion* OutVersion); /** * Run a Git "lfs" command to check the availability of the "Large File System" extension. * @param InPathToGitBinary The path to the Git binary - * @param OutGitVersion If provided, populate with the git version parsed from "version" command + * @param OutVersion If provided, populate with the git version parsed from "version" command */ void FindGitLfsCapabilities(const FString& InPathToGitBinary, FGitVersion* OutVersion); @@ -120,7 +120,7 @@ bool FindRootDirectory(const FString& InPath, FString& OutRepositoryRoot); * @param InPathToGitBinary The path to the Git binary * @param InRepositoryRoot The Git repository from where to run the command - usually the Game directory (can be empty) * @param OutUserName Name of the Git user configured for this repository (or globaly) - * @param OutEmailName E-mail of the Git user configured for this repository (or globaly) + * @param OutUserEmail E-mail of the Git user configured for this repository (or globaly) */ void GetUserConfig(const FString& InPathToGitBinary, const FString& InRepositoryRoot, FString& OutUserName, FString& OutUserEmail); @@ -199,7 +199,7 @@ bool ListFilesInDirectoryRecurse(const FString& InPathToGitBinary, const FString * * @param InPathToGitBinary The path to the Git binary * @param InRepositoryRoot The Git repository from where to run the command - usually the Game directory - * @param InParameter The parameters to the Git commit command + * @param InParameters The parameters to the Git commit command * @param InFiles The files to be operated on * @param OutErrorMessages Any errors (from StdErr) as an array per-line * @returns true if the command succeeded and returned no errors