From 7f705869b0d333822fb994c8ab7e4a7e63779e2d Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Tue, 11 Jul 2023 15:16:41 -0600 Subject: [PATCH] rename: remove git-credential-manager-core symlinks Since 2 versions of Git have released since the rename of the executable from git-credential-manager-core to git-credential-manager, remove the associated symlinks and warnings, (as outlined in docs/rename.md). --- src/linux/Packaging.Linux/build.sh | 6 ---- src/linux/Packaging.Linux/pack.sh | 6 ---- src/osx/Installer.Mac/scripts/postinstall | 3 -- src/shared/Core/Constants.cs | 1 - src/shared/Git-Credential-Manager/Program.cs | 30 -------------------- src/windows/Installer.Windows/layout.ps1 | 13 ++------- 6 files changed, 3 insertions(+), 56 deletions(-) diff --git a/src/linux/Packaging.Linux/build.sh b/src/linux/Packaging.Linux/build.sh index 308530afe3..3b179e22db 100755 --- a/src/linux/Packaging.Linux/build.sh +++ b/src/linux/Packaging.Linux/build.sh @@ -70,12 +70,6 @@ if [ $INSTALL_FROM_SOURCE = true ]; then "$LINK_TO/git-credential-manager" || exit 1 fi - # Create legacy symlink with older name - if [ ! -f "$LINK_TO/git-credential-manager-core" ]; then - ln -s -r "$INSTALL_TO/git-credential-manager" \ - "$LINK_TO/git-credential-manager-core" || exit 1 - fi - echo "Install complete." else # Pack diff --git a/src/linux/Packaging.Linux/pack.sh b/src/linux/Packaging.Linux/pack.sh index 3c1072d55e..249ffb8e83 100755 --- a/src/linux/Packaging.Linux/pack.sh +++ b/src/linux/Packaging.Linux/pack.sh @@ -126,12 +126,6 @@ if [ ! -f "$LINK_TO/git-credential-manager" ]; then "$LINK_TO/git-credential-manager" || exit 1 fi -# Create legacy symlink with older name -if [ ! -f "$LINK_TO/git-credential-manager-core" ]; then - ln -s -r "$INSTALL_TO/git-credential-manager" \ - "$LINK_TO/git-credential-manager-core" || exit 1 -fi - dpkg-deb -Zxz --build "$DEBROOT" "$DEBPKG" || exit 1 echo $MESSAGE diff --git a/src/osx/Installer.Mac/scripts/postinstall b/src/osx/Installer.Mac/scripts/postinstall index 9e4b0bed51..9eed9aa7ab 100755 --- a/src/osx/Installer.Mac/scripts/postinstall +++ b/src/osx/Installer.Mac/scripts/postinstall @@ -30,9 +30,6 @@ fi mkdir -p /usr/local/bin /bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager" /usr/local/bin/git-credential-manager -# Create legacy symlink to GCMCore in /usr/local/bin -/bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager" /usr/local/bin/git-credential-manager-core - # Configure GCM for the current user (running as the current user to avoid root # from taking ownership of ~/.gitconfig) sudo -u ${USER} "$INSTALL_DESTINATION/git-credential-manager" configure diff --git a/src/shared/Core/Constants.cs b/src/shared/Core/Constants.cs index 9b82d06730..80df2e1276 100644 --- a/src/shared/Core/Constants.cs +++ b/src/shared/Core/Constants.cs @@ -210,7 +210,6 @@ public static class HelpUrls public const string GcmCredentialStores = "https://aka.ms/gcm/credstores"; public const string GcmWamComSecurity = "https://aka.ms/gcm/wamadmin"; public const string GcmAutoDetect = "https://aka.ms/gcm/autodetect"; - public const string GcmExecRename = "https://aka.ms/gcm/rename"; public const string GcmDefaultAccount = "https://aka.ms/gcm/defaultaccount"; public const string GcmMultipleUsers = "https://aka.ms/gcm/multipleusers"; } diff --git a/src/shared/Git-Credential-Manager/Program.cs b/src/shared/Git-Credential-Manager/Program.cs index bb9b02dc2c..59f579b9fd 100644 --- a/src/shared/Git-Credential-Manager/Program.cs +++ b/src/shared/Git-Credential-Manager/Program.cs @@ -55,36 +55,6 @@ private static void AppMain(object o) // Write the start and version events context.Trace2.Start(context.ApplicationPath, args); - // - // Git Credential Manager's executable used to be named "git-credential-manager-core" before - // dropping the "-core" suffix. In order to prevent "helper not found" errors for users who - // haven't updated their configuration, we include either a 'shim' or symlink with the old name - // that print warning messages about using the old name, and then continue execution of GCM. - // - // On Windows the shim is an exact copy of the main "git-credential-manager.exe" executable - // with the old name. We inspect argv[0] to see which executable we are launched as. - // - // On UNIX systems we do the same check, except instead of a copy we use a symlink. - // - string appPath = context.ApplicationPath; - if (!string.IsNullOrWhiteSpace(appPath)) - { - // Trim any (.exe) file extension if we're on Windows - // Note that in some circumstances (like being called by Git when config is set - // to just `helper = manager-core`) we don't always have ".exe" at the end. - if (PlatformUtils.IsWindows() && appPath.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) - { - appPath = appPath.Substring(0, appPath.Length - 4); - } - if (appPath.EndsWith("git-credential-manager-core", StringComparison.OrdinalIgnoreCase)) - { - context.Streams.Error.WriteLine( - "warning: git-credential-manager-core was renamed to git-credential-manager"); - context.Streams.Error.WriteLine( - $"warning: see {Constants.HelpUrls.GcmExecRename} for more information"); - } - } - // Register all supported host providers at the normal priority. // The generic provider should never win against a more specific one, so register it with low priority. app.RegisterProvider(new AzureReposHostProvider(context), HostProviderPriority.Normal); diff --git a/src/windows/Installer.Windows/layout.ps1 b/src/windows/Installer.Windows/layout.ps1 index c42e926c85..8ae3389865 100644 --- a/src/windows/Installer.Windows/layout.ps1 +++ b/src/windows/Installer.Windows/layout.ps1 @@ -54,24 +54,17 @@ dotnet publish "$GCM_UI_SRC" ` Write-Output "Publishing Bitbucket UI helper..." dotnet publish "$BITBUCKET_UI_SRC" ` --configuration "$CONFIGURATION" ` - --output "$PAYLOAD" + --output "$PAYLOAD" Write-Output "Publishing GitHub UI helper..." dotnet publish "$GITHUB_UI_SRC" ` --configuration "$CONFIGURATION" ` - --output "$PAYLOAD" + --output "$PAYLOAD" Write-Output "Publishing GitLab UI helper..." dotnet publish "$GITLAB_UI_SRC" ` --configuration "$CONFIGURATION" ` - --output "$PAYLOAD" - -# Create copy of main GCM executable with older "GCM Core" name -Copy-Item -Path "$PAYLOAD/git-credential-manager.exe" ` - -Destination "$PAYLOAD/git-credential-manager-core.exe" - -Copy-Item -Path "$PAYLOAD/git-credential-manager.exe.config" ` - -Destination "$PAYLOAD/git-credential-manager-core.exe.config" + --output "$PAYLOAD" # Delete libraries that are not needed for Windows but find their way # into the publish output.