diff --git a/.gitattributes b/.gitattributes index 2bc4defac6..b0044cf272 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,6 @@ *.perl eol=lf diff=perl *.pl eof=lf diff=perl *.pm eol=lf diff=perl -*.png binary *.py eol=lf diff=python *.bat eol=crlf CODE_OF_CONDUCT.md -whitespace diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 4017ed82ca..0000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,64 +0,0 @@ - - [ ] I was not able to find an [open](https://github.com/git-for-windows/git/issues?q=is%3Aopen) or [closed](https://github.com/git-for-windows/git/issues?q=is%3Aclosed) issue matching what I'm seeing - -### Setup - - - Which version of Git for Windows are you using? Is it 32-bit or 64-bit? - -``` -$ git --version --build-options - -** insert your machine's response here ** -``` - - - Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit? - -``` -$ cmd.exe /c ver - -** insert your machine's response here ** -``` - - - What options did you set as part of the installation? Or did you choose the - defaults? - -``` -# One of the following: -> type "C:\Program Files\Git\etc\install-options.txt" -> type "C:\Program Files (x86)\Git\etc\install-options.txt" -> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt" -> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt" -$ cat /etc/install-options.txt - -** insert your machine's response here ** -``` - - - Any other interesting things about your environment that might be related - to the issue you're seeing? - -** insert your response here ** - -### Details - - - Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other - -** insert your response here ** - - - What commands did you run to trigger this issue? If you can provide a - [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) - this will help us understand the issue. - -``` -** insert your commands here ** -``` - - What did you expect to occur after running these commands? - -** insert here ** - - - What actually happened instead? - -** insert here ** - - - If the problem was occurring with a specific repository, can you provide the - URL to that repository to help us with testing? - -** insert URL here ** diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 831ef6f19f..952c7c3a2a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,19 +1,7 @@ -Thanks for taking the time to contribute to Git! - -Those seeking to contribute to the Git for Windows fork should see -http://gitforwindows.org/#contribute on how to contribute Windows specific -enhancements. - -If your contribution is for the core Git functions and documentation -please be aware that the Git community does not use the github.com issues -or pull request mechanism for their contributions. - -Instead, we use the Git mailing list (git@vger.kernel.org) for code and -documentation submissions, code reviews, and bug reports. The -mailing list is plain text only (anything with HTML is sent directly -to the spam folder). - -Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/) +Thanks for taking the time to contribute to Git! Please be advised that the +Git community does not use github.com for their contributions. Instead, we use +a mailing list (git@vger.kernel.org) for code submissions, code reviews, and +bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/) to conveniently send your Pull Requests commits to our mailing list. Please read the "guidelines for contributing" linked above! diff --git a/.github/config.yml b/.github/config.yml deleted file mode 100644 index 45edb7ba37..0000000000 --- a/.github/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot - -# *Required* toxicity threshold between 0 and .99 with the higher numbers being -# the most toxic. Anything higher than this threshold will be marked as toxic -# and commented on -sentimentBotToxicityThreshold: .7 - -# *Required* Comment to reply with -sentimentBotReplyComment: > - Please be sure to review the code of conduct and be respectful of other users. cc/ @git-for-windows/trusted-git-for-windows-developers diff --git a/.github/workflows/git-artifacts.yml b/.github/workflows/git-artifacts.yml deleted file mode 100644 index 9b4d1c3aaa..0000000000 --- a/.github/workflows/git-artifacts.yml +++ /dev/null @@ -1,514 +0,0 @@ -name: git-artifacts - -on: - # This workflow can be triggered manually in the Actions tab, see - # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ - workflow_dispatch: - inputs: - build_only: - description: 'Optionally restrict what artifacts to build' - required: false - ref: - description: 'Optionally override which branch to build' - required: false - repository: - description: 'Optionally override from where to fetch the specified ref' - required: false - -env: - GPG_OPTIONS: "--batch --yes --no-tty --list-options no-show-photos --verify-options no-show-photos --pinentry-mode loopback" - HOME: "${{github.workspace}}\\home" - MSYSTEM: MINGW64 - USERPROFILE: "${{github.workspace}}\\home" - BUILD_ONLY: "${{github.event.inputs.build_only}}" - REPOSITORY: "${{github.event.inputs.repository}}" - REF: "${{github.event.inputs.ref}}" - -jobs: - bundle-artifacts: - runs-on: windows-latest - steps: - - name: Configure user - shell: bash - run: - USER_NAME="${{github.actor}}" && - USER_EMAIL="${{github.actor}}@users.noreply.github.com" && - mkdir "$HOME" && - git config --global user.name "$USER_NAME" && - git config --global user.email "$USER_EMAIL" && - echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV - - uses: git-for-windows/setup-git-for-windows-sdk@v1 - with: - flavor: build-installers - - name: Clone build-extra - shell: bash - run: | - d=/usr/src/build-extra && - if test ! -d $d/.git - then - git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d - else - git -C $d fetch https://github.com/git-for-windows/build-extra main && - git -C $d switch -C main FETCH_HEAD - fi - - name: Prepare home directory for GPG signing - if: env.GPGKEY != '' - shell: bash - run: | - echo '${{secrets.PRIVGPGKEY}}' | tr % '\n' | gpg $GPG_OPTIONS --import && - mkdir -p home && - git config --global gpg.program "/usr/src/build-extra/gnupg-with-gpgkey.sh" && - info="$(gpg --list-keys --with-colons "${GPGKEY%% *}" | cut -d : -f 1,10 | sed -n '/^uid/{s|uid:||p;q}')" && - git config --global user.name "${info% <*}" && - git config --global user.email "<${info#*<}" - env: - GPGKEY: ${{secrets.GPGKEY}} - - name: Generate bundle artifacts - env: - GPGKEY: ${{secrets.GPGKEY}} - shell: bash - run: | - printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "$@"\n' >/usr/bin/git && - mkdir -p bundle-artifacts && - - { test -n "$REPOSITORY" || REPOSITORY='${{github.repository}}'; } && - { test -n "$REF" || REF='${{github.ref}}'; } && - git -c init.defaultBranch=main init --bare && - git remote add -f origin https://github.com/git-for-windows/git && - git fetch "https://github.com/$REPOSITORY" "$REF:$REF" && - - tag_name="$(git describe --match 'v[0-9]*' FETCH_HEAD)-$(date +%Y%m%d%H%M%S)" && - echo "prerelease-${tag_name#v}" >bundle-artifacts/ver && - echo "${tag_name#v}" >bundle-artifacts/display_version && - echo "$tag_name" >bundle-artifacts/next_version && - git tag $(test -z "$GPGKEY" || echo " -s") -m "Snapshot build" "$tag_name" FETCH_HEAD && - git bundle create bundle-artifacts/git.bundle origin/main.."$tag_name" && - - sh -x /usr/src/build-extra/please.sh mention feature "Snapshot of $(git show -s --pretty='tformat:%h (%s, %ad)' --date=short FETCH_HEAD)" && - git -C /usr/src/build-extra bundle create "$PWD/bundle-artifacts/build-extra.bundle" origin/main..main - - name: Clean up temporary files - if: always() - shell: bash - run: rm -rf home - - name: 'Publish Pipeline Artifact: bundle-artifacts' - uses: actions/upload-artifact@v1 - with: - name: bundle-artifacts - path: bundle-artifacts - pkg: - runs-on: windows-latest - needs: bundle-artifacts - strategy: - matrix: - arch: - - name: x86_64 - bitness: 64 - bin: /amd64 - - name: i686 - bitness: 32 - bin: '' - steps: - - name: Determine whether this job should be skipped - shell: bash - run: | - for e in ${BUILD_ONLY:-pkg} - do - case $e in - *-${{matrix.arch.name}}) exit 0;; # build this artifact - *-arm64) test i686 != ${{matrix.arch.name}} || exit 0;; # pkg-i686 is required for the ARM64 version - *-*) ;; # not this build artifact, keep looking - *) exit 0;; # build this artifact - esac - done - echo "SKIP=true" >>$GITHUB_ENV - - name: Configure user - if: env.SKIP != 'true' - shell: bash - run: - USER_NAME="${{github.actor}}" && - USER_EMAIL="${{github.actor}}@users.noreply.github.com" && - mkdir "$HOME" && - git config --global user.name "$USER_NAME" && - git config --global user.email "$USER_EMAIL" && - echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV - - uses: git-for-windows/setup-git-for-windows-sdk@v1 - if: env.SKIP != 'true' - with: - flavor: build-installers - - name: Download bundle-artifacts - if: env.SKIP != 'true' - uses: actions/download-artifact@v1 - with: - name: bundle-artifacts - path: bundle-artifacts - - name: Clone and update build-extra - if: env.SKIP != 'true' - shell: bash - run: | - d=/usr/src/build-extra && - if test ! -d $d/.git - then - git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d - else - git -C $d fetch https://github.com/git-for-windows/build-extra main && - git -C $d switch -C main FETCH_HEAD - fi && - git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main - - name: Check out git/git - if: env.SKIP != 'true' - shell: bash - run: | - git -c init.defaultBranch=main init && - git remote add -f origin https://github.com/git-for-windows/git && - git fetch --tags bundle-artifacts/git.bundle $(cat bundle-artifacts/next_version) && - git reset --hard $(cat bundle-artifacts/next_version) - - name: Prepare home directory for code-signing - env: - CODESIGN_P12: ${{secrets.CODESIGN_P12}} - CODESIGN_PASS: ${{secrets.CODESIGN_PASS}} - if: env.SKIP != 'true' && env.CODESIGN_P12 != '' && env.CODESIGN_PASS != '' - shell: bash - run: | - cd home && - mkdir -p .sig && - echo -n "$CODESIGN_P12" | tr % '\n' | base64 -d >.sig/codesign.p12 && - echo -n "$CODESIGN_PASS" >.sig/codesign.pass - git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"' - - name: Prepare home directory for GPG signing - if: env.SKIP != 'true' && env.GPGKEY != '' - shell: bash - run: | - echo '${{secrets.PRIVGPGKEY}}' | tr % '\n' | gpg $GPG_OPTIONS --import && - info="$(gpg --list-keys --with-colons "${GPGKEY%% *}" | cut -d : -f 1,10 | sed -n '/^uid/{s|uid:||p;q}')" && - git config --global user.name "${info% <*}" && - git config --global user.email "<${info#*<}" - env: - GPGKEY: ${{secrets.GPGKEY}} - - name: Build mingw-w64-${{matrix.arch.name}}-git - if: env.SKIP != 'true' - env: - GPGKEY: "${{secrets.GPGKEY}}" - shell: bash - run: | - set -x - - # Make sure that there is a `/usr/bin/git` that can be used by `makepkg-mingw` - printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "$@"\n' >/usr/bin/git && - - # Restrict `PATH` to MSYS2 and to Visual Studio (to let `cv2pdb` find the relevant DLLs) - PATH="/mingw64/bin:/usr/bin:/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/:/C/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin${{matrix.arch.bin}}:/C/Windows/system32" - - type -p mspdb140.dll || exit 1 - sh -x /usr/src/build-extra/please.sh build-mingw-w64-git --only-${{matrix.arch.bitness}}-bit --build-src-pkg -o artifacts HEAD && - cp bundle-artifacts/ver artifacts/ && - if test -n "$GPGKEY" - then - for tar in artifacts/*.tar* - do - /usr/src/build-extra/gnupg-with-gpgkey.sh --detach-sign --no-armor $tar - done - fi && - - b=$PWD/artifacts && - version=$(cat bundle-artifacts/next_version) && - (cd /usr/src/MINGW-packages/mingw-w64-git && - cp PKGBUILD.$version PKGBUILD && - git commit -s -m "mingw-w64-git: new version ($version)" PKGBUILD && - git bundle create "$b"/MINGW-packages.bundle origin/main..main) - - name: Clean up temporary files - if: always() && env.SKIP != 'true' - shell: bash - run: rm -rf home - - name: Publish mingw-w64-${{matrix.arch.name}}-git - if: env.SKIP != 'true' - uses: actions/upload-artifact@v1 - with: - name: pkg-${{matrix.arch.name}} - path: artifacts - build-arm64: - needs: bundle-artifacts - runs-on: windows-latest - steps: - - name: Determine whether this job should be skipped - shell: bash - run: | - for e in ${BUILD_ONLY:-pkg} - do - case $e in - *-arm64) exit 0;; # build this artifact - *-*) ;; # not this build artifact, keep looking - *) exit 0;; # build this artifact - esac - done - echo "SKIP=true" >>$GITHUB_ENV - - name: Configure user - if: env.SKIP != 'true' - shell: bash - run: - USER_NAME="${{github.actor}}" && - USER_EMAIL="${{github.actor}}@users.noreply.github.com" && - mkdir -p "$HOME" && - git config --global user.name "$USER_NAME" && - git config --global user.email "$USER_EMAIL" - - name: Download bundle-artifacts - if: env.SKIP != 'true' - uses: actions/download-artifact@v1 - with: - name: bundle-artifacts - path: bundle-artifacts - - name: Check out git/git - if: env.SKIP != 'true' - shell: bash - run: | - git -c init.defaultBranch=main init && - git remote add -f origin https://github.com/git-for-windows/git && - git fetch --tags bundle-artifacts/git.bundle $(cat bundle-artifacts/next_version) && - git reset --hard $(cat bundle-artifacts/next_version) - - name: initialize vcpkg - if: env.SKIP != 'true' - uses: actions/checkout@v2 - with: - repository: 'microsoft/vcpkg' - path: 'compat/vcbuild/vcpkg' - - name: download vcpkg artifacts - if: env.SKIP != 'true' - uses: git-for-windows/get-azure-pipelines-artifact@v0 - with: - repository: git/git - definitionId: 9 - - name: add msbuild to PATH - if: env.SKIP != 'true' - uses: microsoft/setup-msbuild@v1 - - name: copy dlls to root - if: env.SKIP != 'true' - shell: powershell - run: | - & compat\vcbuild\vcpkg_copy_dlls.bat release arm64-windows - if (!$?) { exit(1) } - - name: generate Visual Studio solution - if: env.SKIP != 'true' - shell: bash - run: | - cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/arm64-windows \ - -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=arm64 -DVCPKG_ARCH=arm64-windows \ - -DCMAKE_INSTALL_PREFIX="`pwd`/git-arm64" -DSKIP_DASHED_BUILT_INS=ON -DHOST_CPU=arm64 - - name: MSBuild - if: env.SKIP != 'true' - run: msbuild git.sln -property:Configuration=Release - - name: Link the Git executables - if: env.SKIP != 'true' - run: msbuild INSTALL.vcxproj -property:Configuration=Release - - name: upload build artifacts - if: env.SKIP != 'true' - uses: actions/upload-artifact@v1 - with: - name: arm64-artifacts - path: ./git-arm64 - artifacts: - runs-on: windows-latest - needs: [pkg, build-arm64] - strategy: - matrix: - artifact: - - name: installer - fileprefix: Git - fileextension: exe - - name: portable - fileprefix: PortableGit - fileextension: exe - - name: archive - fileprefix: Git - fileextension: tar.bz2 - - name: mingit - fileprefix: MinGit - fileextension: zip - - name: mingit-busybox - fileprefix: MinGit - fileextension: zip - arch: - - name: x86_64 - bitness: 64 - arm64: false - - name: i686 - bitness: 32 - arm64: false - - name: i686 - bitness: 32 - arm64: true - fail-fast: false - env: - MSYSTEM: MINGW${{matrix.arch.bitness}} - steps: - - name: Determine whether this job should be skipped - shell: bash - run: | - suffix=${{matrix.arch.name}} - if test true = ${{matrix.arch.arm64}} - then - suffix=arm64 - fi - case " $BUILD_ONLY " in - ' ') ;; # not set; build all - *" ${{matrix.artifact.name}} "*|*" ${{matrix.artifact.name}}-$suffix "*) ;; # build this artifact - *) echo "SKIP=true" >>$GITHUB_ENV;; - esac - - name: Download pkg-${{matrix.arch.name}} - if: env.SKIP != 'true' - uses: actions/download-artifact@v1 - with: - name: pkg-${{matrix.arch.name}} - path: pkg-${{matrix.arch.name}} - - name: Download bundle-artifacts - if: env.SKIP != 'true' - uses: actions/download-artifact@v1 - with: - name: bundle-artifacts - path: bundle-artifacts - - uses: git-for-windows/setup-git-for-windows-sdk@v1 - if: env.SKIP != 'true' && matrix.arch.bitness == '64' - with: - flavor: build-installers - - uses: git-for-windows/setup-git-for-windows-sdk@v1 - if: env.SKIP != 'true' && matrix.arch.bitness == '32' - with: - flavor: build-installers - architecture: i686 - - name: Download arm64 artifact - if: env.SKIP != 'true' && matrix.arch.arm64 == true - uses: actions/download-artifact@v1 - with: - name: arm64-artifacts - path: ${{github.workspace}}/arm64 - # Workaround for Git Credential Manager Core on ARM64: https://github.com/git-for-windows/git/issues/3015 - - name: Create git-credential-manager-core wrapper for ARM64 - if: env.SKIP != 'true' && matrix.arch.arm64 == true - shell: bash - run: | - printf '%s\n' '#!/bin/sh' 'exec /mingw32/libexec/git-core/git-credential-manager-core.exe "$@"' > arm64/libexec/git-core/git-credential-manager-core - chmod +x arm64/libexec/git-core/git-credential-manager-core - - name: Clone and update build-extra - if: env.SKIP != 'true' - shell: bash - run: | - d=/usr/src/build-extra && - if test ! -d $d/.git - then - git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d - else - git -C $d fetch https://github.com/git-for-windows/build-extra main && - git -C $d switch -C main FETCH_HEAD - fi && - git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main - - name: Prepare home directory for code-signing - env: - CODESIGN_P12: ${{secrets.CODESIGN_P12}} - CODESIGN_PASS: ${{secrets.CODESIGN_PASS}} - if: env.SKIP != 'true' && (matrix.artifact.name == 'installer' || matrix.artifact.name == 'portable') && env.CODESIGN_P12 != '' && env.CODESIGN_PASS != '' - shell: bash - run: | - mkdir -p home/.sig && - echo -n "$CODESIGN_P12" | tr % '\n' | base64 -d >home/.sig/codesign.p12 && - echo -n "$CODESIGN_PASS" >home/.sig/codesign.pass && - git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"' - - name: Build ${{matrix.arch.bitness}}-bit ${{matrix.artifact.name}} - if: env.SKIP != 'true' - shell: bash - run: | - set -x - if test "${{matrix.arch.arm64}}" = true - then - ARM64="--include-arm64-artifacts=\"$PWD/arm64\"" - else - ARM64= - fi - - eval /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git $ARM64 --version=$(cat pkg-${{matrix.arch.name}}/ver) -o artifacts --${{matrix.artifact.name}} --pkg=pkg-${{matrix.arch.name}}/mingw-w64-${{matrix.arch.name}}-git-[0-9]*.tar.xz --pkg=pkg-${{matrix.arch.name}}/mingw-w64-${{matrix.arch.name}}-git-doc-html-[0-9]*.tar.xz && - if test portable = '${{matrix.artifact.name}}' && test -n "$(git config alias.signtool)" - then - git signtool artifacts/PortableGit-*.exe - fi && - openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed "s/.* //" >artifacts/sha-256.txt - - name: Copy package-versions and pdbs - if: env.SKIP != 'true' && matrix.artifact.name == 'installer' - shell: bash - run: | - cp /usr/src/build-extra/installer/package-versions.txt artifacts/ && - - a=$PWD/artifacts && - p=$PWD/pkg-${{matrix.arch.name}} && - (cd /usr/src/build-extra && - mkdir -p cached-source-packages && - cp "$p"/*-pdb* cached-source-packages/ && - GIT_CONFIG_PARAMETERS="'windows.sdk${{matrix.arch.bitness}}.path='" ./please.sh bundle_pdbs --arch=${{matrix.arch.name}} --directory="$a" installer/package-versions.txt) - - name: Clean up temporary files - if: always() && env.SKIP != 'true' - shell: bash - run: rm -rf home - - name: Publish ${{matrix.artifact.name}}-${{matrix.arch.name}} - if: env.SKIP != 'true' && matrix.arch.arm64 != true - uses: actions/upload-artifact@v1 - with: - name: ${{matrix.artifact.name}}-${{matrix.arch.name}} - path: artifacts - - name: Publish ${{matrix.artifact.name}}-arm64 - if: env.SKIP != 'true' && matrix.arch.arm64 == true - uses: actions/upload-artifact@v1 - with: - name: ${{matrix.artifact.name}}-arm64 - path: artifacts - nuget: - runs-on: windows-latest - needs: pkg - steps: - - name: Determine whether this job should be skipped - shell: bash - run: | - case " $BUILD_ONLY " in - ' ') ;; # not set; build all - *" nuget "*) ;; # build this artifact - *) echo "SKIP=true" >>$GITHUB_ENV;; - esac - - name: Download pkg-x86_64 - if: env.SKIP != 'true' - uses: actions/download-artifact@v1 - with: - name: pkg-x86_64 - path: pkg-x86_64 - - name: Download bundle-artifacts - if: env.SKIP != 'true' - uses: actions/download-artifact@v1 - with: - name: bundle-artifacts - path: bundle-artifacts - - uses: git-for-windows/setup-git-for-windows-sdk@v1 - if: env.SKIP != 'true' - with: - flavor: build-installers - - name: Clone and update build-extra - if: env.SKIP != 'true' - shell: bash - run: | - d=/usr/src/build-extra && - if test ! -d $d/.git - then - git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d - else - git -C $d fetch https://github.com/git-for-windows/build-extra main && - git -C $d switch -C main FETCH_HEAD - fi && - git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main - - uses: nuget/setup-nuget@v1 - if: env.SKIP != 'true' - - name: Build 64-bit NuGet packages - if: env.SKIP != 'true' - shell: bash - run: | - /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --version=$(cat pkg-x86_64/ver) -o artifacts --nuget --pkg=pkg-x86_64/mingw-w64-x86_64-git-[0-9]*.tar.xz --pkg=pkg-x86_64/mingw-w64-x86_64-git-doc-html-[0-9]*.tar.xz && - /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --version=$(cat pkg-x86_64/ver) -o artifacts --nuget-mingit && - openssl dgst -sha256 artifacts/Git*.nupkg | sed "s/.* //" >artifacts/sha-256.txt - - name: Publish nuget-x86_64 - if: env.SKIP != 'true' - uses: actions/upload-artifact@v1 - with: - name: nuget-x86_64 - path: artifacts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2806abe4c0..cd1f52692a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,9 +137,6 @@ jobs: NO_PERL: 1 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'" runs-on: windows-latest - strategy: - matrix: - arch: [x64, arm64] steps: - uses: actions/checkout@v2 - uses: git-for-windows/setup-git-for-windows-sdk@v1 @@ -149,22 +146,26 @@ jobs: repository: 'microsoft/vcpkg' path: 'compat/vcbuild/vcpkg' - name: download vcpkg artifacts - uses: git-for-windows/get-azure-pipelines-artifact@v0 - with: - repository: git/git - definitionId: 9 + shell: powershell + run: | + $urlbase = "https://dev.azure.com/git/git/_apis/build/builds" + $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id + $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl + (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip") + Expand-Archive compat.zip -DestinationPath . -Force + Remove-Item compat.zip - name: add msbuild to PATH uses: microsoft/setup-msbuild@v1 - name: copy dlls to root shell: cmd - run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows + run: compat\vcbuild\vcpkg_copy_dlls.bat release - name: generate Visual Studio solution shell: bash run: | - cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \ - -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows -DHOST_CPU=${{ matrix.arch }} + cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \ + -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON - name: MSBuild - run: msbuild git.sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4 -property:PlatformToolset=v142 + run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142 - name: bundle artifact tar shell: bash env: @@ -178,7 +179,7 @@ jobs: - name: upload tracked files and build artifacts uses: actions/upload-artifact@v2 with: - name: vs-artifacts-${{ matrix.arch }} + name: vs-artifacts path: artifacts vs-test: name: win+VS test @@ -193,7 +194,7 @@ jobs: - name: download tracked files and build artifacts uses: actions/download-artifact@v2 with: - name: vs-artifacts-x64 + name: vs-artifacts path: ${{github.workspace}} - name: extract tracked files and build artifacts shell: bash diff --git a/.github/workflows/monitor-components.yml b/.github/workflows/monitor-components.yml deleted file mode 100644 index 9c78d6d3e9..0000000000 --- a/.github/workflows/monitor-components.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Monitor component updates - -# Git for Windows is a slightly modified subset of MSYS2. Some of its -# components are maintained by Git for Windows, others by MSYS2. To help -# keeping the former up to date, this workflow monitors the Atom/RSS feeds -# and opens new tickets for each new component version. - -on: - schedule: - - cron: "23 8,11,14,17 * * *" - workflow_dispatch: - -env: - CHARACTER_LIMIT: 5000 - MAX_AGE: 48h - -jobs: - job: - runs-on: ubuntu-latest - environment: monitor-components - strategy: - matrix: - component: - - label: git - feed: https://github.com/git/git/tags.atom - - label: git-lfs - feed: https://github.com/git-lfs/git-lfs/tags.atom - - label: gcm-core - feed: https://github.com/microsoft/git-credential-manager-core/tags.atom - - label: tig - feed: https://github.com/jonas/tig/tags.atom - - label: cygwin - feed: https://github.com/cygwin/cygwin/releases.atom - title-pattern: ^(?!.*newlib) - - label: msys2-runtime-package - feed: https://github.com/msys2/MSYS2-packages/commits/master/msys2-runtime.atom - - label: msys2-runtime - feed: https://github.com/msys2/msys2-runtime/commits/HEAD.atom - aggregate: true - - label: openssh - feed: https://github.com/openssh/openssh-portable/tags.atom - - label: openssl - feed: https://github.com/openssl/openssl/tags.atom - title-pattern: ^(?!.*alpha) - - label: gnutls - feed: https://gnutls.org/news.atom - - label: heimdal - feed: https://github.com/heimdal/heimdal/tags.atom - - label: git-sizer - feed: https://github.com/github/git-sizer/tags.atom - - label: gitflow - feed: https://github.com/petervanderdoes/gitflow-avh/tags.atom - - label: curl - feed: https://github.com/curl/curl/tags.atom - - label: libgpg-error - feed: https://github.com/gpg/libgpg-error/releases.atom - title-pattern: ^libgpg-error-[0-9\.]*$ - - label: libgcrypt - feed: https://github.com/gpg/libgcrypt/releases.atom - title-pattern: ^libgcrypt-[0-9\.]*$ - - label: gpg - feed: https://github.com/gpg/gnupg/releases.atom - - label: mintty - feed: https://github.com/mintty/mintty/releases.atom - - label: p7zip - feed: https://sourceforge.net/projects/p7zip/rss?path=/p7zip - - label: bash - feed: https://git.savannah.gnu.org/cgit/bash.git/atom/?h=master - aggregate: true - - label: perl - feed: https://github.com/Perl/perl5/tags.atom - title-pattern: ^(?!.*(5\.[0-9]+[13579]|RC)) - - label: pcre2 - feed: https://github.com/PCRE2Project/pcre2/tags.atom - fail-fast: false - steps: - - uses: git-for-windows/rss-to-issues@v0 - with: - feed: ${{matrix.component.feed}} - prefix: "[New ${{matrix.component.label}} version]" - labels: component-update - github-token: ${{ secrets.MONITOR_COMPONENTS_PAT }} - character-limit: ${{ env.CHARACTER_LIMIT }} - max-age: ${{ env.MAX_AGE }} - aggregate: ${{matrix.component.aggregate}} - title-pattern: ${{matrix.component.title-pattern}} diff --git a/.gitignore b/.gitignore index b416403ac4..a452215764 100644 --- a/.gitignore +++ b/.gitignore @@ -246,4 +246,3 @@ Release/ /git.VC.db *.dSYM /contrib/buildsystems/out -CMakeSettings.json diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 8b373cf551..0215b1fd4c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,9 +1,9 @@ -# Git for Windows Code of Conduct +# Git Code of Conduct This code of conduct outlines our expectations for participants within -the **Git for Windows** community, as well as steps for reporting unacceptable -behavior. We are committed to providing a welcoming and inspiring community -for all and expect our code of conduct to be honored. Anyone who violates +the Git community, as well as steps for reporting unacceptable behavior. +We are committed to providing a welcoming and inspiring community for +all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community. ## Our Pledge @@ -65,8 +65,8 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the Git for Windows maintainer or the community leaders -responsible for enforcement at git@sfconservancy.org, or individually: +reported to the community leaders responsible for enforcement at +git@sfconservancy.org, or individually: - Ævar Arnfjörð Bjarmason - Christian Couder diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index ca9770df8c..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,417 +0,0 @@ -How to Contribute to Git for Windows -==================================== - -Git was originally designed for Unix systems and still today, all the build tools for the Git -codebase assume you have standard Unix tools available in your path. If you have an open-source -mindset and want to start contributing to Git, but primarily use a Windows machine, then you may -have trouble getting started. This guide is for you. - -Get the Source --------------- - -Clone the [GitForWindows repository on GitHub](https://github.com/git-for-windows/git). -It is helpful to create your own fork for storing your development branches. - -Windows uses different line endings than Unix systems. See -[this GitHub article on working with line endings](https://help.github.com/articles/dealing-with-line-endings/#refreshing-a-repository-after-changing-line-endings) -if you have trouble with line endings. - -Build the Source ----------------- - -First, download and install the latest [Git for Windows SDK (64-bit)](https://github.com/git-for-windows/build-extra/releases/latest). -When complete, you can run the Git SDK, which creates a new Git Bash terminal window with -the additional development commands, such as `make`. - - As of time of writing, the SDK uses a different credential manager, so you may still want to use normal Git - Bash for interacting with your remotes. Alternatively, use SSH rather than HTTPS and - avoid credential manager problems. - -You should now be ready to type `make` from the root of your `git` source directory. -Here are some helpful variations: - -* `make -j[N] DEVELOPER=1`: Compile new sources using up to N concurrent processes. - The `DEVELOPER` flag turns on all warnings; code failing these warnings will not be - accepted upstream ("upstream" = "the core Git project"). -* `make clean`: Delete all compiled files. - -When running `make`, you can use `-j$(nproc)` to automatically use the number of processors -on your machine as the number of concurrent build processes. - -You can go deeper on the Windows-specific build process by reading the -[technical overview](https://github.com/git-for-windows/git/wiki/Technical-overview) or the -[guide to compiling Git with Visual Studio](https://github.com/git-for-windows/git/wiki/Compiling-Git-with-Visual-Studio). - -## Building `git` on Windows with Visual Studio - -The typical approach to building `git` is to use the standard `Makefile` with GCC, as -above. Developers working in a Windows environment may want to instead build with the -[Microsoft Visual C++ compiler and libraries toolset (MSVC)](https://blogs.msdn.microsoft.com/vcblog/2017/03/07/msvc-the-best-choice-for-windows/). -There are a few benefits to using MSVC over GCC during your development, including creating -symbols for debugging and [performance tracing](https://github.com/Microsoft/perfview#perfview-overview). - -There are two ways to build Git for Windows using MSVC. Each have their own merits. - -### Using SDK Command Line - -Use one of the following commands from the SDK Bash window to build Git for Windows: - -``` - make MSVC=1 -j12 - make MSVC=1 DEBUG=1 -j12 -``` - -The first form produces release-mode binaries; the second produces debug-mode binaries. -Both forms produce PDB files and can be debugged. However, the first is best for perf -tracing and the second is best for single-stepping. - -You can then open Visual Studio and select File -> Open -> Project/Solution and select -the compiled `git.exe` file. This creates a basic solution and you can use the debugging -and performance tracing tools in Visual Studio to monitor a Git process. Use the Debug -Properties page to set the working directory and command line arguments. - -Be sure to clean up before switching back to GCC (or to switch between debug and -release MSVC builds): - -``` - make MSVC=1 -j12 clean - make MSVC=1 DEBUG=1 -j12 clean -``` - -### Using the IDE - -If you prefer working in Visual Studio with a solution full of projects, then you can use -CMake, either by letting Visual Studio configure it automatically (simply open Git's -top-level directory via `File>Open>Folder...`) or by (downloading and) running -[CMake](https://cmake.org) manually. - -What to Change? ---------------- - -Many new contributors ask: What should I start working on? - -One way to win big with the open-source community is to look at the -[issues page](https://github.com/git-for-windows/git/issues) and see if there are any issues that -you can fix quickly, or if anything catches your eye. - -You can also look at [the unofficial Chromium issues page](https://crbug.com/git) for -multi-platform issues. You can look at recent user questions on -[the Git mailing list](https://public-inbox.org/git). - -Or you can "scratch your own itch", i.e. address an issue you have with Git. The team at Microsoft where the Git for Windows maintainer works, for example, is focused almost entirely on [improving performance](https://blogs.msdn.microsoft.com/devops/2018/01/11/microsofts-performance-contributions-to-git-in-2017/). -We approach our work by finding something that is slow and try to speed it up. We start our -investigation by reliably reproducing the slow behavior, then running that example using -the MSVC build and tracing the results in PerfView. - -You could also think of something you wish Git could do, and make it do that thing! The -only concern I would have with this approach is whether or not that feature is something -the community also wants. If this excites you though, go for it! Don't be afraid to -[get involved in the mailing list](http://vger.kernel.org/vger-lists.html#git) early for -feedback on the idea. - -Test Your Changes ------------------ - -After you make your changes, it is important that you test your changes. Manual testing is -important, but checking and extending the existing test suite is even more important. You -want to run the functional tests to see if you broke something else during your change, and -you want to extend the functional tests to be sure no one breaks your feature in the future. - -### Functional Tests - -Navigate to the `t/` directory and type `make` to run all tests or use `prove` as -[described in the Git for Windows wiki](https://github.com/git-for-windows/git/wiki/Building-Git): - -``` -prove -j12 --state=failed,save ./t[0-9]*.sh -``` - -You can also run each test directly by running the corresponding shell script with a name -like `tNNNN-descriptor.sh`. - -If you are adding new functionality, you may need to create unit tests by creating -helper commands that test a very limited action. These commands are stored in `t/helpers`. -When adding a helper, be sure to add a line to `t/Makefile` and to the `.gitignore` for the -binary file you add. The Git community prefers functional tests using the full `git` -executable, so try to exercise your new code using `git` commands before creating a test -helper. - -To find out why a test failed, repeat the test with the `-x -v -d -i` options and then -navigate to the appropriate "trash" directory to see the data shape that was used for the -test failed step. - -Read [`t/README`](t/README) for more details. - -### Performance Tests - -If you are working on improving performance, you will need to be acquainted with the -performance tests in `t/perf`. There are not too many performance tests yet, but adding one -as your first commit in a patch series helps to communicate the boost your change provides. - -To check the change in performance across multiple versions of `git`, you can use the -`t/perf/run` script. For example, to compare the performance of `git rev-list` across the -`core/master` and `core/next` branches compared to a `topic` branch, you can run - -``` -cd t/perf -./run core/master core/next topic -- p0001-rev-list.sh -``` - -You can also set certain environment variables to help test the performance on different -repositories or with more repetitions. The full list is available in -[the `t/perf/README` file](t/perf/README), -but here are a few important ones: - -``` -GIT_PERF_REPO=/path/to/repo -GIT_PERF_LARGE_REPO=/path/to/large/repo -GIT_PERF_REPEAT_COUNT=10 -``` - -When running the performance tests on Linux, you may see a message "Can't locate JSON.pm in -@INC" and that means you need to run `sudo cpanm install JSON` to get the JSON perl package. - -For running performance tests, it can be helpful to set up a few repositories with strange -data shapes, such as: - -**Many objects:** Clone repos such as [Kotlin](https://github.com/jetbrains/kotlin), [Linux](https://github.com/torvalds/linux), or [Android](https://source.android.com/setup/downloading). - -**Many pack-files:** You can split a fresh clone into multiple pack-files of size at most -16MB by running `git repack -adfF --max-pack-size=16m`. See the -[`git repack` documentation](https://git-scm.com/docs/git-repack) for more information. -You can count the number of pack-files using `ls .git/objects/pack/*.pack | wc -l`. - -**Many loose objects:** If you already split your repository into multiple pack-files, then -you can pick one to split into loose objects using `cat .git/objects/pack/[id].pack | git unpack-objects`; -delete the `[id].pack` and `[id].idx` files after this. You can count the number of loose -bjects using `ls .git/objects/??/* | wc -l`. - -**Deep history:** Usually large repositories also have deep histories, but you can use the -[test-many-commits-1m repo](https://github.com/cirosantilli/test-many-commits-1m/) to -target deep histories without the overhead of many objects. One issue with this repository: -there are no merge commits, so you will need to use a different repository to test a "wide" -commit history. - -**Large Index:** You can generate a large index and repo by using the scripts in -`t/perf/repos`. There are two scripts. `many-files.sh` which will generate a repo with -same tree and blobs but different paths. Using `many-files.sh -d 5 -w 10 -f 9` will create -a repo with ~1 million entries in the index. `inflate-repo.sh` will use an existing repo -and copy the current work tree until it is a specified size. - -Test Your Changes on Linux --------------------------- - -It can be important to work directly on the [core Git codebase](https://github.com/git/git), -such as a recent commit into the `master` or `next` branch that has not been incorporated -into Git for Windows. Also, it can help to run functional and performance tests on your -code in Linux before submitting patches to the mailing list, which focuses on many platforms. -The differences between Windows and Linux are usually enough to catch most cross-platform -issues. - -### Using the Windows Subsystem for Linux - -The [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10) -allows you to [install Ubuntu Linux as an app](https://www.microsoft.com/en-us/store/p/ubuntu/9nblggh4msv6) -that can run Linux executables on top of the Windows kernel. Internally, -Linux syscalls are interpreted by the WSL, everything else is plain Ubuntu. - -First, open WSL (either type "Bash" in Cortana, or execute "bash.exe" in a CMD window). -Then install the prerequisites, and `git` for the initial clone: - -``` -sudo apt-get update -sudo apt-get install git gcc make libssl-dev libcurl4-openssl-dev \ - libexpat-dev tcl tk gettext git-email zlib1g-dev -``` - -Then, clone and build: - -``` -git clone https://github.com/git-for-windows/git -cd git -git remote add -f upstream https://github.com/git/git -make -``` - -Be sure to clone into `/home/[user]/` and not into any folder under `/mnt/?/` or your build -will fail due to colons in file names. - -### Using a Linux Virtual Machine with Hyper-V - -If you prefer, you can use a virtual machine (VM) to run Linux and test your changes in the -full environment. The test suite runs a lot faster on Linux than on Windows or with the WSL. -You can connect to the VM using an SSH terminal like -[PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/). - -The following instructions are for using Hyper-V, which is available in some versions of Windows. -There are many virtual machine alternatives available, if you do not have such a version installed. - -* [Download an Ubuntu Server ISO](https://www.ubuntu.com/download/server). -* Open [Hyper-V Manager](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v). -* [Set up a virtual switch](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/connect-to-network) - so your VM can reach the network. -* Select "Quick Create", name your machine, select the ISO as installation source, and un-check - "This virtual machine will run Windows." -* Go through the Ubuntu install process, being sure to select to install OpenSSH Server. -* When install is complete, log in and check the SSH server status with `sudo service ssh status`. - * If the service is not found, install with `sudo apt-get install openssh-server`. - * If the service is not running, then use `sudo service ssh start`. -* Use `shutdown -h now` to shutdown the VM, go to the Hyper-V settings for the VM, expand Network Adapter - to select "Advanced Features", and set the MAC address to be static (this can save your VM from losing - network if shut down incorrectly). -* Provide as many cores to your VM as you can (for parallel builds). -* Restart your VM, but do not connect. -* Use `ssh` in Git Bash, download [PuTTY](http://www.putty.org/), or use your favorite SSH client to connect to the VM through SSH. - -In order to build and use `git`, you will need the following libraries via `apt-get`: - -``` -sudo apt-get update -sudo apt-get install git gcc make libssl-dev libcurl4-openssl-dev \ - libexpat-dev tcl tk gettext git-email zlib1g-dev -``` - -To get your code from your Windows machine to the Linux VM, it is easiest to push the branch to your fork of Git and clone your fork in the Linux VM. - -Don't forget to set your `git` config with your preferred name, email, and editor. - -Polish Your Commits -------------------- - -Before submitting your patch, be sure to read the [coding guidelines](https://github.com/git/git/blob/master/Documentation/CodingGuidelines) -and check your code to match as best you can. This can be a lot of effort, but it saves -time during review to avoid style issues. - -The other possibly major difference between the mailing list submissions and GitHub PR workflows -is that each commit will be reviewed independently. Even if you are submitting a -patch series with multiple commits, each commit must stand on it's own and be reviewable -by itself. Make sure the commit message clearly explain the why of the commit not the how. -Describe what is wrong with the current code and how your changes have made the code better. - -When preparing your patch, it is important to put yourself in the shoes of the Git community. -Accepting a patch requires more justification than approving a pull request from someone on -your team. The community has a stable product and is responsible for keeping it stable. If -you introduce a bug, then they cannot count on you being around to fix it. When you decided -to start work on a new feature, they were not part of the design discussion and may not -even believe the feature is worth introducing. - -Questions to answer in your patch message (and commit messages) may include: -* Why is this patch necessary? -* How does the current behavior cause pain for users? -* What kinds of repositories are necessary for noticing a difference? -* What design options did you consider before writing this version? Do you have links to - code for those alternate designs? -* Is this a performance fix? Provide clear performance numbers for various well-known repos. - -Here are some other tips that we use when cleaning up our commits: - -* Commit messages should be wrapped at 76 columns per line (or less; 72 is also a - common choice). -* Make sure the commits are signed off using `git commit (-s|--signoff)`. See - [SubmittingPatches](https://github.com/git/git/blob/v2.8.1/Documentation/SubmittingPatches#L234-L286) - for more details about what this sign-off means. -* Check for whitespace errors using `git diff --check [base]...HEAD` or `git log --check`. -* Run `git rebase --whitespace=fix` to correct upstream issues with whitespace. -* Become familiar with interactive rebase (`git rebase -i`) because you will be reordering, - squashing, and editing commits as your patch or series of patches is reviewed. -* Make sure any shell scripts that you add have the executable bit set on them. This is - usually for test files that you add in the `/t` directory. You can use - `git add --chmod=+x [file]` to update it. You can test whether a file is marked as executable - using `git ls-files --stage \*.sh`; the first number is 100755 for executable files. -* Your commit titles should match the "area: change description" format. Rules of thumb: - * Choose ": " prefix appropriately. - * Keep the description short and to the point. - * The word that follows the ": " prefix is not capitalized. - * Do not include a full-stop at the end of the title. - * Read a few commit messages -- using `git log origin/master`, for instance -- to - become acquainted with the preferred commit message style. -* Build source using `make DEVELOPER=1` for extra-strict compiler warnings. - -Submit Your Patch ------------------ - -Git for Windows [accepts pull requests on GitHub](https://github.com/git-for-windows/git/pulls), but -these are reserved for Windows-specific improvements. For core Git, submissions are accepted on -[the Git mailing list](https://public-inbox.org/git). - -### Configure Git to Send Emails - -There are a bunch of options for configuring the `git send-email` command. These options can -be found in the documentation for -[`git config`](https://git-scm.com/docs/git-config) and -[`git send-email`](https://git-scm.com/docs/git-send-email). - -``` -git config --global sendemail.smtpserver -git config --global sendemail.smtpserverport 587 -git config --global sendemail.smtpencryption tls -git config --global sendemail.smtpuser -``` - -To avoid storing your password in the config file, store it in the Git credential manager: - -``` -$ git credential fill -protocol=smtp -host= -username= -password=password -``` - -Before submitting a patch, read the [Git documentation on submitting patches](https://github.com/git/git/blob/master/Documentation/SubmittingPatches). - -To construct a patch set, use the `git format-patch` command. There are three important options: - -* `--cover-letter`: If specified, create a `[v#-]0000-cover-letter.patch` file that can be - edited to describe the patch as a whole. If you previously added a branch description using - `git branch --edit-description`, you will end up with a 0/N mail with that description and - a nice overall diffstat. -* `--in-reply-to=[Message-ID]`: This will mark your cover letter as replying to the given - message (which should correspond to your previous iteration). To determine the correct Message-ID, - find the message you are replying to on [public-inbox.org/git](https://public-inbox.org/git) and take - the ID from between the angle brackets. - -* `--subject-prefix=[prefix]`: This defaults to [PATCH]. For subsequent iterations, you will want to - override it like `--subject-prefix="[PATCH v2]"`. You can also use the `-v` option to have it - automatically generate the version number in the patches. - -If you have multiple commits and use the `--cover-letter` option be sure to open the -`0000-cover-letter.patch` file to update the subject and add some details about the overall purpose -of the patch series. - -### Examples - -To generate a single commit patch file: -``` -git format-patch -s -o [dir] -1 -``` -To generate four patch files from the last three commits with a cover letter: -``` -git format-patch --cover-letter -s -o [dir] HEAD~4 -``` -To generate version 3 with four patch files from the last four commits with a cover letter: -``` -git format-patch --cover-letter -s -o [dir] -v 3 HEAD~4 -``` - -### Submit the Patch - -Run [`git send-email`](https://git-scm.com/docs/git-send-email), starting with a test email: - -``` -git send-email --to=yourself@address.com [dir with patches]/*.patch -``` - -After checking the receipt of your test email, you can send to the list and to any -potentially interested reviewers. - -``` -git send-email --to=git@vger.kernel.org --cc= --cc= [dir with patches]/*.patch -``` - -To submit a nth version patch (say version 3): - -``` -git send-email --to=git@vger.kernel.org --cc= --cc= \ - --in-reply-to= [dir with patches]/*.patch -``` diff --git a/Documentation/config.txt b/Documentation/config.txt index 98f697b52d..5b5b976569 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -503,8 +503,6 @@ include::config/safe.txt[] include::config/sendemail.txt[] -include::config/sendpack.txt[] - include::config/sequencer.txt[] include::config/showbranch.txt[] @@ -541,6 +539,4 @@ include::config/versionsort.txt[] include::config/web.txt[] -include::config/windows.txt[] - include::config/worktree.txt[] diff --git a/Documentation/config/advice.txt b/Documentation/config/advice.txt index 72776b4cf3..a00d0100a8 100644 --- a/Documentation/config/advice.txt +++ b/Documentation/config/advice.txt @@ -118,9 +118,6 @@ advice.*:: waitingForEditor:: Print a message to the terminal whenever Git is waiting for editor input from the user. - nameTooLong:: - Advice shown if a filepath operation is attempted where the - path was too long. nestedTag:: Advice shown if a user attempts to recursively tag a tag object. submoduleAlternateErrorStrategyDie:: @@ -139,7 +136,4 @@ advice.*:: Advice shown when either linkgit:git-add[1] or linkgit:git-rm[1] is asked to update index entries outside the current sparse checkout. - useCoreFSMonitorConfig:: - Advice shown if the deprecated 'core.useBuiltinFSMonitor' config - setting is in use. -- diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt index 6a11bba533..88bc799cf3 100644 --- a/Documentation/config/core.txt +++ b/Documentation/config/core.txt @@ -655,19 +655,6 @@ relatively high IO latencies. When enabled, Git will do the index comparison to the filesystem data in parallel, allowing overlapping IO's. Defaults to true. -core.fscache:: - Enable additional caching of file system data for some operations. -+ -Git for Windows uses this to bulk-read and cache lstat data of entire -directories (instead of doing lstat file by file). - -core.longpaths:: - Enable long path (> 260) support for builtin commands in Git for - Windows. This is disabled by default, as long paths are not supported - by Windows Explorer, cmd.exe and the Git for Windows tool chain - (msys, bash, tcl, perl...). Only enable this if you know what you're - doing and are prepared to live with a few quirks. - core.unsetenvvars:: Windows-only: comma-separated list of environment variables' names that need to be unset before spawning any other process. diff --git a/Documentation/config/http.txt b/Documentation/config/http.txt index c9aa142855..afeeccfbfa 100644 --- a/Documentation/config/http.txt +++ b/Documentation/config/http.txt @@ -189,13 +189,11 @@ http.sslBackend:: http.schannelCheckRevoke:: Used to enforce or disable certificate revocation checks in cURL - when http.sslBackend is set to "schannel" via "true" and "false", - respectively. Another accepted value is "best-effort" (the default) - in which case revocation checks are performed, but errors due to - revocation list distribution points that are offline are silently - ignored, as well as errors due to certificates missing revocation - list distribution points. This option is ignored if cURL lacks - support for setting the relevant SSL option at runtime. + when http.sslBackend is set to "schannel". Defaults to `true` if + unset. Only necessary to disable this if Git consistently errors + and the message is about checking the revocation status of a + certificate. This option is ignored if cURL lacks support for + setting the relevant SSL option at runtime. http.schannelUseSSLCAInfo:: As of cURL v7.60.0, the Secure Channel backend can use the @@ -205,11 +203,6 @@ http.schannelUseSSLCAInfo:: when the `schannel` backend was configured via `http.sslBackend`, unless `http.schannelUseSSLCAInfo` overrides this behavior. -http.sslAutoClientCert:: - As of cURL v7.77.0, the Secure Channel backend won't automatically - send client certificates from the Windows Certificate Store anymore. - To opt in to the old behavior, http.sslAutoClientCert can be set. - http.pinnedPubkey:: Public key of the https service. It may either be the filename of a PEM or DER encoded public key file or a string starting with diff --git a/Documentation/config/safe.txt b/Documentation/config/safe.txt index ec9c85c8f8..fa02f3ccc5 100644 --- a/Documentation/config/safe.txt +++ b/Documentation/config/safe.txt @@ -40,9 +40,3 @@ which id the original user has. If that is not what you would prefer and want git to only trust repositories that are owned by root instead, then you can remove the `SUDO_UID` variable from root's environment before invoking git. -+ -Due to the permission model on Windows where ACLs are used instead of -Unix' simpler permission model, it can be a bit tricky to figure out why -a directory is considered unsafe. To help with this, Git will provide -more detailed information when the environment variable -`GIT_TEST_DEBUG_UNSAFE_DIRECTORIES` is set to `true`. diff --git a/Documentation/config/sendpack.txt b/Documentation/config/sendpack.txt deleted file mode 100644 index e306f657fb..0000000000 --- a/Documentation/config/sendpack.txt +++ /dev/null @@ -1,5 +0,0 @@ -sendpack.sideband:: - Allows to disable the side-band-64k capability for send-pack even - when it is advertised by the server. Makes it possible to work - around a limitation in the git for windows implementation together - with the dump git protocol. Defaults to true. diff --git a/Documentation/config/windows.txt b/Documentation/config/windows.txt deleted file mode 100644 index fdaaf1c655..0000000000 --- a/Documentation/config/windows.txt +++ /dev/null @@ -1,4 +0,0 @@ -windows.appendAtomically:: - By default, append atomic API is used on windows. But it works only with - local disk files, if you're working on a network file system, you should - set it false to turn it off. diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index 6a44de1278..01cb4c9b9c 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -12,7 +12,6 @@ SYNOPSIS 'git reset' [-q] [--pathspec-from-file= [--pathspec-file-nul]] [] 'git reset' (--patch | -p) [] [--] [...] 'git reset' [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [] -DEPRECATED: 'git reset' [-q] [--stdin [-z]] [] DESCRIPTION ----------- @@ -133,16 +132,6 @@ OPTIONS + For more details, see the 'pathspec' entry in linkgit:gitglossary[7]. ---stdin:: - DEPRECATED (use `--pathspec-from-file=-` instead): Instead of taking - list of paths from the command line, read list of paths from the - standard input. Paths are separated by LF (i.e. one path per line) by - default. - --z:: - DEPRECATED (use `--pathspec-file-nul` instead): Only meaningful with - `--stdin`; paths are separated with NUL character instead of LF. - EXAMPLES -------- diff --git a/Documentation/git.txt b/Documentation/git.txt index 30febfc4cf..47a6095ff4 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -443,14 +443,6 @@ Environment Variables --------------------- Various Git commands use the following environment variables: -System -~~~~~~ -`HOME`:: - Specifies the path to the user's home directory. On Windows, if - unset, Git will set a process environment variable equal to: - `$HOMEDRIVE$HOMEPATH` if both `$HOMEDRIVE` and `$HOMEPATH` exist; - otherwise `$USERPROFILE` if `$USERPROFILE` exists. - The Git Repository ~~~~~~~~~~~~~~~~~~ These environment variables apply to 'all' core Git commands. Nb: it diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 85faf9c142..4b36d51beb 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -385,36 +385,6 @@ sign `$` upon checkout. Any byte sequence that begins with with `$Id$` upon check-in. -`symlink` -^^^^^^^^^ - -On Windows, symbolic links have a type: a "file symlink" must point at -a file, and a "directory symlink" must point at a directory. If the -type of symlink does not match its target, it doesn't work. - -Git does not record the type of symlink in the index or in a tree. On -checkout it'll guess the type, which only works if the target exists -at the time the symlink is created. This may often not be the case, -for example when the link points at a directory inside a submodule. - -The `symlink` attribute allows you to explicitly set the type of symlink -to `file` or `dir`, so Git doesn't have to guess. If you have a set of -symlinks that point at other files, you can do: - ------------------------- -*.gif symlink=file ------------------------- - -To tell Git that a symlink points at a directory, use: - ------------------------- -tools_folder symlink=dir ------------------------- - -The `symlink` attribute is ignored on platforms other than Windows, -since they don't distinguish between different types of symlinks. - - `filter` ^^^^^^^^ diff --git a/Makefile b/Makefile index 117652ca65..04d0fd1fe6 100644 --- a/Makefile +++ b/Makefile @@ -715,7 +715,6 @@ TEST_BUILTINS_OBJS += test-advise.o TEST_BUILTINS_OBJS += test-bitmap.o TEST_BUILTINS_OBJS += test-bloom.o TEST_BUILTINS_OBJS += test-chmtime.o -TEST_BUILTINS_OBJS += test-cmp.o TEST_BUILTINS_OBJS += test-config.o TEST_BUILTINS_OBJS += test-crontab.o TEST_BUILTINS_OBJS += test-csprng.o @@ -738,7 +737,6 @@ TEST_BUILTINS_OBJS += test-hash-speed.o TEST_BUILTINS_OBJS += test-hash.o TEST_BUILTINS_OBJS += test-hashmap.o TEST_BUILTINS_OBJS += test-hexdump.o -TEST_BUILTINS_OBJS += test-iconv.o TEST_BUILTINS_OBJS += test-index-version.o TEST_BUILTINS_OBJS += test-json-writer.o TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o @@ -2656,13 +2654,6 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \ compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null endif -headless-git.o: compat/win32/headless.c GIT-CFLAGS - $(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \ - -fno-stack-protector -o $@ -c -Wall -Wwrite-strings $< - -headless-git$X: headless-git.o git.res GIT-LDFLAGS - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res - git-%$X: %.o GIT-LDFLAGS $(GITLIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) @@ -3419,7 +3410,6 @@ clean: profile-clean coverage-clean cocciclean $(RM) po/git.pot po/git-core.pot $(RM) *.res $(RM) $(OBJECTS) - $(RM) headless-git.o $(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB) $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X $(RM) $(TEST_PROGRAMS) @@ -3449,17 +3439,13 @@ endif $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS ifdef MSVC $(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS)) - $(RM) headless-git.o.pdb $(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS)) - $(RM) $(patsubst %.exe,%.ilk,$(OTHER_PROGRAMS)) $(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS)) $(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS)) $(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS)) - $(RM) $(patsubst %.exe,%.ilk,$(PROGRAMS)) $(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS)) $(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS)) $(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS)) - $(RM) $(patsubst %.exe,%.ilk,$(TEST_PROGRAMS)) $(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS)) $(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS)) $(RM) compat/vcbuild/MSVC-DEFS-GEN diff --git a/README.md b/README.md index fe6cf6a90c..7ce4f05bae 100644 --- a/README.md +++ b/README.md @@ -1,76 +1,4 @@ -Git for Windows -=============== - -[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/git-for-windows/git) -[![Build status](https://github.com/git-for-windows/git/workflows/CI/badge.svg)](https://github.com/git-for-windows/git/actions?query=branch%3Amain+event%3Apush) -[![Join the chat at https://gitter.im/git-for-windows/git](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/git-for-windows/git?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -This is [Git for Windows](http://git-for-windows.github.io/), the Windows port -of [Git](http://git-scm.com/). - -The Git for Windows project is run using a [governance -model](http://git-for-windows.github.io/governance-model.html). If you -encounter problems, you can report them as [GitHub -issues](https://github.com/git-for-windows/git/issues), discuss them on Git -for Windows' [Google Group](http://groups.google.com/group/git-for-windows), -and [contribute bug -fixes](https://github.com/git-for-windows/git/wiki/How-to-participate). - -To build Git for Windows, please either install [Git for Windows' -SDK](https://gitforwindows.org/#download-sdk), start its `git-bash.exe`, `cd` -to your Git worktree and run `make`, or open the Git worktree as a folder in -Visual Studio. - -To verify that your build works, use one of the following methods: - -- If you want to test the built executables within Git for Windows' SDK, - prepend `/bin-wrappers` to the `PATH`. -- Alternatively, run `make install` in the Git worktree. -- If you need to test this in a full installer, run `sdk build - git-and-installer`. -- You can also "install" Git into an existing portable Git via `make install - DESTDIR=` where `` refers to the top-level directory of the - portable Git. In this instance, you will want to prepend that portable Git's - `/cmd` directory to the `PATH`, or test by running that portable Git's - `git-bash.exe` or `git-cmd.exe`. -- If you built using a recent Visual Studio, you can use the menu item - `Build>Install git` (you will want to click on `Project>CMake Settings for - Git` first, then click on `Edit JSON` and then point `installRoot` to the - `mingw64` directory of an already-unpacked portable Git). - - As in the previous bullet point, you will then prepend `/cmd` to the `PATH` - or run using the portable Git's `git-bash.exe` or `git-cmd.exe`. -- If you want to run the built executables in-place, but in a CMD instead of - inside a Bash, you can run a snippet like this in the `git-bash.exe` window - where Git was built (ensure that the `EOF` line has no leading spaces), and - then paste into the CMD window what was put in the clipboard: - - ```sh - clip.exe <, and other archival sites. -The core git mailing list is plain text (no HTML!). Issues which are security relevant should be disclosed privately to the Git Security mailing list . diff --git a/SECURITY.md b/SECURITY.md index 3283516842..c720c2ae7f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -28,38 +28,24 @@ Examples for details to include: ## Supported Versions -Git for Windows is a "friendly fork" of [Git](https://git-scm.com/), i.e. changes in Git for Windows are frequently contributed back, and Git for Windows' release cycle closely following Git's. +There are no official "Long Term Support" versions in Git. +Instead, the maintenance track (i.e. the versions based on the +most recently published feature release, also known as ".0" +version) sees occasional updates with bug fixes. -While Git maintains several release trains (when v2.19.1 was released, there were updates to v2.14.x-v2.18.x, too, for example), Git for Windows follows only the latest Git release. For example, there is no Git for Windows release corresponding to Git v2.16.5 (which was released after v2.19.0). +Fixes to vulnerabilities are made for the maintenance track for +the latest feature release and merged up to the in-development +branches. The Git project makes no formal guarantee for any +older maintenance tracks to receive updates. In practice, +though, critical vulnerability fixes are applied not only to the +most recent track, but to at least a couple more maintenance +tracks. -One exception is [MinGit for Windows](https://github.com/git-for-windows/git/wiki/MinGit) (a minimal subset of Git for Windows, intended for bundling with third-party applications that do not need any interactive commands nor support for `git svn`): critical security fixes are backported to the v2.11.x, v2.14.x, v2.19.x, v2.21.x and v2.23.x release trains. +This is typically done by making the fix on the oldest and still +relevant maintenance track, and merging it upwards to newer and +newer maintenance tracks. -## Version number scheme - -The Git for Windows versions reflect the Git version on which they are based. For example, Git for Windows v2.21.0 is based on Git v2.21.0. - -As Git for Windows bundles more than just Git (such as Bash, OpenSSL, OpenSSH, GNU Privacy Guard), sometimes there are interim releases without corresponding Git releases. In these cases, Git for Windows appends a number in parentheses, starting with the number 2, then 3, etc. For example, both Git for Windows v2.17.1 and v2.17.1(2) were based on Git v2.17.1, but the latter included updates for Git Credential Manager and Git LFS, fixing critical regressions. - -## Tag naming scheme - -Every Git for Windows version is tagged using a name that starts with the Git version on which it is based, with the suffix `.windows.` appended. For example, Git for Windows v2.17.1' source code is tagged as [`v2.17.1.windows.1`](https://github.com/git-for-windows/git/releases/tag/v2.17.1.windows.1) (the patch level is always at least 1, given that Git for Windows always has patches on top of Git). Likewise, Git for Windows v2.17.1(2)' source code is tagged as [`v2.17.1.windows.2`](https://github.com/git-for-windows/git/releases/tag/v2.17.1.windows.2). - -## Release Candidate (rc) versions - -As a friendly fork of Git (the "upstream" project), Git for Windows is closely corelated to that project. - -Consequently, Git for Windows publishes versions based on Git's release candidates (for upcoming "`.0`" versions, see [Git's release schedule](https://tinyurl.com/gitCal)). These versions end in `-rc`, starting with `-rc0` for a very early preview of what is to come, and as with regular versions, Git for Windows tries to follow Git's releases as quickly as possible. - -Note: there is currently a bug in the "Check daily for updates" code, where it mistakes the final version as a downgrade from release candidates. Example: if you installed Git for Windows v2.23.0-rc3 and enabled the auto-updater, it would ask you whether you want to "downgrade" to v2.23.0 when that version was available. - -[All releases](https://github.com/git-for-windows/git/releases/), including release candidates, are listed via a link at the footer of the [Git for Windows](https://gitforwindows.org/) home page. - -## Snapshot versions ('nightly builds') - -Git for Windows also provides snapshots (these are not releases) of the the current development as per git-for-Windows/git's `master` branch at the [Snapshots](https://wingit.blob.core.windows.net/files/index.html) page. This link is also listed in the footer of the [Git for Windows](https://gitforwindows.org/) home page. - -Note: even if those builds are not exactly "nightly", they are sometimes referred to as "nightly builds" to keep with other projects' nomenclature. - -## Following upstream's developments - -The [gitforwindows/git repository](https://github.com/git-for-windows/git) also provides the `shears/*` branches. The `shears/*` branches reflect Git for Windows' patches, rebased onto the upstream integration branches, [updated (mostly) via automated CI builds](https://dev.azure.com/git-for-windows/git/_build?definitionId=25). +For example, v2.24.1 was released to address a couple of +[CVEs](https://cve.mitre.org/), and at the same time v2.14.6, +v2.15.4, v2.16.6, v2.17.3, v2.18.2, v2.19.3, v2.20.2, v2.21.1, +v2.22.2 and v2.23.1 were released. diff --git a/abspath.c b/abspath.c index 7a5f114382..39e06b5848 100644 --- a/abspath.c +++ b/abspath.c @@ -91,9 +91,6 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path, goto error_out; } - if (platform_strbuf_realpath(resolved, path)) - return resolved->buf; - strbuf_addstr(&remaining, path); get_root_part(resolved, &remaining); diff --git a/advice.c b/advice.c index 7f633a17b8..6fda9edbc2 100644 --- a/advice.c +++ b/advice.c @@ -48,7 +48,6 @@ static struct { [ADVICE_GRAFT_FILE_DEPRECATED] = { "graftFileDeprecated", 1 }, [ADVICE_IGNORED_HOOK] = { "ignoredHook", 1 }, [ADVICE_IMPLICIT_IDENTITY] = { "implicitIdentity", 1 }, - [ADVICE_NAME_TOO_LONG] = { "nameTooLong", 1 }, [ADVICE_NESTED_TAG] = { "nestedTag", 1 }, [ADVICE_OBJECT_NAME_WARNING] = { "objectNameWarning", 1 }, [ADVICE_PUSH_ALREADY_EXISTS] = { "pushAlreadyExists", 1 }, @@ -75,7 +74,6 @@ static struct { [ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE] = { "submoduleAlternateErrorStrategyDie", 1 }, [ADVICE_SUBMODULES_NOT_UPDATED] = { "submodulesNotUpdated", 1 }, [ADVICE_UPDATE_SPARSE_PATH] = { "updateSparsePath", 1 }, - [ADVICE_USE_CORE_FSMONITOR_CONFIG] = { "useCoreFSMonitorConfig", 1 }, [ADVICE_WAITING_FOR_EDITOR] = { "waitingForEditor", 1 }, }; diff --git a/advice.h b/advice.h index ef39f756ca..7ddc6cbc1a 100644 --- a/advice.h +++ b/advice.h @@ -26,7 +26,6 @@ struct string_list; ADVICE_GRAFT_FILE_DEPRECATED, ADVICE_IGNORED_HOOK, ADVICE_IMPLICIT_IDENTITY, - ADVICE_NAME_TOO_LONG, ADVICE_NESTED_TAG, ADVICE_OBJECT_NAME_WARNING, ADVICE_PUSH_ALREADY_EXISTS, @@ -49,7 +48,6 @@ struct string_list; ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE, ADVICE_SUBMODULES_NOT_UPDATED, ADVICE_UPDATE_SPARSE_PATH, - ADVICE_USE_CORE_FSMONITOR_CONFIG, ADVICE_WAITING_FOR_EDITOR, ADVICE_SKIPPED_CHERRY_PICKS, }; diff --git a/apply.c b/apply.c index f86a01b260..2b7cd930ef 100644 --- a/apply.c +++ b/apply.c @@ -4366,7 +4366,7 @@ static int try_create_file(struct apply_state *state, const char *path, /* Although buf:size is counted string, it also is NUL * terminated. */ - return !!create_symlink(state && state->repo ? state->repo->index : NULL, buf, path); + return !!symlink(buf, path); fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666); if (fd < 0) diff --git a/archive-tar.c b/archive-tar.c index ae87fe646e..042feb66d2 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -17,8 +17,6 @@ static unsigned long offset; static int tar_umask = 002; -static gzFile gzip; - static int write_tar_filter_archive(const struct archiver *ar, struct archiver_args *args); @@ -40,21 +38,11 @@ static int write_tar_filter_archive(const struct archiver *ar, #define USTAR_MAX_MTIME 077777777777ULL #endif -/* writes out the whole block, or dies if fails */ -static void write_block_or_die(const char *block) { - if (gzip) { - if (gzwrite(gzip, block, (unsigned) BLOCKSIZE) != BLOCKSIZE) - die(_("gzwrite failed")); - } else { - write_or_die(1, block, BLOCKSIZE); - } -} - /* writes out the whole block, but only if it is full */ static void write_if_needed(void) { if (offset == BLOCKSIZE) { - write_block_or_die(block); + write_or_die(1, block, BLOCKSIZE); offset = 0; } } @@ -78,7 +66,7 @@ static void do_write_blocked(const void *data, unsigned long size) write_if_needed(); } while (size >= BLOCKSIZE) { - write_block_or_die(buf); + write_or_die(1, buf, BLOCKSIZE); size -= BLOCKSIZE; buf += BLOCKSIZE; } @@ -113,10 +101,10 @@ static void write_trailer(void) { int tail = BLOCKSIZE - offset; memset(block + offset, 0, tail); - write_block_or_die(block); + write_or_die(1, block, BLOCKSIZE); if (tail < 2 * RECORDSIZE) { memset(block, 0, offset); - write_block_or_die(block); + write_or_die(1, block, BLOCKSIZE); } } @@ -455,34 +443,18 @@ static int write_tar_filter_archive(const struct archiver *ar, filter.use_shell = 1; filter.in = -1; - if (!strcmp("gzip -cn", ar->data)) { - char outmode[4] = "wb\0"; - - if (args->compression_level >= 0 && args->compression_level <= 9) - outmode[2] = '0' + args->compression_level; - - gzip = gzdopen(fileno(stdout), outmode); - if (!gzip) - die(_("Could not gzdopen stdout")); - } else { - if (start_command(&filter) < 0) - die_errno(_("unable to start '%s' filter"), cmd.buf); - close(1); - if (dup2(filter.in, 1) < 0) - die_errno(_("unable to redirect descriptor")); - close(filter.in); - } + if (start_command(&filter) < 0) + die_errno(_("unable to start '%s' filter"), cmd.buf); + close(1); + if (dup2(filter.in, 1) < 0) + die_errno(_("unable to redirect descriptor")); + close(filter.in); r = write_tar_archive(ar, args); - if (gzip) { - if (gzclose(gzip) != Z_OK) - die(_("gzclose failed")); - } else { - close(1); - if (finish_command(&filter) != 0) - die(_("'%s' filter reported error"), cmd.buf); - } + close(1); + if (finish_command(&filter) != 0) + die(_("'%s' filter reported error"), cmd.buf); strbuf_release(&cmd); return r; diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index e7200599fb..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,393 +0,0 @@ -variables: - Agent.Source.Git.ShallowFetchDepth: 1 - GIT_CONFIG_PARAMETERS: "'checkout.workers=56' 'user.name=CI' 'user.email=ci@git'" - -jobs: -- job: windows_build - displayName: Windows Build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - steps: - - bash: git clone --bare --depth=1 --filter=blob:none --single-branch -b main https://github.com/git-for-windows/git-sdk-64 - displayName: 'clone git-sdk-64' - - bash: git clone --depth=1 --single-branch -b main https://github.com/git-for-windows/build-extra - displayName: 'clone build-extra' - - bash: sh -x ./build-extra/please.sh create-sdk-artifact --sdk=git-sdk-64.git --out=git-sdk-64-minimal minimal-sdk - displayName: 'build git-sdk-64-minimal-sdk' - - bash: | - # Let Git ignore the SDK and the test-cache - printf "%s\n" /git-sdk-64.git/ /build-extra/ /git-sdk-64-minimal/ /test-cache/ >>'.git/info/exclude' - displayName: 'Ignore untracked directories' - - bash: ci/make-test-artifacts.sh artifacts - displayName: Build - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - DEVELOPER: 1 - NO_PERL: 1 - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - task: PublishPipelineArtifact@0 - displayName: 'Publish Pipeline Artifact: test artifacts' - inputs: - artifactName: 'windows-artifacts' - targetPath: '$(Build.SourcesDirectory)\artifacts' - - task: PublishPipelineArtifact@0 - displayName: 'Publish Pipeline Artifact: git-sdk-64-minimal' - inputs: - artifactName: 'git-sdk-64-minimal' - targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal' - -- job: windows_test - displayName: Windows Test - dependsOn: windows_build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - strategy: - parallel: 10 - steps: - - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact: test artifacts' - inputs: - artifactName: 'windows-artifacts' - targetPath: '$(Build.SourcesDirectory)' - - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact: git-sdk-64-minimal' - inputs: - artifactName: 'git-sdk-64-minimal' - targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal' - - bash: | - test -f artifacts.tar.gz || { - echo No test artifacts found\; skipping >&2 - exit 0 - } - tar xf artifacts.tar.gz || exit 1 - - # Let Git ignore the SDK and the test-cache - printf '%s\n' /git-sdk-64.git/ /build-extra/ /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude - - ci/run-test-slice.sh $SYSTEM_JOBPOSITIONINPHASE $SYSTEM_TOTALJOBSINPHASE || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'Test (parallel)' - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - NO_SVN_TESTS: 1 - GIT_TEST_SKIP_REBASE_P: 1 - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin\\core_perl;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'windows' - platform: Windows - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: vs_build - displayName: Visual Studio Build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - steps: - - bash: git clone --bare --depth=1 --filter=blob:none --single-branch -b main https://github.com/git-for-windows/git-sdk-64 - displayName: 'clone git-sdk-64' - - bash: git clone --depth=1 --single-branch -b main https://github.com/git-for-windows/build-extra - displayName: 'clone build-extra' - - bash: sh -x ./build-extra/please.sh create-sdk-artifact --sdk=git-sdk-64.git --out=git-sdk-64-minimal minimal-sdk - displayName: 'build git-sdk-64-minimal-sdk' - - bash: | - # Let Git ignore the SDK and the test-cache - printf "%s\n" /git-sdk-64-minimal/ /test-cache/ >>'.git/info/exclude' - displayName: 'Ignore untracked directories' - - bash: make NDEBUG=1 DEVELOPER=1 vcxproj - displayName: Generate Visual Studio Solution - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - DEVELOPER: 1 - NO_PERL: 1 - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - powershell: | - $urlbase = "https://dev.azure.com/git/git/_apis/build/builds" - $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id - $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl - (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip") - Expand-Archive compat.zip -DestinationPath . -Force - Remove-Item compat.zip - displayName: 'Download vcpkg artifacts' - - task: MSBuild@1 - inputs: - solution: git.sln - platform: x64 - configuration: Release - maximumCpuCount: 4 - msbuildArguments: /p:PlatformToolset=v142 - - bash: | - ./compat/vcbuild/vcpkg_copy_dlls.bat release && - mkdir -p artifacts && - eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts | grep ^tar)" - displayName: Bundle artifact tar - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - DEVELOPER: 1 - NO_PERL: 1 - MSVC: 1 - VCPKG_ROOT: $(Build.SourcesDirectory)\compat\vcbuild\vcpkg - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - powershell: | - $tag = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-tag.txt").content - $version = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-version.txt").content - $url = "https://github.com/git-for-windows/git/releases/download/${tag}/PortableGit-${version}-64-bit.7z.exe" - (New-Object Net.WebClient).DownloadFile($url,"PortableGit.exe") - & .\PortableGit.exe -y -oartifacts\PortableGit - # Wait until it is unpacked - while (-not @(Remove-Item -ErrorAction SilentlyContinue PortableGit.exe; $?)) { sleep 1 } - displayName: Download & extract portable Git - - task: PublishPipelineArtifact@0 - displayName: 'Publish Pipeline Artifact: MSVC test artifacts' - inputs: - artifactName: 'vs-artifacts' - targetPath: '$(Build.SourcesDirectory)\artifacts' - -- job: vs_test - displayName: Visual Studio Test - dependsOn: vs_build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - strategy: - parallel: 10 - steps: - - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact: VS test artifacts' - inputs: - artifactName: 'vs-artifacts' - targetPath: '$(Build.SourcesDirectory)' - - bash: | - test -f artifacts.tar.gz || { - echo No test artifacts found\; skipping >&2 - exit 0 - } - tar xf artifacts.tar.gz || exit 1 - - # Let Git ignore the SDK and the test-cache - printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude - - cd t && - PATH="$PWD/helper:$PATH" && - test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \ - $(test-tool.exe path-utils slice-tests \ - $SYSTEM_JOBPOSITIONINPHASE $SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh) - displayName: 'Test (parallel)' - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - NO_SVN_TESTS: 1 - GIT_TEST_SKIP_REBASE_P: 1 - PATH: "$(Build.SourcesDirectory)\\PortableGit\\mingw64\\bin;$(Build.SourcesDirectory)\\PortableGit\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'vs' - platform: Windows - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-vs-test-artifacts - -- job: linux_clang - displayName: linux-clang - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - export CC=clang || exit 1 - - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux-clang' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: linux_gcc - displayName: linux-gcc - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux-gcc' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: osx_clang - displayName: osx-clang - condition: succeeded() - pool: - vmImage: macOS-latest - steps: - - bash: | - export CC=clang - - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'osx-clang' - platform: macOS - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: osx_gcc - displayName: osx-gcc - condition: succeeded() - pool: - vmImage: macOS-latest - steps: - - bash: | - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'osx-gcc' - platform: macOS - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: linux32 - displayName: Linux32 - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - res=0 - sudo AGENT_OS="$AGENT_OS" BUILD_BUILDNUMBER="$BUILD_BUILDNUMBER" BUILD_REPOSITORY_URI="$BUILD_REPOSITORY_URI" BUILD_SOURCEBRANCH="$BUILD_SOURCEBRANCH" BUILD_SOURCEVERSION="$BUILD_SOURCEVERSION" SYSTEM_PHASENAME="$SYSTEM_PHASENAME" SYSTEM_TASKDEFINITIONSURI="$SYSTEM_TASKDEFINITIONSURI" SYSTEM_TEAMPROJECT="$SYSTEM_TEAMPROJECT" CC=$CC MAKEFLAGS="$MAKEFLAGS" jobname=linux32 bash -lxc ci/run-docker.sh || res=1 - - sudo chmod a+r t/out/TEST-*.xml - test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts - - exit $res - displayName: 'jobname=linux32 ci/run-docker.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux32' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: static_analysis - displayName: StaticAnalysis - condition: succeeded() - pool: - vmImage: ubuntu-18.04 - steps: - - bash: | - sudo apt-get update && - sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext && - - export jobname=StaticAnalysis && - - ci/run-static-analysis.sh || exit 1 - displayName: 'ci/run-static-analysis.sh' - -- job: documentation - displayName: Documentation - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - sudo apt-get update && - sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns && - - export ALREADY_HAVE_ASCIIDOCTOR=yes. && - export jobname=Documentation && - - ci/test-documentation.sh || exit 1 - displayName: 'ci/test-documentation.sh' diff --git a/builtin/add.c b/builtin/add.c index 76d5ad1f5d..f84372964c 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -593,10 +593,6 @@ int cmd_add(int argc, const char **argv, const char *prefix) die_in_unpopulated_submodule(&the_index, prefix); die_path_inside_submodule(&the_index, &pathspec); - enable_fscache(0); - /* We do not really re-read the index but update the up-to-date flags */ - preload_index(&the_index, &pathspec, 0); - if (add_new_files) { int baselen; @@ -699,7 +695,6 @@ finish: die(_("Unable to write new index file")); dir_clear(&dir); - enable_fscache(0); UNLEAK(pathspec); return exit_status; } diff --git a/builtin/archive.c b/builtin/archive.c index 77d80fdfeb..7176b041b6 100644 --- a/builtin/archive.c +++ b/builtin/archive.c @@ -9,7 +9,6 @@ #include "parse-options.h" #include "pkt-line.h" #include "sideband.h" -#include "config.h" static void create_output_file(const char *output_file) { @@ -94,7 +93,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix) OPT_END() }; - git_config(git_default_config, NULL); argc = parse_options(argc, argv, prefix, local_opts, NULL, PARSE_OPT_KEEP_ALL); diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 40d4214491..8a052c7111 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -9,7 +9,6 @@ #include "prompt.h" #include "quote.h" #include "revision.h" -#include "config.h" static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS") static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV") @@ -1323,7 +1322,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) }; struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL }; - git_config(git_default_config, NULL); argc = parse_options(argc, argv, prefix, options, git_bisect_helper_usage, PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_UNKNOWN); diff --git a/builtin/bundle.c b/builtin/bundle.c index 95219c0944..2adad545a2 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -3,7 +3,6 @@ #include "parse-options.h" #include "cache.h" #include "bundle.h" -#include "config.h" /* * Basic handler for bundle files to connect repositories via sneakernet. @@ -111,7 +110,6 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) { }; char *bundle_file; - git_config(git_default_config, NULL); argc = parse_options_cmd_bundle(argc, argv, prefix, builtin_bundle_verify_usage, options, &bundle_file); /* bundle internals use argv[1] as further parameters */ diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c index abee1be472..bc67d3f0a8 100644 --- a/builtin/check-ref-format.c +++ b/builtin/check-ref-format.c @@ -6,7 +6,6 @@ #include "refs.h" #include "builtin.h" #include "strbuf.h" -#include "config.h" static const char builtin_check_ref_format_usage[] = "git check-ref-format [--normalize] [] \n" @@ -59,7 +58,6 @@ int cmd_check_ref_format(int argc, const char **argv, const char *prefix) int flags = 0; const char *refname; - git_config(git_default_config, NULL); if (argc == 2 && !strcmp(argv[1], "-h")) usage(builtin_check_ref_format_usage); diff --git a/builtin/checkout.c b/builtin/checkout.c index 14d0709397..df3f1663d7 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -391,7 +391,6 @@ static int checkout_worktree(const struct checkout_opts *opts, if (pc_workers > 1) init_parallel_checkout(); - enable_fscache(active_nr); for (pos = 0; pos < active_nr; pos++) { struct cache_entry *ce = active_cache[pos]; if (ce->ce_flags & CE_MATCHED) { @@ -416,7 +415,6 @@ static int checkout_worktree(const struct checkout_opts *opts, errs |= run_parallel_checkout(&state, pc_workers, pc_threshold, NULL, NULL); mem_pool_discard(&ce_mem_pool, should_validate_cache_entries()); - disable_fscache(); remove_marked_cache_entries(&the_index, 1); remove_scheduled_dirs(); errs |= finish_delayed_checkout(&state, opts->show_progress); diff --git a/builtin/clean.c b/builtin/clean.c index 1852e33ec9..5466636e66 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -34,10 +34,6 @@ static const char *msg_remove = N_("Removing %s\n"); static const char *msg_would_remove = N_("Would remove %s\n"); static const char *msg_skip_git_dir = N_("Skipping repository %s\n"); static const char *msg_would_skip_git_dir = N_("Would skip repository %s\n"); -#ifndef CAN_UNLINK_MOUNT_POINTS -static const char *msg_skip_mount_point = N_("Skipping mount point %s\n"); -static const char *msg_would_skip_mount_point = N_("Would skip mount point %s\n"); -#endif static const char *msg_warn_remove_failed = N_("failed to remove %s"); static const char *msg_warn_lstat_failed = N_("could not lstat %s\n"); static const char *msg_skip_cwd = N_("Refusing to remove current working directory\n"); @@ -179,29 +175,6 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, goto out; } - if (is_mount_point(path)) { -#ifndef CAN_UNLINK_MOUNT_POINTS - if (!quiet) { - quote_path(path->buf, prefix, "ed, 0); - printf(dry_run ? - _(msg_would_skip_mount_point) : - _(msg_skip_mount_point), quoted.buf); - } - *dir_gone = 0; -#else - if (!dry_run && unlink(path->buf)) { - int saved_errno = errno; - quote_path(path->buf, prefix, "ed, 0); - errno = saved_errno; - warning_errno(_(msg_warn_remove_failed), quoted.buf); - *dir_gone = 0; - ret = -1; - } -#endif - - goto out; - } - dir = opendir(path->buf); if (!dir) { /* an empty dir could be removed even if it is unreadble */ @@ -211,9 +184,6 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, quote_path(path->buf, prefix, "ed, 0); errno = saved_errno; warning_errno(_(msg_warn_remove_failed), quoted.buf); - if (saved_errno == ENAMETOOLONG) { - advise_if_enabled(ADVICE_NAME_TOO_LONG, _("Setting `core.longPaths` may allow the deletion to succeed.")); - } *dir_gone = 0; } ret = res; @@ -249,9 +219,6 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, quote_path(path->buf, prefix, "ed, 0); errno = saved_errno; warning_errno(_(msg_warn_remove_failed), quoted.buf); - if (saved_errno == ENAMETOOLONG) { - advise_if_enabled(ADVICE_NAME_TOO_LONG, _("Setting `core.longPaths` may allow the deletion to succeed.")); - } *dir_gone = 0; ret = 1; } @@ -295,9 +262,6 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag, quote_path(path->buf, prefix, "ed, 0); errno = saved_errno; warning_errno(_(msg_warn_remove_failed), quoted.buf); - if (saved_errno == ENAMETOOLONG) { - advise_if_enabled(ADVICE_NAME_TOO_LONG, _("Setting `core.longPaths` may allow the deletion to succeed.")); - } *dir_gone = 0; ret = 1; } @@ -1050,7 +1014,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix) if (read_cache() < 0) die(_("index file corrupt")); - enable_fscache(active_nr); pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option"); for (i = 0; i < exclude_list.nr; i++) @@ -1117,9 +1080,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix) qname = quote_path(item->string, NULL, &buf, 0); errno = saved_errno; warning_errno(_(msg_warn_remove_failed), qname); - if (saved_errno == ENAMETOOLONG) { - advise_if_enabled(ADVICE_NAME_TOO_LONG, _("Setting `core.longPaths` may allow the deletion to succeed.")); - } errors++; } else if (!quiet) { qname = quote_path(item->string, NULL, &buf, 0); @@ -1128,7 +1088,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix) } } - disable_fscache(); strbuf_release(&abs_path); strbuf_release(&buf); string_list_clear(&del_list, 0); diff --git a/builtin/clone.c b/builtin/clone.c index 9b50406fac..9e0b2b45ca 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -900,8 +900,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix) struct transport_ls_refs_options transport_ls_refs_options = TRANSPORT_LS_REFS_OPTIONS_INIT; - git_config(git_default_core_config, NULL); - packet_trace_identity("clone"); git_config(git_clone_config, NULL); diff --git a/builtin/column.c b/builtin/column.c index 6971891752..158fdf53d9 100644 --- a/builtin/column.c +++ b/builtin/column.c @@ -34,8 +34,6 @@ int cmd_column(int argc, const char **argv, const char *prefix) OPT_END() }; - git_config(git_default_core_config, NULL); - /* This one is special and must be the first one */ if (argc > 1 && starts_with(argv[1], "--command=")) { command = argv[1] + 10; diff --git a/builtin/commit.c b/builtin/commit.c index cf0e24d3ab..fcf9c85947 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1540,7 +1540,6 @@ int cmd_status(int argc, const char **argv, const char *prefix) PATHSPEC_PREFER_FULL, prefix, argv); - enable_fscache(0); if (status_format != STATUS_FORMAT_PORCELAIN && status_format != STATUS_FORMAT_PORCELAIN_V2) progress_flag = REFRESH_PROGRESS; @@ -1581,7 +1580,6 @@ int cmd_status(int argc, const char **argv, const char *prefix) wt_status_print(&s); wt_status_collect_free_buffers(&s); - disable_fscache(); return 0; } diff --git a/builtin/credential-store.c b/builtin/credential-store.c index a693b235f3..62a4f3c265 100644 --- a/builtin/credential-store.c +++ b/builtin/credential-store.c @@ -4,7 +4,6 @@ #include "credential.h" #include "string-list.h" #include "parse-options.h" -#include "config.h" static struct lock_file credential_lock; @@ -166,8 +165,6 @@ int cmd_credential_store(int argc, const char **argv, const char *prefix) umask(077); - git_config(git_default_config, NULL); - argc = parse_options(argc, (const char **)argv, prefix, options, usage, 0); if (argc != 1) usage_with_options(usage, options); diff --git a/builtin/difftool.c b/builtin/difftool.c index e1f4e24b8d..b3c509b8de 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -513,7 +513,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix, } add_path(&wtdir, wtdir_len, dst_path); if (symlinks) { - if (create_symlink(lstate.istate, wtdir.buf, rdir.buf)) { + if (symlink(wtdir.buf, rdir.buf)) { ret = error_errno("could not symlink '%s' to '%s'", wtdir.buf, rdir.buf); goto finish; } diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 89005baa9d..f045bbbe94 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -5,7 +5,6 @@ #include "connect.h" #include "oid-array.h" #include "protocol.h" -#include "config.h" static const char fetch_pack_usage[] = "git fetch-pack [--all] [--stdin] [--quiet | -q] [--keep | -k] [--thin] " @@ -58,7 +57,6 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) struct packet_reader reader; enum protocol_version version; - git_config(git_default_config, NULL); fetch_if_missing = 0; packet_trace_identity("fetch-pack"); diff --git a/builtin/gc.c b/builtin/gc.c index 2db65703eb..021e9256ae 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -1969,7 +1969,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority "\n" "\n" "\n" - "\"%s\\headless-git.exe\"\n" + "\"%s\\git.exe\"\n" "--exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%s\n" "\n" "\n" diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c index a623518ae7..491af9202d 100644 --- a/builtin/get-tar-commit-id.c +++ b/builtin/get-tar-commit-id.c @@ -6,7 +6,6 @@ #include "tar.h" #include "builtin.h" #include "quote.h" -#include "config.h" static const char builtin_get_tar_commit_id_usage[] = "git get-tar-commit-id"; @@ -28,7 +27,6 @@ int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix) if (argc != 1) usage(builtin_get_tar_commit_id_usage); - git_config(git_default_config, NULL); n = read_in_full(0, buffer, HEADERSIZE); if (n < 0) die_errno("git get-tar-commit-id: read error"); diff --git a/builtin/init-db.c b/builtin/init-db.c index 665d2da51b..546f9c595e 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -78,7 +78,7 @@ static void copy_templates_1(struct strbuf *path, struct strbuf *template_path, if (strbuf_readlink(&lnk, template_path->buf, st_template.st_size) < 0) die_errno(_("cannot readlink '%s'"), template_path->buf); - if (create_symlink(NULL, lnk.buf, path->buf)) + if (symlink(lnk.buf, path->buf)) die_errno(_("cannot symlink '%s' '%s'"), lnk.buf, path->buf); strbuf_release(&lnk); @@ -300,7 +300,7 @@ static int create_default_files(const char *template_path, path = git_path_buf(&buf, "tXXXXXX"); if (!close(xmkstemp(path)) && !unlink(path) && - !create_symlink(NULL, "testing", path) && + !symlink("testing", path) && !lstat(path, &st1) && S_ISLNK(st1.st_mode)) unlink(path); /* good */ @@ -410,7 +410,7 @@ int init_db(const char *git_dir, const char *real_git_dir, startup_info->have_repository = 1; /* Ensure `core.hidedotfiles` is processed */ - git_config(git_default_core_config, NULL); + git_config(platform_core_config, NULL); safe_create_dir(git_dir, 0); diff --git a/builtin/log.c b/builtin/log.c index 8e63cbae28..88a5e98875 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -2364,7 +2364,6 @@ int cmd_cherry(int argc, const char **argv, const char *prefix) OPT_END() }; - git_config(git_default_config, NULL); argc = parse_options(argc, argv, prefix, options, cherry_usage, 0); switch (argc) { diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index 7398b7c4aa..df44e5cc0d 100644 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@ -4,7 +4,6 @@ #include "ref-filter.h" #include "remote.h" #include "refs.h" -#include "config.h" static const char * const ls_remote_usage[] = { N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=]\n" @@ -87,7 +86,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) packet_trace_identity("ls-remote"); - git_config(git_default_config, NULL); if (argc > 1) { int i; CALLOC_ARRAY(pattern, argc); diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index df6cc41721..01d16ef9e5 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -8,7 +8,6 @@ #include "strbuf.h" #include "mailinfo.h" #include "parse-options.h" -#include "config.h" static const char * const mailinfo_usage[] = { /* TRANSLATORS: keep <> in "<" mail ">" info. */ @@ -79,7 +78,6 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix) OPT_END() }; - git_config(git_default_config, NULL); setup_mailinfo(&mi); meta_charset.policy = CHARSET_DEFAULT; diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c index 939c5b4197..73509f651b 100644 --- a/builtin/mailsplit.c +++ b/builtin/mailsplit.c @@ -8,7 +8,6 @@ #include "builtin.h" #include "string-list.h" #include "strbuf.h" -#include "config.h" static const char git_mailsplit_usage[] = "git mailsplit [-d] [-f] [-b] [--keep-cr] -o [(|)...]"; @@ -278,7 +277,6 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix) const char **argp; static const char *stdin_only[] = { "-", NULL }; - git_config(git_default_config, NULL); for (argp = argv+1; *argp; argp++) { const char *arg = *argp; diff --git a/builtin/merge-index.c b/builtin/merge-index.c index 24e5c1f6ea..c0383fe9df 100644 --- a/builtin/merge-index.c +++ b/builtin/merge-index.c @@ -1,7 +1,6 @@ #define USE_THE_INDEX_COMPATIBILITY_MACROS #include "builtin.h" #include "run-command.h" -#include "config.h" static const char *pgm; static int one_shot, quiet; @@ -78,8 +77,6 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix) */ signal(SIGCHLD, SIG_DFL); - git_config(git_default_config, NULL); - if (argc < 3) usage("git merge-index [-o] [-q] (-a | [--] [...])"); diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index d1fa487ce6..5dc94d6f88 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -7,7 +7,6 @@ #include "blob.h" #include "exec-cmd.h" #include "merge-blobs.h" -#include "config.h" static const char merge_tree_usage[] = "git merge-tree "; @@ -376,7 +375,6 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix) if (argc != 4) usage(merge_tree_usage); - git_config(git_default_config, NULL); buf1 = get_tree_descriptor(r, t+0, argv[1]); buf2 = get_tree_descriptor(r, t+1, argv[2]); buf3 = get_tree_descriptor(r, t+2, argv[3]); diff --git a/builtin/mktag.c b/builtin/mktag.c index 275feb0667..5d22909122 100644 --- a/builtin/mktag.c +++ b/builtin/mktag.c @@ -84,7 +84,6 @@ int cmd_mktag(int argc, const char **argv, const char *prefix) builtin_mktag_options, builtin_mktag_usage, 0); - git_config(git_default_config, NULL); if (strbuf_read(&buf, 0, 0) < 0) die_errno(_("could not read from stdin")); diff --git a/builtin/mktree.c b/builtin/mktree.c index 12386110b4..06d81400f5 100644 --- a/builtin/mktree.c +++ b/builtin/mktree.c @@ -8,7 +8,6 @@ #include "tree.h" #include "parse-options.h" #include "object-store.h" -#include "config.h" static struct treeent { unsigned mode; @@ -165,7 +164,6 @@ int cmd_mktree(int ac, const char **av, const char *prefix) OPT_END() }; - git_config(git_default_config, NULL); ac = parse_options(ac, av, prefix, option, mktree_usage, 0); getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf; diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index 28f79b9938..cfbd5c36c7 100644 --- a/builtin/pack-refs.c +++ b/builtin/pack-refs.c @@ -3,7 +3,6 @@ #include "parse-options.h" #include "refs.h" #include "repository.h" -#include "config.h" static char const * const pack_refs_usage[] = { N_("git pack-refs []"), diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c index 221fd881eb..da3273a268 100644 --- a/builtin/prune-packed.c +++ b/builtin/prune-packed.c @@ -1,7 +1,6 @@ #include "builtin.h" #include "parse-options.h" #include "prune-packed.h" -#include "config.h" static const char * const prune_packed_usage[] = { "git prune-packed [-n | --dry-run] [-q | --quiet]", @@ -19,7 +18,6 @@ int cmd_prune_packed(int argc, const char **argv, const char *prefix) OPT_END() }; - git_config(git_default_config, NULL); argc = parse_options(argc, argv, prefix, prune_packed_options, prune_packed_usage, 0); diff --git a/builtin/prune.c b/builtin/prune.c index 5dfd6a47d5..df376b2ed1 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -9,7 +9,6 @@ #include "prune-packed.h" #include "object-store.h" #include "shallow.h" -#include "config.h" static const char * const prune_usage[] = { N_("git prune [-n] [-v] [--progress] [--expire