diff --git a/.github/ISSUE_TEMPLATE/auth-issue.yml b/.github/ISSUE_TEMPLATE/auth-issue.yml index 19cc53066..6f9128eb1 100644 --- a/.github/ISSUE_TEMPLATE/auth-issue.yml +++ b/.github/ISSUE_TEMPLATE/auth-issue.yml @@ -15,7 +15,7 @@ body: description: | What version of Git Credential Manager are you using? - Run `git credential-manager-core --version` from a terminal to see the current version. + Run `git credential-manager --version` from a terminal to see the current version. If you are on an older version of GCM please try updating before creating an issue as the problem you are experiencing may have already been fixed. placeholder: | @@ -120,6 +120,6 @@ body: WSLENV=$WSLENV:GCM_TRACE:GIT_TRACE GCM_TRACE=1 GIT_TRACE=1 git fetch ``` - If you are using GCM version 2.0.567 onwards you can also run `git credential-manager-core diagnose` to collect useful diagnostic information that can be attached here. + If you are using GCM version 2.0.567 onwards you can also run `git credential-manager diagnose` to collect useful diagnostic information that can be attached here. :warning: **Please review and redact any private information before attaching logs and files!** diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 329fc29bc..06a331d98 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -22,10 +22,7 @@ jobs: language: [ 'csharp' ] steps: - - name: Checkout repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # patch around Nerdbank.GitVersioning failure + - uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9a1df1459..277234c27 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,12 +14,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, ubuntu-20.04, windows-2019, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + - uses: actions/checkout@v3 - name: Setup .NET uses: actions/setup-dotnet@v3.0.3 diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml index 864ae2f73..3ecff5b9d 100644 --- a/.github/workflows/lint-docs.yml +++ b/.github/workflows/lint-docs.yml @@ -18,9 +18,9 @@ jobs: name: Lint markdown files runs-on: ubuntu-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@v3 - - uses: DavidAnson/markdownlint-cli2-action@5b7c9f74fec47e6b15667b2cc23c63dff11e449e + - uses: DavidAnson/markdownlint-cli2-action@bb4bb94c73936643d73d345b48fead3e96f90a5e with: globs: | "**/*.md" @@ -30,12 +30,12 @@ jobs: name: Check for broken links runs-on: ubuntu-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@v3 - name: Run link checker # For any troubleshooting, see: # https://github.com/lycheeverse/lychee/blob/master/docs/TROUBLESHOOTING.md - uses: lycheeverse/lychee-action@4dcb8bee2a0a4531cba1a1f392c54e8375d6dd81 + uses: lycheeverse/lychee-action@97189f2c0a3c8b0cb0e704fd4e878af6e5e2b2c5 with: # user-agent: if a user agent is not specified, some websites (e.g. diff --git a/.github/workflows/release-homebrew.yaml b/.github/workflows/release-homebrew.yaml index f45431b03..7e0be9d00 100644 --- a/.github/workflows/release-homebrew.yaml +++ b/.github/workflows/release-homebrew.yaml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Update Homebrew tap - uses: mjcheetham/update-homebrew@v1.2 + uses: mjcheetham/update-homebrew@v1.3 with: token: ${{ secrets.HOMEBREW_TOKEN }} tap: microsoft/git diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83516cd7d..521fea366 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,17 +12,15 @@ jobs: runs-on: macos-latest strategy: matrix: - runtime: [ osx-x64, osx-arm64 ] + runtime: [ osx-x64, osx-arm64 ] steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + - uses: actions/checkout@v3 - name: Set up dotnet uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: 6.0.201 - + - name: Install dependencies run: dotnet restore @@ -31,7 +29,7 @@ jobs: dotnet build src/osx/Installer.Mac/*.csproj \ --configuration=MacRelease --no-self-contained \ --runtime=${{ matrix.runtime }} - + - name: Run macOS unit tests run: | dotnet test --configuration=MacRelease @@ -53,7 +51,7 @@ jobs: echo $CERT_BASE64 | base64 -D > $RUNNER_TEMP/cert.p12 security import $RUNNER_TEMP/cert.p12 -k $RUNNER_TEMP/buildagent.keychain -P $CERT_PASSPHRASE -T /usr/bin/codesign security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k pwd $RUNNER_TEMP/buildagent.keychain - + - name: Developer sign env: APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} @@ -67,7 +65,7 @@ jobs: path: | payload symbols - + osx-payload-sign: name: Sign macOS payload # ESRP service requires signing to run on Windows @@ -77,25 +75,24 @@ jobs: runtime: [ osx-x64, osx-arm64 ] needs: osx-build steps: - - name: Check out repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@v3 - name: Download payload uses: actions/download-artifact@v3 with: name: tmp.${{ matrix.runtime }}-build - + - name: Zip unsigned payload shell: pwsh run: | Compress-Archive -Path payload payload/payload.zip cd payload Get-ChildItem -Exclude payload.zip | Remove-Item -Recurse -Force - + - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - + - name: Set up ESRP client shell: pwsh env: @@ -104,7 +101,7 @@ jobs: REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }} run: | .github\set_up_esrp.ps1 - + - name: Run ESRP client shell: pwsh env: @@ -115,7 +112,7 @@ jobs: python .github\run_esrp_signing.py payload ` $env:APPLE_KEY_CODE $env:APPLE_SIGNING_OP_CODE ` --params 'Hardening' '--options=runtime' - + - name: Unzip signed payload shell: pwsh run: | @@ -128,83 +125,77 @@ jobs: name: ${{ matrix.runtime }}-payload-sign path: | signed - + osx-pack: name: Package macOS payload runs-on: macos-latest strategy: matrix: - runtime: [ osx-x64, osx-arm64 ] + runtime: [ osx-x64, osx-arm64 ] needs: osx-payload-sign steps: - - name: Check out repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + - uses: actions/checkout@v3 + + - name: Set version environment variable + run: echo "VERSION=$(cat VERSION | sed -E 's/.[0-9]+$//')" >> $GITHUB_ENV - name: Set up dotnet uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: 6.0.201 - - # Install Nerdbank.GitVersioning - - uses: dotnet/nbgv@master - with: - setCommonVars: true - name: Download signed payload uses: actions/download-artifact@v3 with: name: ${{ matrix.runtime }}-payload-sign - + - name: Create component package run: | src/osx/Installer.Mac/pack.sh --payload=payload \ - --version=$GitBuildVersionSimple \ + --version=$VERSION \ --output=components/com.microsoft.gitcredentialmanager.component.pkg - + - name: Create product archive run: | src/osx/Installer.Mac/dist.sh --package-path=components \ - --version=$GitBuildVersionSimple --runtime=${{ matrix.runtime }} \ - --output=pkg/gcm-${{ matrix.runtime }}-$GitBuildVersionSimple.pkg || exit 1 - + --version=$VERSION --runtime=${{ matrix.runtime }} \ + --output=pkg/gcm-${{ matrix.runtime }}-$VERSION.pkg || exit 1 + - name: Upload package uses: actions/upload-artifact@v3 with: name: tmp.${{ matrix.runtime }}-pack path: | pkg - + osx-sign: name: Sign and notarize macOS package # ESRP service requires signing to run on Windows runs-on: windows-latest strategy: matrix: - runtime: [ osx-x64, osx-arm64 ] + runtime: [ osx-x64, osx-arm64 ] needs: osx-pack steps: - - name: Check out repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@v3 - name: Download unsigned package uses: actions/download-artifact@v3 with: name: tmp.${{ matrix.runtime }}-pack path: pkg - + - name: Zip unsigned package shell: pwsh run: | Compress-Archive -Path pkg/*.pkg pkg/gcm-pkg.zip cd pkg Get-ChildItem -Exclude gcm-pkg.zip | Remove-Item -Recurse -Force - + - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - + - name: Set up ESRP client shell: pwsh env: @@ -213,7 +204,7 @@ jobs: REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }} run: | .github\set_up_esrp.ps1 - + - name: Sign package shell: pwsh env: @@ -222,14 +213,14 @@ jobs: APPLE_SIGNING_OP_CODE: ${{ secrets.APPLE_SIGNING_OPERATION_CODE }} run: | python .github\run_esrp_signing.py pkg $env:APPLE_KEY_CODE $env:APPLE_SIGNING_OP_CODE - + - name: Unzip signed package shell: pwsh run: | mkdir unsigned Expand-Archive -LiteralPath signed\gcm-pkg.zip -DestinationPath .\unsigned -Force Remove-Item signed\gcm-pkg.zip -Force - + - name: Notarize signed package shell: pwsh env: @@ -238,7 +229,7 @@ jobs: APPLE_NOTARIZATION_OP_CODE: ${{ secrets.APPLE_NOTARIZATION_OPERATION_CODE }} run: | python .github\run_esrp_signing.py unsigned $env:APPLE_KEY_CODE $env:APPLE_NOTARIZATION_OP_CODE --params 'BundleId' 'com.microsoft.gitcredentialmanager' - + - name: Publish signed package uses: actions/upload-artifact@v3 with: @@ -252,20 +243,13 @@ jobs: name: Build and Sign Windows runs-on: windows-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + - uses: actions/checkout@v3 - name: Set up dotnet uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: 6.0.201 - # Install Nerdbank.GitVersioning - - uses: dotnet/nbgv@master - with: - setCommonVars: true - - name: Install dependencies run: dotnet restore @@ -288,7 +272,7 @@ jobs: - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - + - name: Set up ESRP client shell: pwsh env: @@ -297,7 +281,7 @@ jobs: REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }} run: | .github\set_up_esrp.ps1 - + - name: Run ESRP client for unsigned payload shell: pwsh env: @@ -312,7 +296,7 @@ jobs: 'OpusInfo' 'http://www.microsoft.com' ` 'FileDigest' '/fd "SHA256"' 'PageHash' '/NPH' ` 'TimeStamp' '/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256' - + - name: Lay out signed payload shell: pwsh run: | @@ -327,7 +311,7 @@ jobs: shell: pwsh run: | dotnet build src/windows/Installer.Windows /p:PayloadPath=$env:GITHUB_WORKSPACE/signed-payload /p:NoLayout=true --configuration=WindowsRelease - + - name: Run ESRP client for installers shell: pwsh env: @@ -343,7 +327,7 @@ jobs: 'OpusInfo' 'http://www.microsoft.com' ` 'FileDigest' '/fd "SHA256"' 'PageHash' '/NPH' ` 'TimeStamp' '/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256' - + - name: Publish final artifacts uses: actions/upload-artifact@v3 with: @@ -360,9 +344,7 @@ jobs: name: Build Linux runs-on: ubuntu-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + - uses: actions/checkout@v3 - name: Setup .NET uses: actions/setup-dotnet@v3.0.3 @@ -394,13 +376,13 @@ jobs: # ESRP service requires signing to run on Windows runs-on: windows-latest steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@v3 - name: Download artifacts uses: actions/download-artifact@v3 with: name: linux-build - + - name: Remove symbols run: | rm tar/*symbols* @@ -408,7 +390,7 @@ jobs: - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - + - name: Set up ESRP client shell: pwsh env: @@ -417,7 +399,7 @@ jobs: REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }} run: | .github\set_up_esrp.ps1 - + - name: Run ESRP client shell: pwsh env: @@ -427,7 +409,7 @@ jobs: run: | python .github/run_esrp_signing.py deb $env:LINUX_KEY_CODE $env:LINUX_OP_CODE python .github/run_esrp_signing.py tar $env:LINUX_KEY_CODE $env:LINUX_OP_CODE - + - name: Re-name tarball signature file shell: bash run: | @@ -440,7 +422,7 @@ jobs: name: linux-sign path: | signed - + # ================================ # .NET Tool # ================================ @@ -449,18 +431,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. - name: Setup .NET uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: 6.0.201 - - uses: dotnet/nbgv@master - with: - setCommonVars: true - - name: Build .NET tool run: | src/shared/DotnetTool/layout.sh --configuration=Release @@ -478,25 +454,24 @@ jobs: runs-on: windows-latest needs: dotnet-tool-build steps: - - name: Check out repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@v3 - name: Download payload uses: actions/download-artifact@v3 with: name: tmp.dotnet-tool-build - + - name: Zip unsigned payload shell: pwsh run: | Compress-Archive -Path payload payload/payload.zip cd payload Get-ChildItem -Exclude payload.zip | Remove-Item -Recurse -Force - + - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - + - name: Set up ESRP client shell: pwsh env: @@ -505,7 +480,7 @@ jobs: REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }} run: | .github\set_up_esrp.ps1 - + - name: Run ESRP client shell: pwsh env: @@ -515,7 +490,7 @@ jobs: run: | python .github\run_esrp_signing.py payload ` $env:NUGET_KEY_CODE $env:NUGET_OPERATION_CODE - + - name: Lay out signed payload, images, and symbols shell: bash run: | @@ -530,15 +505,18 @@ jobs: name: dotnet-tool-payload-sign path: | dotnet-tool-payload-sign - + dotnet-tool-pack: name: Package .NET tool runs-on: ubuntu-latest needs: dotnet-tool-payload-sign steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + + - name: Set version environment variable + run: echo "VERSION=$(cat VERSION | sed -E 's/.[0-9]+$//')" >> $GITHUB_ENV + + - uses: actions/checkout@v3 - name: Download signed payload uses: actions/download-artifact@v3 @@ -551,14 +529,10 @@ jobs: with: dotnet-version: 6.0.201 - - uses: dotnet/nbgv@master - with: - setCommonVars: true - - name: Package tool run: | src/shared/DotnetTool/pack.sh --configuration=Release \ - --version=$GitBuildVersionSimple --publish-dir=$(pwd)/signed + --version=$VERSION --publish-dir=$(pwd)/signed - name: Upload unsigned package uses: actions/upload-artifact@v3 @@ -573,26 +547,25 @@ jobs: runs-on: windows-latest needs: dotnet-tool-pack steps: - - name: Check out repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: actions/checkout@v3 - name: Download unsigned package uses: actions/download-artifact@v3 with: name: tmp.dotnet-tool-package-unsigned path: nupkg - + - name: Zip unsigned package shell: pwsh run: | Compress-Archive -Path nupkg/*.nupkg nupkg/gcm-nupkg.zip cd nupkg Get-ChildItem -Exclude gcm-nupkg.zip | Remove-Item -Recurse -Force - + - uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - + - name: Set up ESRP client shell: pwsh env: @@ -601,7 +574,7 @@ jobs: REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }} run: | .github\set_up_esrp.ps1 - + - name: Sign package shell: pwsh env: @@ -610,13 +583,13 @@ jobs: NUGET_OPERATION_CODE: ${{ secrets.NUGET_OPERATION_CODE }} run: | python .github\run_esrp_signing.py nupkg $env:NUGET_KEY_CODE $env:NUGET_OPERATION_CODE - + - name: Unzip signed package shell: pwsh run: | Expand-Archive -LiteralPath signed\gcm-nupkg.zip -DestinationPath .\signed -Force Remove-Item signed\gcm-nupkg.zip -Force - + - name: Publish signed package uses: actions/upload-artifact@v3 with: @@ -658,13 +631,7 @@ jobs: runs-on: ${{ matrix.component.os }} needs: [ osx-sign, win-sign, linux-sign, dotnet-tool-sign ] steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. - - - uses: dotnet/nbgv@master - with: - setCommonVars: true + - uses: actions/checkout@v3 - name: Download artifacts uses: actions/download-artifact@v3 @@ -687,7 +654,7 @@ jobs: debpath=$(find ./*.deb) sudo apt install $debpath "${{ matrix.component.command }}" configure - + - name: Install Linux (tarball) if: contains(matrix.component.description, 'tarball') run: | @@ -702,7 +669,7 @@ jobs: # Only validate x64, given arm64 agents are not available pkgpath=$(find ./*.pkg) sudo installer -pkg $pkgpath -target / - + - name: Install .NET tool if: contains(matrix.component.description, 'dotnet-tool') run: | @@ -714,7 +681,7 @@ jobs: shell: bash run: | "${{ matrix.component.command }}" --version | sed 's/+.*//' >actual - echo $GitBuildVersionSimple >expect + cat VERSION | sed -E 's/.[0-9]+$//' >expect cmp expect actual || exit 1 # ================================ @@ -724,22 +691,19 @@ jobs: name: Publish GitHub draft release runs-on: ubuntu-latest needs: [ validate ] - steps: - - name: Check out repository - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + steps: + - uses: actions/checkout@v3 + + - name: Set version environment variable + run: | + # Remove the "revision" portion of the version + echo "VERSION=$(cat VERSION | sed -E 's/.[0-9]+$//')" >> $GITHUB_ENV - name: Set up dotnet uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: 6.0.201 - - # Install Nerdbank.GitVersioning - - uses: dotnet/nbgv@master - with: - setCommonVars: true - + - name: Download artifacts uses: actions/download-artifact@v3 @@ -747,24 +711,24 @@ jobs: run: | mkdir osx-payload-and-symbols - tar -C osx-x64-payload-sign -czf osx-payload-and-symbols/gcm-osx-x64-$GitBuildVersionSimple.tar.gz . - tar -C tmp.osx-x64-build/symbols -czf osx-payload-and-symbols/gcm-osx-x64-$GitBuildVersionSimple-symbols.tar.gz . + tar -C osx-x64-payload-sign -czf osx-payload-and-symbols/gcm-osx-x64-$VERSION.tar.gz . + tar -C tmp.osx-x64-build/symbols -czf osx-payload-and-symbols/gcm-osx-x64-$VERSION-symbols.tar.gz . - tar -C osx-arm64-payload-sign -czf osx-payload-and-symbols/gcm-osx-arm64-$GitBuildVersionSimple.tar.gz . - tar -C tmp.osx-arm64-build/symbols -czf osx-payload-and-symbols/gcm-osx-arm64-$GitBuildVersionSimple-symbols.tar.gz . + tar -C osx-arm64-payload-sign -czf osx-payload-and-symbols/gcm-osx-arm64-$VERSION.tar.gz . + tar -C tmp.osx-arm64-build/symbols -czf osx-payload-and-symbols/gcm-osx-arm64-$VERSION-symbols.tar.gz . - name: Archive Windows payload and symbols run: | mkdir win-x86-payload-and-symbols - zip -jr win-x86-payload-and-symbols/gcm-win-x86-$GitBuildVersionSimple.zip win-sign/signed-payload - zip -jr win-x86-payload-and-symbols/gcm-win-x86-$GitBuildVersionSimple-symbols.zip win-sign/src/windows/Installer.Windows/symbols + zip -jr win-x86-payload-and-symbols/gcm-win-x86-$VERSION.zip win-sign/signed-payload + zip -jr win-x86-payload-and-symbols/gcm-win-x86-$VERSION-symbols.zip win-sign/src/windows/Installer.Windows/symbols - uses: actions/github-script@v6 with: script: | const fs = require('fs'); const path = require('path'); - const version = process.env.GitBuildVersionSimple + const version = process.env.VERSION var releaseMetadata = { owner: context.repo.owner, diff --git a/.github/workflows/validate-install-from-source.yml b/.github/workflows/validate-install-from-source.yml index 554bb605a..95ebdb17c 100644 --- a/.github/workflows/validate-install-from-source.yml +++ b/.github/workflows/validate-install-from-source.yml @@ -34,10 +34,10 @@ jobs: zypper -n install tar gzip elif [[ ${{matrix.vector.image}} == *"centos"* ]]; then dnf install which -y - fi - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works. + fi + + - uses: actions/checkout@v3 + - run: | sh "${GITHUB_WORKSPACE}/src/linux/Packaging.Linux/install-from-source.sh" -y - git-credential-manager --help || exit 1 \ No newline at end of file + git-credential-manager --help || exit 1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fdf9b2f15..87314ca39 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,10 +52,10 @@ request being accepted: [code-of-conduct]: CODE_OF_CONDUCT.md [commits]: https://www.youtube.com/watch?v=4qLtKx9S9a8 [contribute-under-repo-license]: https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license -[fork]: https://github.com/GitCredentialManager/git-credential-manager/fork +[fork]: https://github.com/git-ecosystem/git-credential-manager/fork [github-help]: https://help.github.com [how-to-contribute]: https://opensource.guide/how-to-contribute/ -[issue]: https://github.com/GitCredentialManager/git-credential-manager/issues/new/choose +[issue]: https://github.com/git-ecosystem/git-credential-manager/issues/new/choose [license]: LICENSE -[pr]: https://github.com/GitCredentialManager/git-credential-manager/compare +[pr]: https://github.com/git-ecosystem/git-credential-manager/compare [prs]: https://help.github.com/articles/about-pull-requests/ diff --git a/Directory.Build.props b/Directory.Build.props index 3abe378a3..36038d416 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -27,10 +27,10 @@ - - - 3.4.244 - all + + + 13.0.1 + diff --git a/Directory.Build.targets b/Directory.Build.targets index 3c84f230d..72d4712e7 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -5,6 +5,15 @@ + + + + + + + + + $(IntermediateOutputPath)app.manifest diff --git a/Git-Credential-Manager.sln b/Git-Credential-Manager.sln index 39248b52c..75e1254b7 100644 --- a/Git-Credential-Manager.sln +++ b/Git-Credential-Manager.sln @@ -41,18 +41,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Packaging.Linux", "src\linu EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "linux", "linux", "{8F9D7E67-7DD7-4E32-9134-423281AF00E9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.UI", "src\shared\GitHub.UI\GitHub.UI.csproj", "{B5F00B46-FE93-45F2-B283-52B74B3E13B9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atlassian.Bitbucket.UI", "src\shared\Atlassian.Bitbucket.UI\Atlassian.Bitbucket.UI.csproj", "{EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.UI", "src\shared\Core.UI\Core.UI.csproj", "{001846B0-462B-4A27-90CD-2435D4C0F680}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.UI.Avalonia", "src\shared\Core.UI.Avalonia\Core.UI.Avalonia.csproj", "{DE620324-250C-4262-BA13-198FA6FDB82A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.UI.Avalonia", "src\shared\GitHub.UI.Avalonia\GitHub.UI.Avalonia.csproj", "{459501A8-31E6-41CB-BE54-D31FFF4B2007}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atlassian.Bitbucket.UI.Avalonia", "src\shared\Atlassian.Bitbucket.UI.Avalonia\Atlassian.Bitbucket.UI.Avalonia.csproj", "{714ACBE7-0C69-4D8A-9224-22792CAA8264}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.UI.Windows", "src\windows\GitHub.UI.Windows\GitHub.UI.Windows.csproj", "{0A86ED89-1FC5-42AA-925C-4578FA30607A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atlassian.Bitbucket.UI.Windows", "src\windows\Atlassian.Bitbucket.UI.Windows\Atlassian.Bitbucket.UI.Windows.csproj", "{3F015046-DAF2-4D2A-96EC-F9782F169E45}" @@ -61,14 +49,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitLab", "src\shared\GitLab EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitLab.Tests", "src\shared\GitLab.Tests\GitLab.Tests.csproj", "{1AF9F7C5-FA2E-48F1-B216-4D5E9A27F393}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitLab.UI", "src\shared\GitLab.UI\GitLab.UI.csproj", "{9AFD88E2-7E2C-46DA-9D38-4342086426D3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitLab.UI.Avalonia", "src\shared\GitLab.UI.Avalonia\GitLab.UI.Avalonia.csproj", "{47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitLab.UI.Windows", "src\windows\GitLab.UI.Windows\GitLab.UI.Windows.csproj", "{83EAC1F9-8E1F-41FC-8FC9-2C452452D64E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Git-Credential-Manager.UI.Avalonia", "src\shared\Git-Credential-Manager.UI.Avalonia\Git-Credential-Manager.UI.Avalonia.csproj", "{35659127-8859-4DB9-8DD6-A08C1952632E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Git-Credential-Manager.UI.Windows", "src\windows\Git-Credential-Manager.UI.Windows\Git-Credential-Manager.UI.Windows.csproj", "{01BF56EC-AAC1-4BCA-8204-EE51D968DF5C}" EndProject Global @@ -283,102 +265,6 @@ Global {AD2A935F-3720-4802-8119-6A9B35B254DF}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU {AD2A935F-3720-4802-8119-6A9B35B254DF}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU {AD2A935F-3720-4802-8119-6A9B35B254DF}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.Release|Any CPU.Build.0 = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {B5F00B46-FE93-45F2-B283-52B74B3E13B9}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.Release|Any CPU.Build.0 = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.Debug|Any CPU.Build.0 = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.Release|Any CPU.ActiveCfg = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.Release|Any CPU.Build.0 = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {001846B0-462B-4A27-90CD-2435D4C0F680}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.Release|Any CPU.Build.0 = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {DE620324-250C-4262-BA13-198FA6FDB82A}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.Debug|Any CPU.Build.0 = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.Release|Any CPU.ActiveCfg = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.Release|Any CPU.Build.0 = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {459501A8-31E6-41CB-BE54-D31FFF4B2007}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.Debug|Any CPU.Build.0 = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.Release|Any CPU.ActiveCfg = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.Release|Any CPU.Build.0 = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {714ACBE7-0C69-4D8A-9224-22792CAA8264}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU {0A86ED89-1FC5-42AA-925C-4578FA30607A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0A86ED89-1FC5-42AA-925C-4578FA30607A}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU {0A86ED89-1FC5-42AA-925C-4578FA30607A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -431,38 +317,6 @@ Global {1AF9F7C5-FA2E-48F1-B216-4D5E9A27F393}.MacRelease|Any CPU.Build.0 = Release|Any CPU {1AF9F7C5-FA2E-48F1-B216-4D5E9A27F393}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU {1AF9F7C5-FA2E-48F1-B216-4D5E9A27F393}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.Release|Any CPU.Build.0 = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {9AFD88E2-7E2C-46DA-9D38-4342086426D3}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.Release|Any CPU.Build.0 = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU {83EAC1F9-8E1F-41FC-8FC9-2C452452D64E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {83EAC1F9-8E1F-41FC-8FC9-2C452452D64E}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU {83EAC1F9-8E1F-41FC-8FC9-2C452452D64E}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -473,22 +327,6 @@ Global {83EAC1F9-8E1F-41FC-8FC9-2C452452D64E}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU {83EAC1F9-8E1F-41FC-8FC9-2C452452D64E}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU {83EAC1F9-8E1F-41FC-8FC9-2C452452D64E}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.MacDebug|Any CPU.Build.0 = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.Release|Any CPU.Build.0 = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.WindowsDebug|Any CPU.ActiveCfg = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.WindowsDebug|Any CPU.Build.0 = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.LinuxDebug|Any CPU.ActiveCfg = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.LinuxDebug|Any CPU.Build.0 = Debug|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.LinuxRelease|Any CPU.ActiveCfg = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.LinuxRelease|Any CPU.Build.0 = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.MacRelease|Any CPU.Build.0 = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.WindowsRelease|Any CPU.ActiveCfg = Release|Any CPU - {35659127-8859-4DB9-8DD6-A08C1952632E}.WindowsRelease|Any CPU.Build.0 = Release|Any CPU {01BF56EC-AAC1-4BCA-8204-EE51D968DF5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {01BF56EC-AAC1-4BCA-8204-EE51D968DF5C}.MacDebug|Any CPU.ActiveCfg = Debug|Any CPU {01BF56EC-AAC1-4BCA-8204-EE51D968DF5C}.MacRelease|Any CPU.ActiveCfg = Release|Any CPU @@ -522,20 +360,11 @@ Global {2B3CD8FF-84A6-4B53-A28B-D7A75B0AB4D7} = {66722747-1B61-40E4-A89B-1AC8E6D62EA9} {8F9D7E67-7DD7-4E32-9134-423281AF00E9} = {A7FC1234-95E3-4496-B5F7-4306F41E6A0E} {AD2A935F-3720-4802-8119-6A9B35B254DF} = {8F9D7E67-7DD7-4E32-9134-423281AF00E9} - {B5F00B46-FE93-45F2-B283-52B74B3E13B9} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} - {EB1AA840-6FFF-4464-A9B2-0AEA36F615EA} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} - {001846B0-462B-4A27-90CD-2435D4C0F680} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} - {DE620324-250C-4262-BA13-198FA6FDB82A} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} - {459501A8-31E6-41CB-BE54-D31FFF4B2007} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} - {714ACBE7-0C69-4D8A-9224-22792CAA8264} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} {0A86ED89-1FC5-42AA-925C-4578FA30607A} = {66722747-1B61-40E4-A89B-1AC8E6D62EA9} {3F015046-DAF2-4D2A-96EC-F9782F169E45} = {66722747-1B61-40E4-A89B-1AC8E6D62EA9} {570897DC-A85C-4598-B793-9A00CF710119} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} {1AF9F7C5-FA2E-48F1-B216-4D5E9A27F393} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} - {9AFD88E2-7E2C-46DA-9D38-4342086426D3} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} - {47186A50-8889-4FC7-8A05-F9FCE7F8F4AE} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} {83EAC1F9-8E1F-41FC-8FC9-2C452452D64E} = {66722747-1B61-40E4-A89B-1AC8E6D62EA9} - {35659127-8859-4DB9-8DD6-A08C1952632E} = {D5277A0E-997E-453A-8CB9-4EFCC8B16A29} {01BF56EC-AAC1-4BCA-8204-EE51D968DF5C} = {66722747-1B61-40E4-A89B-1AC8E6D62EA9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/README.md b/README.md index b793f45e7..6a9663e44 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,12 @@ See the [documentation index][docs-index] for links to additional resources. - [Windows broker (experimental)][gcm-windows-broker] +## Future features + +Curious about what's coming next in the GCM project? Take a look at the [project +roadmap][roadmap]! You can find more details about the construction of the +roadmap and how to interpret it [here][roadmap-announcement]. + ## Contributing This project welcomes contributions and suggestions. @@ -113,26 +119,28 @@ When using GitHub logos, please be sure to follow the [azure-devops-ssh]: https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops [bitbucket]: https://bitbucket.org [bitbucket-ssh]: https://confluence.atlassian.com/bitbucket/ssh-keys-935365775.html -[build-status-badge]: https://github.com/GitCredentialManager/git-credential-manager/actions/workflows/continuous-integration.yml/badge.svg -[docs-index]: https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/README.md +[build-status-badge]: https://github.com/git-ecosystem/git-credential-manager/actions/workflows/continuous-integration.yml/badge.svg +[docs-index]: https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/README.md [dotnet]: https://dotnet.microsoft.com [dotnet-distributions]: https://learn.microsoft.com/en-us/dotnet/core/install/linux [git-credential-helper]: https://git-scm.com/docs/gitcredentials -[gcm]: https://github.com/GitCredentialManager/git-credential-manager +[gcm]: https://github.com/git-ecosystem/git-credential-manager [gcm-coc]: CODE_OF_CONDUCT.md [gcm-commit-12294990]: https://github.com/git/git/commit/12294990c90e043862be9eb7eb22c3784b526340 [gcm-contributing]: CONTRIBUTING.md -[gcm-credstores]: https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/credstores.md +[gcm-credstores]: https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/credstores.md [gcm-for-mac-and-linux]: https://github.com/microsoft/Git-Credential-Manager-for-Mac-and-Linux [gcm-for-windows]: https://github.com/microsoft/Git-Credential-Manager-for-Windows -[gcm-http-proxy]: https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/netconfig.md#http-proxy +[gcm-http-proxy]: https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/netconfig.md#http-proxy [gcm-license]: LICENSE -[gcm-usage]: https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/usage.md -[gcm-windows-broker]: https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/windows-broker.md +[gcm-usage]: https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/usage.md +[gcm-windows-broker]: https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/windows-broker.md [git-tools-credential-storage]: https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage [github]: https://github.com [github-ssh]: https://help.github.com/en/articles/connecting-to-github-with-ssh [github-logos]: https://github.com/logos -[install]: https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/install.md +[install]: https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/install.md [ms-package-repos]: https://packages.microsoft.com/repos/ -[workflow-status]: https://github.com/GitCredentialManager/git-credential-manager/actions/workflows/continuous-integration.yml +[roadmap]: https://github.com/git-ecosystem/git-credential-manager/milestones?direction=desc&sort=due_date&state=open +[roadmap-announcement]: https://github.com/git-ecosystem/git-credential-manager/discussions/1203 +[workflow-status]: https://github.com/git-ecosystem/git-credential-manager/actions/workflows/continuous-integration.yml diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..9c1c5ffbd --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.1.0.0 diff --git a/build/GCM.tasks b/build/GCM.tasks index fe7031f34..d48d07751 100644 --- a/build/GCM.tasks +++ b/build/GCM.tasks @@ -13,4 +13,10 @@ + + + + + + diff --git a/build/GetVersion.cs b/build/GetVersion.cs new file mode 100644 index 000000000..2b3473641 --- /dev/null +++ b/build/GetVersion.cs @@ -0,0 +1,45 @@ +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System.IO; + +namespace GitCredentialManager.MSBuild +{ + public class GetVersion : Task + { + [Required] + public string VersionFile { get; set; } + + [Output] + public string Version { get; set; } + + [Output] + public string AssemblyVersion { get; set; } + + [Output] + public string FileVersion { get; set; } + + public override bool Execute() + { + Log.LogMessage(MessageImportance.Normal, "Reading VERSION file..."); + string textVersion = File.ReadAllText(VersionFile); + + if (!System.Version.TryParse(textVersion, out System.Version fullVersion)) + { + Log.LogError("Invalid version '{0}' specified.", textVersion); + return false; + } + + // System.Version names its version components as follows: + // major.minor[.build[.revision]] + // The main version number we use for GCM contains the first three + // components. + // The assembly and file version numbers contain all components, as + // ommitting the revision portion from these properties causes + // runtime failures on Windows. + Version = $"{fullVersion.Major}.{fullVersion.Minor}.{fullVersion.Build}"; + AssemblyVersion = FileVersion = fullVersion.ToString(); + + return true; + } + } +} diff --git a/docs/architecture.md b/docs/architecture.md index 2b2da52c0..0aff15287 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -280,7 +280,7 @@ to the trace object in most places of GCM. [avalonia]: https://avaloniaui.net/ [core-program]: ../src/shared/Git-Credential-Manager/Program.cs [credential-provider]: configuration.md#credentialprovider -[issue-113]: https://github.com/GitCredentialManager/git-credential-manager/issues/113 -[issue-136]: https://github.com/GitCredentialManager/git-credential-manager/issues/136 +[issue-113]: https://github.com/git-ecosystem/git-credential-manager/issues/113 +[issue-136]: https://github.com/git-ecosystem/git-credential-manager/issues/136 [gcm-provider]: environment.md#GCM_PROVIDER [msal]: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet diff --git a/docs/bitbucket-authentication.md b/docs/bitbucket-authentication.md new file mode 100644 index 000000000..c8d47e955 --- /dev/null +++ b/docs/bitbucket-authentication.md @@ -0,0 +1,61 @@ +# Bitbucket Authentication + +When GCM is triggered by Git, it will check the `host` parameter passed +to it. If this parameter contains `bitbucket.org` it will trigger Bitbucket +authentication and prompt you for credentials. In this scenario, you have two +options for authentication: `OAuth` or `Password/Token`. + +### OAuth + +The dialog GCM presents for authentication contains two tabs. The first tab +(labeled `Browser`) will trigger OAuth Authentication. Clicking the `Sign in +with your browser` button opens a browser request to +`_https://bitbucket.org/site/oauth2/authorize?response_type=code&client_id={consumerkey}&state=authenticated&scope={scopes}&redirect_uri=http://localhost:34106/_`. This triggers a flow on Bitbucket requiring you to log in +(and potentially complete 2FA) to authorize GCM to access Bitbucket with the +specified scopes. GCM will then spawn a temporary local webserver, listening on +port 34106, to handle the OAuth redirect/callback. Assuming you successfully +log into Bitbucket and authorize GCM, this callback will include the appropriate +tokens for GCM to handle authencation. These tokens are then stored in your +configured [credential store][credstores] and are returned to Git. + +### Password/Token + +**Note:** Bitbucket Data Center, also known as Bitbucket Server or Bitbucket On +Premises, only supports Basic Authentication - please follow the below +instructions if you are using this product. + +The dialog GCM presents for authentication contains two tabs. The second tab +(labeled `Password/Token`) will trigger Basic Authentication. This tab contains +two fields, one for your username and one for your password or token. If the +`username` parameter was passed into GCM, that will pre-populate the username +field, although it can be overridden. Enter your username (if needed) and your +password or token (i.e. Bitbucket App Password) and click `Sign in`. + +:rotating_light: Requirements for App Passwords :rotating_light: + +If you are planning to use an [App Password][app-password] for basic +authentication, it must at a minimum have _Account Read_ permissions (as shown +below). If your App Password does not have these permissions, you will be +re-prompted for credentials on every interaction with the server. + +![][app-password-example] + +When your username and password are submitted, GCM will attempt to retrieve a +basic authentication token for these credentials via the Bitbucket REST API. If +this is successful, the credentials, username, and password/token are stored in +your configured [credential store][credstores] and are returned to Git. + +If the API request fails with a 401 return code, the entered username/password +combination is invalid; nothing is stored and nothing is returned to Git. In +this scenario, re-attempt authentication, ensuring your credentials are correct. + +If the API request fails with a 403 (Forbidden) return code, the username and +password are valid, but 2FA is enabled on the corresponding Bitbucket Account. +In this scenario, you will be prompted to complete the OAuth authentication +process. If this is successful, the credentials, username, and password/token +are stored in your configured [credential store][credstores] and are returned to +Git. + +[app-password]: https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/ +[app-password-example]: img/app-password.png +[credstores]: ./credstores.md diff --git a/docs/bitbucket-development.md b/docs/bitbucket-development.md index 76605223f..9e6f5abb1 100644 --- a/docs/bitbucket-development.md +++ b/docs/bitbucket-development.md @@ -54,60 +54,12 @@ i.e. using a key such as `git:https://mminns@bitbucket.org/` rather than GCM can support multiple accounts, and usernames, for a single user against Bitbucket, e.g. a personal account and a work account. -## Authentication User Experience - -When the GCM is triggered by Git, the GCM will check the `host` parameter passed -to it. If it contains `bitbucket.org` it will trigger the Bitbucket related -processes. - -### Basic Authentication - -If the GCM needs to prompt the user for credentials they will always be shown an -initial dialog where they can enter a username and password. If the `username` -parameter was passed into the GCM it is used to pre-populate the username field, -although it can be overridden. When username and password credentials are -submitted the GCM will use them to attempt to retrieve a token, for Basic -Authentication this token is in effect the password the user just entered. The -GCM retrieves this `token` by checking the password can be used to successfully -retrieve the User profile via the Bitbucket REST API. - -If the username and password credentials sent as Basic Authentication -credentials works, then the password is identified as the token. The -credentials, the username and the password/token, are then stored and the values -returned to Git. - -If the request for the User profile via the REST API fails with a 401 return -code it indicates the username/password combination is invalid, nothing is -stored and nothing is returned to Git. - -However if the request fails with a 403 (Forbidden) return code, this indicates -that the username and password are valid but 2FA is enabled on the Bitbucket -Account. When this occurs the user it prompted to complete the OAuth -authentication process. - -### OAuth - -OAuth authentication prompts the User with a new dialog where they can trigger -OAuth authentication. This involves opening a browser request to `_https://bitbucket.org/site/oauth2/authorize?response_type=code&client_id={consumerkey}&state=authenticated&scope={scopes}&redirect_uri=http://localhost:34106/_`. -This will trigger a flow on Bitbucket where the user must login, potentially -including a 2FA prompt, and authorize the GCM to access Bitbucket with the -specified scopes. The GCM will spawn a temporary, local webserver, listening on -port 34106, to handle the OAuth redirect/callback. Assuming the user -successfully logins into Bitbucket and authorizes the GCM this callback will -include the Access and Refresh Tokens. - -The Access and Refresh Tokens will be stored against the username and the -username/Access Token credentials returned to Git. - ## On-Premise Bitbucket On-premise Bitbucket, more correctly known as Bitbucket Server or Bitbucket DC, has a number of differences compared to the cloud instance of Bitbucket, [bitbucket.org][bitbucket]. -As far as GCMC is concerned the main difference it doesn't support OAuth so only -Basic Authentication is available. - It is possible to test with Bitbucket Server by running it locally using the following command from the Atlassian SDK: @@ -174,13 +126,13 @@ host by specifying the host url, e.g. https://bitbucket.example.com/ Due to the way GCM resolves hosts and determines REST API urls, if the Bitbucket DC instance is hosted under a relative url (e.g. https://example.com/bitbucket) it is necessary to configure Git to send the full path to GCM. This is done -using the [credential.useHttpPath](configuration.md#credential.useHttpPath) +using the [credential.useHttpPath](configuration.md#credential.useHttpPath) setting. ❯ git config --global credential.https://example.com/bitbucket.usehttppath true If a port number is used in the url of the Bitbucket DC instance the Git -configuration needs to reflect this. However, due to [Issue 608](https://github.com/GitCredentialManager/git-credential-manager/issues/608) +configuration needs to reflect this. However, due to [Issue 608](https://github.com/git-ecosystem/git-credential-manager/issues/608) the port is ignored when resolving [credential.bitbucketDataCenterOAuthClientId](configuration.md#credential.bitbucketDataCenterOAuthClientId) and [credential.bitbucketDataCenterOAuthClientSecret](configuration.md#credential.bitbucketDataCenterOAuthClientSecret). diff --git a/docs/configuration.md b/docs/configuration.md index d77819731..586ce7b89 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -76,6 +76,86 @@ Defaults to enabled. --- +### credential.trace + +Enables trace logging of all activities. +Configuring Git and GCM to trace to the same location is often desirable, and +GCM is compatible and cooperative with `GIT_TRACE`. + +#### Example + +```shell +git config --global credential.trace /tmp/git.log +``` + +If the value of `credential.trace` is a full path to a file in an existing +directory, logs are appended to the file. + +If the value of `credential.trace` is `true` or `1`, logs are written to +standard error. + +Defaults to disabled. + +**Also see: [GCM_TRACE][gcm-trace]** + +--- + +### credential.traceSecrets + +Enables tracing of secret and sensitive information, which is by default masked +in trace output. Requires that `credential.trace` is also enabled. + +#### Example + +```shell +git config --global credential.traceSecrets true +``` + +If the value of `credential.traceSecrets` is `true` or `1`, trace logs will include +secret information. + +Defaults to disabled. + +**Also see: [GCM_TRACE_SECRETS][gcm-trace-secrets]** + +--- + +### credential.traceMsAuth + +Enables inclusion of Microsoft Authentication library (MSAL) logs in GCM trace +output. Requires that `credential.trace` is also enabled. + +#### Example + +```shell +git config --global credential.traceMsAuth true +``` + +If the value of `credential.traceMsAuth` is `true` or `1`, trace logs will +include verbose MSAL logs. + +Defaults to disabled. + +**Also see: [GCM_TRACE_MSAUTH][gcm-trace-msauth]** + +--- + +### credential.debug + +Pauses execution of GCM at launch to wait for a debugger to be attached. + +#### Example + +```shell +git config --global credential.debug true +``` + +Defaults to disabled. + +**Also see: [GCM_DEBUG][gcm-debug]** + +--- + ### credential.provider Define the host provider to use when authenticating. @@ -543,7 +623,10 @@ git config --global credential.msauthFlow devicecode Use the operating system account manager where available. -Defaults to `false`. This default is subject to change in the future. +Defaults to `false`. In certain cloud hosted environments when using a work or +school account, such as [Microsoft DevBox][devbox], the default is `true`. + +These defaults are subject to change in the future. _**Note:** before you enable this option on Windows, please review the [Windows Broker][wam] details for what this means to your local Windows user @@ -564,6 +647,30 @@ git config --global credential.msauthUseBroker true --- +### credential.msauthUseDefaultAccount _(experimental)_ + +Use the current operating system account by default when the broker is enabled. + +Defaults to `false`. In certain cloud hosted environments when using a work or +school account, such as [Microsoft DevBox][devbox], the default is `true`. + +These defaults are subject to change in the future. + +Value|Description +-|- +`true`|Use the current operating system account by default. +`false` _(default)_|Do not assume any account to use by default. + +#### Example + +```shell +git config --global credential.msauthUseDefaultAccount true +``` + +**Also see: [GCM_MSAUTH_USEDEFAULTACCOUNT][gcm-msauth-usedefaultaccount]** + +--- + ### credential.useHttpPath Tells Git to pass the entire repository URL, rather than just the hostname, when @@ -661,6 +768,75 @@ git config --global credential.azreposCredentialType oauth **Also see: [GCM_AZREPOS_CREDENTIALTYPE][gcm-azrepos-credentialtype]** +--- + +### trace2.normalTarget + +Turns on Trace2 Normal Format tracing - see [Git's Trace2 Normal Format +documentation][trace2-normal-docs] for more details. + +#### Example + +```shell +git config --global trace2.normalTarget true +``` + +If the value of `trace2.normalTarget` is a full path to a file in an existing +directory, logs are appended to the file. + +If the value of `trace2.normalTarget` is `true` or `1`, logs are written to +standard error. + +Defaults to disabled. + +**Also see: [GIT_TRACE2][trace2-normal-env]** + +--- + +### trace2.eventTarget + +Turns on Trace2 Event Format tracing - see [Git's Trace2 Event Format +documentation][trace2-event-docs] for more details. + +#### Example + +```shell +git config --global trace2.eventTarget true +``` + +If the value of `trace2.eventTarget` is a full path to a file in an existing +directory, logs are appended to the file. + +If the value of `trace2.eventTarget` is `true` or `1`, logs are written to +standard error. + +Defaults to disabled. + +**Also see: [GIT_TRACE2_EVENT][trace2-event-env]** + +--- + +### trace2.perfTarget + +Turns on Trace2 Performance Format tracing - see [Git's Trace2 Performance +Format documentation][trace2-performance-docs] for more details. + +#### Example + +```shell +git config --global trace2.perfTarget true +``` + +If the value of `trace2.perfTarget` is a full path to a file in an existing +directory, logs are appended to the file. + +If the value of `trace2.perfTarget` is `true` or `1`, logs are written to +standard error. + +Defaults to disabled. + +**Also see: [GIT_TRACE2_PERF][trace2-performance-env]** + [auto-detection]: autodetect.md [azure-tokens]: azrepos-users-and-tokens.md [use-http-path]: https://git-scm.com/docs/gitcredentials/#Documentation/gitcredentials.txt-useHttpPath @@ -671,6 +847,7 @@ git config --global credential.azreposCredentialType oauth [credential-plaintextstorepath]: #credentialplaintextstorepath [credential-cache]: https://git-scm.com/docs/git-credential-cache [cred-stores]: credstores.md +[devbox]: https://azure.microsoft.com/en-us/products/dev-box [enterprise-config]: enterprise-config.md [envars]: environment.md [freedesktop-ss]: https://specifications.freedesktop.org/secret-service/ @@ -682,6 +859,7 @@ git config --global credential.azreposCredentialType oauth [gcm-bitbucket-authmodes]: environment.md#GCM_BITBUCKET_AUTHMODES [gcm-credential-cache-options]: environment.md#GCM_CREDENTIAL_CACHE_OPTIONS [gcm-credential-store]: environment.md#GCM_CREDENTIAL_STORE +[gcm-debug]: environment.md#GCM_DEBUG [gcm-dpapi-store-path]: environment.md#GCM_DPAPI_STORE_PATH [gcm-github-authmodes]: environment.md#GCM_GITHUB_AUTHMODES [gcm-gitlab-authmodes]:environment.md#GCM_GITLAB_AUTHMODES @@ -690,9 +868,13 @@ git config --global credential.azreposCredentialType oauth [gcm-interactive]: environment.md#GCM_INTERACTIVE [gcm-msauth-flow]: environment.md#GCM_MSAUTH_FLOW [gcm-msauth-usebroker]: environment.md#GCM_MSAUTH_USEBROKER-experimental +[gcm-msauth-usedefaultaccount]: environment.md#GCM_MSAUTH_USEDEFAULTACCOUNT-experimental [gcm-namespace]: environment.md#GCM_NAMESPACE [gcm-plaintext-store-path]: environment.md#GCM_PLAINTEXT_STORE_PATH [gcm-provider]: environment.md#GCM_PROVIDER +[gcm-trace]: environment.md#GCM_TRACE +[gcm-trace-secrets]: environment.md#GCM_TRACE_SECRETS +[gcm-trace-msauth]: environment.md#GCM_TRACE_MSAUTH [usage]: usage.md [git-config-http-proxy]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpproxy [http-proxy]: netconfig.md#http-proxy @@ -701,4 +883,10 @@ git config --global credential.azreposCredentialType oauth [provider-migrate]: migration.md#gcm_authority [cache-options]: https://git-scm.com/docs/git-credential-cache#_options [pass]: https://www.passwordstore.org/ +[trace2-normal-docs]: https://git-scm.com/docs/api-trace2#_the_normal_format_target +[trace2-normal-env]: environment.md#GIT_TRACE2 +[trace2-event-docs]: https://git-scm.com/docs/api-trace2#_the_event_format_target +[trace2-event-env]: environment.md#GIT_TRACE2_EVENT +[trace2-performance-docs]: https://git-scm.com/docs/api-trace2#_the_performance_format_target +[trace2-performance-env]: environment.md#GIT_TRACE2_PERF [wam]: windows-broker.md diff --git a/docs/development.md b/docs/development.md index 2b8fcfd41..4637f4574 100644 --- a/docs/development.md +++ b/docs/development.md @@ -3,7 +3,7 @@ Start by cloning this repository: ```shell -git clone https://github.com/GitCredentialManager/git-credential-manager +git clone https://github.com/git-ecosystem/git-credential-manager ``` You also need the latest version of the .NET SDK which can be downloaded and @@ -98,6 +98,12 @@ Git to be the one launching us. ### Collect trace output +GCM has two tracing systems - one that is distinctly GCM's and one that +implements certain features of [Git's Trace2 API][trace2]. Below are +instructions for how to use each. + +#### `GCM_TRACE` + If you want to debug a release build or installation of GCM, you can set the `GCM_TRACE` environment variable to `1` to print trace information to standard error, or to an absolute file path to write trace information to a file. @@ -110,6 +116,80 @@ $ GCM_TRACE=1 git-credential-manager version > Git Credential Manager version 2.0.124-beta+e1ebbe1517 (macOS, .NET 5.0) ``` +#### Git's Trace2 API + +This API can also be used to print debug, performance, and telemetry information +to stderr or a file in various formats. + +##### Supported format targets + +1. The Normal Format Target: Similar to `GCM_TRACE`, this target writes +human-readable output and is best suited for debugging. It can be enabled via +environment variable or config, for example: + + ```shell + export GIT_TRACE2=1 + ``` + + or + + ```shell + git config --global trace2.normalTarget ~/log.normal + ``` + +0. The Performance Format Target: This format is column-based and geared toward +analyzing performance during development and testing. It can be enabled via +environment variable or config, for example: + + ```shell + export GIT_TRACE2_PERF=1 + ``` + + or + + ```shell + git config --global trace2.perfTarget ~/log.perf + ``` + +0. The Event Format Target: This format is json-based and is geared toward +collection of large quantities of data for advanced analysis. It can be enabled +via environment variable or config, for example: + + ```shell + export GIT_TRACE2_EVENT=1 + ``` + + or + + ```shell + git config --global trace2.eventTarget ~/log.event + ``` + +You can read more about each of these format targets in the [corresponding +section][trace2-targets] of Git's Trace2 API documentation. + +##### Supported events + +The below describes, at a high level, the Trace2 API events that are currently +supported in GCM and the information they provide: + +1. `version`: contains the version of the current executable (e.g. GCM or a +helper exe) +0. `start`: contains the complete argv received by current executable's `Main()` +method +0. `exit`: contains current executable's exit code +0. `child_start`: describes a child process that is about to be spawned +0. `child_exit`: describes a child process at exit +0. `region_enter`: describes a region (e.g. a timer for a section of code that +is interesting) on entry +0. `region_leave`: describes a region on leaving + +You can read more about each of these format targets in the [corresponding +section][trace2-events] of Git's Trace2 API documentation. + +Want to see more events? Consider contributing! We'd :love: to see your +awesome work in support of building out this API. + ### Code coverage metrics If you want code coverage metrics these can be generated either from the command @@ -169,4 +249,7 @@ Some URLs are ignored by lychee, per the [lycheeignore][lycheeignore]. [lycheeignore]: ../.lycheeignore [markdownlint]: https://github.com/DavidAnson/markdownlint-cli2 [markdownlint-config]: ../.markdownlint.jsonc +[trace2]: https://git-scm.com/docs/api-trace2 +[trace2-events]: https://git-scm.com/docs/api-trace2#_event_specific_keyvalue_pairs +[trace2-targets]: https://git-scm.com/docs/api-trace2#_trace2_targets [vscode-markdownlint]: https://github.com/DavidAnson/vscode-markdownlint diff --git a/docs/environment.md b/docs/environment.md index 7c73965a7..fcdb7db65 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -39,9 +39,9 @@ logs are appended to the file. If the value of `GCM_TRACE` is `true` or `1`, logs are written to standard error. -Defaults to tracing disabled. +Defaults to disabled. -_No configuration equivalent._ +**Also see: [credential.trace][credential-trace]** --- @@ -71,14 +71,14 @@ secret information. Defaults to disabled. -_No configuration equivalent._ +**Also see: [credential.traceSecrets][credential-trace-secrets]** --- ### GCM_TRACE_MSAUTH -Enables inclusion of Microsoft Authentication libraries (ADAL, MSAL) logs in GCM -trace output. Requires that `GCM_TRACE` is also enabled. +Enables inclusion of Microsoft Authentication library (MSAL) logs in GCM trace +output. Requires that `GCM_TRACE` is also enabled. #### Example @@ -97,11 +97,11 @@ export GCM_TRACE_MSAUTH=1 ``` If the value of `GCM_TRACE_MSAUTH` is `true` or `1`, trace logs will include -verbose ADAL/MSAL logs. +verbose MSAL logs. Defaults to disabled. -_No configuration equivalent._ +**Also see: [credential.traceMsAuth][credential-trace-msauth]** --- @@ -125,7 +125,7 @@ export GCM_DEBUG=1 Defaults to disabled. -_No configuration equivalent._ +**Also see: [credential.debug][credential-debug]** --- @@ -776,7 +776,10 @@ export GCM_MSAUTH_FLOW="devicecode" Use the operating system account manager where available. -Defaults to `false`. This default is subject to change in the future. +Defaults to `false`. In certain cloud hosted environments when using a work or +school account, such as [Microsoft DevBox][devbox], the default is `true`. + +These defaults are subject to change in the future. _**Note:** before you enable this option on Windows, please [review the details][windows-broker] about what this means to your local Windows @@ -803,6 +806,36 @@ export GCM_MSAUTH_USEBROKER="false" --- +### GCM_MSAUTH_USEDEFAULTACCOUNT _(experimental)_ + +Use the current operating system account by default when the broker is enabled. + +Defaults to `false`. In certain cloud hosted environments when using a work or +school account, such as [Microsoft DevBox][devbox], the default is `true`. + +These defaults are subject to change in the future. + +Value|Description +-|- +`true`|Use the current operating system account by default. +`false` _(default)_|Do not assume any account to use by default. + +#### Windows + +```batch +SET GCM_MSAUTH_USEDEFAULTACCOUNT="true" +``` + +#### macOS/Linux + +```bash +export GCM_MSAUTH_USEDEFAULTACCOUNT="false" +``` + +**Also see: [credential.msauthUseDefaultAccount][credential-msauth-usedefaultaccount]** + +--- + ### GCM_AZREPOS_CREDENTIALTYPE Specify the type of credential the Azure Repos host provider should return. @@ -830,6 +863,93 @@ export GCM_AZREPOS_CREDENTIALTYPE="oauth" **Also see: [credential.azreposCredentialType][credential-azrepos-credential-type]** +--- + +### GIT_TRACE2 + +Turns on Trace2 Normal Format tracing - see [Git's Trace2 Normal Format +documentation][trace2-normal-docs] for more details. + +#### Windows + +```batch +SET GIT_TRACE2=%UserProfile%\log.normal +``` + +#### macOS/Linux + +```bash +export GIT_TRACE2=~/log.normal +``` + +If the value of `GIT_TRACE2` is a full path to a file in an existing directory, +logs are appended to the file. + +If the value of `GIT_TRACE2` is `true` or `1`, logs are written to standard +error. + +Defaults to disabled. + +**Also see: [trace2.normalFormat][trace2-normal-config]** + +--- + +### GIT_TRACE2_EVENT + +Turns on Trace2 Event Format tracing - see [Git's Trace2 Event Format +documentation][trace2-event-docs] for more details. + +#### Windows + +```batch +SET GIT_TRACE2_EVENT=%UserProfile%\log.event +``` + +#### macOS/Linux + +```bash +export GIT_TRACE2_EVENT=~/log.event +``` + +If the value of `GIT_TRACE2_EVENT` is a full path to a file in an existing +directory, logs are appended to the file. + +If the value of `GIT_TRACE2_EVENT` is `true` or `1`, logs are written to +standard error. + +Defaults to disabled. + +**Also see: [trace2.eventFormat][trace2-event-config]** + +--- + +### GIT_TRACE2_PERF + +Turns on Trace2 Performance Format tracing - see [Git's Trace2 Performance +Format documentation][trace2-performance-docs] for more details. + +#### Windows + +```batch +SET GIT_TRACE2_PERF=%UserProfile%\log.perf +``` + +#### macOS/Linux + +```bash +export GIT_TRACE2_PERF=~/log.perf +``` + +If the value of `GIT_TRACE2_PERF` is a full path to a file in an existing +directory, logs are appended to the file. + +If the value of `GIT_TRACE2_PERF` is `true` or `1`, logs are written to +standard error. + +Defaults to disabled. + +**Also see: [trace2.perfFormat][trace2-performance-config]** + [autodetect]: autodetect.md [azure-access-tokens]: azrepos-users-and-tokens.md [configuration]: configuration.md @@ -840,6 +960,7 @@ export GCM_AZREPOS_CREDENTIALTYPE="oauth" [credential-bitbucketauthmodes]: configuration.md#credentialbitbucketAuthModes [credential-cacheoptions]: configuration.md#credentialcacheoptions [credential-credentialstore]: configuration.md#credentialcredentialstore +[credential-debug]: configuration.md#credentialdebug [credential-dpapi-store-path]: configuration.md#credentialdpapistorepath [credential-githubauthmodes]: configuration.md#credentialgitHubAuthModes [credential-gitlabauthmodes]: configuration.md#credentialgitLabAuthModes @@ -849,10 +970,15 @@ export GCM_AZREPOS_CREDENTIALTYPE="oauth" [credential-namespace]: configuration.md#credentialnamespace [credential-msauth-flow]: configuration.md#credentialmsauthflow [credential-msauth-usebroker]: configuration.md#credentialmsauthusebroker-experimental +[credential-msauth-usedefaultaccount]: configuration.md#credentialmsauthusedefaultaccount-experimental [credential-plain-text-store]: configuration.md#credentialplaintextstorepath [credential-provider]: configuration.md#credentialprovider [credential-stores]: credstores.md +[credential-trace]: configuration.md#credentialtrace +[credential-trace-secrets]: configuration.md#credentialtracesecrets +[credential-trace-msauth]: configuration.md#credentialtracemsauth [default-values]: enterprise-config.md +[devbox]: https://azure.microsoft.com/en-us/products/dev-box [freedesktop-ss]: https://specifications.freedesktop.org/secret-service/ [gcm]: usage.md [gcm-interactive]: #gcm_interactive @@ -867,4 +993,10 @@ export GCM_AZREPOS_CREDENTIALTYPE="oauth" [libsecret]: https://wiki.gnome.org/Projects/Libsecret [migration-guide]: migration.md#gcm_authority [passwordstore]: https://www.passwordstore.org/ +[trace2-normal-docs]: https://git-scm.com/docs/api-trace2#_the_normal_format_target +[trace2-normal-config]: configuration.md#trace2normalTarget +[trace2-event-docs]: https://git-scm.com/docs/api-trace2#_the_event_format_target +[trace2-event-config]: configuration.md#trace2eventTarget +[trace2-performance-docs]: https://git-scm.com/docs/api-trace2#_the_performance_format_target +[trace2-performance-config]: configuration.md#trace2perfTarget [windows-broker]: windows-broker.md diff --git a/docs/faq.md b/docs/faq.md index 7008b793b..cf761b1e8 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -235,7 +235,7 @@ initiate this flow for you next time access is requested). [bitbucket-ssh]: https://confluence.atlassian.com/bitbucket/ssh-keys-935365775.html [config-gui-prompt]: configuration.md#credentialguiprompt [config-interactive]: configuration.md#credentialinteractive -[create-issue]: https://github.com/GitCredentialManager/git-credential-manager/issues/create +[create-issue]: https://github.com/git-ecosystem/git-credential-manager/issues/create [credstores]: credstores.md [download-and-install]: ../README.md#download-and-install [enable-windows-ssh]: https://support.microsoft.com/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392 diff --git a/docs/github-apideprecation.md b/docs/github-apideprecation.md index f9201db0a..6a54a7a40 100644 --- a/docs/github-apideprecation.md +++ b/docs/github-apideprecation.md @@ -128,7 +128,7 @@ the new token-based authentication requirements **DO NOT** apply to GHES: [gcm]: https://aka.ms/gcm [gcm-install]: ../README.md#download-and-install [gcm-latest]: https://aka.ms/gcm/latest -[gcm-new-issue]: https://github.com/GitCredentialManager/git-credential-manager/issues/new/choose +[gcm-new-issue]: https://github.com/git-ecosystem/git-credential-manager/issues/new/choose [gcm-windows]: https://github.com/microsoft/Git-Credential-Manager-for-Windows [git-windows]: https://git-scm.com/download/win [github-display-pat-image]: img/github-display-pat.png diff --git a/docs/gitlab.md b/docs/gitlab.md index 04b122e1c..4c1135e6b 100644 --- a/docs/gitlab.md +++ b/docs/gitlab.md @@ -58,7 +58,7 @@ git config --global credential.https://code.videolan.org.gitLabDevClientId f35c3 git config --global credential.https://code.videolan.org.gitLabDevClientSecret 631558ec973c5ef65b78db9f41103f8247dc68d979c86f051c0fe4389e1995e8 ``` -See also [issue #677](https://github.com/GitCredentialManager/git-credential-manager/issues/677). +See also [issue #677](https://github.com/git-ecosystem/git-credential-manager/issues/677). ## Preferences diff --git a/docs/hostprovider.md b/docs/hostprovider.md index 9a6e16412..25aaf3d85 100644 --- a/docs/hostprovider.md +++ b/docs/hostprovider.md @@ -343,7 +343,7 @@ take, but implementors SHOULD attempt to follow existing practices and styles. 1. [`System.CommandLine` API][github-dotnet-cli] -[gcm]: https://github.com/GitCredentialManager/git-credential-manager +[gcm]: https://github.com/git-ecosystem/git-credential-manager [github-dotnet-cli]: https://github.com/dotnet/command-line-api [hostprovider-base-class]: #26-hostprovider-base-class [references]: #references diff --git a/docs/img/app-password.png b/docs/img/app-password.png new file mode 100644 index 000000000..da6b4e119 Binary files /dev/null and b/docs/img/app-password.png differ diff --git a/docs/install.md b/docs/install.md index f434ceaa7..08b3c358c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -203,7 +203,7 @@ tool][dotnet-tool]. This is the preferred install method for Linux because you can use it to install on any [.NET-supported distribution][dotnet-supported-distributions]. You -can also use this method on macOS or Windows if you so choose. +can also use this method on macOS if you so choose. **Note:** Make sure you have installed [version 6.0 of the .NET SDK][dotnet-install] before attempting to run the following `dotnet tool` @@ -237,6 +237,6 @@ dotnet tool uninstall -g git-credential-manager [gcm-wsl]: wsl.md [git-for-windows]: https://gitforwindows.org/ [git-for-windows-screenshot]: https://user-images.githubusercontent.com/5658207/140082529-1ac133c1-0922-4a24-af03-067e27b3988b.png -[latest-release]: https://github.com/GitCredentialManager/git-credential-manager/releases/latest +[latest-release]: https://github.com/git-ecosystem/git-credential-manager/releases/latest [linux-uninstall]: linux-fromsrc-uninstall.md [ms-wsl]: https://aka.ms/wsl# diff --git a/docs/rename.md b/docs/rename.md index b69e1c2f1..4d090cc69 100644 --- a/docs/rename.md +++ b/docs/rename.md @@ -156,10 +156,10 @@ or `manager` respectively. > helper that is configured, and overrides any helpers configured at the system/ > machine-wide level. -[rename-pr]: https://github.com/GitCredentialManager/git-credential-manager/pull/541 +[rename-pr]: https://github.com/git-ecosystem/git-credential-manager/pull/541 [rename-blog]: https://github.blog/2022-04-07-git-credential-manager-authentication-for-everyone/#universal-git-authentication -[gcm-org]: https://github.com/GitCredentialManager -[rename-ver]: https://github.com/GitCredentialManager/git-credential-manager/releases +[gcm-org]: https://github.com/git-ecosystem +[rename-ver]: https://github.com/git-ecosystem/git-credential-manager/releases [git-windows]: https://git-scm.com/download/win [gcm-latest]: https://aka.ms/gcm/latest [warnings]: #rename-transition diff --git a/docs/windows-broker.md b/docs/windows-broker.md index c767c172d..24794ebb1 100644 --- a/docs/windows-broker.md +++ b/docs/windows-broker.md @@ -34,6 +34,23 @@ fewer multi-factor authentication prompts, and the ability to use additional authentication technologies like smart cards and Windows Hello. These convenience and security features make a good case for enabling WAM. +## Using the current OS account by default + +Enabling WAM does not currently automatically use the current Windows account +for authentication. In order to opt-in to this behavior you can set the +[`GCM_MSAUTH_USEDEFAULTACCOUNT`][GCM_MSAUTH_USEDEFAULTACCOUNT] environment +variable or set the +[`credential.msauthUseDefaultAccount`][credential.msauthUseDefaultAccount] Git +configuration value to `true`. + +In certain cloud hosted environments when using a work or school account, such +as [Microsoft Dev Box][devbox], this setting is **_automatically enabled_**. + +To disable this behavior, set the environment variable +[`GCM_MSAUTH_USEDEFAULTACCOUNT`][GCM_MSAUTH_USEDEFAULTACCOUNT] or the +[`credential.msauthUseDefaultAccount`][credential.msauthUseDefaultAccount] Git +configuration value explicitly to `false`. + ## Surprising behaviors The WAM and Windows identity systems are complex, addressing a very broad range @@ -174,8 +191,10 @@ In order to fix the problem, there are a few options: [azure-refresh-token-terms]: https://docs.microsoft.com/azure/active-directory/devices/concept-primary-refresh-token#key-terminology-and-components [azure-conditional-access]: https://docs.microsoft.com/azure/active-directory/conditional-access/overview [azure-devops]: https://dev.azure.com -[GCM_MSAUTH_USEBROKER]: environment.md#GCM_MSAUTH_USEBROKER -[credential.msauthUseBroker]: configuration.md#credentialmsauthusebroker +[GCM_MSAUTH_USEBROKER]: environment.md#GCM_MSAUTH_USEBROKER-experimental +[GCM_MSAUTH_USEDEFAULTACCOUNT]: environment.md#GCM_MSAUTH_USEDEFAULTACCOUNT-experimental +[credential.msauthUseBroker]: configuration.md#credentialmsauthusebroker-experimental +[credential.msauthUseDefaultAccount]: configuration.md#credentialmsauthusedefaultaccount-experimental [aad-questions]: img/aad-questions.png [aad-questions-21h1]: img/aad-questions-21H1.png [aad-bitlocker]: img/aad-bitlocker.png @@ -186,3 +205,4 @@ In order to fix the problem, there are a few options: [apps-must-ask]: img/apps-must-ask.png [ms-com]: https://docs.microsoft.com/en-us/windows/win32/com/the-component-object-model [msal-dotnet]: https://aka.ms/msal-net +[devbox]: https://azure.microsoft.com/en-us/products/dev-box diff --git a/docs/wsl.md b/docs/wsl.md index f37ff614c..8007fc74b 100644 --- a/docs/wsl.md +++ b/docs/wsl.md @@ -25,6 +25,9 @@ credential helper: git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe" ``` +> **Note:** the location of git-credential-manager.exe may be different in your +installation of Git for Windows. + If you intend to use Azure DevOps you must _also_ set the following Git configuration _inside of your WSL installation_. diff --git a/src/linux/Packaging.Linux/Packaging.Linux.csproj b/src/linux/Packaging.Linux/Packaging.Linux.csproj index e14eef0a4..8254da948 100644 --- a/src/linux/Packaging.Linux/Packaging.Linux.csproj +++ b/src/linux/Packaging.Linux/Packaging.Linux.csproj @@ -17,18 +17,14 @@ - - - - - - - + + + diff --git a/src/linux/Packaging.Linux/install-from-source.sh b/src/linux/Packaging.Linux/install-from-source.sh index 903e6ede8..6cc767013 100755 --- a/src/linux/Packaging.Linux/install-from-source.sh +++ b/src/linux/Packaging.Linux/install-from-source.sh @@ -34,7 +34,7 @@ Git Credential Manager is licensed under the MIT License: https://aka.ms/gcm/lic [Nn]*) exit ;; - *) + *) echo "Please answer yes or no." ;; esac @@ -198,7 +198,7 @@ script_path="$(cd "$(dirname "$0")" && pwd)" toplevel_path="${script_path%/src/linux/Packaging.Linux}" if [ "z$script_path" = "z$toplevel_path" ] || [ ! -f "$toplevel_path/Git-Credential-Manager.sln" ]; then toplevel_path="$PWD/git-credential-manager" - test -d "$toplevel_path" || git clone https://github.com/GitCredentialManager/git-credential-manager + test -d "$toplevel_path" || git clone https://github.com/git-ecosystem/git-credential-manager fi if [ -z "$DOTNET_ROOT" ]; then diff --git a/src/linux/Packaging.Linux/layout.sh b/src/linux/Packaging.Linux/layout.sh index 0f2c8ab6a..74b76a313 100755 --- a/src/linux/Packaging.Linux/layout.sh +++ b/src/linux/Packaging.Linux/layout.sh @@ -35,10 +35,6 @@ ROOT="$( cd "$THISDIR"/../../.. ; pwd -P )" SRC="$ROOT/src" OUT="$ROOT/out" GCM_SRC="$SRC/shared/Git-Credential-Manager" -GCM_UI_SRC="$SRC/shared/Git-Credential-Manager.UI.Avalonia" -BITBUCKET_UI_SRC="$SRC/shared/Atlassian.Bitbucket.UI.Avalonia" -GITHUB_UI_SRC="$SRC/shared/GitHub.UI.Avalonia" -GITLAB_UI_SRC="$SRC/shared/GitLab.UI.Avalonia" PROJ_OUT="$OUT/linux/Packaging.Linux" # Build parameters @@ -81,42 +77,6 @@ $DOTNET_ROOT/dotnet publish "$GCM_SRC" \ -p:PublishSingleFile=true \ --output="$(make_absolute "$PAYLOAD")" || exit 1 -echo "Publishing core UI helper..." -$DOTNET_ROOT/dotnet publish "$GCM_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained \ - -p:PublishSingleFile=true \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - -echo "Publishing Bitbucket UI helper..." -$DOTNET_ROOT/dotnet publish "$BITBUCKET_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained \ - -p:PublishSingleFile=true \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - -echo "Publishing GitHub UI helper..." -$DOTNET_ROOT/dotnet publish "$GITHUB_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained \ - -p:PublishSingleFile=true \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - -echo "Publishing GitLab UI helper..." -$DOTNET_ROOT/dotnet publish "$GITLAB_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained=true \ - -p:PublishSingleFile=true \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - # Collect symbols echo "Collecting managed symbols..." mv "$PAYLOAD"/*.pdb "$SYMBOLOUT" || exit 1 diff --git a/src/osx/Installer.Mac/Installer.Mac.csproj b/src/osx/Installer.Mac/Installer.Mac.csproj index dd0f33ea8..4f9d44390 100644 --- a/src/osx/Installer.Mac/Installer.Mac.csproj +++ b/src/osx/Installer.Mac/Installer.Mac.csproj @@ -13,18 +13,14 @@ - - - - - - - + + + diff --git a/src/osx/Installer.Mac/layout.sh b/src/osx/Installer.Mac/layout.sh index 0dc664338..a95eb1f0d 100755 --- a/src/osx/Installer.Mac/layout.sh +++ b/src/osx/Installer.Mac/layout.sh @@ -22,9 +22,6 @@ OUT="$ROOT/out" INSTALLER_SRC="$SRC/osx/Installer.Mac" GCM_SRC="$SRC/shared/Git-Credential-Manager" GCM_UI_SRC="$SRC/shared/Git-Credential-Manager.UI.Avalonia" -BITBUCKET_UI_SRC="$SRC/shared/Atlassian.Bitbucket.UI.Avalonia" -GITHUB_UI_SRC="$SRC/shared/GitHub.UI.Avalonia" -GITLAB_UI_SRC="$SRC/shared/GitLab.UI.Avalonia" # Build parameters FRAMEWORK=net6.0 @@ -103,38 +100,6 @@ dotnet publish "$GCM_SRC" \ --self-contained \ --output="$(make_absolute "$PAYLOAD")" || exit 1 -echo "Publishing core UI helper..." -dotnet publish "$GCM_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - -echo "Publishing Bitbucket UI helper..." -dotnet publish "$BITBUCKET_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - -echo "Publishing GitHub UI helper..." -dotnet publish "$GITHUB_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - -echo "Publishing GitLab UI helper..." -dotnet publish "$GITLAB_UI_SRC" \ - --configuration="$CONFIGURATION" \ - --framework="$FRAMEWORK" \ - --runtime="$RUNTIME" \ - --self-contained \ - --output="$(make_absolute "$PAYLOAD")" || exit 1 - # Collect symbols echo "Collecting managed symbols..." mv "$PAYLOAD"/*.pdb "$SYMBOLOUT" || exit 1 diff --git a/src/shared/Atlassian.Bitbucket.Tests/BitbucketAuthenticationTest.cs b/src/shared/Atlassian.Bitbucket.Tests/BitbucketAuthenticationTest.cs index e92cb9061..a4a5e4afb 100644 --- a/src/shared/Atlassian.Bitbucket.Tests/BitbucketAuthenticationTest.cs +++ b/src/shared/Atlassian.Bitbucket.Tests/BitbucketAuthenticationTest.cs @@ -51,6 +51,7 @@ public async Task BitbucketAuthentication_GetCredentialsAsync_All_ShowsMenu_OAut { var context = new TestCommandContext(); context.SessionManager.IsDesktopSession = true; // Allow OAuth mode + context.Settings.IsGuiPromptsEnabled = false; // Force text prompts context.Terminal.Prompts["option (enter for default)"] = "1"; Uri targetUri = null; @@ -71,6 +72,7 @@ public async Task BitbucketAuthentication_GetCredentialsAsync_All_ShowsMenu_Basi var context = new TestCommandContext(); context.SessionManager.IsDesktopSession = true; // Allow OAuth mode + context.Settings.IsGuiPromptsEnabled = false; // Force text prompts context.Terminal.Prompts["option (enter for default)"] = "2"; context.Terminal.Prompts["Username"] = username; context.Terminal.SecretPrompts["Password"] = password; diff --git a/src/shared/Atlassian.Bitbucket.Tests/Cloud/BitbucketOAuth2ClientTest.cs b/src/shared/Atlassian.Bitbucket.Tests/Cloud/BitbucketOAuth2ClientTest.cs index a1afb8f62..1a6866fb6 100644 --- a/src/shared/Atlassian.Bitbucket.Tests/Cloud/BitbucketOAuth2ClientTest.cs +++ b/src/shared/Atlassian.Bitbucket.Tests/Cloud/BitbucketOAuth2ClientTest.cs @@ -7,6 +7,7 @@ using Atlassian.Bitbucket.Cloud; using GitCredentialManager; using GitCredentialManager.Authentication.OAuth; +using GitCredentialManager.Tests.Objects; using Moq; using Xunit; @@ -16,7 +17,6 @@ public class BitbucketOAuth2ClientTest { private Mock httpClient = new Mock(MockBehavior.Strict); private Mock settings = new Mock(MockBehavior.Loose); - private Mock trace = new Mock(MockBehavior.Loose); private Mock browser = new Mock(MockBehavior.Strict); private Mock codeGenerator = new Mock(MockBehavior.Strict); private IEnumerable scopes = new List(); @@ -55,7 +55,7 @@ public async Task BitbucketOAuth2Client_GetAuthorizationCodeAsync_RespectsClient Uri finalCallbackUri = MockFinalCallbackUri(); Bitbucket.Cloud.BitbucketOAuth2Client client = GetBitbucketOAuth2Client(); - + MockGetAuthenticationCodeAsync(finalCallbackUri, clientId, client.Scopes); MockCodeGenerator(); @@ -68,8 +68,9 @@ public async Task BitbucketOAuth2Client_GetAuthorizationCodeAsync_RespectsClient [Fact] public async Task BitbucketOAuth2Client_GetDeviceCodeAsync() { - var client = new Bitbucket.Cloud.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace.Object); - await Assert.ThrowsAsync(async () => await client.GetDeviceCodeAsync(scopes, ct)); + var trace2 = new NullTrace2(); + var client = new Bitbucket.Cloud.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace2); + await Assert.ThrowsAsync(async () => await client.GetDeviceCodeAsync(scopes, ct)); } [Theory] @@ -79,7 +80,8 @@ public async Task BitbucketOAuth2Client_GetDeviceCodeAsync() [InlineData("https", "example.com/", "john", "https://example.com/refresh_token")] public void BitbucketOAuth2Client_GetRefreshTokenServiceName(string protocol, string host, string username, string expectedResult) { - var client = new Bitbucket.Cloud.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace.Object); + var trace2 = new NullTrace2(); + var client = new Bitbucket.Cloud.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace2); var input = new InputArguments(new Dictionary { ["protocol"] = protocol, @@ -100,7 +102,8 @@ private void VerifyAuthorizationCodeResult(OAuth2AuthorizationCodeResult result) private Bitbucket.Cloud.BitbucketOAuth2Client GetBitbucketOAuth2Client() { - var client = new Bitbucket.Cloud.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace.Object); + var trace2 = new NullTrace2(); + var client = new Bitbucket.Cloud.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace2); client.CodeGenerator = codeGenerator.Object; return client; } diff --git a/src/shared/Atlassian.Bitbucket.Tests/DataCenter/BitbucketOAuth2ClientTest.cs b/src/shared/Atlassian.Bitbucket.Tests/DataCenter/BitbucketOAuth2ClientTest.cs index 97d194764..e2e7225db 100644 --- a/src/shared/Atlassian.Bitbucket.Tests/DataCenter/BitbucketOAuth2ClientTest.cs +++ b/src/shared/Atlassian.Bitbucket.Tests/DataCenter/BitbucketOAuth2ClientTest.cs @@ -7,6 +7,7 @@ using Atlassian.Bitbucket.DataCenter; using GitCredentialManager; using GitCredentialManager.Authentication.OAuth; +using GitCredentialManager.Tests.Objects; using Moq; using Xunit; @@ -16,7 +17,6 @@ public class BitbucketOAuth2ClientTest { private Mock httpClient = new Mock(MockBehavior.Strict); private Mock settings = new Mock(MockBehavior.Loose); - private Mock trace = new Mock(MockBehavior.Loose); private Mock browser = new Mock(MockBehavior.Strict); private Mock codeGenerator = new Mock(MockBehavior.Strict); private CancellationToken ct = new CancellationToken(); @@ -77,7 +77,8 @@ private void VerifyAuthorizationCodeResult(OAuth2AuthorizationCodeResult result, private Bitbucket.DataCenter.BitbucketOAuth2Client GetBitbucketOAuth2Client() { - var client = new Bitbucket.DataCenter.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace.Object); + var trace2 = new NullTrace2(); + var client = new Bitbucket.DataCenter.BitbucketOAuth2Client(httpClient.Object, settings.Object, trace2); client.CodeGenerator = codeGenerator.Object; return client; } diff --git a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj b/src/shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj deleted file mode 100644 index a9185278a..000000000 --- a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - WinExe - net6.0 - osx-x64;linux-x64;osx-arm64 - Atlassian.Bitbucket.UI - Atlassian.Bitbucket.UI - - - - - - - - - - TesterWindow.axaml - Code - - - - - diff --git a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Commands/CredentialsCommandImpl.cs b/src/shared/Atlassian.Bitbucket.UI.Avalonia/Commands/CredentialsCommandImpl.cs deleted file mode 100644 index e9be595ad..000000000 --- a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Commands/CredentialsCommandImpl.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; -using Atlassian.Bitbucket.UI.ViewModels; -using Atlassian.Bitbucket.UI.Views; -using GitCredentialManager; -using GitCredentialManager.UI; - -namespace Atlassian.Bitbucket.UI.Commands -{ - public class CredentialsCommandImpl : CredentialsCommand - { - public CredentialsCommandImpl(ICommandContext context) : base(context) { } - - protected override Task ShowAsync(CredentialsViewModel viewModel, CancellationToken ct) - { - return AvaloniaUi.ShowViewAsync(viewModel, GetParentHandle(), ct); - } - } -} diff --git a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Controls/TesterWindow.axaml b/src/shared/Atlassian.Bitbucket.UI.Avalonia/Controls/TesterWindow.axaml deleted file mode 100644 index fca8daf48..000000000 --- a/src/shared/Atlassian.Bitbucket.UI.Avalonia/Controls/TesterWindow.axaml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - + diff --git a/src/shared/Core.UI.Avalonia/Controls/DialogWindow.axaml.cs b/src/shared/Core/UI/Controls/DialogWindow.axaml.cs similarity index 95% rename from src/shared/Core.UI.Avalonia/Controls/DialogWindow.axaml.cs rename to src/shared/Core/UI/Controls/DialogWindow.axaml.cs index 1bed4d454..79501edb8 100644 --- a/src/shared/Core.UI.Avalonia/Controls/DialogWindow.axaml.cs +++ b/src/shared/Core/UI/Controls/DialogWindow.axaml.cs @@ -9,7 +9,7 @@ namespace GitCredentialManager.UI.Controls { - public class DialogWindow : Window + public partial class DialogWindow : Window { private readonly Control _view; private ContentControl _contentHolder; @@ -46,7 +46,7 @@ protected override void OnDataContextChanged(EventArgs e) // Send a focus request to the child view on idle if (_view is IFocusable focusable) { - Avalonia.Threading.Dispatcher.UIThread.Post(() => focusable.SetFocus(), DispatcherPriority.ApplicationIdle); + Avalonia.Threading.Dispatcher.UIThread.Post(() => focusable.SetFocus(), DispatcherPriority.Normal); } } } diff --git a/src/shared/Core.UI/Controls/IFocusable.cs b/src/shared/Core/UI/Controls/IFocusable.cs similarity index 100% rename from src/shared/Core.UI/Controls/IFocusable.cs rename to src/shared/Core/UI/Controls/IFocusable.cs diff --git a/src/shared/Core/UI/Converters/BoolConvertersEx.cs b/src/shared/Core/UI/Converters/BoolConvertersEx.cs new file mode 100644 index 000000000..836df8b8e --- /dev/null +++ b/src/shared/Core/UI/Converters/BoolConvertersEx.cs @@ -0,0 +1,42 @@ +using System; +using System.Globalization; +using System.Linq; +using Avalonia; +using Avalonia.Data.Converters; + +namespace GitCredentialManager.UI.Converters +{ + public static class BoolConvertersEx + { + public static readonly IValueConverter ToThickness = new BoolToThicknessConverter(); + + public static readonly IMultiValueConverter Or = + new FuncMultiValueConverter(x => x.Aggregate(false, (a, b) => a || b)); + + public static readonly IMultiValueConverter And = + new FuncMultiValueConverter(x => x.Aggregate(true, (a, b) => a && b)); + + private class BoolToThicknessConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is not bool b) + { + return null; + } + + if (parameter is int i) + { + return b ? new Thickness(i) : new Thickness(0); + } + + return b ? new Thickness(1) : new Thickness(0); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return null; + } + } + } +} diff --git a/src/shared/Core.UI.Avalonia/Converters/WindowClientAreaConverters.cs b/src/shared/Core/UI/Converters/WindowClientAreaConverters.cs similarity index 100% rename from src/shared/Core.UI.Avalonia/Converters/WindowClientAreaConverters.cs rename to src/shared/Core/UI/Converters/WindowClientAreaConverters.cs diff --git a/src/shared/Core.UI.Avalonia/Dispatcher.cs b/src/shared/Core/UI/Dispatcher.cs similarity index 87% rename from src/shared/Core.UI.Avalonia/Dispatcher.cs rename to src/shared/Core/UI/Dispatcher.cs index dcbf1b224..9dd991438 100644 --- a/src/shared/Core.UI.Avalonia/Dispatcher.cs +++ b/src/shared/Core/UI/Dispatcher.cs @@ -59,7 +59,7 @@ public void VerifyAccess() /// Post work to be run on the thread associated with this dispatcher. /// /// Work to be run. - public void Post(Action work) + public void Post(Action work) { Task _ = InvokeAsync(work); } @@ -69,14 +69,14 @@ public void Post(Action work) /// synchronously until the work is complete. /// /// Work to be run. - public Task InvokeAsync(Action work) + public Task InvokeAsync(Action work) { var tcs = new TaskCompletionSource(); _queue.AddJob(new DispatcherJob(work, tcs)); return tcs.Task; } - public Task InvokeAsync(Func work) + public Task InvokeAsync(Func work) { var tcs = new TaskCompletionSource(); _queue.AddJob(new DispatcherJob(work, tcs)); @@ -85,41 +85,41 @@ public Task InvokeAsync(Func work) private interface IDispatcherJob { - void Execute(); + void Execute(CancellationToken ct); } private class DispatcherJob : IDispatcherJob { - private readonly Action _work; + private readonly Action _work; private readonly TaskCompletionSource _tcs; - public DispatcherJob(Action work, TaskCompletionSource tcs) + public DispatcherJob(Action work, TaskCompletionSource tcs) { _work = work; _tcs = tcs; } - public void Execute() + public void Execute(CancellationToken ct) { - _work(); + _work(ct); _tcs?.SetResult(null); } } private class DispatcherJob : IDispatcherJob { - private readonly Func _work; + private readonly Func _work; private readonly TaskCompletionSource _tcs; - public DispatcherJob(Func work, TaskCompletionSource tcs) + public DispatcherJob(Func work, TaskCompletionSource tcs) { _work = work; _tcs = tcs; } - public void Execute() + public void Execute(CancellationToken ct) { - TResult result = _work(); + TResult result = _work(ct); _tcs?.SetResult(result); } } @@ -127,6 +127,7 @@ public void Execute() private class DispatcherJobQueue { private readonly Queue _queue = new(); + private readonly CancellationTokenSource _cts = new(); private enum State { @@ -157,7 +158,7 @@ public void Run() while (TryTake(out IDispatcherJob job)) { - job.Execute(); + job.Execute(_cts.Token); } } @@ -175,6 +176,7 @@ public void Shutdown() throw new InvalidOperationException("Dispatcher has already shut down."); } _state = State.Stopping; + _cts.Cancel(); Monitor.Pulse(_queue); } } diff --git a/src/shared/Core.UI/HelperApplication.cs b/src/shared/Core/UI/HelperApplication.cs similarity index 100% rename from src/shared/Core.UI/HelperApplication.cs rename to src/shared/Core/UI/HelperApplication.cs diff --git a/src/shared/Core.UI/HelperCommand.cs b/src/shared/Core/UI/HelperCommand.cs similarity index 100% rename from src/shared/Core.UI/HelperCommand.cs rename to src/shared/Core/UI/HelperCommand.cs diff --git a/src/shared/Core.UI/RelayCommand.cs b/src/shared/Core/UI/RelayCommand.cs similarity index 100% rename from src/shared/Core.UI/RelayCommand.cs rename to src/shared/Core/UI/RelayCommand.cs diff --git a/src/shared/Core.UI/ViewModels/CredentialsViewModel.cs b/src/shared/Core/UI/ViewModels/CredentialsViewModel.cs similarity index 97% rename from src/shared/Core.UI/ViewModels/CredentialsViewModel.cs rename to src/shared/Core/UI/ViewModels/CredentialsViewModel.cs index 7f40b8bea..3376ef861 100644 --- a/src/shared/Core.UI/ViewModels/CredentialsViewModel.cs +++ b/src/shared/Core/UI/ViewModels/CredentialsViewModel.cs @@ -7,7 +7,7 @@ public class CredentialsViewModel : WindowViewModel private string _userName; private string _password; private string _description; - private bool _showProductHeader; + private bool _showProductHeader = true; private RelayCommand _signInCommand; public CredentialsViewModel() diff --git a/src/shared/Core/UI/ViewModels/DefaultAccountViewModel.cs b/src/shared/Core/UI/ViewModels/DefaultAccountViewModel.cs new file mode 100644 index 000000000..f91ef6394 --- /dev/null +++ b/src/shared/Core/UI/ViewModels/DefaultAccountViewModel.cs @@ -0,0 +1,79 @@ +using System.Windows.Input; + +namespace GitCredentialManager.UI.ViewModels; + +public class DefaultAccountViewModel : WindowViewModel +{ + private readonly IEnvironment _env; + + private bool _showProductHeader = true; + private string _userName; + private ICommand _continueCommand; + private ICommand _otherAccountCommand; + private ICommand _learnMoreCommand; + + public DefaultAccountViewModel() + { + // For designer only + } + + public DefaultAccountViewModel(IEnvironment environment) : this() + { + _env = environment; + + ContinueCommand = new RelayCommand(Continue); + OtherAccountCommand = new RelayCommand(OtherAccount); + LearnMoreCommand = new RelayCommand(OpenLink); + } + + private void OtherAccount() + { + UseDefaultAccount = false; + Accept(); + } + + private void Continue() + { + UseDefaultAccount = true; + Accept(); + } + + private void OpenLink() + { + BrowserUtils.OpenDefaultBrowser(_env, Link); + } + + public bool UseDefaultAccount { get; private set; } + + public string Link => Constants.HelpUrls.GcmDefaultAccount; + + public bool ShowProductHeader + { + get => _showProductHeader; + set => SetAndRaisePropertyChanged(ref _showProductHeader, value); + } + + public string UserName + { + get => _userName; + set => SetAndRaisePropertyChanged(ref _userName, value); + } + + public ICommand ContinueCommand + { + get => _continueCommand; + set => SetAndRaisePropertyChanged(ref _continueCommand, value); + } + + public ICommand OtherAccountCommand + { + get => _otherAccountCommand; + set => SetAndRaisePropertyChanged(ref _otherAccountCommand, value); + } + + public ICommand LearnMoreCommand + { + get => _learnMoreCommand; + set => SetAndRaisePropertyChanged(ref _learnMoreCommand, value); + } +} diff --git a/src/shared/Core.UI/ViewModels/DeviceCodeViewModel.cs b/src/shared/Core/UI/ViewModels/DeviceCodeViewModel.cs similarity index 97% rename from src/shared/Core.UI/ViewModels/DeviceCodeViewModel.cs rename to src/shared/Core/UI/ViewModels/DeviceCodeViewModel.cs index d44a9f2c7..45112518d 100644 --- a/src/shared/Core.UI/ViewModels/DeviceCodeViewModel.cs +++ b/src/shared/Core/UI/ViewModels/DeviceCodeViewModel.cs @@ -9,7 +9,7 @@ public class DeviceCodeViewModel : WindowViewModel private ICommand _verificationUrlCommand; private string _verificationUrl; private string _userCode; - private bool _showProductHeader; + private bool _showProductHeader = true; public DeviceCodeViewModel() { diff --git a/src/shared/Core.UI/ViewModels/OAuthViewModel.cs b/src/shared/Core/UI/ViewModels/OAuthViewModel.cs similarity index 97% rename from src/shared/Core.UI/ViewModels/OAuthViewModel.cs rename to src/shared/Core/UI/ViewModels/OAuthViewModel.cs index 607642f31..03a2110fb 100644 --- a/src/shared/Core.UI/ViewModels/OAuthViewModel.cs +++ b/src/shared/Core/UI/ViewModels/OAuthViewModel.cs @@ -5,7 +5,7 @@ namespace GitCredentialManager.UI.ViewModels public class OAuthViewModel : WindowViewModel { private string _description; - private bool _showProductHeader; + private bool _showProductHeader = true; private bool _showBrowserLogin; private bool _showDeviceCodeLogin; private RelayCommand _signInBrowserCommand; diff --git a/src/shared/Core.UI/ViewModels/ViewModel.cs b/src/shared/Core/UI/ViewModels/ViewModel.cs similarity index 100% rename from src/shared/Core.UI/ViewModels/ViewModel.cs rename to src/shared/Core/UI/ViewModels/ViewModel.cs diff --git a/src/shared/Core.UI/ViewModels/WindowViewModel.cs b/src/shared/Core/UI/ViewModels/WindowViewModel.cs similarity index 59% rename from src/shared/Core.UI/ViewModels/WindowViewModel.cs rename to src/shared/Core/UI/ViewModels/WindowViewModel.cs index 995a72f9b..078d7c3b8 100644 --- a/src/shared/Core.UI/ViewModels/WindowViewModel.cs +++ b/src/shared/Core/UI/ViewModels/WindowViewModel.cs @@ -5,7 +5,7 @@ namespace GitCredentialManager.UI.ViewModels public class WindowViewModel : ViewModel { private bool _extendClientArea; - private bool _showClientChromeOverride; + private bool _showCustomChromeOverride; private bool _showDebugControls; private string _title; @@ -14,8 +14,10 @@ public class WindowViewModel : ViewModel public WindowViewModel() { - // Default to hiding the system chrome on macOS only for now - ExtendClientArea = PlatformUtils.IsMacOS(); + Title = Constants.DefaultWindowTitle; + + // Extend the client area on Windows and macOS only + ExtendClientArea = PlatformUtils.IsMacOS() || PlatformUtils.IsWindows(); } public bool WindowResult { get; private set; } @@ -28,16 +30,25 @@ public bool ShowDebugControls public bool ShowCustomChrome { - get => ShowClientChromeOverride || (ExtendClientArea && !PlatformUtils.IsMacOS()); + // On macOS we typically do NOT want to show the custom chrome if we've extended the client area + // because the native 'traffic light' controls will still be visible and we don't want to show our own. + get => ShowCustomChromeOverride || (ExtendClientArea && !PlatformUtils.IsMacOS()); } - public bool ShowClientChromeOverride + public bool ShowCustomWindowBorder { - get => _showClientChromeOverride; + // Draw the window border explicitly on Windows + get => ShowCustomChrome && PlatformUtils.IsWindows(); + } + + public bool ShowCustomChromeOverride + { + get => _showCustomChromeOverride; set { - SetAndRaisePropertyChanged(ref _showClientChromeOverride, value); + SetAndRaisePropertyChanged(ref _showCustomChromeOverride, value); RaisePropertyChanged(nameof(ShowCustomChrome)); + RaisePropertyChanged(nameof(ShowCustomWindowBorder)); } } @@ -48,6 +59,7 @@ public bool ExtendClientArea { SetAndRaisePropertyChanged(ref _extendClientArea, value); RaisePropertyChanged(nameof(ShowCustomChrome)); + RaisePropertyChanged(nameof(ShowCustomWindowBorder)); } } diff --git a/src/shared/Git-Credential-Manager.UI.Avalonia/Views/CredentialsView.axaml b/src/shared/Core/UI/Views/CredentialsView.axaml similarity index 94% rename from src/shared/Git-Credential-Manager.UI.Avalonia/Views/CredentialsView.axaml rename to src/shared/Core/UI/Views/CredentialsView.axaml index 5f2b0e0fa..51659345f 100644 --- a/src/shared/Git-Credential-Manager.UI.Avalonia/Views/CredentialsView.axaml +++ b/src/shared/Core/UI/Views/CredentialsView.axaml @@ -2,8 +2,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:vm="clr-namespace:GitCredentialManager.UI.ViewModels;assembly=gcmcoreui" - xmlns:converters="clr-namespace:GitCredentialManager.UI.Converters;assembly=gcmcoreuiavn" + xmlns:vm="clr-namespace:GitCredentialManager.UI.ViewModels;assembly=gcmcore" + xmlns:converters="clr-namespace:GitCredentialManager.UI.Converters;assembly=gcmcore" mc:Ignorable="d" d:DesignWidth="420" x:Class="GitCredentialManager.UI.Views.CredentialsView"> @@ -17,7 +17,7 @@ IsVisible="{Binding ShowProductHeader}"> + + + + + + + + + + + + Do you want to continue with the current account? + + + + + +