diff --git a/.didntcomefromthenpmregistry b/.didntcomefromthenpmregistry deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000000..60318f794c --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,13 @@ +## System information + - node version: + - npm or yarn version: + - OS/version/architecture: + - Applicable nodegit version: + +``` +node -v +npm -v # (or yarn -v) +node -e "console.log(process.platform)" +node -e "console.log(require('os').release())" +node -e "console.log(process.arch)" +``` diff --git a/.github/workflows/build-openssl-packages.yml b/.github/workflows/build-openssl-packages.yml new file mode 100644 index 0000000000..7b7a5dea3e --- /dev/null +++ b/.github/workflows/build-openssl-packages.yml @@ -0,0 +1,48 @@ +name: Build and Publish OpenSSL Packages + +on: + workflow_dispatch: + +jobs: + build-openssl: + name: Build OpenSSL package for (${{ matrix.os }} ${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: windows-latest + arch: arm64 + - os: windows-latest + arch: x64 + - os: macos-15 + arch: arm64 + - os: macos-15-intel + arch: x64 + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + run: npm install + + - name: Build OpenSSL packages + env: + npm_config_arch: ${{ matrix.arch }} + NODEGIT_OPENSSL_BUILD_PACKAGE: 1 + OPENSSL_MACOS_DEPLOYMENT_TARGET: "11.0" + run: node utils/acquireOpenSSL.mjs + + - name: Push OpenSSL package to S3 + env: + npm_config_arch: ${{ matrix.arch }} + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: node utils/uploadOpenSSL.mjs diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000..3cd6aae10c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,196 @@ +on: + push: + branches: + - master + - backport/* + tags: + - v*.*.* + pull_request: + +name: Testing + +jobs: + linux-tests: + name: "Linux Tests" + strategy: + matrix: + node: [20, 22, 24] + fail-fast: false + runs-on: ubuntu-22.04 + steps: + - name: Install Dependencies for Ubuntu + run: sudo apt-get update && sudo apt-get install -y software-properties-common git build-essential clang libssl-dev libkrb5-dev libc++-dev wget zlib1g-dev + + - uses: actions/checkout@v4 + + - name: Setup Environment + run: | + set -e + mkdir ~/.ssh_tests + chmod 700 ~/.ssh_tests + printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config + cat test/id_rsa.pub > ~/.ssh_tests/id_rsa.pub + cat test/id_rsa.enc | base64 -d > ~/.ssh_tests/id_rsa + chmod 600 ~/.ssh_tests/id_rsa* + git config --global user.name "John Doe" + git config --global user.email johndoe@example.com + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + check-latest: true + + - name: Install + run: npm install + + - name: Test + run: | + set -e + eval `ssh-agent -s` + ssh-add ~/.ssh_tests/id_rsa + node utils/retry npm test + + - name: Deploy + if: startsWith(github.ref, 'refs/tags/v') + env: + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: | + npm install -g @mapbox/node-pre-gyp aws-sdk + node lifecycleScripts/clean + node-pre-gyp package + node-pre-gyp publish + + macos-tests: + name: "macOS Tests" + strategy: + matrix: + node: [20, 22, 24] + arch: [x64, arm64] + fail-fast: false + runs-on: ${{ matrix.arch == 'x64' && 'macos-15-intel' || 'macos-15' }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Environment + run: | + mkdir ~/.ssh_tests + chmod 700 ~/.ssh_tests + printf "%b" "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh_tests/config + cat test/id_rsa.pub > ~/.ssh_tests/id_rsa.pub + cat test/id_rsa.enc | base64 -d > ~/.ssh_tests/id_rsa + chmod 600 ~/.ssh_tests/id_rsa* + git config --global user.name "John Doe" + git config --global user.email johndoe@example.com + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + check-latest: true + + - name: Install + run: npm install + + - name: Test + run: | + set -e + eval `ssh-agent -s` + ssh-add ~/.ssh_tests/id_rsa + node utils/retry npm test + + - name: Deploy + if: startsWith(github.ref, 'refs/tags/v') + env: + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: | + npm install -g @mapbox/node-pre-gyp aws-sdk + node lifecycleScripts/clean + node-pre-gyp package + node-pre-gyp publish + + windows-tests: + name: Windows Tests + strategy: + matrix: + node: [20, 22, 24] + arch: [x86, x64, arm64] + exclude: + - node: 24 + arch: x86 + fail-fast: false + runs-on: windows-2022 + steps: + - name: Setup Environment + run: | + git config --file C:\ProgramData\Git\config core.autocrlf input + git config --system core.autocrlf input + git config --global core.autocrlf input + git config --global user.name "John Doe" + git config --global user.email johndoe@example.com + + - uses: actions/checkout@v4 + + - name: Use Node.js + if: matrix.arch == 'x86' + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + check-latest: true + architecture: x86 + + - name: Use Node.js + uses: actions/setup-node@v4 + if: matrix.arch != 'x86' + with: + node-version: ${{ matrix.node }} + check-latest: true + + - name: Install + env: + npm_config_arch: ${{ matrix.arch == 'x86' && 'ia32' || matrix.arch }} + run: npm install + + - name: Test + # need arm64 runners or an emulator to run tests + if: matrix.arch != 'arm64' + env: + GIT_SSH: ${{ github.workspace }}\vendor\plink.exe + run: | + $encodedKey = Get-Content -Path test\private.ppk.enc + $finalPath = Join-Path -Path $HOME -ChildPath .ssh_tests\private.ppk + mkdir ~\.ssh_tests + Set-Content -Value $([System.Convert]::FromBase64String($encodedKey)) -Path $finalPath -AsByteStream + powershell -command "Start-Process .\vendor\pageant\pageant_${{ matrix.arch }}.exe $finalPath" + node utils/retry npm test + + # You're probably wondering why this isn't a single `run: |` step, it certainly is for *nix, + # but it's not, because the CI runner for windows doesn't wait for each step as listed here + # and it treats each additional step past the first as an orphaned process. + - name: Deploy (Dependencies) + if: startsWith(github.ref, 'refs/tags/v') + run: npm install -g @mapbox/node-pre-gyp aws-sdk + + - name: Deploy (Clean) + if: startsWith(github.ref, 'refs/tags/v') + run: node lifecycleScripts\clean + + - name: Deploy (Package) + if: startsWith(github.ref, 'refs/tags/v') + run: node-pre-gyp package --target_arch=${{ matrix.arch }} + + - name: Deploy (Publish) + if: startsWith(github.ref, 'refs/tags/v') + env: + node_pre_gyp_bucket: ${{ secrets.node_pre_gyp_bucket }} + AWS_ACCESS_KEY_ID: ${{ secrets.node_pre_gyp_accessKeyId }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.node_pre_gyp_secretAccessKey }} + run: node-pre-gyp publish --target_arch=${{ matrix.arch }} diff --git a/.gitignore b/.gitignore index ad8bc0b6ef..7d1f15f049 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,14 @@ -/node_modules/ -/vendor/libgit2/ -/vendor/libssh2/ -/vendor/http_parser/ /build/ -/test/coverage/ -/test/repos/ -/test/test/ -/src/ +/coverage/ /include/ /lib/enums.js /lib/nodegit.js -/coverage/ - - -/vendor/Release -/vendor/*.vcxproj -/vendor/*.filters -/vendor/*.sln +/node_modules/ +/src/ +/test/coverage/ +/test/home/ +/test/repos/ +/test/test/ /generate/output /generate/**/*.json @@ -25,7 +17,35 @@ /generate/missing-tests.json /binding.gyp +# Generated vendor files +/vendor/openssl/ +/vendor/libssh2/Makefile +/vendor/libssh2/config.status +/vendor/libssh2/docs/Makefile +/vendor/libssh2/example/.deps/ +/vendor/libssh2/example/Makefile +/vendor/libssh2/example/libssh2_config.h +/vendor/libssh2/example/stamp-h2 +/vendor/libssh2/libssh2.pc +/vendor/libssh2/libtool +/vendor/libssh2/src/.deps/ +/vendor/libssh2/src/Makefile +/vendor/libssh2/src/libssh2_config.h +/vendor/libssh2/src/stamp-h1 +/vendor/libssh2/tests/.deps/ +/vendor/libssh2/tests/Makefile +/vendor/libssh2/tests/ossfuzz/.deps +/vendor/libssh2/tests/ossfuzz/Makefile *.log .DS_STORE .idea +.clangd +.nyc_output/ + +.vscode +jsconfig.json + +test/id_rsa +test/nodegit-test-rsa +test/private.ppk diff --git a/.gitmodules b/.gitmodules index ca6a48f0b5..11538c1e2b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "vendor/libgit2"] path = vendor/libgit2 - url = git://github.com/libgit2/libgit2.git + url = https://github.com/nodegit/libgit2.git +[submodule "vendor/http_parser"] + path = vendor/http_parser + url = https://github.com/nodejs/http-parser diff --git a/.jshintrc b/.jshintrc index cbfa16d303..437878c8ce 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,5 @@ { + "esversion": 9, "boss": true, "curly": true, "eqnull": true, @@ -15,10 +16,11 @@ "it": true }, "immed": false, - "maxlen": 80, + "maxlen": 120, "node": true, "predef": [ - "-Promise" + "Promise", + "Set" ], "proto": true, "quotmark": "double", diff --git a/.npmignore b/.npmignore index c424b3e555..046bdf56a9 100644 --- a/.npmignore +++ b/.npmignore @@ -1,12 +1,14 @@ +/.travis/ /build/ -/example/ /examples/ +/generate/ +/guides/ +/lib/ /test/ /vendor/Release/ -/generate/output -/generate/**/*.json -!/generate/input/*.json +!/include +!/src .astylerc .editorconfig @@ -15,10 +17,11 @@ .jshintrc .travis.yml appveyor.yml -.didntcomefromthenpmregistry -*.vcxproj +!binding.gyp + *.filters -*.sln *.log *.md +*.sln +*.vcxproj diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 426563ef42..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,69 +0,0 @@ -env: - matrix: - - export NODE_VERSION="0.10" - - export NODE_VERSION="0.12" - - export NODE_VERSION="iojs" -matrix: - fast_finish: true - allow_failures: - - env: NODE_VERSION="0.10" - - env: NODE_VERSION="iojs" -before_install: - - git clone https://github.com/creationix/nvm.git ./.nvm - - source ./.nvm/nvm.sh - - nvm install $NODE_VERSION - - nvm use $NODE_VERSION - - if [ $TRAVIS_OS_NAME == "linux" ]; then - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; - sudo apt-get update; - sudo apt-get install gcc-4.9 g++-4.9 lcov; - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20; - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20; - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 20; - sudo update-alternatives --config gcc; - sudo update-alternatives --config g++; - sudo update-alternatives --config gcov; - wget http://downloads.sourceforge.net/ltp/lcov-1.10.tar.gz; - tar xvfz lcov-1.10.tar.gz; - sudo cp -v lcov-1.10/bin/{lcov,genpng,gendesc,genhtml,geninfo} /usr/bin/; - sudo chmod 777 /usr/bin/lcov /usr/bin/genhtml /usr/bin/geninfo /usr/bin/genpng /usg/bin/gendesc; - rm -rf lcov-1.10.tar.gz lcov-1.10; - sudo mv -v `which gcov-4.8` `which gcov`; - export GYP_DEFINES="coverage=1"; - export JOBS=4; - fi - - BUILD_ONLY=true npm install -# This is a random private key used purely for testing. -before_script: - - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - - echo -e "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkTcgXnHuqR0gbwegnr9Zxz4hTkjjV/SpgJNPJz7mo/HKNbx0rqjj1P0yGR053R9GSFFim2ut4NK9DPPUkQdyucw+DoLkYRHJmlJ4BNa9NTCD0sl+eSXO2969kZojCYSOgbmkCJx8mdgTwhzdgE/jhBrsY0hPE6pRTlU+H68/zeNdJUAIJf0LLXOm3hpTKLA19VICltl/j9VvBJpgRHdBylXEyL8HokYpjkQQk1ZXj3m7Nlo8yDdg4VcljOJWC+Xh8kxRMfK5x/VRVsYKCQXN5QlzKeqf7USRDUS/7mFoPUBW+d4kwKtGxRsWuIL2yeqzifZUTOgsh9+ZWAWxWffQZ your_email@example.com" > ~/.ssh/id_rsa.pub - - echo -e "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA5E3IF5x7qkdIG8HoJ6/Wcc+IU5I41f0qYCTTyc+5qPxyjW8d\nK6o49T9MhkdOd0fRkhRYptrreDSvQzz1JEHcrnMPg6C5GERyZpSeATWvTUwg9LJf\nnklztvevZGaIwmEjoG5pAicfJnYE8Ic3YBP44Qa7GNITxOqUU5VPh+vP83jXSVAC\nCX9Cy1zpt4aUyiwNfVSApbZf4/VbwSaYER3QcpVxMi/B6JGKY5EEJNWV495uzZaP\nMg3YOFXJYziVgvl4fJMUTHyucf1UVbGCgkFzeUJcynqn+1EkQ1Ev+5haD1AVvneJ\nMCrRsUbFriC9snqs4n2VEzoLIffmVgFsVn30GQIDAQABAoIBAQDPQm2sQbti0mN8\nD4Uawl8D40v30n8WhUa7EbPTOmlqKAQ2sfDhex9KRbTLEmEBmImA/Eee8o9iCTIy\n8Fv8Fm6pUHt9G6Pti/XvemwW3Q3QNpSUkHqN0FDkgecQVqVBEb6uHo3mDm4RFINX\neOmkp30BjIK9/blEw1D0sFALLOEUPaDdPMwiXtFgqfrFSgpDET3TvQIwZ2LxxTm0\ncNmP3sCSlZHJNkZI4hBEWaaXR+V5/+C1qblDCo5blAWTcX3UzqrwUUJgFi6VnBuh\n7S9Q6+CEIU+4JRyWQNmY8YgZFaAp6IOr/kyfPxTP1+UEVVgcLn3WDYwfG9og0tmz\nfzlruAgBAoGBAPfz73Pey86tNZEanhJhbX8gVjzy2hvyhT0paHg0q/H6c1VWOtUH\nOwZ3Ns2xAZqJhlDqCHnQYSCZDly042U/theP4N8zo1APb4Yg4qdmXF9QE1+2M03r\nkS6138gU/CSCLf8pCYa6pA/GmsaXxloeJGLvT4fzOZRsVav80/92XHRhAoGBAOu2\nmKh4Gr1EjgN9QNbk9cQTSFDtlBEqO/0pTepvL73UvNp/BAn4iYZFU4WnklFVBSWc\nL84Sc732xU12TAbTTUsa6E7W29pS8u7zVTxlIdQIIU5pzDyU1pNNk2kpxzte5p3Y\nPDtniPFsoYLWoH0LpsKL93t2pLAj+IOkE6f3XBq5AoGAIKaYo5N1FxQr952frx/x\nQUpK0N/R5Ng8v18SiLG26rhmM5iVSrQXC7TrHI7wfR8a9tC6qP/NqnM9NuwC/bQ0\nEEo7/GhaWxKNRwZRkmWiSFLNGk9t1hbtGU+N1lUdFtmloPIQdRNiw0kN3JTj474Q\nYI7O1EItFORnK6yxZfR6HEECgYEA1CT7MGUoa8APsMRCXyaiq15Pb8bjxK8mXquW\nHLEFXuzhLCW1FORDoj0y9s/iuKC0iS0ROX8R/J7k5NrbgikbH8WP36UxKkYNr1IC\nHOFImPTYRSKjVsL+fIUNb1DSp3S6SsYbL7v3XJJQqtlQiDq8U8x1aQFXJ9C4EoLR\nzhKrKsECgYBtU/TSF/TATZY5XtrN9O+HX1Fbz70Ci8XgvioheVI2fezOcXPRzDcC\nOYPaCMNKA5E8gHdg4s0TN7uDvKTJ+KhSg2V7gZ39A28dHrJaRX7Nz4k6t2uEBjX9\na1JidpAIbJ+3w7+hj6L299tVZvS+Y/6Dz/uuEQGXfJg/l/5CCvQPsA==\n-----END RSA PRIVATE KEY-----" > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa* - - eval `ssh-agent -s` - - ssh-add ~/.ssh/id_rsa - - git config --global user.name "John Doe" - - git config --global user.email johndoe@example.com -git: - depth: 1 -branches: - only: - - master - - v0.3 -os: - - linux - - osx -script: - - if [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "0.12" ]; then - npm test && npm run cov && npm run coveralls; - else - npm test; - fi -notifications: - slack: - secure: KglNSqZiid9YudCwkPFDh+sZfW5BwFlM70y67E4peHwwlbbV1sSBPHcs74ZHP/lqgEZ4hMv4N2NI58oYFD5/1a+tKIQP1TkdIMuq4j2LXheuirA2HDcydOVrsC8kRx5XFGKdVRg/uyX2dlRHcOWFhxrS6yc6IxtxYWlRTD2SmEc= - webhooks: - urls: - - https://webhooks.gitter.im/e/cbafdb27ad32ba746a73 - on_success: always # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false diff --git a/.travis/deploy-docs.sh b/.travis/deploy-docs.sh new file mode 100755 index 0000000000..50ee50b2b9 --- /dev/null +++ b/.travis/deploy-docs.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + + +# delete "nodegit.github.com" folder if it exists +rm -rf "nodegit.github.com" || exit 0; + +# clone "nodegit.github.com" repository +git clone "https://github.com/nodegit/nodegit.github.com.git" + +# change into "nodegit.github.com" folder +cd "nodegit.github.com" + +# install node dependencies +npm install + +# link "nodegit" folder +ln -s ../.. generate/nodegit + +# generate new docs +node generate + +# configure git user information +git config user.name "Travis CI" +git config user.email "noreply@travis-ci.org" + +# commit changes +git add . +git commit -m "Deploy to GitHub Pages + +see https://github.com/nodegit/nodegit.github.com/commit/${TRAVIS_COMMIT}" +git tag "${TRAVIS_COMMIT}" + +# push to the "nodegit.github.com" repository +git push --quiet "https://${GH_TOKEN}@github.com/nodegit/nodegit.github.com.git" master "${TRAVIS_COMMIT}" > /dev/null 2>&1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 20ae4e40ee..d7c020aac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,3337 @@ # Change Log -## [Unreleased](https://github.com/nodegit/nodegit/tree/HEAD) +## v0.28.0-alpha.36 [(2025-11-21)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.36) -[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.7...HEAD) +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.35...v0.28.0-alpha.36) + +#### Summary of Changes + - Use openssl unconditionally for linux electron builds + - Fix cross-compiling libssh2 + - Fix Windows SSH keys, tests, documentation + - Add CI tests and Prebuilts for MacOS arm64 + - Bump tar-fsa to fix security vulnerabilities + +#### Merged PRs into NodeGit +- [Bump tar-fs from 3.0.9 to 3.1.1](https://github.com/nodegit/nodegit/pull/2034) +- [Use custom electron for non-static builds on linux and fix cross-compilation](https://github.com/nodegit/nodegit/pull/2033) +- [add macos arm64 tests and prebuilts](https://github.com/nodegit/nodegit/pull/2030) + +## v0.28.0-alpha.35 [(2025-11-14)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.35) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.34...v0.28.0-alpha.35) + +#### Summary of Changes + - Bump libgit2 to 1.9.1 + - Bump OpenSSL to 3.0 + - Move OpenSSL Packaging to Github Actions + - Add arm64 build Support + +#### Merged PRs into NodeGit +- [Bump libgit2 to 1.9.1](https://github.com/nodegit/nodegit/pull/2025) +- [Bump OpenSSL to 3.0, Move OpenSSL package generation to Github Actions](https://github.com/nodegit/nodegit/pull/2026) +- [fix: correct macos arch labels](github.com/nodegit/nodegit/pull/2027) +- [Add Ability to compile for arm64](https://github.com/nodegit/nodegit/pull/2028) + +## v0.28.0-alpha.34 [(2025-07-23)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.34) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.33...v0.28.0-alpha.34) + +#### Summary of Changes + - Empty release to fix downstream issues + +#### Merged PRs into NodeGit +- None + +## v0.28.0-alpha.33 [(2025-06-03)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.33) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.32...v0.28.0-alpha.33) + +#### Summary of Changes + - fix non-standard import assertion + - update tar-fs + +#### Merged PRs into NodeGit +- [Fix Invalid Import Assertion, Bump tar-fs](https://github.com/nodegit/nodegit/pull/2022) + +## v0.28.0-alpha.32 [(2025-05-28)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.32) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.31...v0.28.0-alpha.32) + +#### Summary of Changes + - fix windows build on electron + +#### Merged PRs into NodeGit +- [fix electron dependencies again](https://github.com/nodegit/nodegit/pull/2020) + +## v0.28.0-alpha.31 [(2025-05-27)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.31) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.30...v0.28.0-alpha.31) + +#### Summary of Changes +- bump libgit2 from v1.7.2 to v1.8.4 +- update several npm dependencies for deprecations and vulnerabilities + +#### Merged PRs into NodeGit +- [Dependency/Process Updates](https://github.com/nodegit/nodegit/pull/2019) +- [Bump libgit2 to 1.8.4, CI Updates](https://github.com/nodegit/nodegit/pull/2018) + +## v0.28.0-alpha.30 [(2025-02-13)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.30) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.29...v0.28.0-alpha.30) + +#### Summary of Changes +- Fix windows build + +#### Merged PRs into NodeGit +- [define NOMINMAX on windows](https://github.com/nodegit/nodegit/pull/2016) + +## v0.28.0-alpha.29 [(2025-02-11)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.29) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.28...v0.28.0-alpha.29) + +#### Summary of Changes +- Build on Electron 34+ +- fix use-after-free in Repository::statistics() + +#### Merged PRs into NodeGit +- [Bump @axosoft/nan and add ability to compile for c++20](https://github.com/nodegit/nodegit/pull/2012) +- [Fix Github Action workflow](https://github.com/nodegit/nodegit/pull/2014) + + +## v0.28.0-alpha.28 [(2024-07-01)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.28) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.27...v0.28.0-alpha.28) + +#### Summary of changes +- Build on Electron 31+ + +#### Merged PRs into NodeGit +- [Bump nan again for electron 31](https://github.com/nodegit/nodegit/pull/2000) + +## v0.28.0-alpha.27 [(2024-06-06)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.27) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.26...v0.28.0-alpha.27) + +#### Summary of changes +- Build on Electron 29+ + +#### Merged PRs into NodeGit +- [Fix build failure on electron 29+](https://github.com/nodegit/nodegit/pull/1998) + +## v0.28.0-alpha.26 [(2024-04-19)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.26) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.25...v0.28.0-alpha.26) + +#### Summary of changes +- Fix use-after-free in getRemotes + +#### Merged PRs into NodeGit +- [Fix double-free introduced trying to fix other double-free](https://github.com/nodegit/nodegit/pull/1996) + +## v0.28.0-alpha.25 [(2024-04-15)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.25) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.24...v0.28.0-alpha.25) + +#### Summary of changes +- Fix use-after-free in getReferences + +#### Merged PRs into NodeGit +- [Don't free the given repo on error in getReferences and getRemotes](https://github.com/nodegit/nodegit/pull/1995) + +## v0.28.0-alpha.24 [(2024-02-20)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.24) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.23...v0.28.0-alpha.24) + +#### Summary of changes +- Use Collision Detection SHA1 implementation +- Fix win32 Electron build due to incorrect OpenSSL include path + +#### Merged PRs into NodeGit +- [Use builtin SHA1 for libgit compilation](https://github.com/nodegit/nodegit/pull/1992) +- [Ensure OpenSSL root included in win32 Electron builds](https://github.com/nodegit/nodegit/pull/1991) + +## v0.28.0-alpha.23 [(2024-02-14)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.23) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.22...v0.28.0-alpha.23) + +#### Summary of changes +- Bump libgit2 to 1.7.2 + +#### Merged PRs into NodeGit +- [Bump libgit2 to 1.7.2](https://github.com/nodegit/nodegit/pull/1990) + +## v0.28.0-alpha.22 [(2024-02-05)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.22) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.21...v0.28.0-alpha.22) + +#### Summary of changes +- Compatibility with Electron 28 +- NodeGit now requires Node 16+ + +#### Merged PRs into NodeGit +- [Fix electron 28 build failure](https://github.com/nodegit/nodegit/pull/1988) +- [Bump node-gyp to 10.0.1](https://github.com/nodegit/nodegit/pull/1989) + +## v0.28.0-alpha.21 [(2023-02-10)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.21) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.20...v0.28.0-alpha.21) + +#### Summary of changes +- Update OpenSSL to 1.1.1t +- Update got + other packages with security vulnerabilities +- Fix tag.createWithSignature function definition + +#### Merged PRs into NodeGit +- [Bump OpenSSL to 1.1.1t](https://github.com/nodegit/nodegit/pull/1971) +- [Update got + other locked package versions](https://github.com/nodegit/nodegit/pull/1969) +- [Fix tag createWithSignature function](https://github.com/nodegit/nodegit/pull/1945) + +## v0.28.0-alpha.20 [(2022-11-11)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.20) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.19...v0.28.0-alpha.20) + +#### Summary of changes +- Fix electron build issues + +#### Merged PRs into NodeGit +- [Fix electron build issues](https://github.com/nodegit/nodegit/pull/1955) + +## v0.28.0-alpha.19 [(2022-11-08)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.19) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.18...v0.28.0-alpha.19) + +#### Summary of changes +- OpenSSL bump +- OpenSSL binaries will be automatically downloaded when building for Electron on Windows and macOS +- Crash fix on Electron 18+ due to Nan bug +- Partial stash support + +#### Merged PRs into NodeGit +- [Allow overriding C++ standard](https://github.com/nodegit/nodegit/pull/1953) +- [Bump OpenSSL to 1.1.1s](https://github.com/nodegit/nodegit/pull/1952) +- [Fix intermittent crash on Electron 18+](https://github.com/nodegit/nodegit/pull/1951) +- [type is a call](https://github.com/nodegit/nodegit/pull/1942) +- [Fix leak in agent](https://github.com/nodegit/nodegit/pull/1947) +- [Default to using precompiled OpenSSL for Electron](https://github.com/nodegit/nodegit/pull/1949) +- [Partial stash support](https://github.com/nodegit/nodegit/pull/1948) +- [Switch CI to macOS-11](https://github.com/nodegit/nodegit/pull/1950) +- [Preemptively Patch OpenSSL 1.1.1q](https://github.com/nodegit/nodegit/pull/1928) +- [Add getAllFilepaths function in tree object](https://github.com/nodegit/nodegit/pull/1919) + +## v0.28.0-alpha.18 [(2022-05-27)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.18) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.17...v0.28.0-alpha.18) + +#### Summary of changes +- Allow fetching partial patches from diff +- Fix nanosecond comparison typo + +#### Merged PRs into NodeGit +- [Improve Diff.patches to allow an index array](https://github.com/nodegit/nodegit/pull/1916) +- [Bring in GIT_USE_NSEC fix](https://github.com/nodegit/nodegit/pull/1917) + +## v0.28.0-alpha.17 [(2022-05-24)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.17) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.16...v0.28.0-alpha.17) + +#### Summary of changes +- Enable nanosecond precision for file operations + +#### Merged PRs into NodeGit +- [Enable GIT_USE_NSEC](https://github.com/nodegit/nodegit/pull/1912) + +## v0.28.0-alpha.16 [(2022-05-09)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.16) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.15...v0.28.0-alpha.16) + +#### Summary of changes +- Allow disabling specific filters during checkout + +#### Merged PRs into NodeGit +- [Allow disabling specific filters during checkout](https://github.com/nodegit/nodegit/pull/1911) + +## v0.28.0-alpha.15 [(2022-05-05)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.15) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.14...v0.28.0-alpha.15) + +#### Summary of changes +- Expose `GIT_OPT_GET_OWNER_VALIDATION` and `GIT_OPT_SET_OWNER_VALIDATION` + +#### Merged PRs into NodeGit +- [Expose get/set owner validation opts](https://github.com/nodegit/nodegit/pull/1910) + +## v0.28.0-alpha.14 [(2022-05-02)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.14) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.13...v0.28.0-alpha.14) + +#### Summary of changes +- Allow statically linking OpenSSL on Linux +- Update libgit2 to 1.3.1 + +#### Merged PRs into NodeGit +- [Statically compile OpenSSL on linux for electron](https://github.com/nodegit/nodegit/pull/1905) +- [Upgrade libgit2 to 1.3.1](https://github.com/nodegit/nodegit/pull/1894) + +## v0.28.0-alpha.13 [(2022-03-22)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.13) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.12...v0.28.0-alpha.13) + +#### Summary of changes +- Partially fix issue with building for Electron + +#### Merged PRs into NodeGit +- [Fix electron build](https://github.com/nodegit/nodegit/pull/1901) + +## v0.28.0-alpha.12 [(2022-03-18)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.12) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.11...v0.28.0-alpha.12) + +#### Summary of changes +- Updated CI because of GitHub deprecations +- Added workaround for LFS performance regression + +#### Merged PRs into NodeGit +- [Update windows 2016 CI to 2019](https://github.com/nodegit/nodegit/pull/1897) +- [Skip "can clone with git" test, unauthenticated git protocol is no longer supported in Github](https://github.com/nodegit/nodegit/pull/1899) +- [UNSAFE Temporary workaround for LFS checkout performance regression](https://github.com/nodegit/nodegit/pull/1883) +- [Update Github Actions for node 16](https://github.com/nodegit/nodegit/pull/1896) + +## v0.28.0-alpha.11 [(2022-02-08)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.11) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.10...v0.28.0-alpha.11) + +#### Summary of changes +- Updated libssh2 to add RSA SHA2 256/512 SSH key support + +#### Merged PRs into NodeGit +- [RSA SHA2 256/512 key upgrade support RFC 8332 #536 (#626)](https://github.com/nodegit/nodegit/pull/1888) +- [Fix typos in examples](https://github.com/nodegit/nodegit/pull/1884) +- [Don't build shared OpenSSL libs](https://github.com/nodegit/nodegit/pull/1877) + +## v0.28.0-alpha.10 [(2021-11-11)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.10) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.9...v0.28.0-alpha.10) + +#### Summary of changes +- Reworked CI due to GitHub dropping Ubuntu 16.04 support +- When building for Electron on Windows/macOS and prebuilts are unavailable: NodeGit will attempt to build OpenSSL locally by default. This is due to Conan changing their API/provided OpenSSL binaries. There are options for pointing to an installed OpenSSL location or URL for downloading prebuilt binaries, see [Building from source](http://www.nodegit.org/guides/install/from-source/). +- Updated OpenSSL to 1.1.1l +- Updated libssh2 to 1.10.0 +- Added `Repo.prototype.statistics` method for calculating repository statistics +- More progress towards becoming context-aware + +#### Merged PRs into NodeGit +- [Allow download of prebuilt OpenSSL](https://github.com/nodegit/nodegit/pull/1875) +- [Update libssh2 to 1.10.0](https://github.com/nodegit/nodegit/pull/1874) +- [Statistics with same output as "git-sizer -j"](https://github.com/nodegit/nodegit/pull/1846) +- [Fix memory leak on context shutdown](https://github.com/nodegit/nodegit/pull/1856) +- [Build OpenSSL locally for Electron](https://github.com/nodegit/nodegit/pull/1870) +- [Fix a reference error when compiling with VC2019](https://github.com/nodegit/nodegit/pull/1859) +- [Use containers for Linux CI](https://github.com/nodegit/nodegit/pull/1860) + + +## v0.28.0-alpha.9 [(2021-06-04)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.9) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.8...v0.28.0-alpha.9) + +#### Summary of changes +- Fixes an issue where rebase.init and rebase.open were ignoring callbacks in some situations + +#### Merged PRs into NodeGit +- [Shallow clone rebase options before modifying #1845](https://github.com/nodegit/nodegit/pull/1845) + + +## v0.28.0-alpha.8 [(2021-05-10)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.8) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.7...v0.28.0-alpha.8) + +#### Summary of changes +- Fixes another issue where Kerberos proxy authentication causes network failures + +#### Merged PRs into NodeGit +- [Bump libgit2 to include libgit2#5852 #1844](https://github.com/nodegit/nodegit/pull/1844) + +#### Merged PRs into Libgit2 +- [Fix issues with Proxy Authentication after httpclient refactor #5852](https://github.com/libgit2/libgit2/pull/5852) + + +## v0.28.0-alpha.7 [(2021-04-30)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.7) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.6...v0.28.0-alpha.7) + +#### Summary of changes +- Fixes issue with where proxy authentication fails on linux/osx with assertion error. + +#### Merged PRs into NodeGit +- [Bump Libgit2 to fix proxy auth on linux / osx #1841](https://github.com/nodegit/nodegit/pull/1841) + +#### Merged PRs into Libgit2 +- [https://github.com/libgit2/libgit2/pull/5852](https://github.com/libgit2/libgit2/pull/5852) + + +## v0.28.0-alpha.6 [(2021-04-23)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.6) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.5...v0.28.0-alpha.6) + +#### Summary of changes +- Rewrote options normalization such that it is done in C++. Provided deprecated classes for backwards compatibility. These will be removed in a later version of Nodegit. +- Deprecated construction of these objects, in the future, please pass plain objects with just the fields you wish to override to NodeGit, and the library will take care of the rest. + - NodeGit.ApplyOptions + - NodeGit.BlameOptions + - NodeGit.BlobFilterOptions + - NodeGit.CheckoutOptions + - NodeGit.CherrypickOptions + - NodeGit.CloneOptions + - NodeGit.DescribeFormatOptions + - NodeGit.DiffFindOptions + - NodeGit.FetchOptions + - NodeGit.MergeFileInput + - NodeGit.MergeFileOptions + - NodeGit.MergeOptions + - NodeGit.ProxyOptions + - NodeGit.PushOptions + - NodeGit.RebaseOptions + - NodeGit.RemoteCreatOptions + - NodeGit.RepositoryInitOptions + - NodeGit.RevertOptions + - NodeGit.StashApplyOptions + - NodeGit.StatusOptions + - NodeGit.SubmoduleUpdateOptions +- Ensured the following functions have their optional arguments labeled/working as optional: + - NodeGit.Apply + - NodeGit.Checkout.index + - NodeGit.Cherrypick + - NodeGit.Cherrypick.commit + - NodeGit.Merge + - NodeGit.PatchBlobs + - NodeGit.Rebase.open + - NodeGit.Remote.prototype.connect + - NodeGit.Remote.prototype.download + - NodeGit.Remote.prototype.fetch + - NodeGit.Remote.prototype.prune + - NodeGit.Remote.prototype.push + - NodeGit.Remote.prototype.upload + - NodeGit.Stash.apply + - NodeGit.Stash.pop + - NodeGit.Worktree.isPrunable + - NodeGit.Worktree.prune +- Updated the following functions to be async: + - NodeGit.Apply + - NodeGit.Remote.prototype.prune + - NodeGit.Worktree.isPrunable + - NodeGit.Worktree.prune +- Addressed issue where GitWorktreePruneOptions and GitWorktreeAddOptions were impossible to instantiate, thus making working with worktress possible now. +- Addressed issue where GitIndexTime was not configurable +- Addressed issue where the following functions did not return errors from libgit2: + - NodeGit.Merge.analysis + - NodeGit.Note.commitRemove + +#### Merged PRs into NodeGit +- [Eliminate need for normalize options #1837](https://github.com/nodegit/nodegit/pull/1837) +- [Define optional arguments for Patch.fromBlobs() #1835](https://github.com/nodegit/nodegit/pull/1835) + + +## v0.28.0-alpha.5 [(2021-04-09)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.4...v0.28.0-alpha.5) + +#### Summary of changes +- Fixes crash in multithreaded checkout in fork of libgit2 + +#### Merged PRs into NodeGit +- [Update multithreaded checkout in libgit2 #1834](https://github.com/nodegit/nodegit/pull/1834) + +#### Merged PRs into Libgit2 +- [Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string](https://github.com/libgit2/libgit2/pull/5832) +- [Remove duplicate line, in example code](https://github.com/libgit2/libgit2/pull/5821) + + +## v0.28.0-alpha.4 [(2021-04-07)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.3...v0.28.0-alpha.4) + +#### Summary of changes +- Introduces harder safeguards on persistent references to prevent garbage collection during async work + +#### Merged PRs into NodeGit +- [Workaround: Prevent objectwrap from being cleaned up during async work #1833](https://github.com/nodegit/nodegit/pull/1833) + + +## v0.28.0-alpha.3 [(2021-04-02)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.2...v0.28.0-alpha.3) + +#### Summary of changes +- Addresses failure to open repo with empty default branch name + +#### Merged PRs into NodeGit +- [Bring in changes from libgit2 #5832 #1832](https://github.com/nodegit/nodegit/pull/1832) + +#### Cherrypicked PRs into Libgit2 +- [Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string #5832](https://github.com/libgit2/libgit2/pull/5832) + + +## v0.28.0-alpha.2 [(2021-03-31)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.28.0-alpha.1...v0.28.0-alpha.2) + +#### Summary of changes +- Addresses crash in mwindow from libgit2 +- Bumps libgit2 to bring in bug fixes + +#### Merged PRs into NodeGit +- [Bump Libgit2 to 1.1.0 (on current head of libgit2) #1831](https://github.com/nodegit/nodegit/pull/1831) + +#### Merged PRs into Libgit2 +- [tree: deprecate `git_treebuilder_write_with_buffer`](https://github.com/libgit2/libgit2/pull/5815) +- [winhttp: skip certificate check if unable to send request](https://github.com/libgit2/libgit2/pull/5814) +- [commit-graph: Introduce `git_commit_graph_needs_refresh()`](https://github.com/libgit2/libgit2/pull/5764) +- [commit-graph: Support lookups of entries in a commit-graph](https://github.com/libgit2/libgit2/pull/5763) +- [merge: Check insert_head_ids error in create_virtual_base](https://github.com/libgit2/libgit2/pull/5818) +- [Check git_signature_dup failure](https://github.com/libgit2/libgit2/pull/5817) +- [Fix some typos](https://github.com/libgit2/libgit2/pull/5797) +- [include: fix typos in comments](https://github.com/libgit2/libgit2/pull/5805) +- [Fix documentation formating on repository.h](https://github.com/libgit2/libgit2/pull/5806) +- [index: Check git_vector_dup error in write_entries](https://github.com/libgit2/libgit2/pull/5801) +- [refdb_fs: Check git_sortedcache wlock/rlock errors](https://github.com/libgit2/libgit2/pull/5800) +- [Add new bindings for the R language](https://github.com/libgit2/libgit2/pull/5795) +- [Update .gitignore](https://github.com/libgit2/libgit2/pull/5787) +- [patch: add owner accessor](https://github.com/libgit2/libgit2/pull/5731) +- [commit-graph: Introduce a parser for commit-graph files](https://github.com/libgit2/libgit2/pull/5762) +- [revspec: rename git_revparse_mode_t to git_revspec_t](https://github.com/libgit2/libgit2/pull/5786) +- [mwindow: Fix a bug in the LRU window finding code](https://github.com/libgit2/libgit2/pull/5783) +- [ci: don't use ninja on macOS](https://github.com/libgit2/libgit2/pull/5780) +- [midx: Fix a bug in `git_midx_needs_refresh()`](https://github.com/libgit2/libgit2/pull/5768) +- [clone: set refs/remotes/origin/HEAD when branch is specified](https://github.com/libgit2/libgit2/pull/5775) +- [Use `p_pwrite`/`p_pread` consistently throughout the codebase](https://github.com/libgit2/libgit2/pull/5769) +- [README: instructions for using libgit2 without compiling](https://github.com/libgit2/libgit2/pull/5772) +- [Cope with empty default branch](https://github.com/libgit2/libgit2/pull/5770) +- [github-actions: Also rename the main branch here](https://github.com/libgit2/libgit2/pull/5771) +- [blob: fix name of `GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD`](https://github.com/libgit2/libgit2/pull/5760) +- [Add documentation for git_blob_filter_options.version](https://github.com/libgit2/libgit2/pull/5759) +- [Build with NO_MMAP](https://github.com/libgit2/libgit2/pull/5583) +- [zlib: Add support for building with Chromium's zlib implementation](https://github.com/libgit2/libgit2/pull/5748) +- [Handle ipv6 addresses](https://github.com/libgit2/libgit2/pull/5741) +- [Add support for additional SSH hostkey types.](https://github.com/libgit2/libgit2/pull/5750) +- [Fix the `-DENABLE_WERROR=ON` build for gcc 10.2](https://github.com/libgit2/libgit2/pull/5749) +- [repository: use intptr_t's in the config map cache](https://github.com/libgit2/libgit2/pull/5746) +- [Add tests for `git__multiply_int64_overflow`](https://github.com/libgit2/libgit2/pull/5744) +- [Third attempt to fix the 32-bit version of `git__multiply_int64_overf…](https://github.com/libgit2/libgit2/pull/5743) +- [Avoid using `__builtin_mul_overflow` with the clang+32-bit combo](https://github.com/libgit2/libgit2/pull/5742) +- [ci: run codeql](https://github.com/libgit2/libgit2/pull/5709) +- [pack: continue zlib while we can make progress](https://github.com/libgit2/libgit2/pull/5740) +- [Re-enable the RC4 test](https://github.com/libgit2/libgit2/pull/4418) +- [Cache the parsed submodule config when diffing](https://github.com/libgit2/libgit2/pull/5727) +- [Make git__strntol64() ~70%* faster](https://github.com/libgit2/libgit2/pull/5735) +- [winhttp: support optional client cert](https://github.com/libgit2/libgit2/pull/5384) +- [git.git-authors: Replacing his/her with their](https://github.com/libgit2/libgit2/pull/5724) +- [Friendlier getting started in the lack of git_libgit2_init](https://github.com/libgit2/libgit2/pull/5578) +- [Thread-local storage: a generic internal library (with no allocations)](https://github.com/libgit2/libgit2/pull/5720) +- [Thread-free implementation](https://github.com/libgit2/libgit2/pull/5719) +- [Make the pack and mwindow implementations data-race-free](https://github.com/libgit2/libgit2/pull/5593) +- [Make the odb race-free](https://github.com/libgit2/libgit2/pull/5595) +- [Also add the raw hostkey to `git_cert_hostkey`](https://github.com/libgit2/libgit2/pull/5704) +- [Fix the `ENABLE_WERROR=ON` build in Groovy Gorilla (gcc 10.2)](https://github.com/libgit2/libgit2/pull/5715) +- [odb: Add git_odb_options](https://github.com/libgit2/libgit2/pull/5447) +- [Introduce GIT_ASSERT macros](https://github.com/libgit2/libgit2/pull/5327) +- [ci: only report main branch in README status](https://github.com/libgit2/libgit2/pull/5708) +- [ci: run coverity in the nightly builds](https://github.com/libgit2/libgit2/pull/5707) +- [ci: more GitHub Actions](https://github.com/libgit2/libgit2/pull/5706) +- [Add a ThreadSanitizer build](https://github.com/libgit2/libgit2/pull/5597) +- [msvc crtdbg -> win32 leakcheck](https://github.com/libgit2/libgit2/pull/5580) +- [Add missing worktree_dir check and test case](https://github.com/libgit2/libgit2/pull/5692) +- [Fix the `-DTHREADSAFE=OFF` build](https://github.com/libgit2/libgit2/pull/5690) +- [ci: propagate environment variables](https://github.com/libgit2/libgit2/pull/5703) +- [ci: supply a token for self-hosted runners](https://github.com/libgit2/libgit2/pull/5702) +- [ci: supply a token for self-hosted runners](https://github.com/libgit2/libgit2/pull/5701) +- [ci: GitHub Actions for arm64](https://github.com/libgit2/libgit2/pull/5700) +- [ci: stop using deprecated set-env in GitHub Actions](https://github.com/libgit2/libgit2/pull/5697) +- [Deprecate `is_valid_name` functions; replace with `name_is_valid` functions](https://github.com/libgit2/libgit2/pull/5659) +- [Include `${MBEDTLS_INCLUDE_DIR}` when compiling `crypt_mbedtls.c`](https://github.com/libgit2/libgit2/pull/5685) +- [threadstate: rename tlsdata when building w/o threads](https://github.com/libgit2/libgit2/pull/5668) +- [Refactor "global" state](https://github.com/libgit2/libgit2/pull/5546) +- [Make the Windows leak detection more robust](https://github.com/libgit2/libgit2/pull/5661) +- [Define `git___load` when building with `-DTHREADSAFE=OFF`](https://github.com/libgit2/libgit2/pull/5664) +- [ntlm: update ntlm dependency for htonll](https://github.com/libgit2/libgit2/pull/5658) +- [libgit2 v1.1.0](https://github.com/libgit2/libgit2/pull/5660) +- [Update PCRE to 8.44](https://github.com/libgit2/libgit2/pull/5649) +- [clone: update origin's HEAD](https://github.com/libgit2/libgit2/pull/5651) +- [Improve the support of atomics](https://github.com/libgit2/libgit2/pull/5594) +- [Fix error return for invalid extensions.](https://github.com/libgit2/libgit2/pull/5656) +- [Change bare free to allocator free (fixes #5653)](https://github.com/libgit2/libgit2/pull/5654) +- [midx: Introduce a parser for multi-pack-index files](https://github.com/libgit2/libgit2/pull/5401) +- [Fixed typo in comment](https://github.com/libgit2/libgit2/pull/5648) +- [Fix binary diff showing /dev/null](https://github.com/libgit2/libgit2/pull/5494) +- [httpclient: only free challenges for current_server type](https://github.com/libgit2/libgit2/pull/5576) +- [Respect `init.defaultBranch` setting](https://github.com/libgit2/libgit2/pull/5581) +- [patch_parse: handle absence of "index" header for new/deleted cases](https://github.com/libgit2/libgit2/pull/5620) +- [boolean config parsing fails in some cases with mapped values](https://github.com/libgit2/libgit2/pull/5626) +- [Fix config file parsing with multi line values containing quoted parts](https://github.com/libgit2/libgit2/pull/5629) +- [Fix release build warnings](https://github.com/libgit2/libgit2/pull/5636) +- [Fix deprecation links inside of documentation not working](https://github.com/libgit2/libgit2/pull/5631) +- [Fix typo: Make ifndef macroname the same as the define name](https://github.com/libgit2/libgit2/pull/5632) +- [diff stats: fix segfaults with new files](https://github.com/libgit2/libgit2/pull/5619) +- [WinHTTP: Try to use TLS1.3](https://github.com/libgit2/libgit2/pull/5633) +- [Fixed includes for FreeBSD](https://github.com/libgit2/libgit2/pull/5628) +- [Don't fail if a HTTP server announces he supports a protocol upgrade](https://github.com/libgit2/libgit2/pull/5624) +- [Return false instead of segfaulting when checking for default port](https://github.com/libgit2/libgit2/pull/5621) +- [deps: ntlmclient: fix htonll for Haiku](https://github.com/libgit2/libgit2/pull/5612) +- [azure: Remove job generating documentation](https://github.com/libgit2/libgit2/pull/5615) +- [Fix crash in git_describe_commit when opts are NULL.](https://github.com/libgit2/libgit2/pull/5617) +- [Fix `git_mwindow_scan_recently_used` spuriously returning true](https://github.com/libgit2/libgit2/pull/5600) +- [zstream: handle Z_BUF_ERROR appropriately in get_output_chunk](https://github.com/libgit2/libgit2/pull/5599) +- [docs: fix typo](https://github.com/libgit2/libgit2/pull/5610) + + +## v0.28.0-alpha.1 [(2021-03-12)](https://github.com/nodegit/nodegit/releases/tag/v0.28.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.27.0...v0.28.0-alpha.1) + +#### Summary of changes +- *Notice* We planned to fix / address Electron 11 compatibility, but ran into some roadblocks. Fix is coming soon, follow [#114](https://github.com/nodegit/nodegit/issues/1774) for details +- Drops support for Node 10.x.y, < 12.19.x, < 14.10.0 +- Brings in LibGit2 1.0.0 +- NodeGit.Config.prototype.setBool handles truthiness, and NodeGit.Config.prototype.getBool returns true or false +- Fix GC ownership memory issue +- Exposes sidebandProgress callback in GitRemoteCallbacks +- Fixes issue with winhttp and optional client certificates +- Addresses proxy issue with certification validation in Windows +- Fix crash in NodeGit.Repository.prototype.refreshReferences +- Deprecations + - NodeGit.Cred is deprecated in favor of NodeGit.Credential + +#### Merged PRs into NodeGit +- [Include libgit2 winhttp proxy fix #1824](https://github.com/nodegit/nodegit/pull/1824) +- [Return/accept boolean for Config#get/setBool #1827](https://github.com/nodegit/nodegit/pull/1827) +- [First stab at #1800 (async/await in examples) #1802](https://github.com/nodegit/nodegit/pull/1802) +- [returns_info: fix ownedByIndices #1823](https://github.com/nodegit/nodegit/pull/1823) +- [Remove block for sideband_progress in remote_callbacks #1801](https://github.com/nodegit/nodegit/pull/1801) +- [Use key to grab credential type #1828](https://github.com/nodegit/nodegit/pull/1828) +- [Don't strdup nullptr from git_tag_message #1822](https://github.com/nodegit/nodegit/pull/1822) +- [Refactor for context-awareness #1795](https://github.com/nodegit/nodegit/pull/1795) +- [Update longpath enums to match libgit2 #1797](https://github.com/nodegit/nodegit/pull/1797) +- [Bump libgit2 to fork of v1.0.0 #1788](https://github.com/nodegit/nodegit/pull/1788) + +#### Merged PRs into Libgit2 +- [winhttp: skip certificate check if unable to send request #5814](https://github.com/libgit2/libgit2/pull/5814) +- [sanitizer ci: skip negotiate tests](https://github.com/libgit2/libgit2/pull/5596) +- [Add CI support for Memory and UndefinedBehavior Sanitizers](https://github.com/libgit2/libgit2/pull/5569) +- [Access HEAD via the refdb backends](https://github.com/libgit2/libgit2/pull/5563) +- [config_entries: Avoid excessive map operations](https://github.com/libgit2/libgit2/pull/5582) +- [mwindow: set limit on number of open files](https://github.com/libgit2/libgit2/pull/5396) +- [refdb: a set of preliminary refactorings for the reftable backend](https://github.com/libgit2/libgit2/pull/5570) +- [CMake modernization pt2](https://github.com/libgit2/libgit2/pull/5547) +- [Make the tests run cleanly under UndefinedBehaviorSanitizer](https://github.com/libgit2/libgit2/pull/5568) +- [Make the tests pass cleanly with MemorySanitizer](https://github.com/libgit2/libgit2/pull/5567) +- [Enable building git2.rc resource script with GCC](https://github.com/libgit2/libgit2/pull/5561) +- [Make NTLMClient Memory and UndefinedBehavior Sanitizer-clean](https://github.com/libgit2/libgit2/pull/5571) +- [Random fixes for diff-printing](https://github.com/libgit2/libgit2/pull/5559) +- [index: Update the documentation for git_index_add_from_buffer()](https://github.com/libgit2/libgit2/pull/5419) +- [Introduce CI with GitHub Actions](https://github.com/libgit2/libgit2/pull/5550) +- [Random code cleanups and fixes](https://github.com/libgit2/libgit2/pull/5552) +- [examples: log: fix documentation generation](https://github.com/libgit2/libgit2/pull/5553) +- [Missing declarations](https://github.com/libgit2/libgit2/pull/5551) +- [clar: add tap output option](https://github.com/libgit2/libgit2/pull/5541) +- [diff::parse: don't include `diff.h`](https://github.com/libgit2/libgit2/pull/5545) +- [release script: fix typo](https://github.com/libgit2/libgit2/pull/5543) +- [tests: offer exact name matching with a `$` suffix](https://github.com/libgit2/libgit2/pull/5537) +- [httpclient: support googlesource](https://github.com/libgit2/libgit2/pull/5536) +- [git_packbuilder_write: Allow setting path to NULL to use the default path](https://github.com/libgit2/libgit2/pull/5532) +- [mempack: Use threads when building the pack](https://github.com/libgit2/libgit2/pull/5531) +- [clar: use internal functions instead of /bin/cp and /bin/rm](https://github.com/libgit2/libgit2/pull/5528) +- [strarray refactoring](https://github.com/libgit2/libgit2/pull/5535) +- [CMake cleanups](https://github.com/libgit2/libgit2/pull/5481) +- [git_pool_init: allow the function to fail](https://github.com/libgit2/libgit2/pull/5526) +- [diff::workdir: actually test the buffers](https://github.com/libgit2/libgit2/pull/5529) +- [Handle unreadable configuration files](https://github.com/libgit2/libgit2/pull/5527) +- [Make git_index_write() generate valid v4 index](https://github.com/libgit2/libgit2/pull/5533) +- [OpenSSL certificate memory leak](https://github.com/libgit2/libgit2/pull/5522) +- [tests: checkout: fix flaky test due to mtime race](https://github.com/libgit2/libgit2/pull/5515) +- [cmake: Sort source files for reproducible builds](https://github.com/libgit2/libgit2/pull/5523) +- [futils: fix order of declared parameters for `git_futils_fake_symlink`](https://github.com/libgit2/libgit2/pull/5517) +- [Check the version in package.json](https://github.com/libgit2/libgit2/pull/5516) +- [tests: merge: fix printf formatter on 32 bit arches](https://github.com/libgit2/libgit2/pull/5513) +- [Update package.json](https://github.com/libgit2/libgit2/pull/5511) +- [Introduce GIT_ASSERT macros](https://github.com/libgit2/libgit2/pull/5509) +- [README.md: Add instructions for building in MinGW environment](https://github.com/libgit2/libgit2/pull/5512) +- [Fix uninitialized stack memory and NULL ptr dereference in stash_to_index](https://github.com/libgit2/libgit2/pull/5510) +- [Honor GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH for all checkout types ](https://github.com/libgit2/libgit2/pull/5378) +- [docs: add documentation for our coding style](https://github.com/libgit2/libgit2/pull/5482) +- [MSVC: Enable Control Flow Guard (CFG)](https://github.com/libgit2/libgit2/pull/5500) +- [git__hexdump: better mimic `hexdump -C`](https://github.com/libgit2/libgit2/pull/5431) +- [Feature: Allow blame to ignore whitespace change](https://github.com/libgit2/libgit2/pull/5383) +- [deps: ntlmclient: use htobe64 on NetBSD too](https://github.com/libgit2/libgit2/pull/5487) +- [sysdir: remove unused git_sysdir_get_str](https://github.com/libgit2/libgit2/pull/5485) +- [Fix typo causing removal of symbol 'git_worktree_prune_init_options'](https://github.com/libgit2/libgit2/pull/5483) +- [pack: Improve error handling for get_delta_base()](https://github.com/libgit2/libgit2/pull/5425) +- [repo::open: ensure we can open the repository](https://github.com/libgit2/libgit2/pull/5480) +- [examples: additions and fixes](https://github.com/libgit2/libgit2/pull/5421) +- [merge: cache negative cache results for similarity metrics](https://github.com/libgit2/libgit2/pull/5477) +- [Handle repository format v1](https://github.com/libgit2/libgit2/pull/5388) +- [CMake: backend selection streamlining](https://github.com/libgit2/libgit2/pull/5440) +- [refdb_fs: remove unused header file](https://github.com/libgit2/libgit2/pull/5461) +- [patch: correctly handle mode changes for renames](https://github.com/libgit2/libgit2/pull/5466) +- [gitignore: clean up patterns from old times](https://github.com/libgit2/libgit2/pull/5474) +- [README.md: update build matrix to reflect our latest releases](https://github.com/libgit2/libgit2/pull/5478) +- [Release v1.0](https://github.com/libgit2/libgit2/pull/5471) +- [refdb_backend: improve callback documentation](https://github.com/libgit2/libgit2/pull/5464) +- [credentials: provide backcompat for opaque structs](https://github.com/libgit2/libgit2/pull/5465) +- [Fix segfault when calling git_blame_buffer()](https://github.com/libgit2/libgit2/pull/5445) +- [Fix spelling error](https://github.com/libgit2/libgit2/pull/5463) +- [refdb_fs: initialize backend version](https://github.com/libgit2/libgit2/pull/5456) +- [repository: improve commondir docs](https://github.com/libgit2/libgit2/pull/5444) +- [cmake: use install directories provided via GNUInstallDirs](https://github.com/libgit2/libgit2/pull/5455) +- [azure: fix errors due to curl and removal of old VM images](https://github.com/libgit2/libgit2/pull/5451) +- [win32: don't canonicalize relative paths](https://github.com/libgit2/libgit2/pull/5435) +- [CMake booleans](https://github.com/libgit2/libgit2/pull/5422) +- [Set proper pkg-config dependency for pcre2](https://github.com/libgit2/libgit2/pull/5439) +- [httpclient: use a 16kb read buffer for macOS](https://github.com/libgit2/libgit2/pull/5432) +- [ci: provide globalsign certs for bionic](https://github.com/libgit2/libgit2/pull/5437) +- [deps: ntlmclient: fix htonll on big endian FreeBSD](https://github.com/libgit2/libgit2/pull/5426) +- [azure-pipelines: download GlobalSign's certificate manually](https://github.com/libgit2/libgit2/pull/5433) +- [deps: ntlmclient: fix missing htonll symbols on FreeBSD and SunOS](https://github.com/libgit2/libgit2/pull/5417) +- [README: add language binding link to wasm-git](https://github.com/libgit2/libgit2/pull/5420) +- [Fix #5410: fix installing libgit2.pc in wrong location](https://github.com/libgit2/libgit2/pull/5412) +- [Fix typo on GIT_USE_NEC](https://github.com/libgit2/libgit2/pull/5413) +- [tests: diff: verify that we are able to diff with empty subtrees](https://github.com/libgit2/libgit2/pull/5374) +- [README: update our build matrix to reflect current releases](https://github.com/libgit2/libgit2/pull/5408) +- [azure: docker: set up HOME variable to fix Coverity builds](https://github.com/libgit2/libgit2/pull/5409) +- [sha1_lookup: inline its only function into "pack.c"](https://github.com/libgit2/libgit2/pull/5390) +- [Coverity fixes](https://github.com/libgit2/libgit2/pull/5391) +- [Release 0.99](https://github.com/libgit2/libgit2/pull/5291) +- [Release script](https://github.com/libgit2/libgit2/pull/5372) +- [azure: fix ARM32 builds by replacing gosu(1)](https://github.com/libgit2/libgit2/pull/5406) +- [openssl: fix Valgrind issues in nightly builds](https://github.com/libgit2/libgit2/pull/5398) +- [fuzzers: Fix the documentation](https://github.com/libgit2/libgit2/pull/5400) +- [azure: fix misleading messages printed to stderr being](https://github.com/libgit2/libgit2/pull/5392) +- [tests: iterator: fix iterator expecting too few items](https://github.com/libgit2/libgit2/pull/5393) +- [transports: http: fix custom headers not being applied](https://github.com/libgit2/libgit2/pull/5387) +- [azure: fix Coverity pipeline](https://github.com/libgit2/libgit2/pull/5382) +- [azure: tests: re-run flaky proxy tests](https://github.com/libgit2/libgit2/pull/5381) +- [fetchhead: strip credentials from remote URL](https://github.com/libgit2/libgit2/pull/5373) +- [azure-pipelines: properly expand negotiate passwords](https://github.com/libgit2/libgit2/pull/5375) +- [cred: change enum to git_credential_t and GIT_CREDENTIAL_*](https://github.com/libgit2/libgit2/pull/5336) +- [Update link to libgit2 Julia language binding](https://github.com/libgit2/libgit2/pull/5371) +- [Return int from non-free functions](https://github.com/libgit2/libgit2/pull/5365) +- [HTTP: Support Apache-based servers with Negotiate](https://github.com/libgit2/libgit2/pull/5286) +- [internal types: change enums from `type_t` to `_t`](https://github.com/libgit2/libgit2/pull/5364) +- [merge: Return non-const git_repository from accessor method](https://github.com/libgit2/libgit2/pull/5358) +- [Do not return free'd git_repository object on error](https://github.com/libgit2/libgit2/pull/5361) +- [refs: refuse to delete HEAD](https://github.com/libgit2/libgit2/pull/5360) +- [index: replace map macros with inline functions](https://github.com/libgit2/libgit2/pull/5351) +- [Make type mismatch errors consistent](https://github.com/libgit2/libgit2/pull/5359) +- [win32: fix relative symlinks pointing into dirs](https://github.com/libgit2/libgit2/pull/5355) +- [ntlm: prevent (spurious) compiler warnings](https://github.com/libgit2/libgit2/pull/5354) +- [Adds support for multiple SSH auth mechanisms being used sequentially](https://github.com/libgit2/libgit2/pull/5305) +- [netops: handle intact query parameters in service_suffix removal](https://github.com/libgit2/libgit2/pull/5339) +- [Refactor packfile code to use zstream abstraction](https://github.com/libgit2/libgit2/pull/5340) +- [Fix git_submodule_sync with relative url](https://github.com/libgit2/libgit2/pull/5322) +- [http: avoid generating double slashes in url](https://github.com/libgit2/libgit2/pull/5325) +- [Correct typo in name of referenced parameter](https://github.com/libgit2/libgit2/pull/5348) +- [patch_parse: fix undefined behaviour due to arithmetic on NULL pointers](https://github.com/libgit2/libgit2/pull/5338) +- [smart_pkt: fix overflow resulting in OOB read/write of one byte](https://github.com/libgit2/libgit2/pull/5337) +- [branch: clarify documentation around branches](https://github.com/libgit2/libgit2/pull/5300) +- [examples: checkout: implement guess heuristic for remote branches](https://github.com/libgit2/libgit2/pull/5283) +- [Minor doc improvements](https://github.com/libgit2/libgit2/pull/5320) +- [attr: Update definition of binary macro](https://github.com/libgit2/libgit2/pull/5333) +- [Security fixes for master](https://github.com/libgit2/libgit2/pull/5331) +- [release.md: note that we do two security releases](https://github.com/libgit2/libgit2/pull/5318) +- [MSVC: Fix warning C4133 on x64: "function": Incompatible types - from "unsigned long *" to "size_t *"](https://github.com/libgit2/libgit2/pull/5317) +- [ci: only push docs from the libgit2/libgit2 repo](https://github.com/libgit2/libgit2/pull/5316) +- [global: convert to fiber-local storage to fix exit races](https://github.com/libgit2/libgit2/pull/5314) +- [Fix copy&paste in git_cherrypick_commit docstring](https://github.com/libgit2/libgit2/pull/5315) +- [patch_parse: fix out-of-bounds reads caused by integer underflow](https://github.com/libgit2/libgit2/pull/5312) +- [tests: fix compiler warning if tracing is disabled](https://github.com/libgit2/libgit2/pull/5311) +- [tests: config: only test parsing huge file with GITTEST_INVASIVE_SPEED](https://github.com/libgit2/libgit2/pull/5313) +- [diff: complete support for git patchid](https://github.com/libgit2/libgit2/pull/5306) +- [Memory optimizations for config entries](https://github.com/libgit2/libgit2/pull/5243) +- [ssh: include sha256 host key hash when supported](https://github.com/libgit2/libgit2/pull/5307) +- [Various examples shape-ups](https://github.com/libgit2/libgit2/pull/5272) +- [Improve trace support in tests](https://github.com/libgit2/libgit2/pull/5309) +- [Move `git_off_t` to `git_object_size_t`](https://github.com/libgit2/libgit2/pull/5123) +- [Add compat typdef for git_attr_t](https://github.com/libgit2/libgit2/pull/5310) +- [CI Build Updates](https://github.com/libgit2/libgit2/pull/5308) +- [patch_parse: use paths from "---"/"+++" lines for binary patches](https://github.com/libgit2/libgit2/pull/5303) +- [Follow 308 redirect in WinHTTP transport](https://github.com/libgit2/libgit2/pull/5285) +- [fileops: correct error return on p_lstat failures when mkdir](https://github.com/libgit2/libgit2/pull/5302) +- [config_mem: implement support for snapshots](https://github.com/libgit2/libgit2/pull/5299) +- [patch_parse: fix segfault when header path contains whitespace only](https://github.com/libgit2/libgit2/pull/5298) +- [config_file: fix race when creating an iterator](https://github.com/libgit2/libgit2/pull/5282) +- [Fix crash if snapshotting a config_snapshot](https://github.com/libgit2/libgit2/pull/5293) +- [fix a bug introduced in 8a23597b](https://github.com/libgit2/libgit2/pull/5295) +- [reflogs: fix behaviour around reflogs with newlines](https://github.com/libgit2/libgit2/pull/5275) +- [commit: verify objects exist in git_commit_with_signature](https://github.com/libgit2/libgit2/pull/5289) +- [patch_parse: fixes for fuzzing errors](https://github.com/libgit2/libgit2/pull/5276) +- [apply: add GIT_APPLY_CHECK](https://github.com/libgit2/libgit2/pull/5227) +- [refs: unlock unmodified refs on transaction commit](https://github.com/libgit2/libgit2/pull/5264) +- [fuzzers: add a new fuzzer for patch parsing](https://github.com/libgit2/libgit2/pull/5269) +- [patch_parse: handle patches without extended headers](https://github.com/libgit2/libgit2/pull/5273) +- [Provide a wrapper for simple submodule clone steps](https://github.com/libgit2/libgit2/pull/4637) +- [macOS GSS Support](https://github.com/libgit2/libgit2/pull/5238) +- [cmake: correct the link stanza for CoreFoundation](https://github.com/libgit2/libgit2/pull/5265) +- [Fix file locking on POSIX OS](https://github.com/libgit2/libgit2/pull/5257) +- [cmake: update minimum CMake version to v3.5.1](https://github.com/libgit2/libgit2/pull/5260) +- [patch_parse: handle patches with new empty files](https://github.com/libgit2/libgit2/pull/5248) +- [DRY commit parsing](https://github.com/libgit2/libgit2/pull/4445) +- [azure: avoid building and testing in Docker as root](https://github.com/libgit2/libgit2/pull/5239) +- [regexp: implement a new regular expression API](https://github.com/libgit2/libgit2/pull/5226) +- [git_refdb API fixes](https://github.com/libgit2/libgit2/pull/5106) +- [Don't use enum for flags](https://github.com/libgit2/libgit2/pull/5242) +- [valgrind: suppress memory leaks in libssh2_session_handshake](https://github.com/libgit2/libgit2/pull/5240) +- [buffer: fix writes into out-of-memory buffers](https://github.com/libgit2/libgit2/pull/5232) +- [cred: add missing private header in GSSAPI block](https://github.com/libgit2/libgit2/pull/5237) +- [CMake pkg-config modulification](https://github.com/libgit2/libgit2/pull/5206) +- [Update chat resources in README.md](https://github.com/libgit2/libgit2/pull/5229) +- [Circular header splitting](https://github.com/libgit2/libgit2/pull/5223) + +## v0.27.0 [(2020-07-28)](https://github.com/nodegit/nodegit/releases/tag/v0.27.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.5...v0.27.0) + +#### Summary of changes +- Expose git_remote_rename +- Bump OpenSSL from 1.1.0i -> 1.1.1c in Windows/Mac OS Electron builds +- Replace unmaintained request library with got +- Remove promisify-node and use vanilla promises for all NodeGit promises +- Prebuilds for Node 14, deprecate Node 8 +- Persist RemoteCallbacks and ProxyOptions on the remote if using Remote.prototype.connect. This fixes a segfault when using any routines on a connected remote. + +####Merged PRs into NodeGit +- [Upgrade build environments #1785](https://github.com/nodegit/nodegit/pull/1785) +- [Remote needs to persist the callback/proxyOpts/headers #1784](https://github.com/nodegit/nodegit/pull/1784) +- [Remove promisify-node and remove old callback api remnants](https://github.com/nodegit/nodegit/pull/1772) +- [Replace deprecated package request with got](https://github.com/nodegit/nodegit/pull/1771) +- [Bump OpenSSL prebuilt to 1.1.1c](https://github.com/nodegit/nodegit/pull/1770) +- [Expose git_remote_rename](https://github.com/nodegit/nodegit/pull/1767) +- [Dedupe Remote.prototype.fetch](https://github.com/nodegit/nodegit/pull/1766) + +## v0.27.0-alpha.1 [(2020-03-26)](https://github.com/nodegit/nodegit/releases/tag/v0.27.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.5...v0.27.0-alpha.1) + +#### Summary of changes +- Expose git_remote_rename +- Bump OpenSSL from 1.1.0i -> 1.1.1c in Windows/Mac OS Electron builds +- Replace unmaintained request library with got +- Remove promisify-node and use vanilla promises for all NodeGit promises + +#### Merged PRs into NodeGit +- [Remove promisify-node and remove old callback api remnants](https://github.com/nodegit/nodegit/pull/1772) +- [Replace deprecated package request with got](https://github.com/nodegit/nodegit/pull/1771) +- [Bump OpenSSL prebuilt to 1.1.1c](https://github.com/nodegit/nodegit/pull/1770) +- [Expose git_remote_rename](https://github.com/nodegit/nodegit/pull/1767) +- [Dedupe Remote.prototype.fetch](https://github.com/nodegit/nodegit/pull/1766) + + +## v0.26.5 [(2020-02-27)](https://github.com/nodegit/nodegit/releases/tag/v0.26.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.4...v0.26.5) + +#### Summary of changes +- Bring in improvement to client certificate handling on Windows from [winhttp: support optional client cert #5384](https://github.com/libgit2/libgit2/pull/5384) +- `Commit.prototype.parent()` now correctly assigns the repo property on the retrieved commit. This should solve certain bugs when working with a commit retrieved from `parent`. + +#### Merged PRs into NodeGit +- [Bring in Libgit2 #5384 to NodeGit](https://github.com/nodegit/nodegit/pull/1758) +- [Fix behavior of Commit#parent](https://github.com/nodegit/nodegit/pull/1509) +- [Remove DiffList](https://github.com/nodegit/nodegit/pull/1733) +- [Remove unnecessary assignment of Commit#repo](https://github.com/nodegit/nodegit/pull/1508) + +#### Merged PRs into LibGit2 +- [winhttp: support optional client cert #5384](https://github.com/libgit2/libgit2/pull/5384) +- [Support `core.longpaths` on Windows #5347](https://github.com/libgit2/libgit2/pull/5347) +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) + + +## v0.26.4 [(2020-01-14)](https://github.com/nodegit/nodegit/releases/tag/v0.26.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.3...v0.26.4) + +#### Summary of changes +- Bumped LibGit2 + - Now can be configured to support longpaths on Windows. Does not respect the config value, but is configured through `NodeGit.Libgit2.opts`. See [#1748](https://github.com/nodegit/nodegit/pull/1748) for details. + - Support for complex SSH auth creds handshakes +- Pulled in patch for Libssh2 that covers an integer overflow, see [Libssh2#402](https://github.com/libssh2/libssh2/pull/402) + +#### Merged PRs into NodeGit +- [Fix some issues from the libgit2 bump](https://github.com/nodegit/nodegit/pull/1751) +- [Add option to support longpaths on Windows](https://github.com/nodegit/nodegit/pull/1748) +- [Bring in libssh2#402](https://github.com/nodegit/nodegit/pull/1749) +- [Wait for copy and remove promises to finish](https://github.com/nodegit/nodegit/pull/1730) + +#### Merged PRs into LibGit2 +- [Support `core.longpaths` on Windows #5347](https://github.com/libgit2/libgit2/pull/5347) +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [win32: fix relative symlinks pointing into dirs](https://github.com/libgit2/libgit2/pull/5355) +- [ntlm: prevent (spurious) compiler warnings](https://github.com/libgit2/libgit2/pull/5354) +- [Adds support for multiple SSH auth mechanisms being used sequentially](https://github.com/libgit2/libgit2/pull/5305) +- [netops: handle intact query parameters in service_suffix removal](https://github.com/libgit2/libgit2/pull/5339) +- [Refactor packfile code to use zstream abstraction](https://github.com/libgit2/libgit2/pull/5340) +- [Fix git_submodule_sync with relative url](https://github.com/libgit2/libgit2/pull/5322) +- [http: avoid generating double slashes in url](https://github.com/libgit2/libgit2/pull/5325) +- [Correct typo in name of referenced parameter](https://github.com/libgit2/libgit2/pull/5348) +- [patch_parse: fix undefined behaviour due to arithmetic on NULL pointers](https://github.com/libgit2/libgit2/pull/5338) +- [smart_pkt: fix overflow resulting in OOB read/write of one byte](https://github.com/libgit2/libgit2/pull/5337) +- [branch: clarify documentation around branches](https://github.com/libgit2/libgit2/pull/5300) +- [examples: checkout: implement guess heuristic for remote branches](https://github.com/libgit2/libgit2/pull/5283) +- [Minor doc improvements](https://github.com/libgit2/libgit2/pull/5320) +- [attr: Update definition of binary macro](https://github.com/libgit2/libgit2/pull/5333) +- [Security fixes for master](https://github.com/libgit2/libgit2/pull/5331) +- [release.md: note that we do two security releases](https://github.com/libgit2/libgit2/pull/5318) +- [MSVC: Fix warning C4133 on x64: "function": Incompatible types - from "unsigned long *" to "size_t *"](https://github.com/libgit2/libgit2/pull/5317) +- [ci: only push docs from the libgit2/libgit2 repo](https://github.com/libgit2/libgit2/pull/5316) +- [global: convert to fiber-local storage to fix exit races](https://github.com/libgit2/libgit2/pull/5314) +- [Fix copy&paste in git_cherrypick_commit docstring](https://github.com/libgit2/libgit2/pull/5315) +- [patch_parse: fix out-of-bounds reads caused by integer underflow](https://github.com/libgit2/libgit2/pull/5312) +- [tests: fix compiler warning if tracing is disabled](https://github.com/libgit2/libgit2/pull/5311) +- [tests: config: only test parsing huge file with GITTEST_INVASIVE_SPEED](https://github.com/libgit2/libgit2/pull/5313) +- [diff: complete support for git patchid](https://github.com/libgit2/libgit2/pull/5306) +- [Memory optimizations for config entries](https://github.com/libgit2/libgit2/pull/5243) +- [ssh: include sha256 host key hash when supported](https://github.com/libgit2/libgit2/pull/5307) +- [Various examples shape-ups](https://github.com/libgit2/libgit2/pull/5272) +- [Improve trace support in tests](https://github.com/libgit2/libgit2/pull/5309) +- [Move `git_off_t` to `git_object_size_t`](https://github.com/libgit2/libgit2/pull/5123) +- [Add compat typdef for git_attr_t](https://github.com/libgit2/libgit2/pull/5310) +- [CI Build Updates](https://github.com/libgit2/libgit2/pull/5308) +- [patch_parse: use paths from "---"/"+++" lines for binary patches](https://github.com/libgit2/libgit2/pull/5303) +- [Follow 308 redirect in WinHTTP transport](https://github.com/libgit2/libgit2/pull/5285) +- [fileops: correct error return on p_lstat failures when mkdir](https://github.com/libgit2/libgit2/pull/5302) +- [config_mem: implement support for snapshots](https://github.com/libgit2/libgit2/pull/5299) +- [patch_parse: fix segfault when header path contains whitespace only](https://github.com/libgit2/libgit2/pull/5298) +- [config_file: fix race when creating an iterator](https://github.com/libgit2/libgit2/pull/5282) +- [Fix crash if snapshotting a config_snapshot](https://github.com/libgit2/libgit2/pull/5293) +- [fix a bug introduced in 8a23597b](https://github.com/libgit2/libgit2/pull/5295) +- [reflogs: fix behaviour around reflogs with newlines](https://github.com/libgit2/libgit2/pull/5275) +- [commit: verify objects exist in git_commit_with_signature](https://github.com/libgit2/libgit2/pull/5289) +- [patch_parse: fixes for fuzzing errors](https://github.com/libgit2/libgit2/pull/5276) +- [apply: add GIT_APPLY_CHECK](https://github.com/libgit2/libgit2/pull/5227) +- [refs: unlock unmodified refs on transaction commit](https://github.com/libgit2/libgit2/pull/5264) +- [fuzzers: add a new fuzzer for patch parsing](https://github.com/libgit2/libgit2/pull/5269) +- [patch_parse: handle patches without extended headers](https://github.com/libgit2/libgit2/pull/5273) +- [Provide a wrapper for simple submodule clone steps](https://github.com/libgit2/libgit2/pull/4637) +- [macOS GSS Support](https://github.com/libgit2/libgit2/pull/5238) +- [cmake: correct the link stanza for CoreFoundation](https://github.com/libgit2/libgit2/pull/5265) +- [Fix file locking on POSIX OS](https://github.com/libgit2/libgit2/pull/5257) +- [cmake: update minimum CMake version to v3.5.1](https://github.com/libgit2/libgit2/pull/5260) +- [patch_parse: handle patches with new empty files](https://github.com/libgit2/libgit2/pull/5248) +- [DRY commit parsing](https://github.com/libgit2/libgit2/pull/4445) +- [azure: avoid building and testing in Docker as root](https://github.com/libgit2/libgit2/pull/5239) +- [regexp: implement a new regular expression API](https://github.com/libgit2/libgit2/pull/5226) +- [git_refdb API fixes](https://github.com/libgit2/libgit2/pull/5106) +- [Don't use enum for flags](https://github.com/libgit2/libgit2/pull/5242) +- [valgrind: suppress memory leaks in libssh2_session_handshake](https://github.com/libgit2/libgit2/pull/5240) +- [buffer: fix writes into out-of-memory buffers](https://github.com/libgit2/libgit2/pull/5232) +- [cred: add missing private header in GSSAPI block](https://github.com/libgit2/libgit2/pull/5237) +- [CMake pkg-config modulification](https://github.com/libgit2/libgit2/pull/5206) +- [Update chat resources in README.md](https://github.com/libgit2/libgit2/pull/5229) +- [Circular header splitting](https://github.com/libgit2/libgit2/pull/5223) + + +## v0.26.3 [(2019-12-10)](https://github.com/nodegit/nodegit/releases/tag/v0.26.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.2...v0.26.3) + +#### Summary of changes +- Include LibGit2 security patch: https://github.com/libgit2/libgit2/releases/tag/v0.28.4 + +#### Merged PRs into NodeGit +- [Bring in security patches from libgit2 #1743](https://github.com/nodegit/nodegit/pull/1743) + + +## v0.26.2 [(2019-09-26)](https://github.com/nodegit/nodegit/releases/tag/v0.26.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.1...v0.26.2) + +#### Summary of changes +- Added options to fetch additional data (gpg signature) from LibGit2 in revWalk.prototype.commitWalk and return plain objects + - _revWalk.prototype.commitWalk(numCommits: number, { returnPlainObjects: boolean })_ + +#### Merged PRs into NodeGit +- [Optionally retrieve more data on commit walk #1728](https://github.com/nodegit/nodegit/pull/1728) + + +## v0.26.1 [(2019-09-16)](https://github.com/nodegit/nodegit/releases/tag/v0.26.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.26.0...v0.26.1) + +#### Summary of changes +- Bumped LibGit2 + - Additional git ignore fixes + - Allow credentials callback to return any credential type from list of supported types + - Memory leak and allocation fixes +- updateTips has optional parameters and should convert plain objects into options structs correctly now +- Added Nodegit.Blob.prototype.filter, this should be used instead of NodeGit.Blob.filteredContent as it is not deprecated. + +#### Merged PRs into NodeGit +- [Bump libgit2 to latest fork of master #1723](https://github.com/nodegit/nodegit/pull/1723) +- [updateTips: optional param and normalizeOptions #1722](https://github.com/nodegit/nodegit/pull/1722) + +#### Merged PRs into LibGit2 +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [azure: build Docker images as part of the pipeline](https://github.com/libgit2/libgit2/pull/5198) +- [smart: use push_glob instead of manual filtering](https://github.com/libgit2/libgit2/pull/5195) +- [ntlm: fix failure to find openssl headers](https://github.com/libgit2/libgit2/pull/5216) +- [cmake: remove extraneous logging](https://github.com/libgit2/libgit2/pull/5222) +- [open:fix memory leak when passing NULL to git_repository_open_ext](https://github.com/libgit2/libgit2/pull/5224) +- [apply: Fix a patch corruption related to EOFNL handling](https://github.com/libgit2/libgit2/pull/5209) +- [ignore: correct handling of nested rules overriding wild card unignore](https://github.com/libgit2/libgit2/pull/5210) +- [Memory allocation fixes for diff generator](https://github.com/libgit2/libgit2/pull/5214) +- [Use an HTTP scheme that supports the given credentials](https://github.com/libgit2/libgit2/pull/5212) +- [apply: git_apply_to_tree fails to apply patches that add new files](https://github.com/libgit2/libgit2/pull/5208) +- [Optionally read `.gitattributes` from HEAD](https://github.com/libgit2/libgit2/pull/5189) +- [config: implement "onbranch" conditional](https://github.com/libgit2/libgit2/pull/5196) +- [Fix include casing for case-sensitive filesystems.](https://github.com/libgit2/libgit2/pull/5213) +- [util: use 64 bit timer on Windows](https://github.com/libgit2/libgit2/pull/5054) +- [Memory allocation audit](https://github.com/libgit2/libgit2/pull/5200) +- [clone: don't decode URL percent encodings](https://github.com/libgit2/libgit2/pull/5187) +- [Security updates from 0.28.3](https://github.com/libgit2/libgit2/pull/5202) + + +## v0.26.0 [(2019-09-09)](https://github.com/nodegit/nodegit/releases/tag/v0.26.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.1...v0.26.0) + +#### Summary of changes +- Bumped libssh2 to 1.9 for security patch +- Remote.prototype.upload and Remote.prototype.updateTips should be async now + +#### Merged PRs into NodeGit +- [GitRemote upload and updateTips are async #1720](https://github.com/nodegit/nodegit/pull/1720) +- [Update libssh2 to 1.9 #1719](https://github.com/nodegit/nodegit/pull/1719) + + +## v0.25.1 [(2019-08-13)](https://github.com/nodegit/nodegit/releases/tag/v0.25.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0...v0.25.1) + +#### Summary of changes +Security patch for LibGit2: +- A carefully constructed commit object with a very large number + of parents may lead to potential out-of-bounds writes or + potential denial of service. + +- The ProgramData configuration file is always read for compatibility + with Git for Windows and Portable Git installations. The ProgramData + location is not necessarily writable only by administrators, so we + now ensure that the configuration file is owned by the administrator + or the current user. + +Additionally: +- Stash should run much faster now. + +#### Merged PRs into LibGit2 +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [stash: avoid recomputing tree when committing worktree](https://github.com/libgit2/libgit2/pull/5113) +- [Variadic macros](https://github.com/libgit2/libgit2/pull/5121) +- [Add sign capability to git_rebase_commit](https://github.com/libgit2/libgit2/pull/4913) +- [remote: remove unused block of code](https://github.com/libgit2/libgit2/pull/5197) +- [Adjust printf specifiers in examples code](https://github.com/libgit2/libgit2/pull/5146) +- [config: check if we are running in a sandboxed environment](https://github.com/libgit2/libgit2/pull/5191) +- [Fix example checkout to forbid rather than require --](https://github.com/libgit2/libgit2/pull/5184) +- [editorconfig: update to match our coding style](https://github.com/libgit2/libgit2/pull/5183) +- [Compare buffers in diff example](https://github.com/libgit2/libgit2/pull/5125) +- [Include ahead_behind in the test suite](https://github.com/libgit2/libgit2/pull/5135) +- [config: separate file and snapshot backends](https://github.com/libgit2/libgit2/pull/5186) +- [object: deprecate git_object__size for removal](https://github.com/libgit2/libgit2/pull/5192) + + +## v0.25.0 [(2019-08-09)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.24.3...v0.25.0) + +#### Summary of changes +##### BREAKING +- `getRemotes` no longer returns remote names, it now returns remote objects directly. Use `getRemoteNames` to get a list of remote names. +- Converted Buf.prototype.set and Buf.prototype.grow from async to sync +- `Repository.prototype.continueRebase` will now throw on any error except for EAPPLIED on the first call to `Rebase.prototype.next` +- Drops support for Ubuntu 14 after EOL +- Removed access to the `diff_so_far` param in `git_diff_notify_cb` and `git_diff_progress_cb` +- Changed `FilterSource.prototype.repo` to async to prevent segfaults on filters that run during `Submodule.status` +- Changed `NodeGit.Signature.default` to async, because it actually ends up reading the config. +- Fixed bug where templates were not reporting errors for synchronous methods. It's a bit of a wide net, but in general, + it is now possible certain sync methods in NodeGit will begin failing that did not fail before. This is the correct + behavior. + +##### Deprecations +- Support signing commits in `Repository.prototype.mergeBranches`. The last parameter `processMergeMessageCallback` is now deprecated, but will continue to work. Use the options object instead, which will contain the `processMergeMessageCallback`, as well as the `signingCb`. + +##### New +- Support for Node 12 +- Add signing support for commits and annotated tags + - Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback + pattern for signing commits or tags should use the exact same callback type and with the same meaning. + `type SigningCallback = (content: string) => {| code: number, field?: string, signedData?: string |};` + If the code is `NodeGit.Error.CODE.OK` or 0, the operation will succeed and _at least_ signedData is expected to be filled out. + If the code is a negative number, except for `NodeGit.Error.CODE.PASSTHROUGH`, the signing operation will fail. + If the code is `NodeGit.Error.CODE.PASSTHROUGH`, the operation will continue without signing the object. +- Exposed `AnnotatedCommit` methods: + - `AnnotatedCommit.prototype.ref` +- Exposed `Apply` methods: + - `Apply.apply` applies a diff to the repository + - `Apply.toTree` applies a diff to a tree +- Exposed `Config` methods: + - `Config.prototype.deleteEntry` + - `Config.prototype.deleteMultivar` + - `Config.prototype.getBool` + - `Config.prototype.getInt32` + - `Config.prototype.getInt64` + - `Config.prototype.setMultivar` + - `Config.prototype.snapshot` +- Exposed `ConfigIterator` with methods: + - `ConfigIterator.create` + - `ConfigIterator.createGlob` + - `ConfigIterator.createMultivar` + - `ConfigIterator.prototype.next` +- Exposed `IndexNameEntry`: + - `IndexNameEntry.add` + - `IndexNameEntry.clear` + - `IndexNameEntry.entryCount` + - `IndexNameEntry.getByIndex` + - `IndexNameEntry.prototype.ancestor` + - `IndexNameEntry.prototype.ours` + - `IndexNameEntry.prototype.theirs` +- Exposed `IndexReucEntry`: + - `IndexReucEntry.add` + - `IndexReucEntry.clear` + - `IndexReucEntry.entryCount` + - `IndexReucEntry.find` + - `IndexReucEntry.getByIndex` + - `IndexReucEntry.getByPath` + - `IndexReucEntry.remove` + - `IndexReucEntry.prototype.mode` + - `IndexReucEntry.prototype.oid` + - `IndexReucEntry.prototype.path` +- Exposed `Mailmap`: + - `Mailmap.prototype.addEntry` + - `Mailmap.fromBuffer` + - `Mailmap.fromRepository` + - `Mailmap.create` + - `Mailmap.prototype.resolve` + - `Mailmap.prototype.resolveSignature` +- Exposed `Merge` methods: + - `Merge.analysis` + - `Merge.analysisForRef` +- Exposed `Path.isGitfile` +- Added `RebaseOptions` to `Repository.prototype.rebaseContinue` +- Added `NodeGit.Reference.updateTerminal` +- Exposed `Remote` methods: + - `Remote.createWithOpts` +- Exposed `Tag.createFromBuffer` +- Expose `Tree.prototype.createUpdated(repo, numUpdates, updates)` + +##### Fixed +- Updates lodash dependency to address security notice +- Fixed a prototype problem with cherrypick, merge, and other collections that have a function at their root. call, apply, and bind should now be on NodeGit.Cherrypick. +- Bumped libssh2 to resolve security notice. +- Improve speed and correctness of fileHistoryWalk. The API should not have changed; however, when the end of the walk has been reached, `reachedEndOfHistory` will be specified on the resulting array. +- Fixes openssl prebuilt downloads for electron builds +- Fixes commits retrieved from `Commit.prototype.parent` +- Bump Node-Gyp to 4.0.0 to fix tar security vulnerability +- Optimized a set of routines in NodeGit. These methods as written in Javascript require hundreds or thousands of requests to async workers to retrieve data. We've batched these requests and performed them on a single async worker. There are now native implementations of the following: + - `Repository.prototype.getReferences`: Retrieves all references on async worker. + - `Repository.prototype.getRemotes`: Retrieves all remotes on async worker. + - `Repository.prototype.getSubmodules`: Retrieves all submodules on async worker. + - `Repository.prototype.refreshReferences`: Open sourced function from GitKraken. Grabs a lot of information about references on an async worker. + - `Revwalk.prototype.commitWalk`: Retrieves up to N commits from a revwalk on an async worker. +- When installing on a machine that has yarn and does not have npm, the preinstall script should succeed now +- `ceiling_dirs` is now an optional parameter to `Repository.discover` +- Added support for building on IBM i (PASE) machines +- Fixed leak where struct/option types were leaking libgit2 pointers +- Switched `NodeGit.Oid.fromString`'s internal implementation from `git_oid_fromstr` to `git_oid_fromstrp` +- Fixed builds for Electron 4 +- Updated `Signature.prototype.toString` to optionally include timestamps + +##### LibGit2 Bump +- Fixes gitignore issue with pattern negation +- `Remote.list` now gets the correct list of remotes if remotes are changed by external process +- Always use builtin regex for linux for portability +- Use Iconv on OSX for better internationalization support. +- Removed LibCurl from LibGit2: + - Now with built-in NTLM proxy support + - Now with built-in Negotiate/Kerberos proxy support + - Working with proxy URLs may be different as curl could auto detect scheme for proxies +- Various git config fixes +- Various git ignore fixes +- Various libgit2 performance improvements +- Windows/Linux now use PCRE for regex, OSX uses regcomp_l, this should address collation issues in diffing + +#### Merged PRs into NodeGit +- [Add deprecation warnings for enums that need them. #1711](https://github.com/nodegit/nodegit/pull/1711) +- [https://github.com/nodegit/nodegit/pull/1706](https://github.com/nodegit/nodegit/pull/1706) +- [Reintroduce Odb.prototype.addDiskAlternate #1695](https://github.com/nodegit/nodegit/pull/1695) +- [Fix behaviour of Repository#getReferences #1708](https://github.com/nodegit/nodegit/pull/1708) +- [Bump libgit2 #1705](https://github.com/nodegit/nodegit/pull/1705) +- [Fix Tree#createUpdated #1704](https://github.com/nodegit/nodegit/pull/1704) +- [Fix failing tests on CI #1703](https://github.com/nodegit/nodegit/pull/1703) +- [Audit lodash and fix package-lock.json #1702](https://github.com/nodegit/nodegit/pull/1702) +- [Implement support for Node 12 #1696](https://github.com/nodegit/nodegit/pull/1696) +- [Remove NSEC #1699](https://github.com/nodegit/nodegit/pull/1699) +- [Use builtin regex library for linux for better portability #1693](https://github.com/nodegit/nodegit/pull/1693) +- [Remove pcre-config from binding.gyp #1694](https://github.com/nodegit/nodegit/pull/1694) +- [refresh_references.cc: skip refs that can't be directly resolved #1689](https://github.com/nodegit/nodegit/pull/1689) +- [Bump libgit2 to fork of latest master #1690](https://github.com/nodegit/nodegit/pull/1690) +- [Bump libssh2 to 1.8.2 and fix some npm audit warnings #1678](https://github.com/nodegit/nodegit/pull/1678) +- [Root functions should keep their function prototypes correctly #1681](https://github.com/nodegit/nodegit/pull/1681) +- [refresh_references.cc: bust LibGit2 remote list cache by reading config #1685](https://github.com/nodegit/nodegit/pull/1685) +- [Implement faster file history walk #1676](https://github.com/nodegit/nodegit/pull/1676) +- [EOL for Node 6 and Ubuntu 14.04 #1649](https://github.com/nodegit/nodegit/pull/1649) +- [Ensures that commits from parent(*) has a repository #1658](https://github.com/nodegit/nodegit/pull/1658) +- [Update openssl conan distributions #1663](https://github.com/nodegit/nodegit/pull/1663) +- [Support signing in Repository#mergeBranches #1664](https://github.com/nodegit/nodegit/pull/1664) +- [Dependency upgrade node-gyp upgraded to 4.0.0 #1672](https://github.com/nodegit/nodegit/pull/1672) +- [Add additional getters to streamline information gathering (breaking change) #1671](https://github.com/nodegit/nodegit/pull/1671) +- [Clean up some dangerous memory accesses in callbacks #1642](https://github.com/nodegit/nodegit/pull/1642) +- [Output the item that was deprecated when giving deprecation notice #1643](https://github.com/nodegit/nodegit/pull/1643) +- [Don't fail yarn installs when we can't find npm #1644](https://github.com/nodegit/nodegit/pull/1644) +- [`ceiling_dirs` parameter in `Repository.discover` is optional #1245](https://github.com/nodegit/nodegit/pull/1245) +- [Add missing `shouldAlloc` declarations for git_merge_analysis* functions #1641](https://github.com/nodegit/nodegit/pull/1641) +- [Fix regex state causing subsequent runs of Tag.extractSignature to fail #1630](https://github.com/nodegit/nodegit/pull/1630) +- [Update LibGit2 docs to v0.28.0 #1631](https://github.com/nodegit/nodegit/pull/1631) +- [Add support for building on IBM i (PASE) #1634](https://github.com/nodegit/nodegit/pull/1634) +- [Expose more config methods #1635](https://github.com/nodegit/nodegit/pull/1635) +- [Catch errors and pass them to libgit2 as error codes in rebase signingcb #1636](https://github.com/nodegit/nodegit/pull/1636) +- [Simplify check for IBM i operating system #1637](https://github.com/nodegit/nodegit/pull/1637) +- [Bump LibGit2 to fork of v0.28.1 #1638](https://github.com/nodegit/nodegit/pull/1638) +- [We should clear the persistent cell in structs when they are destroyed #1629](https://github.com/nodegit/nodegit/pull/1629) +- [Fix "errorno" typo #1628](https://github.com/nodegit/nodegit/pull/1628) +- [Bump Libgit2 fork to v0.28.0 #1627](https://github.com/nodegit/nodegit/pull/1627) +- [Fix macOS and Windows Electron 4 builds #1626](https://github.com/nodegit/nodegit/pull/1626) +- [Fix non-existent / dangling refs cause Repository.prototype.createCommitWithSignature to fail #1624](https://github.com/nodegit/nodegit/pull/1624) +- [Handle new gyp information for electron builds #1623](https://github.com/nodegit/nodegit/pull/1623) +- [Use same API for signingCb in all places that can be crypto signed #1621](https://github.com/nodegit/nodegit/pull/1621) +- [Breaking: Repository.prototype.continueRebase enhancements #1619](https://github.com/nodegit/nodegit/pull/1619) +- [adds support for gpg commit signing (fixes #1018) #1448](https://github.com/nodegit/nodegit/pull/1448) +- [Add `updateRef` parameter to Repository#createCommitWithSignature #1610](https://github.com/nodegit/nodegit/pull/1610) +- [Documentation fixes. #1611](https://github.com/nodegit/nodegit/pull/1611) +- [Add Commit#amendWithSignature #1616](https://github.com/nodegit/nodegit/pull/1616) +- [Bump libgit2 to a preview of v0.28 #1615](https://github.com/nodegit/nodegit/pull/1615) +- [Fix issues with Commit#amendWithSignature #1617](https://github.com/nodegit/nodegit/pull/1617) +- [Marked Repository.createBlobFromBuffer as async #1614](https://github.com/nodegit/nodegit/pull/1614) +- [Add functionality for creating Tags with signatures and extracting signatures from Tags #1618](https://github.com/nodegit/nodegit/pull/1618) + +#### Merged PRs into LibGit2 +- [Add sign capability to git_rebase_commit #4913](https://github.com/libgit2/libgit2/pull/4913) +- [Parallelize checkout_create_the_new for perf #4205](https://github.com/libgit2/libgit2/pull/4205) +- [config_file: refresh when creating an iterator](https://github.com/libgit2/libgit2/pull/5181) +- [azure: drop powershell](https://github.com/libgit2/libgit2/pull/5141) +- [fuzzer: use futils instead of fileops](https://github.com/libgit2/libgit2/pull/5180) +- [w32: fix unlinking of directory symlinks](https://github.com/libgit2/libgit2/pull/5151) +- [patch_parse: fix segfault due to line containing static contents](https://github.com/libgit2/libgit2/pull/5179) +- [ignore: fix determining whether a shorter pattern negates another](https://github.com/libgit2/libgit2/pull/5173) +- [patch_parse: handle missing newline indicator in old file](https://github.com/libgit2/libgit2/pull/5159) +- [patch_parse: do not depend on parsed buffer's lifetime](https://github.com/libgit2/libgit2/pull/5158) +- [sha1: fix compilation of WinHTTP backend](https://github.com/libgit2/libgit2/pull/5174) +- [repository: do not initialize HEAD if it's provided by templates](https://github.com/libgit2/libgit2/pull/5176) +- [configuration: cvar -> configmap](https://github.com/libgit2/libgit2/pull/5138) +- [Evict cache items more efficiently](https://github.com/libgit2/libgit2/pull/5172) +- [clar: fix suite count](https://github.com/libgit2/libgit2/pull/5175) +- [Ignore VS2017 specific files and folders](https://github.com/libgit2/libgit2/pull/5163) +- [gitattributes: ignore macros defined in subdirectories](https://github.com/libgit2/libgit2/pull/5156) +- [clar: correctly account for "data" suites when counting](https://github.com/libgit2/libgit2/pull/5168) +- [Allocate memory more efficiently when packing objects](https://github.com/libgit2/libgit2/pull/5170) +- [fileops: fix creation of directory in filesystem root](https://github.com/libgit2/libgit2/pull/5131) +- [win32: fix fuzzers and have CI build them](https://github.com/libgit2/libgit2/pull/5160) +- [Config parser separation](https://github.com/libgit2/libgit2/pull/5134) +- [config_file: implement stat cache to avoid repeated rehashing](https://github.com/libgit2/libgit2/pull/5132) +- [ci: build with ENABLE_WERROR on Windows](https://github.com/libgit2/libgit2/pull/5143) +- [Fix Regression: attr: Correctly load system attr file (on Windows)](https://github.com/libgit2/libgit2/pull/5152) +- [hash: fix missing error return on production builds](https://github.com/libgit2/libgit2/pull/5145) +- [Resolve static check warnings in example code](https://github.com/libgit2/libgit2/pull/5142) +- [Multiple hash algorithms](https://github.com/libgit2/libgit2/pull/4438) +- [More documentation](https://github.com/libgit2/libgit2/pull/5128) +- [Incomplete commondir support](https://github.com/libgit2/libgit2/pull/4967) +- [Remove warnings](https://github.com/libgit2/libgit2/pull/5078) +- [Re-run flaky tests](https://github.com/libgit2/libgit2/pull/5140) +- [errors: use lowercase](https://github.com/libgit2/libgit2/pull/5137) +- [largefile tests: only write 2GB on 32-bit platforms](https://github.com/libgit2/libgit2/pull/5136) +- [Fix broken link in README](https://github.com/libgit2/libgit2/pull/5129) +- [net: remove unused `git_headlist_cb`](https://github.com/libgit2/libgit2/pull/5122) +- [cmake: default NTLM client to off if no HTTPS support](https://github.com/libgit2/libgit2/pull/5124) +- [attr: rename constants and macros for consistency](https://github.com/libgit2/libgit2/pull/5119) +- [Change API instances of `fromnoun` to `from_noun` (with an underscore)](https://github.com/libgit2/libgit2/pull/5117) +- [object: rename git_object__size to git_object_size](https://github.com/libgit2/libgit2/pull/5118) +- [Replace fnmatch with wildmatch](https://github.com/libgit2/libgit2/pull/5110) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/5111) +- [Removal of `p_fallocate`](https://github.com/libgit2/libgit2/pull/5114) +- [Modularize our TLS & hash detection](https://github.com/libgit2/libgit2/pull/5055) +- [tests: merge::analysis: use test variants to avoid duplicated test suites](https://github.com/libgit2/libgit2/pull/5109) +- [Rename options initialization functions](https://github.com/libgit2/libgit2/pull/5101) +- [deps: ntlmclient: disable implicit fallthrough warnings](https://github.com/libgit2/libgit2/pull/5112) +- [gitignore with escapes](https://github.com/libgit2/libgit2/pull/5097) +- [Handle URLs with a colon after host but no port](https://github.com/libgit2/libgit2/pull/5108) +- [Merge analysis support for bare repos](https://github.com/libgit2/libgit2/pull/5022) +- [Add memleak check docs](https://github.com/libgit2/libgit2/pull/5104) +- [Data-driven tests](https://github.com/libgit2/libgit2/pull/5098) +- [sha1dc: update to fix endianess issues on AIX/HP-UX](https://github.com/libgit2/libgit2/pull/5107) +- [Add NTLM support for HTTP(s) servers and proxies](https://github.com/libgit2/libgit2/pull/5052) +- [Callback type names should be suffixed with `_cb`](https://github.com/libgit2/libgit2/pull/5102) +- [tests: checkout: fix symlink.git being created outside of sandbox](https://github.com/libgit2/libgit2/pull/5099) +- [ignore: handle escaped trailing whitespace](https://github.com/libgit2/libgit2/pull/5095) +- [Ignore: only treat one leading slash as a root identifier](https://github.com/libgit2/libgit2/pull/5074) +- [online tests: use gitlab for auth failures](https://github.com/libgit2/libgit2/pull/5094) +- [Ignore files: don't ignore whitespace](https://github.com/libgit2/libgit2/pull/5076) +- [cache: fix cache eviction using deallocated key](https://github.com/libgit2/libgit2/pull/5088) +- [SECURITY.md: split out security-relevant bits from readme](https://github.com/libgit2/libgit2/pull/5085) +- [Restore NetBSD support](https://github.com/libgit2/libgit2/pull/5086) +- [repository: fix garbage return value](https://github.com/libgit2/libgit2/pull/5084) +- [cmake: disable fallthrough warnings for PCRE](https://github.com/libgit2/libgit2/pull/5083) +- [Configuration parsing: validate section headers with quotes](https://github.com/libgit2/libgit2/pull/5073) +- [Loosen restriction on wildcard "*" refspecs](https://github.com/libgit2/libgit2/pull/5060) +- [Use PCRE for our fallback regex engine when regcomp_l is unavailable](https://github.com/libgit2/libgit2/pull/4935) +- [Remote URL last-chance resolution](https://github.com/libgit2/libgit2/pull/5062) +- [Skip UTF8 BOM in ignore files](https://github.com/libgit2/libgit2/pull/5075) +- [We've already added `ZLIB_LIBRARIES` to `LIBGIT2_LIBS` so don't also add the `z` library](https://github.com/libgit2/libgit2/pull/5080) +- [Define SYMBOLIC_LINK_FLAG_DIRECTORY if required](https://github.com/libgit2/libgit2/pull/5077) +- [Support symlinks for directories in win32](https://github.com/libgit2/libgit2/pull/5065) +- [rebase: orig_head and onto accessors](https://github.com/libgit2/libgit2/pull/5057) +- [cmake: correctly detect if system provides `regcomp`](https://github.com/libgit2/libgit2/pull/5063) +- [Correctly write to missing locked global config](https://github.com/libgit2/libgit2/pull/5023) +- [[RFC] util: introduce GIT_DOWNCAST macro](https://github.com/libgit2/libgit2/pull/4561) +- [examples: implement SSH authentication](https://github.com/libgit2/libgit2/pull/5051) +- [git_repository_init: stop traversing at windows root](https://github.com/libgit2/libgit2/pull/5050) +- [config_file: check result of git_array_alloc](https://github.com/libgit2/libgit2/pull/5053) +- [patch_parse.c: Handle CRLF in parse_header_start](https://github.com/libgit2/libgit2/pull/5027) +- [fix typo](https://github.com/libgit2/libgit2/pull/5045) +- [sha1: don't inline `git_hash_global_init` for win32](https://github.com/libgit2/libgit2/pull/5039) +- [ignore: treat paths with trailing "/" as directories](https://github.com/libgit2/libgit2/pull/5040) +- [Test that largefiles can be read through the tree API](https://github.com/libgit2/libgit2/pull/4874) +- [Tests for symlinked user config](https://github.com/libgit2/libgit2/pull/5034) +- [patch_parse: fix parsing addition/deletion of file with space](https://github.com/libgit2/libgit2/pull/5035) +- [Optimize string comparisons](https://github.com/libgit2/libgit2/pull/5018) +- [Negation of subdir ignore causes other subdirs to be unignored](https://github.com/libgit2/libgit2/pull/5020) +- [xdiff: fix typo](https://github.com/libgit2/libgit2/pull/5024) +- [docs: clarify relation of safe and forced checkout strategy](https://github.com/libgit2/libgit2/pull/5032) +- [Each hash implementation should define `git_hash_global_init`](https://github.com/libgit2/libgit2/pull/5026) +- [[Doc] Update URL to git2-rs](https://github.com/libgit2/libgit2/pull/5012) +- [remote: Rename git_remote_completion_type to _t](https://github.com/libgit2/libgit2/pull/5008) +- [odb: provide a free function for custom backends](https://github.com/libgit2/libgit2/pull/5005) +- [Have git_branch_lookup accept GIT_BRANCH_ALL](https://github.com/libgit2/libgit2/pull/5000) +- [Rename git_transfer_progress to git_indexer_progress](https://github.com/libgit2/libgit2/pull/4997) +- [High-level map APIs](https://github.com/libgit2/libgit2/pull/4901) +- [refdb_fs: fix loose/packed refs lookup racing with repacks](https://github.com/libgit2/libgit2/pull/4984) +- [Allocator restructuring](https://github.com/libgit2/libgit2/pull/4998) +- [cache: fix misnaming of `git_cache_free`](https://github.com/libgit2/libgit2/pull/4992) +- [examples: produce single cgit2 binary](https://github.com/libgit2/libgit2/pull/4956) +- [Remove public 'inttypes.h' header](https://github.com/libgit2/libgit2/pull/4991) +- [Prevent reading out of bounds memory](https://github.com/libgit2/libgit2/pull/4996) +- [Fix a memory leak in odb_otype_fast()](https://github.com/libgit2/libgit2/pull/4987) +- [Make stdalloc__reallocarray call stdalloc__realloc](https://github.com/libgit2/libgit2/pull/4986) +- [Remove `git_time_monotonic`](https://github.com/libgit2/libgit2/pull/4990) +- [Fix a _very_ improbable memory leak in git_odb_new()](https://github.com/libgit2/libgit2/pull/4988) +- [ci: publish documentation on merge](https://github.com/libgit2/libgit2/pull/4989) +- [Enable creation of worktree from bare repo's default branch](https://github.com/libgit2/libgit2/pull/4982) +- [Allow bypassing check for '.keep' file](https://github.com/libgit2/libgit2/pull/4965) +- [Deprecation: export the deprecated functions properly](https://github.com/libgit2/libgit2/pull/4979) +- [ci: skip ssh tests on macOS nightly](https://github.com/libgit2/libgit2/pull/4980) +- [CI build fixups](https://github.com/libgit2/libgit2/pull/4976) +- [v0.28 rc1](https://github.com/libgit2/libgit2/pull/4970) +- [Docs](https://github.com/libgit2/libgit2/pull/4968) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/4954) +- [ci: add an individual coverity pipeline](https://github.com/libgit2/libgit2/pull/4964) +- [ci: run docurium to create documentation](https://github.com/libgit2/libgit2/pull/4961) +- [ci: return coverity to the nightlies](https://github.com/libgit2/libgit2/pull/4962) +- [Clean up some warnings](https://github.com/libgit2/libgit2/pull/4950) +- [Nightlies: use `latest` docker images](https://github.com/libgit2/libgit2/pull/4869) +- [index: preserve extension parsing errors](https://github.com/libgit2/libgit2/pull/4858) +- [Deprecate functions and constants more gently](https://github.com/libgit2/libgit2/pull/4952) +- [Don't use deprecated constants](https://github.com/libgit2/libgit2/pull/4957) +- [Fix VS warning C4098: 'giterr_set_str' : void function returning a value](https://github.com/libgit2/libgit2/pull/4955) +- [Move `giterr` to `git_error`](https://github.com/libgit2/libgit2/pull/4917) +- [odb: Fix odb foreach to also close on positive error code](https://github.com/libgit2/libgit2/pull/4949) +- [repository: free memory in symlink detection function](https://github.com/libgit2/libgit2/pull/4948) +- [ci: update poxyproxy, run in quiet mode](https://github.com/libgit2/libgit2/pull/4947) +- [Add/multiply with overflow tweaks](https://github.com/libgit2/libgit2/pull/4945) +- [Improve deprecation of old enums](https://github.com/libgit2/libgit2/pull/4944) +- [Move `git_ref_t` to `git_reference_t`](https://github.com/libgit2/libgit2/pull/4939) +- [More `git_obj` to `git_object` updates](https://github.com/libgit2/libgit2/pull/4940) +- [ci: only run invasive tests in nightly](https://github.com/libgit2/libgit2/pull/4943) +- [Always build a cdecl library](https://github.com/libgit2/libgit2/pull/4930) +- [changelog: document changes since 0.27](https://github.com/libgit2/libgit2/pull/4932) +- [Fix a bunch of warnings](https://github.com/libgit2/libgit2/pull/4925) +- [mailmap: prefer ethomson@edwardthomson.com](https://github.com/libgit2/libgit2/pull/4941) +- [Convert tests/resources/push.sh to LF endings](https://github.com/libgit2/libgit2/pull/4937) +- [Get rid of some test files that were accidentally committed](https://github.com/libgit2/libgit2/pull/4936) +- [Fix crash on remote connection when GIT_PROXY_AUTO is set but no proxy is detected](https://github.com/libgit2/libgit2/pull/4934) +- [Make ENABLE_WERROR actually work](https://github.com/libgit2/libgit2/pull/4924) +- [Remove unconditional -Wno-deprecated-declaration on macOS](https://github.com/libgit2/libgit2/pull/4931) +- [Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int *' (C4133) on VS](https://github.com/libgit2/libgit2/pull/4926) +- [Fix Linux warnings](https://github.com/libgit2/libgit2/pull/4928) +- [Coverity fixes](https://github.com/libgit2/libgit2/pull/4922) +- [Shutdown callback count](https://github.com/libgit2/libgit2/pull/4919) +- [Update CRLF filtering to match modern git](https://github.com/libgit2/libgit2/pull/4904) +- [refdb_fs: refactor error handling in `refdb_reflog_fs__delete`](https://github.com/libgit2/libgit2/pull/4915) +- [Remove empty (sub-)directories when deleting refs](https://github.com/libgit2/libgit2/pull/4833) +- [Support creating annotated commits from annotated tags](https://github.com/libgit2/libgit2/pull/4910) +- [Fix segfault in loose_backend__readstream](https://github.com/libgit2/libgit2/pull/4906) +- [make proxy_stream_close close target stream even on errors](https://github.com/libgit2/libgit2/pull/4905) +- [Index API updates for consistency](https://github.com/libgit2/libgit2/pull/4807) +- [Allow merge analysis against any reference](https://github.com/libgit2/libgit2/pull/4770) +- [revwalk: Allow changing hide_cb](https://github.com/libgit2/libgit2/pull/4888) +- [Unused function warnings](https://github.com/libgit2/libgit2/pull/4895) +- [Add builtin proxy support for the http transport](https://github.com/libgit2/libgit2/pull/4870) +- [config: fix adding files if their parent directory is a file](https://github.com/libgit2/libgit2/pull/4898) +- [Allow certificate and credential callbacks to decline to act](https://github.com/libgit2/libgit2/pull/4879) +- [Fix warning C4133 incompatible types in MSVC](https://github.com/libgit2/libgit2/pull/4896) +- [index: introduce git_index_iterator](https://github.com/libgit2/libgit2/pull/4884) +- [commit: fix out-of-bound reads when parsing truncated author fields](https://github.com/libgit2/libgit2/pull/4894) +- [tests: 🌀 address two null argument instances #4847](https://github.com/libgit2/libgit2/pull/4847) +- [Some OpenSSL issues](https://github.com/libgit2/libgit2/pull/4875) +- [worktree: Expose git_worktree_add_init_options](https://github.com/libgit2/libgit2/pull/4892) +- [transport/http: Include non-default ports in Host header](https://github.com/libgit2/libgit2/pull/4882) +- [Support symlinks on Windows when core.symlinks=true](https://github.com/libgit2/libgit2/pull/4713) +- [strntol: fix out-of-bounds reads when parsing numbers with leading sign](https://github.com/libgit2/libgit2/pull/4886) +- [apply: small fixups in the test suite](https://github.com/libgit2/libgit2/pull/4885) +- [signature: fix out-of-bounds read when parsing timezone offset](https://github.com/libgit2/libgit2/pull/4883) +- [Remote creation API](https://github.com/libgit2/libgit2/pull/4667) +- [Index collision fixes](https://github.com/libgit2/libgit2/pull/4818) +- [Patch (diff) application](https://github.com/libgit2/libgit2/pull/4705) +- [smart transport: only clear url on hard reset (regression)](https://github.com/libgit2/libgit2/pull/4880) +- [Tree parsing fixes](https://github.com/libgit2/libgit2/pull/4871) +- [CI: Fix macOS leak detection](https://github.com/libgit2/libgit2/pull/4860) +- [README: more CI status badges](https://github.com/libgit2/libgit2/pull/4800) +- [ci: Fix some minor issues](https://github.com/libgit2/libgit2/pull/4867) +- [Object parse fixes](https://github.com/libgit2/libgit2/pull/4864) +- [Windows CI: fail build on test failure](https://github.com/libgit2/libgit2/pull/4862) +- [ci: run all the jobs during nightly builds](https://github.com/libgit2/libgit2/pull/4863) +- [strtol removal](https://github.com/libgit2/libgit2/pull/4851) +- [ buf::oom tests: use custom allocator for oom failures](https://github.com/libgit2/libgit2/pull/4854) +- [ci: arm docker builds](https://github.com/libgit2/libgit2/pull/4804) +- [Win32 path canonicalization refactoring](https://github.com/libgit2/libgit2/pull/4852) +- [Check object existence when creating a tree from an index](https://github.com/libgit2/libgit2/pull/4840) +- [Ninja build](https://github.com/libgit2/libgit2/pull/4841) +- [docs: fix transparent/opaque confusion in the conventions file](https://github.com/libgit2/libgit2/pull/4853) +- [Configuration variables can appear on the same line as the section header](https://github.com/libgit2/libgit2/pull/4819) +- [path: export the dotgit-checking functions](https://github.com/libgit2/libgit2/pull/4849) +- [cmake: correct comment from libssh to libssh2](https://github.com/libgit2/libgit2/pull/4850) +- [Object parsing fuzzer](https://github.com/libgit2/libgit2/pull/4845) +- [config: Port config_file_fuzzer to the new in-memory backend.](https://github.com/libgit2/libgit2/pull/4842) +- [Add some more tests for git_futils_rmdir_r and some cleanup](https://github.com/libgit2/libgit2/pull/4828) +- [diff_stats: use git's formatting of renames with common directories](https://github.com/libgit2/libgit2/pull/4830) +- [ignore unsupported http authentication contexts](https://github.com/libgit2/libgit2/pull/4839) +- [submodule: ignore path and url attributes if they look like options](https://github.com/libgit2/libgit2/pull/4837) +- [Smart packet security fixes](https://github.com/libgit2/libgit2/pull/4836) +- [config_file: properly ignore includes without "path" value](https://github.com/libgit2/libgit2/pull/4832) +- [int-conversion](https://github.com/libgit2/libgit2/pull/4831) +- [cmake: enable new quoted argument policy CMP0054](https://github.com/libgit2/libgit2/pull/4829) +- [fix check if blob is uninteresting when inserting tree to packbuilder](https://github.com/libgit2/libgit2/pull/4824) +- [Documentation fixups](https://github.com/libgit2/libgit2/pull/4827) +- [CI: refactoring](https://github.com/libgit2/libgit2/pull/4812) +- [In-memory configuration](https://github.com/libgit2/libgit2/pull/4767) +- [Some warnings](https://github.com/libgit2/libgit2/pull/4784) +- [index: release the snapshot instead of freeing the index](https://github.com/libgit2/libgit2/pull/4803) +- [online::clone: free url and username before resetting](https://github.com/libgit2/libgit2/pull/4816) +- [git_remote_prune to be O(n * logn)](https://github.com/libgit2/libgit2/pull/4794) +- [Rename "VSTS" to "Azure DevOps" and "Azure Pipelines"](https://github.com/libgit2/libgit2/pull/4813) +- [cmake: enable -Wformat and -Wformat-security](https://github.com/libgit2/libgit2/pull/4810) +- [Fix revwalk limiting regression](https://github.com/libgit2/libgit2/pull/4809) +- [path validation: `char` is not signed by default.](https://github.com/libgit2/libgit2/pull/4805) +- [revwalk: refer the sorting modes more to git's options](https://github.com/libgit2/libgit2/pull/4811) +- [Clar XML output redux](https://github.com/libgit2/libgit2/pull/4778) +- [remote: store the connection data in a private struct](https://github.com/libgit2/libgit2/pull/4785) +- [docs: clarify and include licenses of dependencies](https://github.com/libgit2/libgit2/pull/4789) +- [config_file: fix quadratic behaviour when adding config multivars](https://github.com/libgit2/libgit2/pull/4799) +- [config: Fix a leak parsing multi-line config entries](https://github.com/libgit2/libgit2/pull/4792) +- [Prevent heap-buffer-overflow](https://github.com/libgit2/libgit2/pull/4797) +- [ci: remove travis](https://github.com/libgit2/libgit2/pull/4790) +- [Update VSTS YAML files with the latest syntax](https://github.com/libgit2/libgit2/pull/4791) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/4788) +- [config: convert unbounded recursion into a loop](https://github.com/libgit2/libgit2/pull/4781) +- [Document giterr_last() use only after error. #4772](https://github.com/libgit2/libgit2/pull/4773) +- [util: make the qsort_r check work on macOS](https://github.com/libgit2/libgit2/pull/4765) +- [fuzzer: update for indexer changes](https://github.com/libgit2/libgit2/pull/4782) +- [tree: accept null ids in existing trees when updating](https://github.com/libgit2/libgit2/pull/4727) +- [Pack file verification](https://github.com/libgit2/libgit2/pull/4374) +- [cmake: detect and use libc-provided iconv](https://github.com/libgit2/libgit2/pull/4777) +- [Coverity flavored clang analyzer fixes](https://github.com/libgit2/libgit2/pull/4774) +- [tests: verify adding index conflicts with invalid filemodes fails](https://github.com/libgit2/libgit2/pull/4776) +- [worktree: unlock should return 1 when the worktree isn't locked](https://github.com/libgit2/libgit2/pull/4769) +- [Add a fuzzer for config files](https://github.com/libgit2/libgit2/pull/4752) +- [Fix 'invalid packet line' for ng packets containing errors](https://github.com/libgit2/libgit2/pull/4763) +- [Fix leak in index.c](https://github.com/libgit2/libgit2/pull/4768) +- [threads::diff: use separate git_repository objects](https://github.com/libgit2/libgit2/pull/4754) +- [travis: remove Coverity cron job](https://github.com/libgit2/libgit2/pull/4766) +- [parse: Do not initialize the content in context to NULL](https://github.com/libgit2/libgit2/pull/4749) +- [config_file: Don't crash on options without a section](https://github.com/libgit2/libgit2/pull/4750) +- [ci: Correct the status code check so Coverity doesn't force-fail Travis](https://github.com/libgit2/libgit2/pull/4764) +- [ci: remove appveyor](https://github.com/libgit2/libgit2/pull/4760) +- [diff: fix OOM on AIX when finding similar deltas in empty diff](https://github.com/libgit2/libgit2/pull/4761) +- [travis: do not execute Coverity analysis for all cron jobs](https://github.com/libgit2/libgit2/pull/4755) +- [ci: enable compilation with "-Werror"](https://github.com/libgit2/libgit2/pull/4759) +- [smart_pkt: fix potential OOB-read when processing ng packet](https://github.com/libgit2/libgit2/pull/4758) +- [Fix a double-free in config parsing](https://github.com/libgit2/libgit2/pull/4751) +- [Fuzzers](https://github.com/libgit2/libgit2/pull/4728) +- [ci: run VSTS builds on master and maint branches](https://github.com/libgit2/libgit2/pull/4746) +- [Windows: default credentials / fallback credential handling](https://github.com/libgit2/libgit2/pull/4743) +- [ci: add VSTS build badge to README](https://github.com/libgit2/libgit2/pull/4745) +- [ci: set PKG_CONFIG_PATH for travis](https://github.com/libgit2/libgit2/pull/4744) +- [CI: Refactor and introduce VSTS builds](https://github.com/libgit2/libgit2/pull/4723) +- [revwalk: remove tautologic condition for hiding a commit](https://github.com/libgit2/libgit2/pull/4742) +- [winhttp: retry erroneously failing requests](https://github.com/libgit2/libgit2/pull/4731) +- [Add a configurable limit to the max pack size that will be indexed](https://github.com/libgit2/libgit2/pull/4721) +- [mbedtls: remove unused variable "cacert"](https://github.com/libgit2/libgit2/pull/4739) +- [Squash some leaks](https://github.com/libgit2/libgit2/pull/4732) +- [Add a checkout example](https://github.com/libgit2/libgit2/pull/4692) +- [Assorted Coverity fixes](https://github.com/libgit2/libgit2/pull/4702) +- [Remove GIT_PKT_PACK entirely](https://github.com/libgit2/libgit2/pull/4704) +- [ ignore: improve `git_ignore_path_is_ignored` description Git analogy](https://github.com/libgit2/libgit2/pull/4722) +- [alloc: don't overwrite allocator during init if set](https://github.com/libgit2/libgit2/pull/4724) +- [C90 standard compliance](https://github.com/libgit2/libgit2/pull/4700) +- [Delta OOB access](https://github.com/libgit2/libgit2/pull/4719) +- [Release v0.27.3](https://github.com/libgit2/libgit2/pull/4717) +- [streams: report OpenSSL errors if global init fails](https://github.com/libgit2/libgit2/pull/4710) +- [patch_parse: populate line numbers while parsing diffs](https://github.com/libgit2/libgit2/pull/4687) +- [Fix git_worktree_validate failing on bare repositories](https://github.com/libgit2/libgit2/pull/4686) +- [git_refspec_transform: Handle NULL dst](https://github.com/libgit2/libgit2/pull/4699) +- [Add a "dirty" state to the index when it has unsaved changes](https://github.com/libgit2/libgit2/pull/4536) +- [refspec: rename `git_refspec__free` to `git_refspec__dispose`](https://github.com/libgit2/libgit2/pull/4709) +- [streams: openssl: Handle error in SSL_CTX_new](https://github.com/libgit2/libgit2/pull/4701) +- [refspec: add public parsing api](https://github.com/libgit2/libgit2/pull/4519) +- [Fix interaction between limited flag and sorting over resets](https://github.com/libgit2/libgit2/pull/4688) +- [deps: fix implicit fallthrough warning in http-parser](https://github.com/libgit2/libgit2/pull/4691) +- [Fix assorted leaks found via fuzzing](https://github.com/libgit2/libgit2/pull/4698) +- [Fix type confusion in git_smart__connect](https://github.com/libgit2/libgit2/pull/4695) +- [Verify ref_pkt's are long enough](https://github.com/libgit2/libgit2/pull/4696) +- [Config parser cleanups](https://github.com/libgit2/libgit2/pull/4411) +- [Fix last references to deprecated git_buf_free](https://github.com/libgit2/libgit2/pull/4685) +- [revwalk: avoid walking the entire history when output is unsorted](https://github.com/libgit2/libgit2/pull/4606) +- [Add mailmap support.](https://github.com/libgit2/libgit2/pull/4586) +- [tree: remove unused functions](https://github.com/libgit2/libgit2/pull/4683) +- [Link `mbedTLS` libraries in when `SHA1_BACKEND` == "mbedTLS"](https://github.com/libgit2/libgit2/pull/4678) +- [editorconfig: allow trailing whitespace in markdown](https://github.com/libgit2/libgit2/pull/4676) +- [docs: fix statement about tab width](https://github.com/libgit2/libgit2/pull/4681) +- [diff: fix enum value being out of allowed range](https://github.com/libgit2/libgit2/pull/4680) +- [pack: rename `git_packfile_stream_free`](https://github.com/libgit2/libgit2/pull/4436) +- [Stop leaking the memory](https://github.com/libgit2/libgit2/pull/4677) +- [Bugfix release v0.27.2](https://github.com/libgit2/libgit2/pull/4632) +- [Fix stash save bug with fast path index check](https://github.com/libgit2/libgit2/pull/4668) +- [path: unify `git_path_is_*` APIs](https://github.com/libgit2/libgit2/pull/4662) +- [Fix negative gitignore rules with leading directories ](https://github.com/libgit2/libgit2/pull/4670) +- [Custom memory allocators](https://github.com/libgit2/libgit2/pull/4576) +- [index: Fix alignment issues in write_disk_entry()](https://github.com/libgit2/libgit2/pull/4655) +- [travis: war on leaks](https://github.com/libgit2/libgit2/pull/4558) +- [refdb_fs: fix regression: failure when globbing for non-existant references](https://github.com/libgit2/libgit2/pull/4665) +- [tests: submodule: do not rely on config iteration order](https://github.com/libgit2/libgit2/pull/4673) +- [Detect duplicated submodules for the same path](https://github.com/libgit2/libgit2/pull/4641) +- [Fix docurium missing includes](https://github.com/libgit2/libgit2/pull/4530) +- [github: update issue template](https://github.com/libgit2/libgit2/pull/4627) +- [streams: openssl: add missing check on OPENSSL_LEGACY_API](https://github.com/libgit2/libgit2/pull/4661) +- [mbedtls: don't require mbedtls from our pkgconfig file](https://github.com/libgit2/libgit2/pull/4656) +- [Fixes for CVE 2018-11235](https://github.com/libgit2/libgit2/pull/4660) +- [Backport fixes for CVE 2018-11235](https://github.com/libgit2/libgit2/pull/4659) +- [Added note about Windows junction points to the differences from git document](https://github.com/libgit2/libgit2/pull/4653) +- [cmake: resolve libraries found by pkg-config ](https://github.com/libgit2/libgit2/pull/4642) +- [refdb_fs: enhance performance of globbing](https://github.com/libgit2/libgit2/pull/4629) +- [global: adjust init count under lock](https://github.com/libgit2/libgit2/pull/4645) +- [Fix GCC 8.1 warnings](https://github.com/libgit2/libgit2/pull/4646) +- [Worktrees can be made from bare repositories](https://github.com/libgit2/libgit2/pull/4630) +- [docs: add documentation to state differences from the git cli](https://github.com/libgit2/libgit2/pull/4605) +- [Sanitize the hunk header to ensure it contains UTF-8 valid data](https://github.com/libgit2/libgit2/pull/4542) +- [examples: ls-files: add ls-files to list paths in the index](https://github.com/libgit2/libgit2/pull/4380) +- [OpenSSL legacy API cleanups](https://github.com/libgit2/libgit2/pull/4608) +- [worktree: add functions to get name and path](https://github.com/libgit2/libgit2/pull/4640) +- [Fix deletion of unrelated branch on worktree](https://github.com/libgit2/libgit2/pull/4633) +- [mbedTLS support](https://github.com/libgit2/libgit2/pull/4173) +- [Configuration entry iteration in order](https://github.com/libgit2/libgit2/pull/4525) +- [blame_git: fix coalescing step never being executed](https://github.com/libgit2/libgit2/pull/4580) +- [Fix leaks in master](https://github.com/libgit2/libgit2/pull/4636) +- [Leak fixes for v0.27.1](https://github.com/libgit2/libgit2/pull/4635) +- [worktree: Read worktree specific reflog for HEAD](https://github.com/libgit2/libgit2/pull/4577) +- [fixed stack smashing due to wrong size of struct stat on the stack](https://github.com/libgit2/libgit2/pull/4631) +- [scripts: add backporting script](https://github.com/libgit2/libgit2/pull/4476) +- [worktree: add ability to create worktree with pre-existing branch](https://github.com/libgit2/libgit2/pull/4524) +- [refs: preserve the owning refdb when duping reference](https://github.com/libgit2/libgit2/pull/4618) +- [Submodules-API should report .gitmodules parse errors instead of ignoring them](https://github.com/libgit2/libgit2/pull/4522) +- [Typedef git_pkt_type and clarify recv_pkt return type](https://github.com/libgit2/libgit2/pull/4514) +- [online::clone: validate user:pass in HTTP_PROXY](https://github.com/libgit2/libgit2/pull/4556) +- [ transports: ssh: disconnect session before freeing it ](https://github.com/libgit2/libgit2/pull/4596) +- [revwalk: fix uninteresting revs sometimes not limiting graphwalk](https://github.com/libgit2/libgit2/pull/4622) +- [attr_file: fix handling of directory patterns with trailing spaces](https://github.com/libgit2/libgit2/pull/4614) +- [transports: local: fix assert when fetching into repo with symrefs](https://github.com/libgit2/libgit2/pull/4613) +- [remote/proxy: fix git_transport_certificate_check_db description](https://github.com/libgit2/libgit2/pull/4597) +- [Flag options in describe.h as being optional](https://github.com/libgit2/libgit2/pull/4587) +- [diff: Add missing GIT_DELTA_TYPECHANGE -> 'T' mapping.](https://github.com/libgit2/libgit2/pull/4611) +- [appveyor: fix typo in registry key to disable DHE](https://github.com/libgit2/libgit2/pull/4609) +- [Fix build with LibreSSL 2.7](https://github.com/libgit2/libgit2/pull/4607) +- [appveyor: workaround for intermittent test failures](https://github.com/libgit2/libgit2/pull/4603) +- [sha1dc: update to fix errors with endianess](https://github.com/libgit2/libgit2/pull/4601) +- [submodule: check index for path and prefix before adding submodule](https://github.com/libgit2/libgit2/pull/4378) +- [odb: mempack: fix leaking objects when freeing mempacks](https://github.com/libgit2/libgit2/pull/4602) +- [types: remove unused git_merge_result](https://github.com/libgit2/libgit2/pull/4598) +- [checkout: change default strategy to SAFE](https://github.com/libgit2/libgit2/pull/4531) +- [Add myself to git.git-authors](https://github.com/libgit2/libgit2/pull/4570) + + +## v0.25.0-alpha.16 [(2019-07-23)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.16) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.15...v0.25.0-alpha.16) + +#### Summary of changes +- Adds support for Node 12 +- Updates lodash dependency to address security notice +- Expose Tree.prototype.createUpdated(repo, numUpdates, updates) +- Bumps libgit2 + - Fixes gitignore issue with pattern negation + - Remote.list now gets the correct list of remotes if remotes are changed by external process + +#### Merged PRs into NodeGit +- [Bump libgit2 #1705](https://github.com/nodegit/nodegit/pull/1705) +- [Fix Tree#createUpdated #1704](https://github.com/nodegit/nodegit/pull/1704) +- [Fix failing tests on CI #1703](https://github.com/nodegit/nodegit/pull/1703) +- [Audit lodash and fix package-lock.json #1702](https://github.com/nodegit/nodegit/pull/1702) +- [Implement support for Node 12 #1696](https://github.com/nodegit/nodegit/pull/1696) + +#### Merged PRs into LibGit2 +- [config_file: refresh when creating an iterator #5181](https://github.com/libgit2/libgit2/pull/5181) +- [azure: drop powershell #5141](https://github.com/libgit2/libgit2/pull/5141) +- [fuzzer: use futils instead of fileops #5180](https://github.com/libgit2/libgit2/pull/5180) +- [w32: fix unlinking of directory symlinks #5151](https://github.com/libgit2/libgit2/pull/5151) +- [patch_parse: fix segfault due to line containing static contents #5179](https://github.com/libgit2/libgit2/pull/5179) +- [ignore: fix determining whether a shorter pattern negates another #5173](https://github.com/libgit2/libgit2/pull/5173) +- [patch_parse: handle missing newline indicator in old file #5159](https://github.com/libgit2/libgit2/pull/5159) +- [patch_parse: do not depend on parsed buffer's lifetime #5158](https://github.com/libgit2/libgit2/pull/5158) +- [sha1: fix compilation of WinHTTP backend #5174](https://github.com/libgit2/libgit2/pull/5174) +- [repository: do not initialize HEAD if it's provided by templates #5176](https://github.com/libgit2/libgit2/pull/5176) +- [configuration: cvar -> configmap #5138](https://github.com/libgit2/libgit2/pull/5138) +- [Evict cache items more efficiently #5172](https://github.com/libgit2/libgit2/pull/5172) +- [clar: fix suite count #5175](https://github.com/libgit2/libgit2/pull/5175) +- [Ignore VS2017 specific files and folders #5163](https://github.com/libgit2/libgit2/pull/5163) +- [gitattributes: ignore macros defined in subdirectories #5156](https://github.com/libgit2/libgit2/pull/5156) +- [clar: correctly account for "data" suites when counting #5168](https://github.com/libgit2/libgit2/pull/5168) +- [Allocate memory more efficiently when packing objects #5170](https://github.com/libgit2/libgit2/pull/5170) +- [fileops: fix creation of directory in filesystem root #5131](https://github.com/libgit2/libgit2/pull/5131) +- [win32: fix fuzzers and have CI build them #5160](https://github.com/libgit2/libgit2/pull/5160) +- [Config parser separation #5134](https://github.com/libgit2/libgit2/pull/5134) +- [config_file: implement stat cache to avoid repeated rehashing #5132](https://github.com/libgit2/libgit2/pull/5132) +- [ci: build with ENABLE_WERROR on Windows #5143](https://github.com/libgit2/libgit2/pull/5143) +- [Fix Regression: attr: Correctly load system attr file (on Windows) #5152](https://github.com/libgit2/libgit2/pull/5152) +- [hash: fix missing error return on production builds #5145](https://github.com/libgit2/libgit2/pull/5145) +- [Resolve static check warnings in example code #5142](https://github.com/libgit2/libgit2/pull/5142) +- [Multiple hash algorithms #4438](https://github.com/libgit2/libgit2/pull/4438) +- [More documentation #5128](https://github.com/libgit2/libgit2/pull/5128) +- [Incomplete commondir support #4967](https://github.com/libgit2/libgit2/pull/4967) +- [Remove warnings #5078](https://github.com/libgit2/libgit2/pull/5078) +- [Re-run flaky tests #5140](https://github.com/libgit2/libgit2/pull/5140) + + +## v0.25.0-alpha.15 [(2019-07-15)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.15) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.14...v0.25.0-alpha.15) + +#### Summary of changes +- Removed NSEC optimization due to performance regressions in repositories that did not use NSEC optimization cloned via NodeGit. + +#### Merged PRs into NodeGit +- [Remove NSEC #1699](https://github.com/nodegit/nodegit/pull/1699) + + +## v0.25.0-alpha.14 [(2019-07-01)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.14) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.13...v0.25.0-alpha.14) + +#### Summary of changes +- Always use builtin regex for linux for portability + +#### Merged PRs into NodeGit +- [Use builtin regex library for linux for better portability #1693](https://github.com/nodegit/nodegit/pull/1693) +- [Remove pcre-config from binding.gyp #1694](https://github.com/nodegit/nodegit/pull/1694) + +## v0.25.0-alpha.13 [(2019-06-26)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.13) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.12...v0.25.0-alpha.13) + +#### Summary of changes +- Turn on GIT_USE_NSEC on all platforms +- Use Iconv on OSX for better internationalization support. +- Bump libgit2 to bring in: + - NTLM proxy support + - Negotiate/Kerberos proxy support + - Various git config fixes + - Various git ignore fixes + - Various libgit2 performance improvements + - Windows/Linux now use PCRE for regex, OSX uses regcomp_l, this should address collation issues in diffing +- Fixed bug with Repository.prototype.refreshReferences dying on corrupted reference. We now ignore corrupted references + +#### Merged PRs into NodeGit +- [refresh_references.cc: skip refs that can't be directly resolved #1689](https://github.com/nodegit/nodegit/pull/1689) +- [Bump libgit2 to fork of latest master #1690](https://github.com/nodegit/nodegit/pull/1690) + +#### Merged PRs into LibGit2 +- [errors: use lowercase](https://github.com/libgit2/libgit2/pull/5137) +- [largefile tests: only write 2GB on 32-bit platforms](https://github.com/libgit2/libgit2/pull/5136) +- [Fix broken link in README](https://github.com/libgit2/libgit2/pull/5129) +- [net: remove unused `git_headlist_cb`](https://github.com/libgit2/libgit2/pull/5122) +- [cmake: default NTLM client to off if no HTTPS support](https://github.com/libgit2/libgit2/pull/5124) +- [attr: rename constants and macros for consistency](https://github.com/libgit2/libgit2/pull/5119) +- [Change API instances of `fromnoun` to `from_noun` (with an underscore)](https://github.com/libgit2/libgit2/pull/5117) +- [object: rename git_object__size to git_object_size](https://github.com/libgit2/libgit2/pull/5118) +- [Replace fnmatch with wildmatch](https://github.com/libgit2/libgit2/pull/5110) +- [Documentation fixes](https://github.com/libgit2/libgit2/pull/5111) +- [Removal of `p_fallocate`](https://github.com/libgit2/libgit2/pull/5114) +- [Modularize our TLS & hash detection](https://github.com/libgit2/libgit2/pull/5055) +- [tests: merge::analysis: use test variants to avoid duplicated test suites](https://github.com/libgit2/libgit2/pull/5109) +- [Rename options initialization functions](https://github.com/libgit2/libgit2/pull/5101) +- [deps: ntlmclient: disable implicit fallthrough warnings](https://github.com/libgit2/libgit2/pull/5112) +- [gitignore with escapes](https://github.com/libgit2/libgit2/pull/5097) +- [Handle URLs with a colon after host but no port](https://github.com/libgit2/libgit2/pull/5108) +- [Merge analysis support for bare repos](https://github.com/libgit2/libgit2/pull/5022) +- [Add memleak check docs](https://github.com/libgit2/libgit2/pull/5104) +- [Data-driven tests](https://github.com/libgit2/libgit2/pull/5098) +- [sha1dc: update to fix endianess issues on AIX/HP-UX](https://github.com/libgit2/libgit2/pull/5107) +- [Add NTLM support for HTTP(s) servers and proxies](https://github.com/libgit2/libgit2/pull/5052) +- [Callback type names should be suffixed with `_cb`](https://github.com/libgit2/libgit2/pull/5102) +- [tests: checkout: fix symlink.git being created outside of sandbox](https://github.com/libgit2/libgit2/pull/5099) +- [ignore: handle escaped trailing whitespace](https://github.com/libgit2/libgit2/pull/5095) +- [Ignore: only treat one leading slash as a root identifier](https://github.com/libgit2/libgit2/pull/5074) +- [online tests: use gitlab for auth failures](https://github.com/libgit2/libgit2/pull/5094) +- [Ignore files: don't ignore whitespace](https://github.com/libgit2/libgit2/pull/5076) +- [cache: fix cache eviction using deallocated key](https://github.com/libgit2/libgit2/pull/5088) +- [SECURITY.md: split out security-relevant bits from readme](https://github.com/libgit2/libgit2/pull/5085) +- [Restore NetBSD support](https://github.com/libgit2/libgit2/pull/5086) +- [repository: fix garbage return value](https://github.com/libgit2/libgit2/pull/5084) +- [cmake: disable fallthrough warnings for PCRE](https://github.com/libgit2/libgit2/pull/5083) +- [Configuration parsing: validate section headers with quotes](https://github.com/libgit2/libgit2/pull/5073) +- [Loosen restriction on wildcard "*" refspecs](https://github.com/libgit2/libgit2/pull/5060) +- [Use PCRE for our fallback regex engine when regcomp_l is unavailable](https://github.com/libgit2/libgit2/pull/4935) +- [Remote URL last-chance resolution](https://github.com/libgit2/libgit2/pull/5062) +- [Skip UTF8 BOM in ignore files](https://github.com/libgit2/libgit2/pull/5075) +- [We've already added `ZLIB_LIBRARIES` to `LIBGIT2_LIBS` so don't also add the `z` library](https://github.com/libgit2/libgit2/pull/5080) +- [Define SYMBOLIC_LINK_FLAG_DIRECTORY if required](https://github.com/libgit2/libgit2/pull/5077) +- [Support symlinks for directories in win32](https://github.com/libgit2/libgit2/pull/5065) +- [rebase: orig_head and onto accessors](https://github.com/libgit2/libgit2/pull/5057) +- [cmake: correctly detect if system provides `regcomp`](https://github.com/libgit2/libgit2/pull/5063) +- [Correctly write to missing locked global config](https://github.com/libgit2/libgit2/pull/5023) +- [[RFC] util: introduce GIT_DOWNCAST macro](https://github.com/libgit2/libgit2/pull/4561) +- [examples: implement SSH authentication](https://github.com/libgit2/libgit2/pull/5051) +- [git_repository_init: stop traversing at windows root](https://github.com/libgit2/libgit2/pull/5050) +- [config_file: check result of git_array_alloc](https://github.com/libgit2/libgit2/pull/5053) +- [patch_parse.c: Handle CRLF in parse_header_start](https://github.com/libgit2/libgit2/pull/5027) +- [fix typo](https://github.com/libgit2/libgit2/pull/5045) +- [sha1: don't inline `git_hash_global_init` for win32](https://github.com/libgit2/libgit2/pull/5039) +- [ignore: treat paths with trailing "/" as directories](https://github.com/libgit2/libgit2/pull/5040) +- [Test that largefiles can be read through the tree API](https://github.com/libgit2/libgit2/pull/4874) +- [Tests for symlinked user config](https://github.com/libgit2/libgit2/pull/5034) +- [patch_parse: fix parsing addition/deletion of file with space](https://github.com/libgit2/libgit2/pull/5035) +- [Optimize string comparisons](https://github.com/libgit2/libgit2/pull/5018) +- [Negation of subdir ignore causes other subdirs to be unignored](https://github.com/libgit2/libgit2/pull/5020) +- [xdiff: fix typo](https://github.com/libgit2/libgit2/pull/5024) +- [docs: clarify relation of safe and forced checkout strategy](https://github.com/libgit2/libgit2/pull/5032) +- [Each hash implementation should define `git_hash_global_init`](https://github.com/libgit2/libgit2/pull/5026) +- [[Doc] Update URL to git2-rs](https://github.com/libgit2/libgit2/pull/5012) +- [remote: Rename git_remote_completion_type to _t](https://github.com/libgit2/libgit2/pull/5008) +- [odb: provide a free function for custom backends](https://github.com/libgit2/libgit2/pull/5005) +- [Have git_branch_lookup accept GIT_BRANCH_ALL](https://github.com/libgit2/libgit2/pull/5000) +- [Rename git_transfer_progress to git_indexer_progress](https://github.com/libgit2/libgit2/pull/4997) +- [High-level map APIs](https://github.com/libgit2/libgit2/pull/4901) +- [refdb_fs: fix loose/packed refs lookup racing with repacks](https://github.com/libgit2/libgit2/pull/4984) +- [Allocator restructuring](https://github.com/libgit2/libgit2/pull/4998) +- [cache: fix misnaming of `git_cache_free`](https://github.com/libgit2/libgit2/pull/4992) +- [examples: produce single cgit2 binary](https://github.com/libgit2/libgit2/pull/4956) +- [Remove public 'inttypes.h' header](https://github.com/libgit2/libgit2/pull/4991) +- [Prevent reading out of bounds memory](https://github.com/libgit2/libgit2/pull/4996) +- [Fix a memory leak in odb_otype_fast()](https://github.com/libgit2/libgit2/pull/4987) +- [Make stdalloc__reallocarray call stdalloc__realloc](https://github.com/libgit2/libgit2/pull/4986) +- [Remove `git_time_monotonic`](https://github.com/libgit2/libgit2/pull/4990) +- [Fix a _very_ improbable memory leak in git_odb_new()](https://github.com/libgit2/libgit2/pull/4988) +- [ci: publish documentation on merge](https://github.com/libgit2/libgit2/pull/4989) +- [Enable creation of worktree from bare repo's default branch](https://github.com/libgit2/libgit2/pull/4982) +- [Allow bypassing check for '.keep' file](https://github.com/libgit2/libgit2/pull/4965) +- [Release v0.28.1](https://github.com/libgit2/libgit2/pull/4983) + + + +## v0.25.0-alpha.12 [(2019-06-03)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.12) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.11...v0.25.0-alpha.12) + +#### Summary of changes +- Fix bug in Repository.prototype.refreshReferences where new remote references from a new remote added/fetched on a separte repo instance do not show up in the result. +- Fixed a prototype problem with cherrypick, merge, and other collections that have a function at their root. call, apply, and bind should now be on NodeGit.Cherrypick. +- Bumped libssh2 to resolve security notice. + +#### Merged PRs into NodeGit +- [Bump libssh2 to 1.8.2 and fix some npm audit warnings #1678](https://github.com/nodegit/nodegit/pull/1678) +- [Root functions should keep their function prototypes correctly #1681](https://github.com/nodegit/nodegit/pull/1681) +- [refresh_references.cc: bust LibGit2 remote list cache by reading config #1685](https://github.com/nodegit/nodegit/pull/1685) + + +## v0.25.0-alpha.11 [(2019-05-20)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.11) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.10...v0.25.0-alpha.11) + +#### Summary of changes +- Improve speed and correctness of fileHistoryWalk. The API should not have changed; however, when the end of the walk has been reached, `reachedEndOfHistory` will be specified on the resulting array. + +#### Merged PRs into NodeGit +- [Implement faster file history walk #1676](https://github.com/nodegit/nodegit/pull/1676) + + +## v0.25.0-alpha.10 [(2019-05-03)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.10) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.9...v0.25.0-alpha.10) + +#### Summary of changes +- Drops support for Ubuntu 14 after EOL +- Fixes openssl prebuilt downloads for electron builds +- Fixes commits retrieved from Commit.prototype.parent +- *DEPRECATION* Support signing commits in Repository.prototype.mergeBranches. The last parameter `processMergeMessageCallback` is now deprecated, but will continue to work. Use the options object instead, which will contain the `processMergeMessageCallback`, as well as the `signingCb`. +- Bump Node-Gyp to 4.0.0 to fix tar security vulnerability +- *BREAKING* `getRemotes` no longer returns remote names, it now returns remote objects directly. Use `getRemoteNames` to get a list of remote names. +- Optimized a set of routines in NodeGit. These methods as written in Javascript require hundreds or thousands of requests to async workers to retrieve data. We've batched these requests and performed them on a single async worker. There are now native implementations of the following: + - Repository.prototype.getReferences: Retrieves all references on async worker. + - Repository.prototype.getRemotes: Retrieves all remotes on async worker. + - Repository.prototype.getSubmodules: Retrieves all submodules on async worker. + - Repository.prototype.refreshReferences: Open sourced function from GitKraken. Grabs a lot of information about references on an async worker. + - Revwalk.prototype.commitWalk: Retrieves up to N commits from a revwalk on an async worker. + +#### Merged PRs into NodeGit +- [EOL for Node 6 and Ubuntu 14.04 #1649](https://github.com/nodegit/nodegit/pull/1649) +- [Ensures that commits from parent(*) has a repository #1658](https://github.com/nodegit/nodegit/pull/1658) +- [Update openssl conan distributions #1663](https://github.com/nodegit/nodegit/pull/1663) +- [Support signing in Repository#mergeBranches #1664](https://github.com/nodegit/nodegit/pull/1664) +- [Dependency upgrade node-gyp upgraded to 4.0.0 #1672](https://github.com/nodegit/nodegit/pull/1672) +- [Add additional getters to streamline information gathering (breaking change) #1671](https://github.com/nodegit/nodegit/pull/1671) + + + +## v0.25.0-alpha.9 [(2019-03-04)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.9) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.8...v0.25.0-alpha.9) + +#### Summary of changes +- Removed access to the diff_so_far param in git_diff_notify_cb and git_diff_progress_cb +- Changed FilterSource.prototype.repo to async to prevent segfaults on filters that run during Submodule.status +- Clean up deprecation messages to inform users of what was deprecated, not just what users should switch to +- When installing on a machine that has yarn and does not have npm, the preinstall script should succeed now +- ceiling_dirs is now an optional parameter to Repository.discover + +#### Merged PRs into NodeGit +- [Clean up some dangerous memory accesses in callbacks #1642](https://github.com/nodegit/nodegit/pull/1642) +- [Output the item that was deprecated when giving deprecation notice #1643](https://github.com/nodegit/nodegit/pull/1643) +- [Don't fail yarn installs when we can't find npm #1644](https://github.com/nodegit/nodegit/pull/1644) +- [`ceiling_dirs` parameter in `Repository.discover` is optional #1245](https://github.com/nodegit/nodegit/pull/1245) + + +## v0.25.0-alpha.8 [(2019-02-27)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.8) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.7...v0.25.0-alpha.8) + +#### Summary of changes +- Fixed segfault in NodeGit.Merge.analysis and NodeGit.Merge.analysisForRef + +#### Merged PRs into NodeGit +- [Add missing `shouldAlloc` declarations for git_merge_analysis* functions #1641](https://github.com/nodegit/nodegit/pull/1641) + + +## v0.25.0-alpha.7 [(2019-02-20)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.7) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.6...v0.25.0-alpha.7) + +#### Summary of changes +- Fixed bug where repeated uses of extractSignature would fail because of the use of regex.prototype.match +- Added support for building on IBM i (PASE) machines +- Fixed bug where signingCb in rebases would not return error codes to LibGit2 if the signingCb threw or rejected +- Exposed AnnotatedCommit methods: + - AnnotatedCommit.prototype.ref +- Exposed Apply methods: + - Apply.apply applies a diff to the repository + - Apply.toTree applies a diff to a tree +- Exposed Config methods: + - Config.prototype.deleteEntry + - Config.prototype.deleteMultivar + - Config.prototype.getBool + - Config.prototype.getInt32 + - Config.prototype.getInt64 + - Config.prototype.setMultivar + - Config.prototype.snapshot +- Exposed ConfigIterator with methods: + - ConfigIterator.create + - ConfigIterator.createGlob + - ConfigIterator.createMultivar + - ConfigIterator.prototype.next +- Exposed Merge methods: + - Merge.analysis + - Merge.analysisForRef +- Expose Remote methods: + - Remote.createWithOpts + +#### Merged PRs into NodeGit +- [Fix regex state causing subsequent runs of Tag.extractSignature to fail #1630](https://github.com/nodegit/nodegit/pull/1630) +- [Update LibGit2 docs to v0.28.0 #1631](https://github.com/nodegit/nodegit/pull/1631) +- [Add support for building on IBM i (PASE) #1634](https://github.com/nodegit/nodegit/pull/1634) +- [Expose more config methods #1635](https://github.com/nodegit/nodegit/pull/1635) +- [Catch errors and pass them to libgit2 as error codes in rebase signingcb #1636](https://github.com/nodegit/nodegit/pull/1636) +- [Simplify check for IBM i operating system #1637](https://github.com/nodegit/nodegit/pull/1637) +- [Bump LibGit2 to fork of v0.28.1 #1638](https://github.com/nodegit/nodegit/pull/1638) + + +## v0.25.0-alpha.6 [(2019-02-14)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.6) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.5...v0.25.0-alpha.6) + +#### Summary of changes +- Bumped LibGit2 to v0.28.0. +- Fixed problem with continue rebase preventing users from skipping commits +- Fixed leak where struct/option types were leaking libgit2 pointers + +#### Merged PRs into NodeGit +- [We should clear the persistent cell in structs when they are destroyed #1629](https://github.com/nodegit/nodegit/pull/1629) +- [Fix "errorno" typo #1628](https://github.com/nodegit/nodegit/pull/1628) +- [Bump Libgit2 fork to v0.28.0 #1627](https://github.com/nodegit/nodegit/pull/1627) + + +## v0.25.0-alpha.5 [(2019-02-11)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.4...v0.25.0-alpha.5) + +#### Summary of changes +- Fixed builds for Electron 4 for real this time + +#### Merged PRs into NodeGit +- [Fix macOS and Windows Electron 4 builds #1626](https://github.com/nodegit/nodegit/pull/1626) + + +## v0.25.0-alpha.4 [(2019-02-08)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.3...v0.25.0-alpha.4) + +#### Summary of changes +- Fixed bug where signing the init commit failed due to being unable to update the `HEAD` ref. +- Changed `NodeGit.Signature.default` to async, because it actually ends up reading the config. +- Fixed bug where templates were not reporting errors for synchronous methods. It's a bit of a wide net, but in general, + it is now possible certain sync methods in NodeGit will begin failin that did not fail before. This is the correct + behavior. +- Switched `NodeGit.Oid.fromString`'s internal implementation from `git_oid_fromstr` to `git_oid_fromstrp` +- Fixed builds for Electron 4 +- Added `NodeGit.Reference.updateTerminal` + +#### Merged PRs into NodeGit +- [Fix non-existent / dangling refs cause Repository.prototype.createCommitWithSignature to fail #1624](https://github.com/nodegit/nodegit/pull/1624) +- [Handle new gyp information for electron builds #1623](https://github.com/nodegit/nodegit/pull/1623) + + +## v0.25.0-alpha.3 [(2019-02-05)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.2...v0.25.0-alpha.3) + +#### Summary of changes +- Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback + pattern for signing commits or tags should use the exact same callback type and with the same meaning. + `type SigningCallback = (content: string) => {| code: number, field?: string, signedData?: string |};` + If the code is `NodeGit.Error.CODE.OK` or 0, the operation will succeed and _at least_ signedData is expected to be filled out. + If the code is a negative number, except for `NodeGit.Error.CODE.PASSTHROUGH`, the signing operation will fail. + If the code is `NodeGit.Error.CODE.PASSTHROUGH`, the operation will continue without signing the object. + +#### Merged PRs into NodeGit +- [Use same API for signingCb in all places that can be crypto signed #1621](https://github.com/nodegit/nodegit/pull/1621) + + +## v0.25.0-alpha.2 [(2019-02-01)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.25.0-alpha.1...v0.25.0-alpha.2) + +#### Summary of changes +- Added RebaseOptions to repository.prototype.rebaseContinue + +#### Merged PRs into NodeGit +- [Breaking: Repository.prototype.continueRebase enhancements #1619](https://github.com/nodegit/nodegit/pull/1619) + + +## v0.25.0-alpha.1 [(2019-01-30)](https://github.com/nodegit/nodegit/releases/tag/v0.25.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.24.0...v0.25.0-alpha.1) + +#### Summary of changes +- Bump Libgit2 to preview of v0.28.0 +- Add signing support for commits and annotated tags +- Updated Signature.prototype.toString to optionally include timestamps +- [BREAKING] Converted Buf.prototype.set and Buf.prototype.grow from async to sync +- Added complete support for libgit2 types: + - git_index_name_entry + - git_index_reuc_entry + - git_mailmap +- Exposed git_path_is_gitfile +- Exposed git_tag_create_frombuffer + +#### Merged PRs into NodeGit +- [adds support for gpg commit signing (fixes #1018) #1448](https://github.com/nodegit/nodegit/pull/1448) +- [Add `updateRef` parameter to Repository#createCommitWithSignature #1610](https://github.com/nodegit/nodegit/pull/1610) +- [Documentation fixes. #1611](https://github.com/nodegit/nodegit/pull/1611) +- [Add Commit#amendWithSignature #1616](https://github.com/nodegit/nodegit/pull/1616) +- [Bump libgit2 to a preview of v0.28 #1615](https://github.com/nodegit/nodegit/pull/1615) +- [Fix issues with Commit#amendWithSignature #1617](https://github.com/nodegit/nodegit/pull/1617) +- [Marked Repository.createBlobFromBuffer as async #1614](https://github.com/nodegit/nodegit/pull/1614) +- [Add functionality for creating Tags with signatures and extracting signatures from Tags #1618](https://github.com/nodegit/nodegit/pull/1618) + + +## v0.24.0 [(2019-01-16)](https://github.com/nodegit/nodegit/releases/tag/v0.24.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.23.0...v0.24.0) + +#### Summary of changes +- Garbage collect most of the library. +- All free functions have been removed. The expectation is that they will be collected by the GC. +- All init options methods have been removed. They were never supposed to be exposed in the first place. +- Added support for performing history walks on directories. +- Fix various bugs that led to segfaults or incorrect behavior. +- Removed ssl and crypto dependency from non-electron builds. + +##### Removed methods +Mostly due to missing support anyway, please report anything you were using as an issue. + - NodeGit.Blob.createFromStreamCommit + - NodeGit.Branch.Iterator.prototype.new + - NodeGit.Config.initBackend + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Index.prototype.owner + - NodeGit.Note.iteratorNew + - NodeGit.Note.next + - NodeGit.Odb.prototype.addDiskAlternate + - NodeGit.Repository.prototype.configSnapshot + - NodeGit.Signature.prototype.dup + - NodeGit.Tag.foreach + - NodeGit.Transport.init + - NodeGit.Transport.sshWithPaths + - NodeGit.Transport.unregister + +##### Newly exposed methods: + - NodeGit.Config.prototype.getEntry + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.refresh + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Diff.prototype.isSortedIcase + - NodeGit.DiffStats.prototype.deletions + - NodeGit.DiffStats.prototype.filesChanged + - NodeGit.DiffStats.prototype.insertions + - NodeGit.DiffStats.prototype.toBuf + - NodeGit.Odb.hashfile + - NodeGit.Odb.prototype.readPrefix + - NodeGit.OidShorten.prototype.add + - NodeGit.OidShorten.create + - NodeGit.PathspecMatchList.prototype.diffEntry + - NodeGit.PathspecMatchList.prototype.entry + - NodeGit.PathspecMatchList.prototype.entrycount + - NodeGit.PathspecMatchList.prototype.failedEntry + - NodeGit.PathspecMatchList.prototype.failedEntryCount + +##### Newly exposed types + - NodeGit.DescribeFormatOptions + - NodeGit.DiffStats + - NodeGit.OidShorten + - NodeGit.PathspecMatchList + +#### Merged PRs into NodeGit +- [Garbage collection: Free mostly everything automatically #1570](https://github.com/nodegit/nodegit/pull/1570) +- [Fix typo in GitHub issue template #1586](https://github.com/nodegit/nodegit/pull/1586) +- [More suitable example about Signature #1582](https://github.com/nodegit/nodegit/pull/1582) +- [Add support for directories when using `fileHistoryWalk` #1583](https://github.com/nodegit/nodegit/pull/1583) +- [Add a test for Repository's getReferenceCommit #1601](https://github.com/nodegit/nodegit/pull/1601) +- [Check parameters before performing reset #1603](https://github.com/nodegit/nodegit/pull/1603) +- [Remove ssl and crypto dependency on non-electron builds #1600](https://github.com/nodegit/nodegit/pull/1600) +- [Clean up libssh2 configure step #1574](https://github.com/nodegit/nodegit/pull/1574) +- [Fix checkout bug in our fork of libgit2 #1609](https://github.com/nodegit/nodegit/pull/1609) +- [Fix segfault in NodeGit.Revert.revert #1605](https://github.com/nodegit/nodegit/pull/1605) + + +## v0.24.0-alpha.1 [(2018-10-25)](https://github.com/nodegit/nodegit/releases/tag/v0.24.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.23.0...v0.24.0-alpha.1) + +#### Summary of changes +- Garbage collect most of the library. +- All free functions have been removed. The expectation is that they will be collected by the GC. +- All init options methods have been removed. They were never supposed to be exposed in the first place. + +##### Removed methods +Mostly due to missing support anyway, please report anything you were using as an issue. + - NodeGit.Blob.createFromStreamCommit + - NodeGit.Branch.Iterator.prototype.new + - NodeGit.Config.initBackend + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Index.prototype.owner + - NodeGit.Note.iteratorNew + - NodeGit.Note.next + - NodeGit.Odb.prototype.addDiskAlternate + - NodeGit.Repository.prototype.configSnapshot + - NodeGit.Signature.prototype.dup + - NodeGit.Tag.foreach + - NodeGit.Transport.init + - NodeGit.Transport.sshWithPaths + - NodeGit.Transport.unregister + +##### Newly exposed methods: + - NodeGit.Config.prototype.getEntry + - NodeGit.Config.prototype.snapshot + - NodeGit.Config.prototype.refresh + - NodeGit.Config.prototype.setBool + - NodeGit.Config.prototype.setInt32 + - NodeGit.Config.prototype.setInt64 + - NodeGit.Diff.prototype.isSortedIcase + - NodeGit.DiffStats.prototype.deletions + - NodeGit.DiffStats.prototype.filesChanged + - NodeGit.DiffStats.prototype.insertions + - NodeGit.DiffStats.prototype.toBuf + - NodeGit.Odb.hashfile + - NodeGit.Odb.prototype.readPrefix + - NodeGit.OidShorten.prototype.add + - NodeGit.OidShorten.create + - NodeGit.PathspecMatchList.prototype.diffEntry + - NodeGit.PathspecMatchList.prototype.entry + - NodeGit.PathspecMatchList.prototype.entrycount + - NodeGit.PathspecMatchList.prototype.failedEntry + - NodeGit.PathspecMatchList.prototype.failedEntryCount + +##### Newly exposed types + - NodeGit.DescribeFormatOptions + - NodeGit.DiffStats + - NodeGit.OidShorten + - NodeGit.PathspecMatchList + +#### Merged PRs into NodeGit +- [Garbage collection: Free mostly everything automatically #1570](https://github.com/nodegit/nodegit/pull/1570) + + +## v0.23.0 [(2018-10-22)](https://github.com/nodegit/nodegit/releases/tag/v0.23.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.2...v0.23.0) + +#### Summary of changes +- Added Node 10 support. +- We no longer compile OpenSSL. Instead, we prefer the OpenSSL shipped with Node. In electron builds, we prefer the system openssl on linux, and we get prebuilt static libs from Conan. +- Cleaned up some compiler warnings +- Our http_parser dependency is now a submodule. +- Updated some dependencies in npm to get rid of security vulnerabilities and warnings. +- Exposed transfer progress callback for pushing. +- Libssh2 is now preconfigured for both Mac OS and Windows + +#### Merged PRs into NodeGit +- [warn about node v10 incompatibility in readme #1534](https://github.com/nodegit/nodegit/pull/1534) +- [Define error codes to fix compiler warnings about unused variables #1486](https://github.com/nodegit/nodegit/pull/1486) +- [Include http_parser via submodule #1551](https://github.com/nodegit/nodegit/pull/1551) +- [Update dependencies to get rid of security vulnerabilities #1547](https://github.com/nodegit/nodegit/pull/1547) +- [add github issue template #1548](https://github.com/nodegit/nodegit/pull/1548) +- [Enable git_push_transfer_progress - Help wanted #1500](https://github.com/nodegit/nodegit/pull/1500) +- [Fixed createBranch API params #1552](https://github.com/nodegit/nodegit/pull/1552) +- [Use curl-config to find curl #1555](https://github.com/nodegit/nodegit/pull/1555) +- [Update readme #1554](https://github.com/nodegit/nodegit/pull/1554) +- [Node 10 support #1545](https://github.com/nodegit/nodegit/pull/1545) +- [Update dependencies #1519](https://github.com/nodegit/nodegit/pull/1519) +- [Run submodule updates in sequence rather than parallel #1558](https://github.com/nodegit/nodegit/pull/1558) +- [Fix Electron builds on win32 #1560](https://github.com/nodegit/nodegit/pull/1560) +- [Use static `libssh2_config.h` on MacOS builds #1569](https://github.com/nodegit/nodegit/pull/1569) + + +## v0.23.0-alpha.2 [(2018-10-19)](https://github.com/nodegit/nodegit/releases/tag/v0.23.0-alpha.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.23.0-alpha.1...v0.23.0-alpha.2) + +#### Summary of changes +On Mac OS Mojave, libssh2 configure failed to configure, because libssh2 always tries to configure against system libraries. The configure process uses links to determine that a OpenSSL is present. Since OSX and Windows no longer link against the system lib, we've prebuilt the configure steps for both environments. This should be stable when building NodeGit on Mojave. + +#### Merged PRs into NodeGit +- [Use static `libssh2_config.h` on MacOS builds #1569](https://github.com/nodegit/nodegit/pull/1569) + + +## v0.23.0-alpha.1 [(2018-10-01)](https://github.com/nodegit/nodegit/releases/tag/v0.23.0-alpha.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.2...v0.23.0-alpha.1) + +#### Summary of changes +- Added Node 10 support. +- We no longer compile OpenSSL. Instead, we prefer the OpenSSL shipped with Node. In electron builds, we prefer the system openssl on linux, and we get prebuilt static libs from Conan. +- Cleaned up some compiler warnings +- Our http_parser dependency is now a submodule. +- Updated some dependencies in npm to get rid of security vulnerabilities and warnings. +- Exposed transfer progress callback for pushing. + +#### Merged PRs into NodeGit +- [warn about node v10 incompatibility in readme #1534](https://github.com/nodegit/nodegit/pull/1534) +- [Define error codes to fix compiler warnings about unused variables #1486](https://github.com/nodegit/nodegit/pull/1486) +- [Include http_parser via submodule #1551](https://github.com/nodegit/nodegit/pull/1551) +- [Update dependencies to get rid of security vulnerabilities #1547](https://github.com/nodegit/nodegit/pull/1547) +- [add github issue template #1548](https://github.com/nodegit/nodegit/pull/1548) +- [Enable git_push_transfer_progress - Help wanted #1500](https://github.com/nodegit/nodegit/pull/1500) +- [Fixed createBranch API params #1552](https://github.com/nodegit/nodegit/pull/1552) +- [Use curl-config to find curl #1555](https://github.com/nodegit/nodegit/pull/1555) +- [Update readme #1554](https://github.com/nodegit/nodegit/pull/1554) +- [Node 10 support #1545](https://github.com/nodegit/nodegit/pull/1545) +- [Update dependencies #1519](https://github.com/nodegit/nodegit/pull/1519) +- [Run submodule updates in sequence rather than parallel #1558](https://github.com/nodegit/nodegit/pull/1558) +- [Fix Electron builds on win32 #1560](https://github.com/nodegit/nodegit/pull/1560) + + +## v0.22.2 [(2018-07-10)](https://github.com/nodegit/nodegit/releases/tag/v0.22.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.1...v0.22.2) + +#### Summary of changes +- Bumped libgit2 to 0.27.3 to incorporate security patch. Details can be found here https://github.com/libgit2/libgit2/releases/tag/v0.27.3 +- Also includes changes made in 0.27.2. Details can be found here https://github.com/libgit2/libgit2/releases/tag/v0.27.2 +- Ensure optional params are respected as optional in `NodeGit.Merge.trees` + +#### Merged PRs into NodeGit +- [Fix argument handling in Git.Merge.trees #1507](https://github.com/nodegit/nodegit/pull/1507) + +#### Included non-merged libgit2 PRs: + - [Parallelize checkout_create_the_new for ntfs perf gains #4205](https://github.com/libgit2/libgit2/pull/4205) + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + +#### Included merged libgit2 PRs: +- [Bugfix release v0.27.2 #4632](https://github.com/libgit2/libgit2/pull/4632) +- [Release v0.27.3 #4717](https://github.com/libgit2/libgit2/pull/4717) + + +## v0.22.1 [(2018-04-09)](https://github.com/nodegit/nodegit/releases/tag/v0.22.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.22.0...v0.22.1) + +#### Summary of changes +Bumped libgit2 to 0.27.1 to address security flaw with submodule name validation (CVE-2018-11235, reported by Etienne Stalmans). +Details can be found here https://github.com/libgit2/libgit2/releases/tag/v0.27.1 + + +## v0.22.0 [(2018-04-09)](https://github.com/nodegit/nodegit/releases/tag/v0.22.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.21.2...v0.22.0) + +#### Summary of changes +- Expose [Tag.listMatch](https://libgit2.github.com/libgit2/#v0.26.3/group/tag/git_tag_list_match) +- Expose [Repo.prototype.createCommitBuffer](https://libgit2.github.com/libgit2/#v0.26.3/group/commit/git_commit_create_buffer) +- Bump Libgt2 to 0.27.0. For more information about what was in this release. [Check upstream](https://github.com/libgit2/libgit2/releases/tag/v0.27.0). +- Errors are now properly thrown from + - `Attr.prototype.get` + - `Blob.createFrombuffer` + - `Blob.createFromworkdir` + - `Reference.list` + - `Remote.prototype.getFetchRefspecs` + - `Remote.prototype.getPushRefspecs` + - `Status.file` +- WorkTree is now exposed + - Static methods + - `add` + - `list` + - `lookup` + - `openFromRepository` + - Instance methods + - `isLocked` + - `isPrunable` + - `lock` + - `prune` + - `unlock` + - `validate` +- **BREAKING** Functions that are now async + - `Attr.prototype.getMany` + - `Tag.prototype.target` + - `Treebuilder.prototype.Write` +- **BREAKING** Diffs generated from `Diff.treeToIndex` and `Diff.treeToWorkdirWithIndex` conditionally support `Diff.OPTION.IGNORE_CASE`. Only on repositories where the index is case insensitive will the flag be set on the output diff. The flag itself is ignored when passed to `DiffOptions`. + +#### Merged PRs into NodeGit +- [Add JavaScript Tag.listMatch function for git_tag_list_match #1470](https://github.com/nodegit/nodegit/pull/1470) +- [Expose error code in Status.file #1468](https://github.com/nodegit/nodegit/pull/1468) +- [Travis documentation deploy fixes #1466](https://github.com/nodegit/nodegit/pull/1466) +- [Bump to libgit2 v0.27.0 #1477](https://github.com/nodegit/nodegit/pull/1477) +- [Add repo.createCommitBuffer #1481](https://github.com/nodegit/nodegit/pull/1481) + +#### Included non-merged libgit2 PRs: + - [Parallelize checkout_create_the_new for ntfs perf gains #4205](https://github.com/libgit2/libgit2/pull/4205) + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + + +## v0.21.2 [(2018-03-19)](https://github.com/nodegit/nodegit/releases/tag/v0.21.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.21.1...v0.21.2) + +#### Summary of changes +- Drop support for node 7 +- Fixed an issue where fast-forward rebase would throw an error unexepctedly. +- Expose git_commit_extract_signature +- TreeEntry.prototype.path() should always return posix style separators +- Expose git_config_open_ondisk +- Expose git_config_find_global +- Expose git_config_find_system +- Expose git_config_find_xdg +- Expose git_config_get_path + +#### Merged PRs into NodeGit + - [Fix typo in CHANGELOG.md #1455](https://github.com/nodegit/nodegit/pull/1455) + - [Add two tests for Tag #1452](https://github.com/nodegit/nodegit/pull/1452) + - [Handle fast-forward merges properly in repository.performRebase #1457](https://github.com/nodegit/nodegit/pull/1457) + - [Enable git_commit_extract_signature #1458](https://github.com/nodegit/nodegit/pull/1458) + - [removes 'only' from test #1460](https://github.com/nodegit/nodegit/pull/1460) + - [Deploy documentation and make extended tests visible #1447](https://github.com/nodegit/nodegit/pull/1447) + - [resolves #1433 TreeEntry#path should return posix path #1434](https://github.com/nodegit/nodegit/pull/1434) + - [Exposed git_config_open_ondisk #1459](https://github.com/nodegit/nodegit/pull/1459) + - [Expose git_config functions #1463](https://github.com/nodegit/nodegit/pull/1463) + + +## v0.21.1 [(2018-03-05)](https://github.com/nodegit/nodegit/releases/tag/v0.21.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.21.0...v0.21.1) + +#### Summary of changes +- Fixed an issue where having html escape characters in the path portion of an ssh url always fails when performing remote actions. + +#### Included non-merged libgit2 PRs: +- [Unescape special characters in SSH repo paths #4557](https://github.com/libgit2/libgit2/pull/4557) + +## v0.21.0 [(2018-02-26)](https://github.com/nodegit/nodegit/releases/tag/v0.21.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.20.3...v0.21.0) + +#### Summary of changes to NodeGit: + - [Generate default options for Revert.revert to prevent an exception #1404](https://github.com/nodegit/nodegit/pull/1404) + - [fix issue with re-require()'ing native modules #1354](https://github.com/nodegit/nodegit/pull/1354) + - [Expose JavaScript function name in a rejected promise #1393](https://github.com/nodegit/nodegit/pull/1393) + - [Fix compiling with clang #1344](https://github.com/nodegit/nodegit/pull/1344) + - [Fix typos #1415](https://github.com/nodegit/nodegit/pull/1415) + - [build: add NetBSD support to opensslconf.h #1374](https://github.com/nodegit/nodegit/pull/1374) + - [Fix example by forcing backslashes with path.posix #1346](https://github.com/nodegit/nodegit/pull/1346) + - [Expose the Node.js GC when running `mocha `scripts #1258](https://github.com/nodegit/nodegit/pull/1258) + - [Exposed filter_list; Fixed discard lines to use filters #1414](https://github.com/nodegit/nodegit/pull/1414) + - [Add tests for AnnotatedCommit #1325](https://github.com/nodegit/nodegit/pull/1325) + - [Adding docs for NodeGit #1350](https://github.com/nodegit/nodegit/pull/1350) + - [Fix details-for-tree-entry.js to access fields instead of calling a function #1326](https://github.com/nodegit/nodegit/pull/1326) + - [Add JavaScript version of `git_tag_peel()` #1269](https://github.com/nodegit/nodegit/pull/1269) + - [Fixed documentation error #1417](https://github.com/nodegit/nodegit/pull/1417) + - [Annotate Blame.file as async #1421](https://github.com/nodegit/nodegit/pull/1421) + - [Add two missing tests to Commit #1422](https://github.com/nodegit/nodegit/pull/1422) + - [CI: Update Node.js versions + some deps #1444](https://github.com/nodegit/nodegit/pull/1444) + - [Expose fetch_options.custom_headers #1430](https://github.com/nodegit/nodegit/pull/1430) + +## v0.20.3 [(2017-10-18)](https://github.com/nodegit/nodegit/releases/tag/v0.20.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.20.2...v0.20.3) + +#### Summary of changes outside of libgit2 bump: + - [Bumped libgit to libgit-next head #1387](https://github.com/nodegit/nodegit/pull/1387) + - [Added a better normalizeOptions pattern for the submodule update routine #1388](https://github.com/nodegit/nodegit/pull/1388) + - [Updated input docs to allow for git_push_update_reference_cb to generate #1386](https://github.com/nodegit/nodegit/pull/1386) + - [Updated descriptors for git_index_find and git_index_find_prefix #1391](https://github.com/nodegit/nodegit/pull/1391) + +#### Included merged libgit2 PRs: + - [Fix template dir empty string #4273](https://github.com/libgit2/libgit2/pull/4273) + - [travis: upgrade container to Ubuntu 14.04 #4211](https://github.com/libgit2/libgit2/pull/4211) + - [merge: perform exact rename detection in linear time #4202](https://github.com/libgit2/libgit2/pull/4202) + - [merge: fix potential free of uninitialized memory #4277](https://github.com/libgit2/libgit2/pull/4277) + - [cmake: Permit disabling external http-parser #4278](https://github.com/libgit2/libgit2/pull/4278) + - [Out of tree builds #4235](https://github.com/libgit2/libgit2/pull/4235) + - [Convert port with htons() in p_getaddrinfo() #4280](https://github.com/libgit2/libgit2/pull/4280) + - [tests: config: fix missing declaration causing error #4291](https://github.com/libgit2/libgit2/pull/4291) + - [git_reset_*: pass parameters as const pointers #4287](https://github.com/libgit2/libgit2/pull/4287) + - [signature: don't leave a dangling pointer to the strings on parse failure #4306](https://github.com/libgit2/libgit2/pull/4306) + - [Patch ID calculation #4272](https://github.com/libgit2/libgit2/pull/4272) + - [Configuration file fixes with includes #4250](https://github.com/libgit2/libgit2/pull/4250) + - [win32: provide fast-path for retrying filesystem operations #4311](https://github.com/libgit2/libgit2/pull/4311) + - [Build with patched libcurl #4317](https://github.com/libgit2/libgit2/pull/4317) + - [tsort: remove idempotent conditional assignment #4314](https://github.com/libgit2/libgit2/pull/4314) + - [tests: rebase::submodule: verify initialization method calls #4320](https://github.com/libgit2/libgit2/pull/4320) + - [Remove unused 'sys/remote.h' header #4323](https://github.com/libgit2/libgit2/pull/4323) + - [patch_generate: represent buffers as void pointers #4304](https://github.com/libgit2/libgit2/pull/4304) + - [sha1_position: convert do-while to while #4326](https://github.com/libgit2/libgit2/pull/4326) + - [sha1_lookup: drop sha1_entry_pos function #4327](https://github.com/libgit2/libgit2/pull/4327) + - [oid: use memcmp in git_oid__hashcmp #4328](https://github.com/libgit2/libgit2/pull/4328) + - [Docs: Fix inline comments for git_diff_hunk #4330](https://github.com/libgit2/libgit2/pull/4330) + - [Split up CMakeLists.txt build instructions #4282](https://github.com/libgit2/libgit2/pull/4282) + - [-Werror builds for Travis #4279](https://github.com/libgit2/libgit2/pull/4279) + - [Submodules with bare repo #4305](https://github.com/libgit2/libgit2/pull/4305) + - [Fix negative ignore rules with patterns #4296](https://github.com/libgit2/libgit2/pull/4296) + - [README: Mention Guile-Git bindings. #4342](https://github.com/libgit2/libgit2/pull/4342) + - [features.h: allow building without CMake-generated feature header #4346](https://github.com/libgit2/libgit2/pull/4346) + - [Clear the remote_ref_name buffer in git_push_update_tips() #4344](https://github.com/libgit2/libgit2/pull/4344) + - [Fix AppVeyor build failures due to CRTDBG linking issue #4347](https://github.com/libgit2/libgit2/pull/4347) + - [diff: cleanup hash ctx in `git_diff_patchid` #4348](https://github.com/libgit2/libgit2/pull/4348) + - [Reproducible builds #4334](https://github.com/libgit2/libgit2/pull/4334) + - [Static linking for bundled deps #4339](https://github.com/libgit2/libgit2/pull/4339) + - [Use SOCK_CLOEXEC when creating sockets #4364](https://github.com/libgit2/libgit2/pull/4364) + - [Document that a commit is not a descendant of itself #4362](https://github.com/libgit2/libgit2/pull/4362) + - [refs: do not use peeled OID if peeling to a tag #4367](https://github.com/libgit2/libgit2/pull/4367) + - [remote: add typedef to normalize push_update_reference callback #4363](https://github.com/libgit2/libgit2/pull/4363) + - [travis: add custom apt sources #4321](https://github.com/libgit2/libgit2/pull/4321) + - [Fix Issue #4047 Check return codes and free objects #4370](https://github.com/libgit2/libgit2/pull/4370) + - [Plug some leaks in curl's proxy handling #4359](https://github.com/libgit2/libgit2/pull/4359) + - [Checkout typechange-only deltas #4369](https://github.com/libgit2/libgit2/pull/4369) + - [tests: checkout::tree: verify status entrycount changes on chmod #4371](https://github.com/libgit2/libgit2/pull/4371) + - [transports: smart: fix memory leak when skipping symbolic refs #4368](https://github.com/libgit2/libgit2/pull/4368) + - [cmake: fix linking in Xcode with object libraries only #4372](https://github.com/libgit2/libgit2/pull/4372) + - [cmake: use static dependencies when building static libgit2 #4356](https://github.com/libgit2/libgit2/pull/4356) + +#### Included non-merged libgit2 PRs: + - [Parallelize checkout_create_the_new for ntfs perf gains #4205](https://github.com/libgit2/libgit2/pull/4205) + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + + + +## v0.20.2 [(2017-09-13)](https://github.com/nodegit/nodegit/releases/tag/v0.20.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.20.0...v0.20.2) + +#### Summary of changes outside of libgit2 bump: + - [Fixed an issue where large buffer allocations in filters (> 256MB) causes a segfault #1368](https://github.com/nodegit/nodegit/pull/1368) + - [Fix git_tree_entry double free #1332](https://github.com/nodegit/nodegit/pull/1332) + +## v0.20.0 [(2017-08-16)](https://github.com/nodegit/nodegit/releases/tag/v0.20.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.19.0...v0.20.0) + +#### Summary of changes outside of libgit2 bump: + - [BREAKING: Added blob methods and converted to async #1327](https://github.com/nodegit/nodegit/pull/1327) + - [BREAKING: Convert sync methods to async methods #1348](https://github.com/nodegit/nodegit/pull/1348) + - [Exposed libgit2 git_branch_remote_name method #1340](https://github.com/nodegit/nodegit/pull/1340) + - [Adding git_filter support in nodegit #1331](https://github.com/nodegit/nodegit/pull/1331) + - [Add CI build config for node stable version #1337](https://github.com/nodegit/nodegit/pull/1337) + - [removed node v4 tests #1330](https://github.com/nodegit/nodegit/pull/1330) + +#### Included merged libgit2 PRs: + - [Include fixups #4288](https://github.com/libgit2/libgit2/pull/4288) + - [Docs: Fix inline comments for git_diff_hunk #4330](https://github.com/libgit2/libgit2/pull/4330) + - [oid: use memcmp in git_oid__hashcmp #4328](https://github.com/libgit2/libgit2/pull/4328) + - [sha1_lookup: drop sha1_entry_pos function #4327](https://github.com/libgit2/libgit2/pull/4327) + - [sha1_position: convert do-while to while #4326](https://github.com/libgit2/libgit2/pull/4326) + - [patch_generate: represent buffers as void pointers #4304](https://github.com/libgit2/libgit2/pull/4304) + - [Remove unused 'sys/remote.h' header #4323](https://github.com/libgit2/libgit2/pull/4323) + - [tests: rebase::submodule: verify initialization method calls #4320](https://github.com/libgit2/libgit2/pull/4320) + - [tests: rewrite rebase-submodule .gitmodule file #4275](https://github.com/libgit2/libgit2/pull/4275) + - [tsort: remove idempotent conditional assignment #4314](https://github.com/libgit2/libgit2/pull/4314) + - [Build with patched libcurl #4317](https://github.com/libgit2/libgit2/pull/4317) + - [win32: provide fast-path for retrying filesystem operations #4311](https://github.com/libgit2/libgit2/pull/4311) + - [Configuration file fixes with includes #4250](https://github.com/libgit2/libgit2/pull/4250) + - [Patch ID calculation #4272](https://github.com/libgit2/libgit2/pull/4272) + - [signature: don't leave a dangling pointer to the strings on parse failure #4306](https://github.com/libgit2/libgit2/pull/4306) + - [git_reset_*: pass parameters as const pointers #4287](https://github.com/libgit2/libgit2/pull/4287) + - [tests: config: fix missing declaration causing error #4291](https://github.com/libgit2/libgit2/pull/4291) + - [Convert port with htons() in p_getaddrinfo() #4280](https://github.com/libgit2/libgit2/pull/4280) + - [Out of tree builds #4235](https://github.com/libgit2/libgit2/pull/4235) + - [cmake: Permit disabling external http-parser #4278](https://github.com/libgit2/libgit2/pull/4278) + - [merge: fix potential free of uninitialized memory #4277](https://github.com/libgit2/libgit2/pull/4277) + - [merge: perform exact rename detection in linear time #4202](https://github.com/libgit2/libgit2/pull/4202) + - [travis: upgrade container to Ubuntu 14.04 #4211](https://github.com/libgit2/libgit2/pull/4211) + - [Fix template dir empty string #4273](https://github.com/libgit2/libgit2/pull/4273) + - [adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention #4267](https://github.com/libgit2/libgit2/pull/4267) + - [travis: replace use of deprecated homebrew/dupes tap #4268](https://github.com/libgit2/libgit2/pull/4268) + - [Test improvements #4269](https://github.com/libgit2/libgit2/pull/4269) + - [Read prefix tests #4265](https://github.com/libgit2/libgit2/pull/4265) + - [Allow creation of a configuration object in an in-memory repository #4263](https://github.com/libgit2/libgit2/pull/4263) + - [travis: install openssl explicitly #4266](https://github.com/libgit2/libgit2/pull/4266) + - [smart_protocol: fix parsing of server ACK responses #4261](https://github.com/libgit2/libgit2/pull/4261) + - [odb_read_prefix: reset error in backends loop #4264](https://github.com/libgit2/libgit2/pull/4264) + - [Update version number to 0.26 #4262](https://github.com/libgit2/libgit2/pull/4262) + - [CHANGELOG: add various changes introduced since v0.25 #4254](https://github.com/libgit2/libgit2/pull/4254) + - [Ensure packfiles with different contents have different names #4088](https://github.com/libgit2/libgit2/pull/4088) + - [Update to forced checkout and untracked files #4260](https://github.com/libgit2/libgit2/pull/4260) + - [settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION` #4259](https://github.com/libgit2/libgit2/pull/4259) + - [Buffer growing cleanups #4255](https://github.com/libgit2/libgit2/pull/4255) + - [Coverity fixes #4253](https://github.com/libgit2/libgit2/pull/4253) + - [SHA1DC update #4258](https://github.com/libgit2/libgit2/pull/4258) + - [Fix path computations for compressed index entries #4236](https://github.com/libgit2/libgit2/pull/4236) + - [(Temporarily) disable UNC tests #4256](https://github.com/libgit2/libgit2/pull/4256) + - [fix build with libressl #4251](https://github.com/libgit2/libgit2/pull/4251) + - [Fix issue with directory glob ignore in subdirectories #4239](https://github.com/libgit2/libgit2/pull/4239) + - [Submodule working directory #4243](https://github.com/libgit2/libgit2/pull/4243) + - [Introduce home directory expansion function for config files, attribute files #4179](https://github.com/libgit2/libgit2/pull/4179) + - [Fix proxy auto detect not utilizing callbacks #4097](https://github.com/libgit2/libgit2/pull/4097) + - [git_repository_set_head: use tag name in reflog #4174](https://github.com/libgit2/libgit2/pull/4174) + - [revparse: support open-ended ranges #4231](https://github.com/libgit2/libgit2/pull/4231) + - [Fix GCC warnings #4240](https://github.com/libgit2/libgit2/pull/4240) + - [Update README: VS -> VSTS #4238](https://github.com/libgit2/libgit2/pull/4238) + - [tests: repo: fix repo discovery tests on overlayfs #4232](https://github.com/libgit2/libgit2/pull/4232) + - [libssh2 shutdown #4229](https://github.com/libgit2/libgit2/pull/4229) + - [WIP: squash some memleaks #4226](https://github.com/libgit2/libgit2/pull/4226) + - [Verify object hashes #4197](https://github.com/libgit2/libgit2/pull/4197) + - [transport: provide a getter for the proxy options #4206](https://github.com/libgit2/libgit2/pull/4206) + - [Debian HTTPS feature test failure #4216](https://github.com/libgit2/libgit2/pull/4216) + - [Do not free config when creating remote #4224](https://github.com/libgit2/libgit2/pull/4224) + - [socket_stream: continue to next addrinfo on socket creation failure #4219](https://github.com/libgit2/libgit2/pull/4219) + - [Honor read-only flag when writing to config backends #4217](https://github.com/libgit2/libgit2/pull/4217) + - [diff_parse: free object instead of its pointer #4215](https://github.com/libgit2/libgit2/pull/4215) + +#### Included non-merged libgit2 PRs: + + - [Parallelize checkout_create_the_new for ntfs perf gains #4205](https://github.com/libgit2/libgit2/pull/4205) + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + + +## v0.19.0 [(2017-04-20)](https://github.com/nodegit/nodegit/releases/tag/v0.19.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.18.0...v0.19.0) + +#### Summary of changes outside of libgit2 bump: + - You can now convert tree entries in blobs [PR #1272](https://github.com/nodegit/nodegit/pull/1272) + +#### Included merged libgit2 PRs: + + - [fileops: fix leaking fd in `mmap_ro_file` #4201](https://github.com/libgit2/libgit2/pull/4201) + - [README: document our relation to changes in upstream #4198](https://github.com/libgit2/libgit2/pull/4198) + - [filter: only close filter if it's been initialized correctly #4196](https://github.com/libgit2/libgit2/pull/4196) + - [Fix building against OpenSSL v1.1 #4195](https://github.com/libgit2/libgit2/pull/4195) + - [pkgconfig: fix handling of prefixes containing whitespaces #4193](https://github.com/libgit2/libgit2/pull/4193) + - [Refactor some of the win32 POSIX emulation #4192](https://github.com/libgit2/libgit2/pull/4192) + - [Correct non-existent file references in `odb.h` #4188](https://github.com/libgit2/libgit2/pull/4188) + - [Coverity #4183](https://github.com/libgit2/libgit2/pull/4183) + - [git_treebuilder_write_with_buffer refactorings #4182](https://github.com/libgit2/libgit2/pull/4182) + - [Fix memory leaks #4180](https://github.com/libgit2/libgit2/pull/4180) + - [sha1dc: perf improvements from upstream #4178](https://github.com/libgit2/libgit2/pull/4178) + - [inet_pton: don't assume addr families don't exist #4176](https://github.com/libgit2/libgit2/pull/4176) + - [git_futils: don't O_EXCL and O_TRUNC #4175](https://github.com/libgit2/libgit2/pull/4175) + - [Fix the documentation for git_cred_acquire_cb #4172](https://github.com/libgit2/libgit2/pull/4172) + - [Fix typo in remote.h API #4171](https://github.com/libgit2/libgit2/pull/4171) + - [Fix resolving absolute symlinks (on at least Win32) #4169](https://github.com/libgit2/libgit2/pull/4169) + - [Coverity fixes #4167](https://github.com/libgit2/libgit2/pull/4167) + - [Remove `map_free` macros #4166](https://github.com/libgit2/libgit2/pull/4166) + - [Worktree fixes #4163](https://github.com/libgit2/libgit2/pull/4163) + - [merge_driver: fix const-correctness for source getters #4162](https://github.com/libgit2/libgit2/pull/4162) + - [submodule: catch when submodule is not staged on update #4161](https://github.com/libgit2/libgit2/pull/4161) + - [Diff fixes #4160](https://github.com/libgit2/libgit2/pull/4160) + - [Skip uninteresting commits in revwalk timesort iterator #4157](https://github.com/libgit2/libgit2/pull/4157) + - [git_futils_readbuffer: don't compute sha-1 #4156](https://github.com/libgit2/libgit2/pull/4156) + - [Support namespaced references again #4154](https://github.com/libgit2/libgit2/pull/4154) + - [rebase: ignore untracked files in submodules #4151](https://github.com/libgit2/libgit2/pull/4151) + - [git_commit_create: freshen tree objects in commit #4150](https://github.com/libgit2/libgit2/pull/4150) + - [cmake: only enable supported compiler warning flags #4148](https://github.com/libgit2/libgit2/pull/4148) + - [winhttp: disambiguate error messages when sending requests #4146](https://github.com/libgit2/libgit2/pull/4146) + - [tests: refs::create: fix memory leak #4145](https://github.com/libgit2/libgit2/pull/4145) + - [Fix: make reflog include \"(merge)\" for merge commits #4143](https://github.com/libgit2/libgit2/pull/4143) + - [Fix minor typos in CONVENTIONS.md #4142](https://github.com/libgit2/libgit2/pull/4142) + - [Fix inet_pton tests triggering an assert in Haiku #4141](https://github.com/libgit2/libgit2/pull/4141) + - [README: Mention how to run tests #4139](https://github.com/libgit2/libgit2/pull/4139) + - [tests: Add create__symbolic_with_arbitrary_content #4138](https://github.com/libgit2/libgit2/pull/4138) + - [appveyor: don't rewrite the system mingw #4137](https://github.com/libgit2/libgit2/pull/4137) + - [Introduce (optional) SHA1 collision attack detection #4136](https://github.com/libgit2/libgit2/pull/4136) + - [Provide error on gcc < 4.1 when THREADSAFE #4135](https://github.com/libgit2/libgit2/pull/4135) + - [fix regression from #4092 #4133](https://github.com/libgit2/libgit2/pull/4133) + - [Attrcache cleanups #4131](https://github.com/libgit2/libgit2/pull/4131) + - [Improve clar messages #4130](https://github.com/libgit2/libgit2/pull/4130) + - [Minor comment fix #4127](https://github.com/libgit2/libgit2/pull/4127) + - [refdb: catch additional per-worktree refs #4124](https://github.com/libgit2/libgit2/pull/4124) + - [Signature cleanups #4122](https://github.com/libgit2/libgit2/pull/4122) + - [Changes to provide option to turn off/on ofs_delta #4115](https://github.com/libgit2/libgit2/pull/4115) + - [khash cleanups #4092](https://github.com/libgit2/libgit2/pull/4092) + - [fsync all the things #4030](https://github.com/libgit2/libgit2/pull/4030) + - [Worktree implementation #3436](https://github.com/libgit2/libgit2/pull/3436) + +#### Included non-merged libgit2 PRs: + + - [Parallelize checkout_create_the_new for ntfs perf gains #4205](https://github.com/libgit2/libgit2/pull/4205) + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + - [Fix proxy auto detect not utilizing callbacks #4097](https://github.com/libgit2/libgit2/pull/4097) + +## v0.18.0 [(2017-02-28)](https://github.com/nodegit/nodegit/releases/tag/v0.18.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.17.0...v0.18.0) + +### API Changes + + - All callbacks that go to libgit2 now have an optional `waitForResult` flag that can be `true`/`false`. Defaults to false. When true it will not stop libgit2 from continuing on before the JS code is fully executed and resolved (in cases of a Promise). This is useful for progress callbacks (like fetching) where the bubbling up of the progress to JS doesn't really need the C/C++ code to wait for the JS code to fully handle the event before continuing. This can have serious performance implications for many callbacks that can be fired quite frequently. + - `given_opts` in `Revert.revert` are now optional + - `checkout_opts` in `Reset.fromAnnotated` and `Reset.reset` are now optional + - `Reset.fromAnnotated` is now async + - `message` on `Stash.save` is now optional + - Added `processMergeMessageCallback` on `Repository#mergeBranches` to allow for custom merge messages + - Add `beforeFinishFn` to `Repository#rebaseBranches` and `Repository#continueRebase`. This is called before the invocation of `finish()`. If the callback returns a promise, `finish()` will be called when the promise resolves. The `beforeFinishFn` will be called with an object that has on it: + - `ontoName` The name of the branch that we rebased onto + - `ontoSha` The sha that we rebased onto + - `originalHeadName` The name of the branch that we rebased + - `originalHeadSha` The sha of the branch that was rebased + - `rewitten` which is an array of sha pairs that contain which contain what the commit sha was before the rebase and what the commit sha is after the rebase + +### Summary of Changes from bumping libgit2 to 43275f5 + +[PR #1123](https://github.com/nodegit/nodegit/pull/1223) bumped libgit2 which brought in many changes and bug fixes. + +#### Included merged libgit2 PRs: + + - [Use a shared buffer in calls of git_treebuilder_write to avoid heap contention #3892](https://github.com/libgit2/libgit2/pull/3892) + - [WinHTTP: set proper error messages when SSL fails #4050](https://github.com/libgit2/libgit2/pull/4050) + - [Clang analyzer run #4051](https://github.com/libgit2/libgit2/pull/4051) + - [Extend packfile in increments of page_size. #4053](https://github.com/libgit2/libgit2/pull/4053) + - [Fix general example memory leaks #4078](https://github.com/libgit2/libgit2/pull/4078) + - [WIP: some coverity & compiler warning fixes #4086](https://github.com/libgit2/libgit2/pull/4086) + - [Fix a few recent warnings #4087](https://github.com/libgit2/libgit2/pull/4087) + - [Fix uninitialized variable warning #4095](https://github.com/libgit2/libgit2/pull/4095) + - [Update docs for git_oid_fromstrn and p #4096](https://github.com/libgit2/libgit2/pull/4096) + - [Fix digest credentials for proxy in windows #4104](https://github.com/libgit2/libgit2/pull/4104) + - [Vector reverse overflow #4105](https://github.com/libgit2/libgit2/pull/4105) + - [Flag given_opts in git_revert as optional #4108](https://github.com/libgit2/libgit2/pull/4108) + - [Flag checkout_opts in git_reset as optional #4109](https://github.com/libgit2/libgit2/pull/4109) + - [dirname with DOS prefixes #4111](https://github.com/libgit2/libgit2/pull/4111) + - [Add support for lowercase proxy environment variables #4112](https://github.com/libgit2/libgit2/pull/4112) + - [Flag options in git_stash_apply and git_stash_pop as being optional #4117](https://github.com/libgit2/libgit2/pull/4117) + - [rename detection: don't try to detect submodule renames #4119](https://github.com/libgit2/libgit2/pull/4119) + - [tests: fix permissions on testrepo.git index file #4121](https://github.com/libgit2/libgit2/pull/4121) + +#### Included non-merged libgit2 PRs: + + - [negotiate always fails via libcurl #4126](https://github.com/libgit2/libgit2/pull/4126) + - [Fix proxy auto detect not utilizing callbacks #4097](https://github.com/libgit2/libgit2/pull/4097) + +### Summary of Changes to NodeGit outside of libgit2 bump + + - Don't overwrite C++ files for things that haven't changed [PR #1091](https://github.com/nodegit/nodegit/pull/1091) + - Add the option to "fire and forget" callbacks so libgit2 doesn't wait for JS to finish before proceeding [PR #1208](https://github.com/nodegit/nodegit/pull/1208) + - Send back the error code from libgit2 when a call fails [PR #1209](https://github.com/nodegit/nodegit/pull/1209) + - Initialize pointers to null [PR #1210](https://github.com/nodegit/nodegit/pull/1210) + - Replace Gitter with Slack [PR #1212](https://github.com/nodegit/nodegit/pull/1212) + - Make `given_opts` in `Revert.revert` optional [PR #1213](https://github.com/nodegit/nodegit/pull/1213) + - Make `Reset.fromAnnotated` async and `checkout_opts` optional [PR #1214](https://github.com/nodegit/nodegit/pull/1214) + - Make `message` on `Stash.save` optional [PR #1215](https://github.com/nodegit/nodegit/pull/1215) + - Add `Remote.ls` to NodeGit [PR #1218](https://github.com/nodegit/nodegit/pull/1218) + - Add `processMergeMessageCallback` to `Repository#mergeBranches` to allow for custom merge messages [PR #1219](https://github.com/nodegit/nodegit/pull/1219) + - Bump libgit2 to 43275f5 [PR #1223](https://github.com/nodegit/nodegit/pull/1223) from srajko/bump-libgit + - Provide rebase details on finish [PR #1224](https://github.com/nodegit/nodegit/pull/1224) + - Use wider int to calculate throttle window [PR #1232](https://github.com/nodegit/nodegit/pull/1232) + - Update comment to reflect the correct path for generated code output [PR #1236](https://github.com/nodegit/nodegit/pull/1236) + - Remove nwjs example from the docs [PR #1238](https://github.com/nodegit/nodegit/pull/1238) + - Remove `sudo` requirement from linux 32-bit builds [PR #1241](https://github.com/nodegit/nodegit/pull/1241) + +## v0.17.0 [(2017-01-06)](https://github.com/nodegit/nodegit/releases/tag/v0.17.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.16.0...v0.17.0) + +### Targeted Platform Changes + +In this release we had added support for Node v7 and latest Electron. We have removed support for Node v0.12 and v5. + +We are also deprecating nw.js support since it is currently broken, no one in the current team uses it and we would not be able to currently support nw.js in an effective manner with a good user experience. + +### Now building against shared libcurl lib + +For proxy support we now use libcurl for HTTP/HTTPS transport which should have no noticeable change in NodeGit remote operations but if changes are noticed this is worth mentioning as a potential source. + +### Memory leak fixes and stability increases + +Many PR's were made to fix memory leaks as they were found so memory usage should go down in this version for long running scripts. Additionally, when performing operations with callbacks (transfer progress, credentials, etc...) there was a small chance for a segfault when NodeGit would schedule the callback to go into JavaScript. This is now fixed. + +### Fixes to the build + +Many users, especially on windows, were experiencing errors during the build. The build still isn't perfect but a lot of the bugs were fixed. + +### Bump libgit2 to 0bf0526 + +The majority of changes to NodeGit v17 were in libgit2. The API breaking changes that are known are: + +- `RevWalk` is returning different results [libgit2 PR #3921](https://github.com/libgit2/libgit2/pull/3921) +- Changes in error messages returned [libgit2 PR #4049](https://github.com/libgit2/libgit2/pull/4049) + +Summary of changes that were brought in: + +https://github.com/nodegit/nodegit/pull/1187#issuecomment-277760323 + +### Changes to NodeGit outside of libgit2 bump + +- Define GIT_SSH_MEMORY_CREDENTIALS for libgit2 [PR #949](https://github.com/nodegit/nodegit/pull/949) +- Add "Path" to ssh variable names in tests for clarity [PR #1135](https://github.com/nodegit/nodegit/pull/1135) +- Fix revwalk memory leaks [PR #1137](https://github.com/nodegit/nodegit/pull/1137) +- Fix tree entry leaks [PR #1138](https://github.com/nodegit/nodegit/pull/1138) +- Fix typo in postinstall script [PR #1141](https://github.com/nodegit/nodegit/pull/1141) +- Fix windows exception handling in build [PR #1143](https://github.com/nodegit/nodegit/pull/1143) +- Fix CI failures on node 0.12 [PR #1144](https://github.com/nodegit/nodegit/pull/1144) +- Fix postinstall script crash when install location has spaces in its path [PR #1148](https://github.com/nodegit/nodegit/pull/1148) +- Update 0.13 changelog [PR #1151](https://github.com/nodegit/nodegit/pull/1151) +- Minor documentation fix in Checkout.index [PR #1164](https://github.com/nodegit/nodegit/pull/1164) +- FreeBSD also uses struct timespec st_mtim [PR #1165](https://github.com/nodegit/nodegit/pull/1165) +- README.md needs to show where to get Slack invitation [PR #1170](https://github.com/nodegit/nodegit/pull/1170) +- Add @async tag to `Tree#getEntry` [PR #1178](https://github.com/nodegit/nodegit/pull/1178) +- Fix incorrect anchor link in TESTING.md [PR #1179](https://github.com/nodegit/nodegit/pull/1179) +- Added tests for Tag [PR #1180](https://github.com/nodegit/nodegit/pull/1180) +- Added tests for Branch [PR #1181](https://github.com/nodegit/nodegit/pull/1181) +- Escape the spaces in dir for shell command [PR #1186](https://github.com/nodegit/nodegit/pull/1186) +- Bump libgit to 0bf0526 [PR #1187](https://github.com/nodegit/nodegit/pull/1187) +- Checkout's tree* functions do not support Oid as a parameter [PR #1190](https://github.com/nodegit/nodegit/pull/1190) +- Build against shared library for libcurl [PR #1195](https://github.com/nodegit/nodegit/pull/1195) +- Move libuv calls to correct thread [PR #1197](https://github.com/nodegit/nodegit/pull/1197) +- Update `Repository#createBranch` docs [PR #1198](https://github.com/nodegit/nodegit/pull/1198) +- Remove Node v0.12 and v5 [PR #1199](https://github.com/nodegit/nodegit/pull/1199) +- Specify acceptable types for `lookup` and `dwim` in Reference [PR #1203](https://github.com/nodegit/nodegit/pull/1203) +- Build for Node 7.4.0 [PR #1204](https://github.com/nodegit/nodegit/pull/1204) +- Write the index to a repository directly in merge-cleanly.js examples [PR #1205](https://github.com/nodegit/nodegit/pull/1205) + +## v0.16.0 [(2016-09-15)](https://github.com/nodegit/nodegit/releases/tag/v0.16.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.15.1...v0.16.0) + +- Bump libssh2 to 1.7.0 [PR #1071](https://github.com/nodegit/nodegit/pull1071) +- Js cleanup [PR #1074](https://github.com/nodegit/nodegit/pull1074) +- Expose merge options and diff flags [PR #1076](https://github.com/nodegit/nodegit/pull1076) +- Fix Tree#entryByName function and add test [PR #1079](https://github.com/nodegit/nodegit/pull1079) +- Add isSubmodule() method [PR #1080](https://github.com/nodegit/nodegit/pull1080) +- Fix two typos in the documentation for Commit#parents [PR #1081](https://github.com/nodegit/nodegit/pull1081) +- Memory management: duplicate time [PR #1090](https://github.com/nodegit/nodegit/pull1090) +- Preempt nan to fix deprecated calls to Get/SetHiddenValue [PR #1106](https://github.com/nodegit/nodegit/pull1106) +- Try re-enabling node >6.2 [PR #1107](https://github.com/nodegit/nodegit/pull1107) +- Bump openssl to 1.0.2h (same as node 6.3.1) [PR #1108](https://github.com/nodegit/nodegit/pull1108) +- Don't run postbuild when we detect electron install [PR #1111](https://github.com/nodegit/nodegit/pull1111) +- Added instructions for CircleCI users [PR #1113](https://github.com/nodegit/nodegit/pull1113) +- Fix up electron and nw.js docs [PR #1114](https://github.com/nodegit/nodegit/pull1114) +- Patch libssh2 to work with vs2015 [PR #1125](https://github.com/nodegit/nodegit/pull1125) +- Fix CI [PR #1126](https://github.com/nodegit/nodegit/pull1126) + + +## v0.15.1 [(2016-06-20)](https://github.com/nodegit/nodegit/releases/tag/v0.15.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.15.0...v0.15.1) + +- Fix postinstall breaking build if it fails. + +## v0.14.1 [(2016-06-20)](https://github.com/nodegit/nodegit/releases/tag/v0.14.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.14.0...v0.14.1) + +- Fix postinstall breaking build if it fails. + +## v0.15.0 [(2016-06-20)](https://github.com/nodegit/nodegit/releases/tag/v0.15.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.14.0...v0.15.0) + +- Update to libgit2 @ 37dba1a [PR #1041](https://github.com/nodegit/nodegit/pull/1041) + +This updates NodeGit to use the latest `HEAD` version of libgit2. The plan for staying on the official tagged releases of libgit2 is that they will get a maintenance branch and not-breaking API fixes will be backported to them. The first branch of this sort is `maint/0.14`. Going forward new releases of NodeGit will follow closely to the `master` branch of libgit2. + +Summary of changes that were brought in: + +https://github.com/libgit2/libgit2/commit/37dba1a739b5ee6c45dc9f3c0bd1f7f7a18f13f7 +------- + +### Changes or improvements + +* `NodeGit.FetchOptions`, and `NodeGit.PushOptions` now have a `proxyOpts` field that accepts a `NodeGit.ProxyOptions` object that allows NodeGit to use a proxy for all remote communication + +* `NodeGit.MergeOptions` has a `defaultDriver` field that lets the caller change the driver used to when both sides of a merge have changed + +### API additions + +* `Commit.createWithSignature` allows the caller to create a signed commit. There are no tests for this currently so it's labelled experimental. + +* `Blob`, `Commit`, `Tag`, and `Tree` all have a new prototype `dup` method on them to make a low-level copy of the libgit2 object if needed. + +* `Odb#expandIds` is exposed which takes in a list of short ids and expands them in-place to the full id of the object in the database + +## v0.14.0 [(2016-06-20)](https://github.com/nodegit/nodegit/releases/tag/v0.14.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.13.2...v0.14.0) + +- Improve lifecycle scripts and install process [PR #1055](https://github.com/nodegit/nodegit/pull/1055) +- Fix example code [PR #1058](https://github.com/nodegit/nodegit/pull/1058) + +## v0.13.2 [(2016-06-09)](https://github.com/nodegit/nodegit/releases/tag/v0.13.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.13.1...v0.13.2) + +- Stop `RevWalk#walk` from swallowing errors in the callback [PR #1047](https://github.com/nodegit/nodegit/pull/1047) +- Stop swallowing errors in the install script [PR #1048](https://github.com/nodegit/nodegit/pull/1048) +- Fix initializing submodules when installing from npm [PR #1050](https://github.com/nodegit/nodegit/pull/1050) + +## v0.13.1 [(2016-06-03)](https://github.com/nodegit/nodegit/releases/tag/v0.13.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.13.0...v0.13.1) + +## Added + +- `Repository#discardLines` is now a thing [PR #1021](https://github.com/nodegit/nodegit/pull/1021) + +## Modified + +- Async methods now use a custom threadpool to prevent thread-locking the event loop [PR #1019](https://github.com/nodegit/nodegit/pull/1019) + +## Bug fixes + +- Fix building NodeGit from NPM [PR #1026](https://github.com/nodegit/nodegit/pull/1026) +- Plug a memory leak in `RevWalk.fastWalk` [PR #1030](https://github.com/nodegit/nodegit/pull/1030) +- Plug a memory leak with `Oid` [PR #1033](https://github.com/nodegit/nodegit/pull/1033) +- Fixed some underlying libgit2 objects getting freed incorrectly [PR #1036](https://github.com/nodegit/nodegit/pull/1036) + +## v0.13.0 [(2016-05-04)](https://github.com/nodegit/nodegit/releases/tag/v0.13.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.12.2...v0.13.0) + +## Summary + +This is a big update! Lots of work was done to bring NodeGit up to the latest stable libgit2 version (v0.24.1), to use babel in the library, to make it more stable, remove memory leaks, squash bugs and in general just improve the library for all. Make sure to see all of the API changes below (there are a lot). + +## Node support + +We have added Node 6 as a supported platform! Going forward we aim to have 1:1 support for versions of Node that are either current or LTS. That means that v0.12 will not be supported soon so if you're on that please upgrade to at least Node v4. Also Node v5 will *NOT* be LTS so when Node stops supporting that in the coming months we will as well. You can read more about the current Node upgrade plan [here](https://nodejs.org/en/blog/release/v6.0.0/). + +## API Changes +------- + +### Modified + +- `Index#add`, `Index#addByPath`, `Index#clear`, `Index#conflictAdd`, `Index#conflictCleanup`, `Index#conflictGet`, `Index#conflictRemove`, `Index.open`, `Index#read`, `Index#readTree`, `Index#remove`, `Index#removeByPath`, `Index#removeDirectory`, `Index#read`, `Index#write`, `Index#writeTree`, and `Index#writeTreeTo` are all now asynchronous functions [PR #971](https://github.com/nodegit/nodegit/pull/971) +- Made `ancestoryEntry`, `outEntry` and `theirEntry` optional parameters on `Index#conflictAdd` [PR #997](https://github.com/nodegit/nodegit/pull/997) +- `Repository#refreshIndex` will return an Index object back that has the latest data loaded off of disk [PR #986](https://github.com/nodegit/nodegit/pull/986) +- `Commit.create` is now asynchronous [PR #1022](https://github.com/nodegit/nodegit/pull/1022) +- `Remote.create` is now asynchronous [PR #990](https://github.com/nodegit/nodegit/pull/990) + +### Added + +- `Diff#merge` will combine a diff into itself [PR #1000](https://github.com/nodegit/nodegit/pull/1000) +- `ReflogEntry#committer`, `ReflogEntry#idNew`, `ReflogEntry#idOld`, and `ReflogEntry#message` have been added +[PR #1013](https://github.com/nodegit/nodegit/pull/1013) + +### Removed + +- `Repository#openIndex` [PR #989](https://github.com/nodegit/nodegit/pull/989), use `Repository#index` or `Repository#refreshIndex` instead +- `Reflog#entryCommitter`, `Reflog#entryIdNew`, `Reflog#entryIdOld`, and `Reflog#entryMessage` have been moved to be under `ReflogEntry` +[PR #1013](https://github.com/nodegit/nodegit/pull/1013) + +### Bug fixes + +- `Branch.name` works now [PR #991](https://github.com/nodegit/nodegit/pull/991) +- Fixed a crash with callbacks from libgit2 [PR #944](https://github.com/nodegit/nodegit/pull/944) +- Fixed a crash in `Tree#entryByName` [PR #998](https://github.com/nodegit/nodegit/pull/998) +- More memory leaks have been plugged [PR #1005](https://github.com/nodegit/nodegit/pull/1005), [PR #1006](https://github.com/nodegit/nodegit/pull/1006), [PR #1014](https://github.com/nodegit/nodegit/pull/1014), and [PR #1015](https://github.com/nodegit/nodegit/pull/1015) +- `Commit#getDiffWithOptions` now actually passes the options correctly [PR #1008](https://github.com/nodegit/nodegit/pull/1008) + +## Upgraded to libgit2 v0.24.1 [PR #1010](https://github.com/nodegit/nodegit/pull/1010) +------- + +### Changes or improvements + +- Custom merge drivers can now be registered, which allows callers to + configure callbacks to honor `merge=driver` configuration in + `.gitattributes`. + +- Custom filters can now be registered with wildcard attributes, for + example `filter=*`. Consumers should examine the attributes parameter + of the `check` function for details. + +- Symlinks are now followed when locking a file, which can be + necessary when multiple worktrees share a base repository. + +- You can now set your own user-agent to be sent for HTTP requests by + using the `Libgit2.OPT.SET_USER_AGENT` with `Libgit2.opts()`. + +- You can set custom HTTP header fields to be sent along with requests + by passing them in the fetch and push options. + +- Tree objects are now assumed to be sorted. If a tree is not + correctly formed, it will give bad results. This is the git approach + and cuts a significant amount of time when reading the trees. + +- Filter registration is now protected against concurrent + registration. + +- Filenames which are not valid on Windows in an index no longer cause + to fail to parse it on that OS. + +- Rebases can now be performed purely in-memory, without touching the + repository's workdir. + +- When adding objects to the index, or when creating new tree or commit + objects, the inputs are validated to ensure that the dependent objects + exist and are of the correct type. This object validation can be + disabled with the `Libgit2.OPT.ENABLE_STRICT_OBJECT_CREATION` option. + +- The WinHTTP transport's handling of bad credentials now behaves like + the others, asking for credentials again. + +### API additions + +- `Blob.createFromStream()` and + `Blob.createFromStreamCommit` allow you to create a blob by + writing into a stream. Useful when you do not know the final size or + want to copy the contents from another stream. + +- `Config#lock` has been added, which allow for + transactional/atomic complex updates to the configuration, removing + the opportunity for concurrent operations and not committing any + changes until the unlock. + +- `DiffOptions` added a new callback `progress_cb` to report on the + progress of the diff as files are being compared. The documentation of + the existing callback `notify_cb` was updated to reflect that it only + gets called when new deltas are added to the diff. + +- `FetchOptions` and `PushOptions` have gained a `customHeaders` + field to set the extra HTTP header fields to send. + +- `Commit#headerField` allows you to look up a specific header + field in a commit. + +### Breaking API changes + +- `MergeOptions` now provides a `defaultDriver` that can be used + to provide the name of a merge driver to be used to handle files changed + during a merge. + +- The `Merge.TREE_FLAG` is now `Merge.FLAG`. Subsequently, + `treeFlags` field of the `MergeOptions` structure is now named `flags`. + +- The `Merge.FILE_FLAGS` enum is now `Merge.FILE_FLAG` for + consistency with other enum type names. + +- `Cert` descendent types now have a proper `parent` member + +- It is the responsibility of the refdb backend to decide what to do + with the reflog on ref deletion. The file-based backend must delete + it, a database-backed one may wish to archive it. + +- `Index#add` and `Index#conflictAdd` will now use the case + as provided by the caller on case insensitive systems. Previous + versions would keep the case as it existed in the index. This does + not affect the higher-level `Index#addByPath` or + `Index#addFromBuffer` functions. + +- The `Config.LEVEL` enum has gained a higher-priority value + `PROGRAMDATA` which represent a rough Windows equivalent + to the system level configuration. + +- `RebaseOptions` now has a `mergeOptions` field. + +- The index no longer performs locking itself. This is not something + users of the library should have been relying on as it's not part of + the concurrency guarantees. + +- `Remote#connect()` now takes a `customHeaders` argument to set + the extra HTTP header fields to send. + +- `Tree.entryFilemode`, `Tree.entryFilemodeRaw`, `Tree.entryId`, `Tree.entryName`, + `Tree.entryToObject`, and `Tree.entryType` have all been moved to the `TreeEntry` prototype. + Additionally, the `TreeEntry` fields have been removed in lieu of the corresponding functions to return + the data. + +## v0.12.2 [(2016-04-07)](https://github.com/nodegit/nodegit/releases/tag/v0.12.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.12.1...v0.12.2) + +## Added + +- We now provide 32-bit binaries for linux [PR #980](https://github.com/nodegit/nodegit/pull/980) + +## Bug fixes + +- Added memory clean up for references [PR #977](https://github.com/nodegit/nodegit/pull/977) and remotes [PR #981](https://github.com/nodegit/nodegit/pull/981) + +## v0.12.1 [(2016-03-30)](https://github.com/nodegit/nodegit/releases/tag/v0.12.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.12.0...v0.12.1) + +## Bug fixes + +- Fixed post install script dying on windows [PR #978](https://github.com/nodegit/nodegit/pull/978) + +## v0.12.0 [(2016-03-28)](https://github.com/nodegit/nodegit/releases/tag/v0.12.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.9...v0.12.0) + +## API changes +- `Ignore` + - Made `Ignore.pathIsIgnored` async [PR #970](https://github.com/nodegit/nodegit/pull/970) + +## Bug fixes + +- Added an error message when trying to install NodeGit without a required version of libstdc++ [PR #972](https://github.com/nodegit/nodegit/pull/972) +- Fix a crash when grabbing content out of a buffer that has unicode [PR #966](https://github.com/nodegit/nodegit/pull/966) +- Added some plumbing for better memory management [PR #958](https://github.com/nodegit/nodegit/pull/958) +- Fix `checkoutOptions` in `Stash#apply` [PR #956](https://github.com/nodegit/nodegit/pull/956) +- Fixed install when there is a space in the username on windows [PR #951](https://github.com/nodegit/nodegit/pull/951) +- Bump to nan@2.2.0 [PR #952](https://github.com/nodegit/nodegit/pull/952) + +## v0.11.9 [(2016-03-09)](https://github.com/nodegit/nodegit/releases/tag/v0.11.9) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.8...v0.11.9) + +- Fixed crash when calculating diff via `ConvenientPatch` [PR #945](https://github.com/nodegit/nodegit/pull/945) + +## v0.11.8 [(2016-03-07)](https://github.com/nodegit/nodegit/releases/tag/v0.11.8) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.7...v0.11.8) + +- Removed callback throttling due to segmentation faults. Will be implemented later. [PR #943](https://github.com/nodegit/nodegit/pull/943) + +## v0.11.7 [(2016-03-07)](https://github.com/nodegit/nodegit/releases/tag/v0.11.7) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.6...v0.11.7) + +- Added `Repository#mergeheadForeach` [PR #937](https://github.com/nodegit/nodegit/pull/937) +- Improved speed of all callbacks dramatically [PR #932](https://github.com/nodegit/nodegit/pull/932) +- Fixed `Merge.merge` docs to show it takes in an `AnnotatedCommit` and not a `Commit` [PR #935](https://github.com/nodegit/nodegit/pull/935) +- Fixed unicode in `Diff.blobToBuffer` getting corrupted [PR #935](https://github.com/nodegit/nodegit/pull/935) +- Fixed fetching/pulling to bitbucket in versions > v5.6 of node [PR #942](https://github.com/nodegit/nodegit/pull/942) + +## v0.11.6 [(2016-03-01)](https://github.com/nodegit/nodegit/releases/tag/v0.11.6) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.5...v0.11.6) + +- Added `Repository#checkoutRef` [PR #891](https://github.com/nodegit/nodegit/pull/891) +- `Repository#createCommitOnHead` no longer dies if the repo is empty [PR #927](https://github.com/nodegit/nodegit/pull/927) +- Fixed memory leak in `Patch#convenientFromDiff` [PR #930](https://github.com/nodegit/nodegit/pull/930) +- Generated files now have a header comment indicating that they are generated [PR #924](https://github.com/nodegit/nodegit/pull/924) +- Fixed http parsing errors in Node 5.6 [PR #931](https://github.com/nodegit/nodegit/pull/931) +- Fixed `Tree#walk` not returning the correct entries on `end` [PR #929](https://github.com/nodegit/nodegit/pull/929) + +## v0.11.5 [(2016-02-25)](https://github.com/nodegit/nodegit/releases/tag/v0.11.5) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.4...v0.11.5) + +- Fixed crash when calculating a diff [PR #922](https://github.com/nodegit/nodegit/pull/922) +- Fixed an issue with return values getting randomly corrupted [PR #923](https://github.com/nodegit/nodegit/pull/923)) + +## v0.11.4 [(2016-02-24)](https://github.com/nodegit/nodegit/releases/tag/v0.11.4) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.3...v0.11.4) + +- Fixed callback out values in callbacks from C++. This affects any NodeGit call that is passed a callback as an option [PR #921](https://github.com/nodegit/nodegit/pull/921) +- Fixed an issue with building the debug version of NodeGit on windows [PR #918](https://github.com/nodegit/nodegit/pull/918) + +## v0.11.3 [(2016-02-22)](https://github.com/nodegit/nodegit/releases/tag/v0.11.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.2...v0.11.3) + +- Fixed an issue where initializing NodeGit would sometimes seg fault. Also fixed an error when fetching concurrently [PR #912](https://github.com/nodegit/nodegit/pull/912) + +## v0.11.2 [(2016-02-18)](https://github.com/nodegit/nodegit/releases/tag/v0.11.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.1...v0.11.2) + +- Fixed an issue where when staging lines if the index is locked NodeGit just nuked it [PR #906](https://github.com/nodegit/nodegit/pull/906) +- Fixed diff calculation when staging lines/hunks [PR #906](https://github.com/nodegit/nodegit/pull/906) +- Fixed seg-fault in linux that happens when getting the diff of very small files [PR #908](https://github.com/nodegit/nodegit/pull/908) +- Fixed `RevWalk#fastWalk` dying when an error happens in libgit2 [PR #909](https://github.com/nodegit/nodegit/pull/909) + +## v0.11.1 [(2016-02-09)](https://github.com/nodegit/nodegit/releases/tag/v0.11.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.11.0...v0.11.1) + +- Numerous fixes and perf boosts to file history [PR #900](https://github.com/nodegit/nodegit/pull/900)[PR #896](https://github.com/nodegit/nodegit/pull/896) +- Several doc fixes [PR #899](https://github.com/nodegit/nodegit/pull/899)[PR #897](https://github.com/nodegit/nodegit/pull/897) + +## v0.11.0 [(2016-02-04)](https://github.com/nodegit/nodegit/releases/tag/v0.11.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.10.0...v0.11.0) + +- Change `Revert.commit` and `Revert.revert` to by async. [PR #887](https://github.com/nodegit/nodegit/pull/887) +- Added `RevWalk#fileHistoryWalk` for a faster way to retrieve history for a specific file. [PR #889](https://github.com/nodegit/nodegit/pull/889) + +## v0.10.0 [(2016-02-01)](https://github.com/nodegit/nodegit/releases/tag/v0.10.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.9.0...v0.10.0) + +- Clean mutexes are part of GC. No longer leaves processes running after the script ends [PR #880](https://github.com/nodegit/nodegit/pull/880) +- Increased the performance of `ConvenientPatch` by an order of magnitude [PR #883](https://github.com/nodegit/nodegit/pull/883) + +# API changes +- `ConvenientPatch` + - `ConvenientPatch` does not have a `patch` or a `delta` property associated with it, if you were using the `delta`, please just use prototype methods `oldFile`, `newFile`, and `Status`, which are stripped directly from the `delta`. + - `ConvenientPatch#hunks` returns a promise with an array of `ConvenientHunks`. +- `ConvenientHunk` + - `ConvenientHunk` does not have an exposed diffHunk associated with it, but does have the same members as diffHunk: + - `size()` : number of lines in the hunk + - `oldStart()` : old starting position + - `oldLines()` : number of lines in old file + - `newStart()` : new starting position + - `newLines()` : number of lines in new file + - `headerLen()` : length of header + - `header()` : returns the header of the hunk + - `lines()` : returns a promise containing `DiffLines`, not `ConvenientLines`. +- `DiffLine` +- `DiffLine` now contains the members `rawContent()` and `content()`. + - `rawContent()` contains the unformatted content of the line. This is no longer a string from the line to the end of the file. + - `content()` contains the utf8 formatted content of the line. + +## v0.9.0 [(2016-01-21)](https://github.com/nodegit/nodegit/releases/tag/v0.9.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.8.0...v0.9.0) + +- Thread safe fix to stop crashing on releasing mutexes [PR #876](https://github.com/nodegit/nodegit/pull/876) +- `Submodule#setIgnore`, `Submodule#setUpdate`, and `Submodule#setUrl` are now all async. `Submodule#status` and `Submodule#location` are now available [PR #867](https://github.com/nodegit/nodegit/pull/867) and [PR #870](https://github.com/nodegit/nodegit/pull/870) +- `Remote#defaultBranch` is now available [PR #872](https://github.com/nodegit/nodegit/pull/872) +- `Repository#mergeBranches` now takes in a `MergeOptions` parameter [PR #873](https://github.com/nodegit/nodegit/pull/873) +- Remove a NodeGit specific hack to make `Index#addAll` faster since that is fixed in libgit2 [PR #875](https://github.com/nodegit/nodegit/pull/875)) + +## v0.8.0 [(2016-01-15)](https://github.com/nodegit/nodegit/releases/tag/v0.8.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.7.0...0.8.0) + +- Thread safe locking has been added and currently is defaulted to off. Use `NodeGit.enableThreadSafety()` to turn on +- NodeGit no longer requires a specific Promise object from the `nodegit-promise` library to be passed in. You can now use whatever you want! +- `Repository#stageFilemode` now can accept an array of strings for files to update +- `Submodule#addToIndex`, `Submodule#addFinalize`, `Submodule#init`, `Submodule#open`, `Submodule#sync`, and `Submodule#update` are now all async methodss + +## v0.7.0 [(2016-01-08)](https://github.com/nodegit/nodegit/releases/tag/v0.7.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.6.3...0.7.0) + +- Bumped openssl to 1.0.2e to fix issues with prebuilts on linux platforms +- Fixed a bug with GIT_ITER_OVER breaking rebase and other iterative methods +- Make GraphDescendentOf asynchronous +- Fixed line length of utf8 stringss + +## v0.6.3 [(2015-12-16)](https://github.com/nodegit/nodegit/releases/tag/v0.6.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.6.2...0.6.3) + + - Fixed a bug where manually building for vanilla node would fail without explicitly + setting the target + +## v0.6.2 [(2015-12-16)](https://github.com/nodegit/nodegit/releases/tag/v0.6.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.6.1...0.6.2) + + - Fixed a bug where manually building on windows would fail (if unable to download a prebuilt binary) + +## v0.6.1 [(2015-12-14)](https://github.com/nodegit/nodegit/releases/tag/v0.6.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.6.0...0.6.1) + + - Fixed Treebuilder.create to have an optional source + - Added Repository.getSubmoduleNames + - Added Submodule.Foreach + +## v0.6.0 [(2015-12-08)](https://github.com/nodegit/nodegit/releases/tag/v0.6.0) + + - Added file mode staging + - Added a fast rev walk to do the rev walk in C++ and bubble the result up to JS + - Updated to latest libgit2 + - Updated to latest openssl + - Updated to latest nodegit-promise + - Removed c++11 dependency + - Fixed weirdness in lifecycle scripts + - Added downloading prebuilt binaries for electron + +## v0.4.1 [(2015-06-02)](https://github.com/nodegit/nodegit/tree/0.4.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.4.0...0.4.1) + +**Closed issues:** + +- Error: Module did not self-register [\#593](https://github.com/nodegit/nodegit/issues/593) + +- A guide on how to create a new branch, switch to it and delete it. [\#588](https://github.com/nodegit/nodegit/issues/588) + +- A way to get "gone" branches [\#583](https://github.com/nodegit/nodegit/issues/583) + +- Missing documentation pages for BranchIterator and NodeIterator [\#581](https://github.com/nodegit/nodegit/issues/581) + +- ELIFECYCLE error on `npm rebuild` [\#578](https://github.com/nodegit/nodegit/issues/578) + +- npm rebuild fails \(lifecycleScripts/clean should not delete lifecycleScripts!\) [\#576](https://github.com/nodegit/nodegit/issues/576) + +- Unable to compile and install v0.4.0 on Windows [\#575](https://github.com/nodegit/nodegit/issues/575) + +- Doesn't work with Electron [\#574](https://github.com/nodegit/nodegit/issues/574) + +- Doesn't work with io.js 2.x [\#573](https://github.com/nodegit/nodegit/issues/573) + +- Getting an exception during a fetchAll in defaultSignature in repository.js [\#572](https://github.com/nodegit/nodegit/issues/572) + +- tree\_entry path function not working when calling getEntry with a path including subdir [\#570](https://github.com/nodegit/nodegit/issues/570) + +- Build is broken on windows [\#565](https://github.com/nodegit/nodegit/issues/565) + +- Cloning git sub modules using "nodegit" npm module [\#560](https://github.com/nodegit/nodegit/issues/560) + +- How to get remote latest commit? [\#559](https://github.com/nodegit/nodegit/issues/559) + +- npm install fails for nw.js [\#558](https://github.com/nodegit/nodegit/issues/558) + +- nodegit and nw.js [\#557](https://github.com/nodegit/nodegit/issues/557) + +**Merged pull requests:** + +- Cherrypick tests [\#595](https://github.com/nodegit/nodegit/pull/595) ([jdgarcia](https://github.com/jdgarcia)) + +- Fix for issue \#591. TreeEntry.path\(\) throws when TreeEntry came from Tree.entries\(\) [\#592](https://github.com/nodegit/nodegit/pull/592) ([tomruggs](https://github.com/tomruggs)) + +- Standard merge [\#589](https://github.com/nodegit/nodegit/pull/589) ([jdgarcia](https://github.com/jdgarcia)) + +- Add `git\_index\_conflict\_get` and test [\#586](https://github.com/nodegit/nodegit/pull/586) ([johnhaley81](https://github.com/johnhaley81)) + +- Bump nan [\#584](https://github.com/nodegit/nodegit/pull/584) ([johnhaley81](https://github.com/johnhaley81)) + +- Fix CI false positives [\#582](https://github.com/nodegit/nodegit/pull/582) ([johnhaley81](https://github.com/johnhaley81)) + +- Added NodeGit.Checkout.index [\#579](https://github.com/nodegit/nodegit/pull/579) ([jdgarcia](https://github.com/jdgarcia)) + +- Check for existence to avoid throwing an error when there is no default signature [\#577](https://github.com/nodegit/nodegit/pull/577) ([tomruggs](https://github.com/tomruggs)) + +- Fix path function in tree\_entry \(fix for issue \#570\) [\#571](https://github.com/nodegit/nodegit/pull/571) ([jfremy](https://github.com/jfremy)) + +- Fix Rebase issues [\#568](https://github.com/nodegit/nodegit/pull/568) ([jdgarcia](https://github.com/jdgarcia)) + +- Fix build issues with 0.4.0 [\#566](https://github.com/nodegit/nodegit/pull/566) ([maxkorp](https://github.com/maxkorp)) + +- stop cleaning on post-install [\#562](https://github.com/nodegit/nodegit/pull/562) ([maxkorp](https://github.com/maxkorp)) + +## v0.4.0 [(2015-05-07)](https://github.com/nodegit/nodegit/tree/v0.4.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.3.3...v0.4.0) + +**Closed issues:** + +- Error installing nodegit as dependency of an atom-shell app [\#556](https://github.com/nodegit/nodegit/issues/556) + +- New version of nan is breaking compile [\#554](https://github.com/nodegit/nodegit/issues/554) + +- Install error from openssl [\#551](https://github.com/nodegit/nodegit/issues/551) + +- How to get Tag instance by tag\_name? [\#543](https://github.com/nodegit/nodegit/issues/543) + +- ELIFECYCLE Error on install [\#540](https://github.com/nodegit/nodegit/issues/540) + +- Remote.delete returns -3 [\#539](https://github.com/nodegit/nodegit/issues/539) + +- Repository.init should accept boolean value for is\_bare [\#538](https://github.com/nodegit/nodegit/issues/538) + +- getStatus hangs [\#537](https://github.com/nodegit/nodegit/issues/537) + +- Unable to compile or install with npm install nodegit [\#536](https://github.com/nodegit/nodegit/issues/536) + +- `options` not reusable, nodegit destroys it [\#533](https://github.com/nodegit/nodegit/issues/533) + +- 'Error: 'directory' exists and is not an empty directory' \(but it doesn't exist\) [\#530](https://github.com/nodegit/nodegit/issues/530) + +- hey !:-\) problem with Branch.iteratorNew \(support\) [\#528](https://github.com/nodegit/nodegit/issues/528) + +- hey !:-\) problem with Branch.iteratorNew [\#527](https://github.com/nodegit/nodegit/issues/527) + +- hey !:-\) problem with Branch.iteratorNew [\#526](https://github.com/nodegit/nodegit/issues/526) + +- hey !:-\) problem with Branch.iteratorNew [\#525](https://github.com/nodegit/nodegit/issues/525) + +- Error: Reference 'refs/remotes/user/foo/HEAD' not found [\#523](https://github.com/nodegit/nodegit/issues/523) + +- Path issues windows [\#522](https://github.com/nodegit/nodegit/issues/522) + +- Issues on scientific linux 6.6 [\#521](https://github.com/nodegit/nodegit/issues/521) + +- It's looking for node-typ under `/Users/johnh/.node-gyp` [\#518](https://github.com/nodegit/nodegit/issues/518) + +- Not working with iojs [\#516](https://github.com/nodegit/nodegit/issues/516) + +- Cred.sshKeyNew not working: Too many redirects or authentication replays [\#511](https://github.com/nodegit/nodegit/issues/511) + +- Open a Repo from a subfolder [\#509](https://github.com/nodegit/nodegit/issues/509) + +- Create git-like CLI [\#508](https://github.com/nodegit/nodegit/issues/508) + +- Cannot create an instance of Packbuilder [\#507](https://github.com/nodegit/nodegit/issues/507) + +- Cannot find module '../build/Debug/nodegit' [\#506](https://github.com/nodegit/nodegit/issues/506) + +- Bug with oid implicit cast inside C++ [\#501](https://github.com/nodegit/nodegit/issues/501) + +- Failed to `require` on Ubuntu 12.04LTS [\#493](https://github.com/nodegit/nodegit/issues/493) + +- Enable `git\_config` [\#449](https://github.com/nodegit/nodegit/issues/449) + +- Pull example doesn't fully update the index [\#389](https://github.com/nodegit/nodegit/issues/389) + +**Merged pull requests:** + +- There is an incompatibility with NaN 1.8.x, keeping 1.7.x for now. [\#552](https://github.com/nodegit/nodegit/pull/552) ([wiggzz](https://github.com/wiggzz)) + +- A wrapper for git\_diff\_blob\_to\_buffer [\#550](https://github.com/nodegit/nodegit/pull/550) ([bleathem](https://github.com/bleathem)) + +- Update to 0.4.0 [\#548](https://github.com/nodegit/nodegit/pull/548) ([tbranyen](https://github.com/tbranyen)) + +- Removed the superflous "line" argument [\#547](https://github.com/nodegit/nodegit/pull/547) ([bleathem](https://github.com/bleathem)) + +- This fixes polling sync promises in callbacks. [\#546](https://github.com/nodegit/nodegit/pull/546) ([johnhaley81](https://github.com/johnhaley81)) + +- Add get/set config string methods and tests [\#545](https://github.com/nodegit/nodegit/pull/545) ([johnhaley81](https://github.com/johnhaley81)) + +- Make `Remote.delete` async and return error messages correctly [\#544](https://github.com/nodegit/nodegit/pull/544) ([johnhaley81](https://github.com/johnhaley81)) + +- Bump "nodegit-promise" version [\#542](https://github.com/nodegit/nodegit/pull/542) ([johnhaley81](https://github.com/johnhaley81)) + +- Introduced a new ConvenientLine class to wrap the lines returned from ConvenientHunk. [\#541](https://github.com/nodegit/nodegit/pull/541) ([bleathem](https://github.com/bleathem)) + +- Fix some things missed by the generating scripts [\#535](https://github.com/nodegit/nodegit/pull/535) ([johnhaley81](https://github.com/johnhaley81)) + +- Attempt remove the delete keyword [\#534](https://github.com/nodegit/nodegit/pull/534) ([tbranyen](https://github.com/tbranyen)) + +- Fix freeing a `GitOid` that was passed as a string [\#531](https://github.com/nodegit/nodegit/pull/531) ([johnhaley81](https://github.com/johnhaley81)) + +- fix typo: "byes" [\#529](https://github.com/nodegit/nodegit/pull/529) ([rutsky](https://github.com/rutsky)) + +- Add convenience methods to status file [\#524](https://github.com/nodegit/nodegit/pull/524) ([maxkorp](https://github.com/maxkorp)) + +- Lots of complaints of missing build/Debug/nodegit [\#520](https://github.com/nodegit/nodegit/pull/520) ([tbranyen](https://github.com/tbranyen)) + +- Add `Graph.aheadBehind` and tests [\#517](https://github.com/nodegit/nodegit/pull/517) ([johnhaley81](https://github.com/johnhaley81)) + +- Update to use libgit2 v0.22.2 [\#515](https://github.com/nodegit/nodegit/pull/515) ([johnhaley81](https://github.com/johnhaley81)) + +- Add `Repository.prototype.fetchheadForeach` and tests [\#514](https://github.com/nodegit/nodegit/pull/514) ([johnhaley81](https://github.com/johnhaley81)) + +- Converted create methods to be synchronous [\#513](https://github.com/nodegit/nodegit/pull/513) ([tbranyen](https://github.com/tbranyen)) + +- Fix atom-shell build on windows [\#512](https://github.com/nodegit/nodegit/pull/512) ([johnhaley81](https://github.com/johnhaley81)) + +- Update Checkout and Merge [\#505](https://github.com/nodegit/nodegit/pull/505) ([orderedlist](https://github.com/orderedlist)) + +- Add note tests [\#504](https://github.com/nodegit/nodegit/pull/504) ([tbranyen](https://github.com/tbranyen)) + +- Revert "Guide navigation is currently confusing" [\#503](https://github.com/nodegit/nodegit/pull/503) ([thgaskell](https://github.com/thgaskell)) + +- Improve coverage [\#502](https://github.com/nodegit/nodegit/pull/502) ([tbranyen](https://github.com/tbranyen)) + +- Adds in CPP code coverage and joined JS [\#499](https://github.com/nodegit/nodegit/pull/499) ([tbranyen](https://github.com/tbranyen)) + +- Add twitter username to README.md [\#498](https://github.com/nodegit/nodegit/pull/498) ([johnhaley81](https://github.com/johnhaley81)) + +- Fix symbolic reference handling in getReferences [\#496](https://github.com/nodegit/nodegit/pull/496) ([billt2006](https://github.com/billt2006)) + +- Enable `git\_stash\_foreach` [\#495](https://github.com/nodegit/nodegit/pull/495) ([johnhaley81](https://github.com/johnhaley81)) + +- Guide navigation is currently confusing [\#494](https://github.com/nodegit/nodegit/pull/494) ([tbranyen](https://github.com/tbranyen)) + +- Fix gitter badge for npm [\#492](https://github.com/nodegit/nodegit/pull/492) ([billt2006](https://github.com/billt2006)) + +- Add automatically generated change log file. [\#465](https://github.com/nodegit/nodegit/pull/465) ([skywinder](https://github.com/skywinder)) + +## v0.3.3 [(2015-03-16)](https://github.com/nodegit/nodegit/tree/v0.3.3) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.3.2...v0.3.3) + +**Merged pull requests:** + +- Download all dev dependencies before build [\#491](https://github.com/nodegit/nodegit/pull/491) ([johnhaley81](https://github.com/johnhaley81)) + +## v0.3.2 [(2015-03-16)](https://github.com/nodegit/nodegit/tree/v0.3.2) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.3.1...v0.3.2) + +**Closed issues:** + +- Amazon S3 CDN link is broken [\#482](https://github.com/nodegit/nodegit/issues/482) + +**Merged pull requests:** + +- Confirm builder exists before building [\#490](https://github.com/nodegit/nodegit/pull/490) ([johnhaley81](https://github.com/johnhaley81)) + +## v0.3.1 [(2015-03-14)](https://github.com/nodegit/nodegit/tree/v0.3.1) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.3.0...v0.3.1) + +**Merged pull requests:** + +- Revert node-pre-gyp to install not build [\#486](https://github.com/nodegit/nodegit/pull/486) ([tbranyen](https://github.com/tbranyen)) + +## v0.3.0 [(2015-03-13)](https://github.com/nodegit/nodegit/tree/v0.3.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.7...v0.3.0) **Closed issues:** +- Push [\#463](https://github.com/nodegit/nodegit/issues/463) + - Suppress astyle errors [\#459](https://github.com/nodegit/nodegit/issues/459) - io.js support [\#447](https://github.com/nodegit/nodegit/issues/447) - Meteor: icon fonts not working \(Resource interpreted as Font but transferred with MIME type text/html\) [\#443](https://github.com/nodegit/nodegit/issues/443) -- Don't let users set the payloads through JS [\#436](https://github.com/nodegit/nodegit/issues/436) - -- Transfer callback stats are being converted wrong [\#432](https://github.com/nodegit/nodegit/issues/432) +- AnnotatedCommit.x listing as Annotated.commitX [\#437](https://github.com/nodegit/nodegit/issues/437) - fetchAll\(\) fails unless a default signature is available [\#431](https://github.com/nodegit/nodegit/issues/431) -- Push example needs to be updated [\#429](https://github.com/nodegit/nodegit/issues/429) - - Question: Is there a certificateCheck option available for pushing to a remote repository? [\#420](https://github.com/nodegit/nodegit/issues/420) - Repository.open returns empty object [\#412](https://github.com/nodegit/nodegit/issues/412) @@ -38,8 +3350,6 @@ - Subtrees + custom error handling [\#400](https://github.com/nodegit/nodegit/issues/400) -- Callbacks need to handle more use-cases [\#395](https://github.com/nodegit/nodegit/issues/395) - - How to use nodegit in atom shell ..... [\#393](https://github.com/nodegit/nodegit/issues/393) - Cannot create a new branch [\#391](https://github.com/nodegit/nodegit/issues/391) @@ -50,40 +3360,58 @@ - Rename combyne folder to templates [\#378](https://github.com/nodegit/nodegit/issues/378) -- Building for atom-shell v0.21.0 fails [\#376](https://github.com/nodegit/nodegit/issues/376) - - Cloning SSH repos seem to fail [\#372](https://github.com/nodegit/nodegit/issues/372) - Commit.getDiff is backwards? [\#368](https://github.com/nodegit/nodegit/issues/368) - List all files in repo \(git ls-tree\) [\#365](https://github.com/nodegit/nodegit/issues/365) -- Cloning locks up when more than 3 at the same time. [\#364](https://github.com/nodegit/nodegit/issues/364) - - Checking out a branch [\#361](https://github.com/nodegit/nodegit/issues/361) - nodegit no longer builds in nwjs [\#360](https://github.com/nodegit/nodegit/issues/360) -- Update to v0.22 of libgit2 [\#355](https://github.com/nodegit/nodegit/issues/355) - - Module install/build fails on Heroku [\#332](https://github.com/nodegit/nodegit/issues/332) - 2 Step Authentication [\#323](https://github.com/nodegit/nodegit/issues/323) -- Needed Examples for 0.3.0 [\#321](https://github.com/nodegit/nodegit/issues/321) +**Merged pull requests:** + +- Rename `Annotated` to `AnnotatedCommit` [\#485](https://github.com/nodegit/nodegit/pull/485) ([johnhaley81](https://github.com/johnhaley81)) -- Tests randomly failing in AppVeyor [\#316](https://github.com/nodegit/nodegit/issues/316) +- Bump version to 0.3.0 [\#484](https://github.com/nodegit/nodegit/pull/484) ([johnhaley81](https://github.com/johnhaley81)) -- Start using prepublishing to fix dependencies [\#301](https://github.com/nodegit/nodegit/issues/301) +- Remove unneeded connect call from push example [\#483](https://github.com/nodegit/nodegit/pull/483) ([johnhaley81](https://github.com/johnhaley81)) -- Get commits history only for a file [\#220](https://github.com/nodegit/nodegit/issues/220) +- Update push example [\#481](https://github.com/nodegit/nodegit/pull/481) ([billt2006](https://github.com/billt2006)) -- enable Index.addAll and related [\#131](https://github.com/nodegit/nodegit/issues/131) +- Fix trailing space in atom-shell windows install [\#480](https://github.com/nodegit/nodegit/pull/480) ([johnhaley81](https://github.com/johnhaley81)) -**Merged pull requests:** +- Fix atom-shell install on windows [\#479](https://github.com/nodegit/nodegit/pull/479) ([johnhaley81](https://github.com/johnhaley81)) + +- Updated API documentation link to work with NPM's markdown renderer. [\#477](https://github.com/nodegit/nodegit/pull/477) ([hughfdjackson](https://github.com/hughfdjackson)) + +- Add option to `fetch` to prune the remote afterwards [\#476](https://github.com/nodegit/nodegit/pull/476) ([johnhaley81](https://github.com/johnhaley81)) + +- Make index.addAll use status to increase performance [\#475](https://github.com/nodegit/nodegit/pull/475) ([maxkorp](https://github.com/maxkorp)) + +- Add defaults to `Remote.prototype.push` [\#474](https://github.com/nodegit/nodegit/pull/474) ([johnhaley81](https://github.com/johnhaley81)) + +- Fix `createCommitOnHead` [\#473](https://github.com/nodegit/nodegit/pull/473) ([johnhaley81](https://github.com/johnhaley81)) + +- Move guides around to remove subindexes [\#472](https://github.com/nodegit/nodegit/pull/472) ([orderedlist](https://github.com/orderedlist)) + +- Put `Remote.Push` on the remote prototype [\#470](https://github.com/nodegit/nodegit/pull/470) ([johnhaley81](https://github.com/johnhaley81)) + +- Change Repository.prototype.setHead to be asynchronous [\#469](https://github.com/nodegit/nodegit/pull/469) ([jrbalsano](https://github.com/jrbalsano)) + +- Test in Node 0.12 and io.js [\#468](https://github.com/nodegit/nodegit/pull/468) ([tbranyen](https://github.com/tbranyen)) + +- Add checkoutBranch convenience method [\#466](https://github.com/nodegit/nodegit/pull/466) ([johnhaley81](https://github.com/johnhaley81)) - Don't assign enums to \_\_proto\_\_ [\#464](https://github.com/nodegit/nodegit/pull/464) ([orderedlist](https://github.com/orderedlist)) +- Fix push example [\#462](https://github.com/nodegit/nodegit/pull/462) ([johnhaley81](https://github.com/johnhaley81)) + - Adds support for strarray in structs [\#461](https://github.com/nodegit/nodegit/pull/461) ([orderedlist](https://github.com/orderedlist)) - supress astyle warnings [\#460](https://github.com/nodegit/nodegit/pull/460) ([maxkorp](https://github.com/maxkorp)) @@ -116,22 +3444,14 @@ - Fix transfer callback stats [\#440](https://github.com/nodegit/nodegit/pull/440) ([johnhaley81](https://github.com/johnhaley81)) -- Put `uv\_async\_init` on main thread [\#438](https://github.com/nodegit/nodegit/pull/438) ([johnhaley81](https://github.com/johnhaley81)) - -- Fix libuv threading issue [\#435](https://github.com/nodegit/nodegit/pull/435) ([johnhaley81](https://github.com/johnhaley81)) - - Automatically free repositories post clone [\#434](https://github.com/nodegit/nodegit/pull/434) ([tbranyen](https://github.com/tbranyen)) - Skip transfer progress test until it's fixed [\#433](https://github.com/nodegit/nodegit/pull/433) ([johnhaley81](https://github.com/johnhaley81)) -- git\_create\_tag doesn't have the correct descriptor [\#430](https://github.com/nodegit/nodegit/pull/430) ([mattyclarkson](https://github.com/mattyclarkson)) - - Change environment to default for upgraded service [\#428](https://github.com/nodegit/nodegit/pull/428) ([maxkorp](https://github.com/maxkorp)) - Make the `git\_remote\_push` function async [\#427](https://github.com/nodegit/nodegit/pull/427) ([johnhaley81](https://github.com/johnhaley81)) -- Fix file lock 2 [\#426](https://github.com/nodegit/nodegit/pull/426) ([tbranyen](https://github.com/tbranyen)) - - Attempt to fix Windows file locking bug [\#425](https://github.com/nodegit/nodegit/pull/425) ([tbranyen](https://github.com/tbranyen)) - Fix seg faults [\#424](https://github.com/nodegit/nodegit/pull/424) ([johnhaley81](https://github.com/johnhaley81)) @@ -146,6 +3466,8 @@ - Update jsdoc and ignore some methods [\#418](https://github.com/nodegit/nodegit/pull/418) ([orderedlist](https://github.com/orderedlist)) +- Converting Examples to Guides [\#417](https://github.com/nodegit/nodegit/pull/417) ([tbranyen](https://github.com/tbranyen)) + - Fix callbacks with just return value and single payload [\#416](https://github.com/nodegit/nodegit/pull/416) ([johnhaley81](https://github.com/johnhaley81)) - Add `git\_reset` and `git\_reset\_default` [\#415](https://github.com/nodegit/nodegit/pull/415) ([johnhaley81](https://github.com/johnhaley81)) @@ -156,8 +3478,6 @@ - Tree Entry getBlob\(\) should also support the callback pattern. [\#405](https://github.com/nodegit/nodegit/pull/405) ([jeffwilcox](https://github.com/jeffwilcox)) -- Tree Entry getBlob\(\) should also support the callback pattern. [\#404](https://github.com/nodegit/nodegit/pull/404) ([jeffwilcox](https://github.com/jeffwilcox)) - - Adds in git\_checkout\_tree [\#402](https://github.com/nodegit/nodegit/pull/402) ([tbranyen](https://github.com/tbranyen)) - Made changes to the README [\#399](https://github.com/nodegit/nodegit/pull/399) ([tbranyen](https://github.com/tbranyen)) @@ -184,8 +3504,6 @@ - Make all cred generators sync. [\#377](https://github.com/nodegit/nodegit/pull/377) ([maxkorp](https://github.com/maxkorp)) -- Plaintext credential not async [\#375](https://github.com/nodegit/nodegit/pull/375) ([mbleigh](https://github.com/mbleigh)) - - Status and StatusList [\#374](https://github.com/nodegit/nodegit/pull/374) ([orderedlist](https://github.com/orderedlist)) - Fix the package scripts [\#373](https://github.com/nodegit/nodegit/pull/373) ([maxkorp](https://github.com/maxkorp)) @@ -202,17 +3520,15 @@ - Updated fs-extra to 0.15.0 [\#363](https://github.com/nodegit/nodegit/pull/363) ([johnhaley81](https://github.com/johnhaley81)) -- update to libgit2 v0.21.5 [\#362](https://github.com/nodegit/nodegit/pull/362) ([maxkorp](https://github.com/maxkorp)) - - Make remote\#download async [\#326](https://github.com/nodegit/nodegit/pull/326) ([tbranyen](https://github.com/tbranyen)) - Enable transfer progress [\#325](https://github.com/nodegit/nodegit/pull/325) ([tbranyen](https://github.com/tbranyen)) -## [v0.2.7](https://github.com/nodegit/nodegit/tree/v0.2.7) (2015-01-21) +## v0.2.7 [(2015-01-21)](https://github.com/nodegit/nodegit/tree/v0.2.7) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.6...v0.2.7) -## [v0.2.6](https://github.com/nodegit/nodegit/tree/v0.2.6) (2015-01-20) +## v0.2.6 [(2015-01-20)](https://github.com/nodegit/nodegit/tree/v0.2.6) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.5...v0.2.6) @@ -220,7 +3536,7 @@ - \[WIP\] Added in some diff functions from libgit2 [\#348](https://github.com/nodegit/nodegit/pull/348) ([johnhaley81](https://github.com/johnhaley81)) -## [v0.2.5](https://github.com/nodegit/nodegit/tree/v0.2.5) (2015-01-20) +## v0.2.5 [(2015-01-20)](https://github.com/nodegit/nodegit/tree/v0.2.5) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.4...v0.2.5) @@ -234,10 +3550,6 @@ - Can't require nodegit without building it explicitly [\#340](https://github.com/nodegit/nodegit/issues/340) -- Can't build for node-webkit [\#335](https://github.com/nodegit/nodegit/issues/335) - -- Error when creating a new ssh key during credential handshake. [\#333](https://github.com/nodegit/nodegit/issues/333) - - Tracking down bugs [\#331](https://github.com/nodegit/nodegit/issues/331) - Document possible values of CloneOptions [\#330](https://github.com/nodegit/nodegit/issues/330) @@ -250,10 +3562,6 @@ - Fetch doesn't seem to work with https urls. [\#322](https://github.com/nodegit/nodegit/issues/322) -- `git diff --cached --name-only` [\#183](https://github.com/nodegit/nodegit/issues/183) - -- git status [\#170](https://github.com/nodegit/nodegit/issues/170) - **Merged pull requests:** - Refactor installation and publication [\#359](https://github.com/nodegit/nodegit/pull/359) ([maxkorp](https://github.com/maxkorp)) @@ -264,14 +3572,10 @@ - Fixed a typo in the debug build instruction. [\#356](https://github.com/nodegit/nodegit/pull/356) ([mcollina](https://github.com/mcollina)) -- Added a null check on freeing the raw object [\#354](https://github.com/nodegit/nodegit/pull/354) ([johnhaley81](https://github.com/johnhaley81)) - - \[WIP\] Attempt at fixing appveyor [\#352](https://github.com/nodegit/nodegit/pull/352) ([johnhaley81](https://github.com/johnhaley81)) - Updated to nan 1.5.0 and fixed build errors [\#351](https://github.com/nodegit/nodegit/pull/351) ([johnhaley81](https://github.com/johnhaley81)) -- WIP: Refactor publishing [\#350](https://github.com/nodegit/nodegit/pull/350) ([maxkorp](https://github.com/maxkorp)) - - Added debug build instructions. [\#349](https://github.com/nodegit/nodegit/pull/349) ([mcollina](https://github.com/mcollina)) - Added checkout head method and tests [\#347](https://github.com/nodegit/nodegit/pull/347) ([johnhaley81](https://github.com/johnhaley81)) @@ -298,7 +3602,7 @@ - moving some deps to devdeps [\#320](https://github.com/nodegit/nodegit/pull/320) ([maxkorp](https://github.com/maxkorp)) -## [v0.2.4](https://github.com/nodegit/nodegit/tree/v0.2.4) (2014-12-05) +## v0.2.4 [(2014-12-05)](https://github.com/nodegit/nodegit/tree/v0.2.4) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.3...v0.2.4) @@ -314,8 +3618,6 @@ - current branch [\#305](https://github.com/nodegit/nodegit/issues/305) -- Don't require json output for production [\#302](https://github.com/nodegit/nodegit/issues/302) - - Module fails to load [\#299](https://github.com/nodegit/nodegit/issues/299) - How to list all tags? [\#298](https://github.com/nodegit/nodegit/issues/298) @@ -324,10 +3626,6 @@ - Next release checklist [\#256](https://github.com/nodegit/nodegit/issues/256) -- CI issues [\#202](https://github.com/nodegit/nodegit/issues/202) - -- Variable names in the Docs? [\#157](https://github.com/nodegit/nodegit/issues/157) - **Merged pull requests:** - Fixed fetch to be async and use callbacks [\#319](https://github.com/nodegit/nodegit/pull/319) ([johnhaley81](https://github.com/johnhaley81)) @@ -346,8 +3644,6 @@ - fix signature.now and add signature tests [\#308](https://github.com/nodegit/nodegit/pull/308) ([maxkorp](https://github.com/maxkorp)) -- Add a Gitter chat badge to README.md [\#304](https://github.com/nodegit/nodegit/pull/304) ([gitter-badger](https://github.com/gitter-badger)) - - move nodegit.js to a template to remove idefs dependency [\#303](https://github.com/nodegit/nodegit/pull/303) ([maxkorp](https://github.com/maxkorp)) - Fixed tag list and added a test for it [\#300](https://github.com/nodegit/nodegit/pull/300) ([johnhaley81](https://github.com/johnhaley81)) @@ -358,11 +3654,11 @@ - Styling [\#295](https://github.com/nodegit/nodegit/pull/295) ([maxkorp](https://github.com/maxkorp)) -## [v0.2.3](https://github.com/nodegit/nodegit/tree/v0.2.3) (2014-11-25) +## v0.2.3 [(2014-11-25)](https://github.com/nodegit/nodegit/tree/v0.2.3) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.2...v0.2.3) -## [v0.2.2](https://github.com/nodegit/nodegit/tree/v0.2.2) (2014-11-25) +## v0.2.2 [(2014-11-25)](https://github.com/nodegit/nodegit/tree/v0.2.2) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.1...v0.2.2) @@ -370,7 +3666,7 @@ - Moved some dependencies around to help the generate not fail [\#294](https://github.com/nodegit/nodegit/pull/294) ([johnhaley81](https://github.com/johnhaley81)) -## [v0.2.1](https://github.com/nodegit/nodegit/tree/v0.2.1) (2014-11-25) +## v0.2.1 [(2014-11-25)](https://github.com/nodegit/nodegit/tree/v0.2.1) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.2.0...v0.2.1) @@ -378,7 +3674,7 @@ - Rewrite installer [\#293](https://github.com/nodegit/nodegit/pull/293) ([johnhaley81](https://github.com/johnhaley81)) -## [v0.2.0](https://github.com/nodegit/nodegit/tree/v0.2.0) (2014-11-25) +## v0.2.0 [(2014-11-25)](https://github.com/nodegit/nodegit/tree/v0.2.0) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.1.4...v0.2.0) @@ -400,8 +3696,6 @@ - require\('path'\).Repo.open\(...\) returns {} [\#241](https://github.com/nodegit/nodegit/issues/241) -- Refactoring how internal C objects are stored in V8 and passed to JS [\#240](https://github.com/nodegit/nodegit/issues/240) - - RevWalk malloc error [\#239](https://github.com/nodegit/nodegit/issues/239) - OS X tests in Travis-CI [\#237](https://github.com/nodegit/nodegit/issues/237) @@ -420,24 +3714,12 @@ - Did getReferences dissapear? [\#223](https://github.com/nodegit/nodegit/issues/223) -- How to get UNIX file attributes? [\#222](https://github.com/nodegit/nodegit/issues/222) - -- How to get mtime for TreeEntry/file? [\#221](https://github.com/nodegit/nodegit/issues/221) - -- Commit only if there is changes [\#219](https://github.com/nodegit/nodegit/issues/219) - - Again for \#147 [\#218](https://github.com/nodegit/nodegit/issues/218) - Update documentation on nodegit.org [\#217](https://github.com/nodegit/nodegit/issues/217) -- Can you provide the prebuilt binaries on S3? [\#216](https://github.com/nodegit/nodegit/issues/216) - - Stable = bump to 1.0 [\#215](https://github.com/nodegit/nodegit/issues/215) -- How can I push a commit? [\#214](https://github.com/nodegit/nodegit/issues/214) - -- "Error: Reference 'refs/heads/master' not found " when create commit in a empty repo [\#213](https://github.com/nodegit/nodegit/issues/213) - - Example on nodegit.com homepage is invalid [\#211](https://github.com/nodegit/nodegit/issues/211) - tree.diffWorkDir deprecated? [\#209](https://github.com/nodegit/nodegit/issues/209) @@ -454,76 +3736,18 @@ - CloneOptions documentation lacking [\#192](https://github.com/nodegit/nodegit/issues/192) -- Getting the HEAD commit SHA [\#191](https://github.com/nodegit/nodegit/issues/191) - - Webpage examples are not up to date [\#190](https://github.com/nodegit/nodegit/issues/190) - Automatically generate structs from types array [\#187](https://github.com/nodegit/nodegit/issues/187) -- Adding a new file always returns the same SHA. [\#185](https://github.com/nodegit/nodegit/issues/185) - -- Current Travis passes with fallback binary. [\#182](https://github.com/nodegit/nodegit/issues/182) - - Error: connect ETIMEDOUT during install [\#179](https://github.com/nodegit/nodegit/issues/179) - TODO [\#177](https://github.com/nodegit/nodegit/issues/177) - Notes [\#176](https://github.com/nodegit/nodegit/issues/176) -- How to create a branch [\#174](https://github.com/nodegit/nodegit/issues/174) - -- `p-\>index\_map.data' failed [\#172](https://github.com/nodegit/nodegit/issues/172) - - Integration improvements. [\#171](https://github.com/nodegit/nodegit/issues/171) -- invalid ELF header from build/Release/nodegit.node [\#167](https://github.com/nodegit/nodegit/issues/167) - -- Removing generated source. [\#165](https://github.com/nodegit/nodegit/issues/165) - -- using newer libgit2 version [\#164](https://github.com/nodegit/nodegit/issues/164) - -- Generating tests for bindings. [\#163](https://github.com/nodegit/nodegit/issues/163) - -- Streams? [\#161](https://github.com/nodegit/nodegit/issues/161) - -- Unfortunately GitHub decided to go their own way :-/ [\#160](https://github.com/nodegit/nodegit/issues/160) - -- Separate additional meta data from JSON. [\#152](https://github.com/nodegit/nodegit/issues/152) - -- Git Pull [\#151](https://github.com/nodegit/nodegit/issues/151) - -- branch.cc missing from binding.gyp [\#149](https://github.com/nodegit/nodegit/issues/149) - -- numDeltasOfType is a static method not on the prototype [\#148](https://github.com/nodegit/nodegit/issues/148) - -- Not sure how this happen [\#147](https://github.com/nodegit/nodegit/issues/147) - -- Emscripten binding templates. [\#142](https://github.com/nodegit/nodegit/issues/142) - -- git+ssh transport support [\#136](https://github.com/nodegit/nodegit/issues/136) - -- Support for git\_merge [\#133](https://github.com/nodegit/nodegit/issues/133) - -- Random segfault in kh\_get\_off [\#132](https://github.com/nodegit/nodegit/issues/132) - -- Unexpected HTTP status code: 401 [\#130](https://github.com/nodegit/nodegit/issues/130) - -- Commit\#messageEncoding triggers a segmentation fault [\#129](https://github.com/nodegit/nodegit/issues/129) - -- Passing CloneOptions [\#127](https://github.com/nodegit/nodegit/issues/127) - -- Commit.getDiff\(\) fails for first commit [\#125](https://github.com/nodegit/nodegit/issues/125) - -- Adding directories [\#121](https://github.com/nodegit/nodegit/issues/121) - -- checkout head and update working tree [\#114](https://github.com/nodegit/nodegit/issues/114) - -- Index add cacheinfo [\#111](https://github.com/nodegit/nodegit/issues/111) - -- Remote.prototype.pushUrl\(\) Segmentation fault: 11 and Remote.prototype.setPushUrl\(url\) not working ? [\#109](https://github.com/nodegit/nodegit/issues/109) - -- Set working tree [\#93](https://github.com/nodegit/nodegit/issues/93) - **Merged pull requests:** - add history.md and update readme [\#291](https://github.com/nodegit/nodegit/pull/291) ([maxkorp](https://github.com/maxkorp)) @@ -554,8 +3778,6 @@ - Exposes the NodeGit Promise implementation [\#278](https://github.com/nodegit/nodegit/pull/278) ([tbranyen](https://github.com/tbranyen)) -- Fixes incorrect method used in path lookup [\#277](https://github.com/nodegit/nodegit/pull/277) ([tbranyen](https://github.com/tbranyen)) - - \[WIP\] Update examples [\#276](https://github.com/nodegit/nodegit/pull/276) ([johnhaley81](https://github.com/johnhaley81)) - Added script to generate missing tests [\#274](https://github.com/nodegit/nodegit/pull/274) ([johnhaley81](https://github.com/johnhaley81)) @@ -572,8 +3794,6 @@ - require --documentation flag to include text in idefs [\#265](https://github.com/nodegit/nodegit/pull/265) ([maxkorp](https://github.com/maxkorp)) -- This is a test [\#263](https://github.com/nodegit/nodegit/pull/263) ([johnhaley81](https://github.com/johnhaley81)) - - Added ability for callbacks to poll promises for fulfillment value [\#260](https://github.com/nodegit/nodegit/pull/260) ([johnhaley81](https://github.com/johnhaley81)) - Generate nodegit from libgit2 docs and refactor descriptor [\#259](https://github.com/nodegit/nodegit/pull/259) ([johnhaley81](https://github.com/johnhaley81)) @@ -582,20 +3802,14 @@ - Bump to latest libgit2 [\#257](https://github.com/nodegit/nodegit/pull/257) ([tbranyen](https://github.com/tbranyen)) -- Added status methods [\#255](https://github.com/nodegit/nodegit/pull/255) ([tbranyen](https://github.com/tbranyen)) - - Use Start-Process to start pageant.exe [\#254](https://github.com/nodegit/nodegit/pull/254) ([FeodorFitsner](https://github.com/FeodorFitsner)) -- Adds in git\_index\_add and GitIndexInfo struct [\#253](https://github.com/nodegit/nodegit/pull/253) ([tbranyen](https://github.com/tbranyen)) - - Adds in a broken unit test for \#109 [\#252](https://github.com/nodegit/nodegit/pull/252) ([tbranyen](https://github.com/tbranyen)) - Added more git\_cred methods [\#251](https://github.com/nodegit/nodegit/pull/251) ([johnhaley81](https://github.com/johnhaley81)) - Refactor classes [\#250](https://github.com/nodegit/nodegit/pull/250) ([maxkorp](https://github.com/maxkorp)) -- Remove openssl [\#249](https://github.com/nodegit/nodegit/pull/249) ([tbranyen](https://github.com/tbranyen)) - - Update Readme, to improve example code [\#248](https://github.com/nodegit/nodegit/pull/248) ([nmn](https://github.com/nmn)) - \[TEST\] Appveyor agent [\#247](https://github.com/nodegit/nodegit/pull/247) ([tbranyen](https://github.com/tbranyen)) @@ -608,8 +3822,6 @@ - Blame methods [\#242](https://github.com/nodegit/nodegit/pull/242) ([tbranyen](https://github.com/tbranyen)) -- Enable multios [\#238](https://github.com/nodegit/nodegit/pull/238) ([maxkorp](https://github.com/maxkorp)) - - Add revwalk.hide and revwalk.simplifyFirstParent [\#235](https://github.com/nodegit/nodegit/pull/235) ([tbranyen](https://github.com/tbranyen)) - Add revwalk.hide and revwalk.simplifyFirstParent [\#234](https://github.com/nodegit/nodegit/pull/234) ([orderedlist](https://github.com/orderedlist)) @@ -624,10 +3836,6 @@ - Test fixes [\#226](https://github.com/nodegit/nodegit/pull/226) ([johnhaley81](https://github.com/johnhaley81)) -- Get HEAD SHA [\#210](https://github.com/nodegit/nodegit/pull/210) ([tbranyen](https://github.com/tbranyen)) - -- Started working on initializing a repo with init options [\#208](https://github.com/nodegit/nodegit/pull/208) ([tbranyen](https://github.com/tbranyen)) - - Added new methods in checkout and repository [\#207](https://github.com/nodegit/nodegit/pull/207) ([tbranyen](https://github.com/tbranyen)) - Added additional remote methods [\#206](https://github.com/nodegit/nodegit/pull/206) ([tbranyen](https://github.com/tbranyen)) @@ -658,13 +3866,7 @@ - Better installation flow for developing. [\#180](https://github.com/nodegit/nodegit/pull/180) ([tbranyen](https://github.com/tbranyen)) -- \[Experimental\] Emscripten fun. [\#168](https://github.com/nodegit/nodegit/pull/168) ([tbranyen](https://github.com/tbranyen)) - -- \[WIP\] Descriptor refactor. [\#162](https://github.com/nodegit/nodegit/pull/162) ([tbranyen](https://github.com/tbranyen)) - -- Enable promises. [\#153](https://github.com/nodegit/nodegit/pull/153) ([tbranyen](https://github.com/tbranyen)) - -## [v0.1.4](https://github.com/nodegit/nodegit/tree/v0.1.4) (2014-06-13) +## v0.1.4 [(2014-06-13)](https://github.com/nodegit/nodegit/tree/v0.1.4) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.1.3...v0.1.4) @@ -674,14 +3876,10 @@ - using "Branch" object results in "undefined" error =\> branch.cc missing from binding.gyp? [\#166](https://github.com/nodegit/nodegit/issues/166) -- Feature: Compatibility with node \>=v0.11.13 [\#159](https://github.com/nodegit/nodegit/issues/159) - - Windows: Failure on install [\#158](https://github.com/nodegit/nodegit/issues/158) - Can't install v0.1.2 under OSX [\#155](https://github.com/nodegit/nodegit/issues/155) -- Logo for project [\#69](https://github.com/nodegit/nodegit/issues/69) - **Merged pull requests:** - \[WIP\] Prebuilt binaries. [\#178](https://github.com/nodegit/nodegit/pull/178) ([tbranyen](https://github.com/tbranyen)) @@ -690,19 +3888,15 @@ - Fixed: "ReferenceError: error is not defined" [\#169](https://github.com/nodegit/nodegit/pull/169) ([danyshaanan](https://github.com/danyshaanan)) -## [v0.1.3](https://github.com/nodegit/nodegit/tree/v0.1.3) (2014-05-02) +## v0.1.3 [(2014-05-02)](https://github.com/nodegit/nodegit/tree/v0.1.3) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.1.2...v0.1.3) -**Closed issues:** - -- Fix AppVeyor. [\#154](https://github.com/nodegit/nodegit/issues/154) - **Merged pull requests:** - Fix erroneous OS detection for installation in OS X. [\#156](https://github.com/nodegit/nodegit/pull/156) ([tbranyen](https://github.com/tbranyen)) -## [v0.1.2](https://github.com/nodegit/nodegit/tree/v0.1.2) (2014-05-02) +## v0.1.2 [(2014-05-02)](https://github.com/nodegit/nodegit/tree/v0.1.2) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.1.1...v0.1.2) @@ -740,7 +3934,7 @@ - WIP New installer. [\#140](https://github.com/nodegit/nodegit/pull/140) ([tbranyen](https://github.com/tbranyen)) -## [v0.1.1](https://github.com/nodegit/nodegit/tree/v0.1.1) (2014-03-23) +## v0.1.1 [(2014-03-23)](https://github.com/nodegit/nodegit/tree/v0.1.1) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.1.0...v0.1.1) @@ -782,8 +3976,6 @@ - missing cstring [\#88](https://github.com/nodegit/nodegit/issues/88) -- Memory management for the codegen `wip` branch [\#84](https://github.com/nodegit/nodegit/issues/84) - - Installing fails - can't find vendor/libgit2/build [\#80](https://github.com/nodegit/nodegit/issues/80) - Improving JavaScript API [\#73](https://github.com/nodegit/nodegit/issues/73) @@ -796,8 +3988,6 @@ - Support for Node 0.11+ [\#135](https://github.com/nodegit/nodegit/pull/135) ([pierreinglebert](https://github.com/pierreinglebert)) -- Fixed the error message to pass test. [\#119](https://github.com/nodegit/nodegit/pull/119) ([tbranyen](https://github.com/tbranyen)) - - Added git\_diff\_delta\_dup to git\_diff\_get\_patch to fix a memory issue whe... [\#113](https://github.com/nodegit/nodegit/pull/113) ([kmctown](https://github.com/kmctown)) - Try requiring build/Debug/nodegit if build/Release/nodegit wasn't found. [\#108](https://github.com/nodegit/nodegit/pull/108) ([papandreou](https://github.com/papandreou)) @@ -822,7 +4012,7 @@ - Add system dependencies for OSX install [\#82](https://github.com/nodegit/nodegit/pull/82) ([philschatz](https://github.com/philschatz)) -## [v0.1.0](https://github.com/nodegit/nodegit/tree/v0.1.0) (2013-09-07) +## v0.1.0 [(2013-09-07)](https://github.com/nodegit/nodegit/tree/v0.1.0) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.79...v0.1.0) @@ -842,51 +4032,31 @@ - Nested walks scatter memory and cause SEGFAULTS [\#72](https://github.com/nodegit/nodegit/issues/72) -- Why is new git.Oid\(\).fromString\(\) etc. async? [\#68](https://github.com/nodegit/nodegit/issues/68) - - feature request: Provide fileMode / getType method on tree entries [\#67](https://github.com/nodegit/nodegit/issues/67) - Document DiffList [\#66](https://github.com/nodegit/nodegit/issues/66) -- Implement query-like access to repo content [\#61](https://github.com/nodegit/nodegit/issues/61) - -- Tags [\#58](https://github.com/nodegit/nodegit/issues/58) - - Procedure for moving development to nodegit/nodegit [\#55](https://github.com/nodegit/nodegit/issues/55) -- cloning or updating repositories? [\#50](https://github.com/nodegit/nodegit/issues/50) - - Cannot install on OSX [\#49](https://github.com/nodegit/nodegit/issues/49) -- Add file to repo [\#45](https://github.com/nodegit/nodegit/issues/45) - **Merged pull requests:** -- Fixed TreeBuilder.write's missing repo argument to match its documentation [\#85](https://github.com/nodegit/nodegit/pull/85) ([FrozenCow](https://github.com/FrozenCow)) - - Codegen [\#79](https://github.com/nodegit/nodegit/pull/79) ([nkallen](https://github.com/nkallen)) -- Codegen [\#78](https://github.com/nodegit/nodegit/pull/78) ([nkallen](https://github.com/nkallen)) - -- Codegen [\#77](https://github.com/nodegit/nodegit/pull/77) ([nkallen](https://github.com/nkallen)) - - Updated LICENSE to MIT [\#75](https://github.com/nodegit/nodegit/pull/75) ([tbranyen](https://github.com/tbranyen)) -## [v0.0.79](https://github.com/nodegit/nodegit/tree/v0.0.79) (2013-04-05) +## v0.0.79 [(2013-04-05)](https://github.com/nodegit/nodegit/tree/v0.0.79) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.778...v0.0.79) **Closed issues:** -- Un-chain async example on github pages [\#65](https://github.com/nodegit/nodegit/issues/65) - - Clarify commit.history documentation [\#63](https://github.com/nodegit/nodegit/issues/63) -- Make commit.time pass Date object [\#62](https://github.com/nodegit/nodegit/issues/62) - - Python error on installing nodegit 0.0.77 [\#59](https://github.com/nodegit/nodegit/issues/59) -## [v0.0.778](https://github.com/nodegit/nodegit/tree/v0.0.778) (2013-03-26) +## v0.0.778 [(2013-03-26)](https://github.com/nodegit/nodegit/tree/v0.0.778) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.77...v0.0.778) @@ -894,15 +4064,15 @@ - See issue \#59 [\#60](https://github.com/nodegit/nodegit/pull/60) ([dctr](https://github.com/dctr)) -## [v0.0.77](https://github.com/nodegit/nodegit/tree/v0.0.77) (2013-03-24) +## v0.0.77 [(2013-03-24)](https://github.com/nodegit/nodegit/tree/v0.0.77) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.76...v0.0.77) -## [v0.0.76](https://github.com/nodegit/nodegit/tree/v0.0.76) (2013-03-24) +## v0.0.76 [(2013-03-24)](https://github.com/nodegit/nodegit/tree/v0.0.76) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.75...v0.0.76) -## [v0.0.75](https://github.com/nodegit/nodegit/tree/v0.0.75) (2013-03-24) +## v0.0.75 [(2013-03-24)](https://github.com/nodegit/nodegit/tree/v0.0.75) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.74...v0.0.75) @@ -932,11 +4102,11 @@ - Comment all code methods [\#1](https://github.com/nodegit/nodegit/issues/1) -## [v0.0.74](https://github.com/nodegit/nodegit/tree/v0.0.74) (2013-03-21) +## v0.0.74 [(2013-03-21)](https://github.com/nodegit/nodegit/tree/v0.0.74) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.73...v0.0.74) -## [v0.0.73](https://github.com/nodegit/nodegit/tree/v0.0.73) (2013-03-21) +## v0.0.73 [(2013-03-21)](https://github.com/nodegit/nodegit/tree/v0.0.73) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.72...v0.0.73) @@ -950,11 +4120,11 @@ - Tree each method is synchronous [\#15](https://github.com/nodegit/nodegit/issues/15) -## [v0.0.72](https://github.com/nodegit/nodegit/tree/v0.0.72) (2013-03-06) +## v0.0.72 [(2013-03-06)](https://github.com/nodegit/nodegit/tree/v0.0.72) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.71...v0.0.72) -## [v0.0.71](https://github.com/nodegit/nodegit/tree/v0.0.71) (2013-03-06) +## v0.0.71 [(2013-03-06)](https://github.com/nodegit/nodegit/tree/v0.0.71) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.6...v0.0.71) @@ -968,8 +4138,6 @@ - update for node 0.5.9 [\#29](https://github.com/nodegit/nodegit/issues/29) -- Issue with errors [\#23](https://github.com/nodegit/nodegit/issues/23) - **Merged pull requests:** - Converted from eio\_custom to uv\_queue\_work [\#48](https://github.com/nodegit/nodegit/pull/48) ([faceleg](https://github.com/faceleg)) @@ -984,15 +4152,7 @@ - Refactor [\#37](https://github.com/nodegit/nodegit/pull/37) ([mmalecki](https://github.com/mmalecki)) -- Refactor [\#36](https://github.com/nodegit/nodegit/pull/36) ([mmalecki](https://github.com/mmalecki)) - -- Removed references to node\_events.h [\#31](https://github.com/nodegit/nodegit/pull/31) ([alexkwolfe](https://github.com/alexkwolfe)) - -- Updates for node 0.5.9 \(fixed Issue \#29\) [\#30](https://github.com/nodegit/nodegit/pull/30) ([tojocky](https://github.com/tojocky)) - -- Error constants added [\#25](https://github.com/nodegit/nodegit/pull/25) ([milani](https://github.com/milani)) - -## [v0.0.6](https://github.com/nodegit/nodegit/tree/v0.0.6) (2011-12-19) +## v0.0.6 [(2011-12-19)](https://github.com/nodegit/nodegit/tree/v0.0.6) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.4...v0.0.6) @@ -1006,9 +4166,7 @@ - Node 0.6x fixes [\#34](https://github.com/nodegit/nodegit/pull/34) ([moneal](https://github.com/moneal)) -- Updates for node 0.6x [\#33](https://github.com/nodegit/nodegit/pull/33) ([moneal](https://github.com/moneal)) - -## [v0.0.4](https://github.com/nodegit/nodegit/tree/v0.0.4) (2011-05-14) +## v0.0.4 [(2011-05-14)](https://github.com/nodegit/nodegit/tree/v0.0.4) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.3...v0.0.4) @@ -1018,13 +4176,9 @@ - example/convenience-repo.js errors [\#21](https://github.com/nodegit/nodegit/issues/21) -- Use new Error when throwing exceptions [\#20](https://github.com/nodegit/nodegit/issues/20) - -- Scope.close when handlescope is used [\#19](https://github.com/nodegit/nodegit/issues/19) - - Branch history each method is asynchronous [\#11](https://github.com/nodegit/nodegit/issues/11) -## [v0.0.3](https://github.com/nodegit/nodegit/tree/v0.0.3) (2011-04-13) +## v0.0.3 [(2011-04-13)](https://github.com/nodegit/nodegit/tree/v0.0.3) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.2...v0.0.3) @@ -1032,18 +4186,10 @@ - error handling [\#18](https://github.com/nodegit/nodegit/issues/18) -- nodegit namespace [\#14](https://github.com/nodegit/nodegit/issues/14) - -- Rename all classes to have Git prefix [\#13](https://github.com/nodegit/nodegit/issues/13) - - Windows link issue [\#12](https://github.com/nodegit/nodegit/issues/12) -## [v0.0.2](https://github.com/nodegit/nodegit/tree/v0.0.2) (2011-03-14) +## v0.0.2 [(2011-03-14)](https://github.com/nodegit/nodegit/tree/v0.0.2) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.0.1...v0.0.2) -## [v0.0.1](https://github.com/nodegit/nodegit/tree/v0.0.1) (2011-03-10) - - - -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file +## v0.0.1 [(2011-03-10)](https://github.com/nodegit/nodegit/tree/v0.0.1) \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 52a55d1485..337971a438 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,8 +5,9 @@ Contribution Guidelines We try to be available pretty often to help when problems come up. We like to split incoming questions into two categories: potential bugs/features, and questions. If you want a feature added, or think you've found a bug -in the code (or in the examples), search the [issue tracker](https://github.com/nodegit/nodegit/issues) and if you dont -find anything, file a new issue. If you just have questions, instead of using issues, contact us in our [Gitter room](https://gitter.im/nodegit/nodegit). +in the code (or in the examples), search the [issue tracker](https://github.com/nodegit/nodegit/issues) and if you don't +find anything, file a new issue. If you just have questions, instead of using issues, [sign up](http://slack.libgit2.org/) +to libgit2's Slack instance and then contact us in the [#nodegit channel](https://libgit2.slack.com/messages/nodegit/). ## How to Help ## @@ -21,7 +22,7 @@ These are all good easy ways to start getting involved with the project. You can and see if you can help with any existing issues. Please comment with your intention and any questions before getting started; duplicating work or doing something that would be rejected always sucks. -Additionally, [the documentation](http://www.nodegit.org) needs some love. Get in touch with one of us on Gitter if +Additionally, [the documentation](http://www.nodegit.org) needs some love. Get in touch with one of us on Slack if you'd like to lend a hand with that. -For anything else, Gitter is probably the best way to get in touch as well. Happy coding, merge you soon! +For anything else, Slack is probably the best way to get in touch as well. Happy coding, merge you soon! diff --git a/FAQ.md b/FAQ.md new file mode 100644 index 0000000000..6d136b8206 --- /dev/null +++ b/FAQ.md @@ -0,0 +1,13 @@ +NodeGit FAQ +----------- + +Feel free to add common problems with their solutions here, or just anything that wasn't clear at first. + +#### Error: callback returned unsupported credentials type #### + +As seen in nodegit/#959 -- some golang hackers have started to use the following stanza in .gitconfig to allow `go get` to work with private repos: +``` +[url "git@github.com:"] + insteadOf = https://github.com/ +``` +But if you do this, code can call `NodeGit.Clone.clone(url: 'https://foo')` and have the `authentication` callback be asked for **SSH** credentials instead of HTTPS ones, which might not be what your application expected. diff --git a/README.md b/README.md index aba7d7a4e1..72442d791d 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,24 @@ -NodeGit -------- +# NodeGit > Node bindings to the [libgit2](http://libgit2.github.com/) project. - - - - - - - - - - - - - - - - - - -
LinuxOS XWindowsCoverageDependencies
- - - - - Coverage Status - - -
- -**Stable: 0.3.3** +[![Actions Status](https://github.com/nodegit/nodegit/workflows/Testing/badge.svg)](https://github.com/nodegit/nodegit/actions) + +**Stable (libgit2@v0.28.3): 0.28.3** ## Have a problem? Come chat with us! ## -[![Gitter](http://www.nodegit.org/img/gitterbadge.svg)](https://gitter.im/nodegit/nodegit) +Visit [slack.libgit2.org](http://slack.libgit2.org/) to sign up, then join us in #nodegit. ## Maintained by ## -Tim Branyen [@tbranyen](http://twitter.com/tbranyen), -John Haley [@johnhaley81](http://twitter.com/johnhaley81), -Max Korp [@maxkorp](http://twitter.com/MaximilianoKorp), and -Steve Smith [@orderedlist](https://twitter.com/orderedlist) with help from tons of +Tyler Ang-Wanek [@twwanek](http://twitter.com/twwanek) with help from tons of [awesome contributors](https://github.com/nodegit/nodegit/contributors)! ### Alumni Maintainers ### +Tim Branyen [@tbranyen](http://twitter.com/tbranyen), +John Haley [@johnhaley81](http://twitter.com/johnhaley81), +Max Korp [@maxkorp](http://twitter.com/MaximilianoKorp), +Steve Smith [@orderedlist](https://twitter.com/orderedlist), Michael Robinson [@codeofinterest](http://twitter.com/codeofinterest), and Nick Kallen [@nk](http://twitter.com/nk) @@ -61,20 +35,70 @@ dependencies. npm install nodegit ``` -**Note: NodeGit will only work on io.js Windows with [the iojs binary instead of node](https://github.com/rvagg/pangyp/issues/4).** +If you receive errors about libstdc++, which are commonly experienced when +building on Travis-CI, you can fix this by upgrading to the latest +libstdc++-4.9. + +In Ubuntu: + +``` sh +sudo add-apt-repository ppa:ubuntu-toolchain-r/test +sudo apt-get update +sudo apt-get install libstdc++-4.9-dev +``` + +In Travis: + +``` yaml +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libstdc++-4.9-dev +``` -If you encounter problems while installing, you should try the Building from -source instructions below. +In CircleCI: + +``` yaml + dependencies: + pre: + - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + - sudo apt-get update + - sudo apt-get install -y libstdc++-4.9-dev +``` + +If you receive errors about *lifecycleScripts* preinstall/install you probably miss *libssl-dev* +In Ubuntu: +``` +sudo apt-get install libssl-dev +``` + +You will need the following libraries installed on your linux machine: + - libpcre + - libpcreposix + - libkrb5 + - libk5crypto + - libcom_err + +When building locally, you will also need development packages for kerberos and pcre, so both of these utilities must be present on your machine: + - pcre-config + - krb5-config + + +If you are still encountering problems while installing, you should try the +[Building from source](http://www.nodegit.org/guides/install/from-source/) +instructions. ## API examples. ## ### Cloning a repository and reading a file: ### ``` javascript -var clone = require("./").Clone.clone; +var Git = require("nodegit"); -// Clone a given repository into a specific folder. -clone("https://github.com/nodegit/nodegit", "tmp", null) +// Clone a given repository into the `./tmp` folder. +Git.Clone("https://github.com/nodegit/nodegit", "./tmp") // Look up this known commit. .then(function(repo) { // Use a known commit sha from this repository. @@ -94,8 +118,8 @@ clone("https://github.com/nodegit/nodegit", "tmp", null) }) // Display information about the blob. .then(function(blob) { - // Show the name, sha, and filesize in bytes. - console.log(blob.entry.name() + blob.entry.sha() + blob.size() + "b"); + // Show the path, sha, and filesize in bytes. + console.log(blob.entry.path() + blob.entry.sha() + blob.rawsize() + "b"); // Show a spacer. console.log(Array(72).join("=") + "\n\n"); @@ -110,10 +134,10 @@ clone("https://github.com/nodegit/nodegit", "tmp", null) ### Emulating git log: ### ``` javascript -var open = require("nodegit").Repository.open; +var Git = require("nodegit"); // Open the repository directory. -open("tmp") +Git.Repository.open("tmp") // Open the master branch. .then(function(repo) { return repo.getMasterCommit(); @@ -140,7 +164,7 @@ open("tmp") var author = commit.author(); // Display author information. - console.log("Author:\t" + author.name() + " <", author.email() + ">"); + console.log("Author:\t" + author.name() + " <" + author.email() + ">"); // Show the commit date. console.log("Date:\t" + commit.date()); @@ -163,41 +187,3 @@ You will need to build locally before running the tests. See above. ``` bash npm test ``` - -## Migrating from old versions. ## - -The bump from 0.1.4 to 0.2.0 was a big one. Many things changed, see here: -https://github.com/nodegit/nodegit/compare/v0.1.4...v0.2.0 - -This update is wholly and entirely a breaking one, and older versions won't be -maintained. For the purpose of migration, perhaps the biggest point to make -is that async methods can now use promises, rather than just taking callbacks. -Additionally, lots of method and property names have changed. - -## nw.js (Node-Webkit) ## - -### Native compilation for nw.js ### -A common issue is with NodeGit not functioning properly inside of -[nw.js](http://github.com/nwjs/nw.js) applications. Because NodeGit -is a native module, it has to be rebuilt for node-webkit using -[nw-gyp](http://github.com/rogerwang/nw-gyp). By default, NodeGit will look -in the root package's package.json for an `engines` property, and within look -for a `nw.js` property (or a `node-webkit` if the prior isn't found) that holds -a specific version of nw.js. The value of this property is what will get passed -as the `--target` argument to `nw-gyp configure`. - -### Version incompatibility ### -Prior to version 0.2.6, NodeGit used [nan](http://github.com/rvagg/nan) v1.4.3. -As of 0.2.6, NodeGit uses nan v1.5.1 to provide support for io.js. Unfortunately, -this breaks some nw.js compatibility. With nw.js 0.12+, the name was changed to -nw.js from node-webkit. The alpha currently still breaks with NodeGit due to the -nan update, but should be fixed in the final v0.12.0 release. Ă…pplications using -previous versions of node webkit have 2 options: -1) Use an older version (v0.2.4 or earlier) of NodeGit -2) Use [npm shrinkwrap](https://docs.npmjs.com/cli/shrinkwrap) to force NodeGit to -use nan v1.4.3. Since the binary always recompiles when being used with nw.js, you -shouldn't have to do anything else to make sure it works. As of NodeGit v0.2.6, -the change to nan v1.4.3 doesn't cause any problems. - -Currently, support for nw.js is limited, although we intend to support it better -in the future. diff --git a/TESTING.md b/TESTING.md index 16623aa149..c149c6b5b2 100644 --- a/TESTING.md +++ b/TESTING.md @@ -11,6 +11,9 @@ Currently there are a number of fields and functions in NodeGit that have no tes npm run generateMissingTests ``` +>You should have run already `npm install .` or it will complain about +> missing `nodegit-promise` or suchlike + This will make the file `generate/output/missing-tests.json` which will contain info for tests or files that are currently missing. From this file you can find fields and functions that don't have any tests yet and pick one to work on. @@ -32,13 +35,14 @@ In the `missing-tests.json` file you'll see it formatted like so: In the file each `{className}` corresponds to a file found at `test/tests/{classname}`. Each entry in either `fields` or `functions` is a missing test for the respective field/function. -In the file that your test is going in you can just append it to the file inside of the `describe` function block. +In the file that your test is going in you can just append it to the file inside the `describe` function block. It can be helpful to reference the [libgit2 API docs](https://libgit2.github.com/libgit2/#v0.21.4) to know what the field or function is doing inside of libgit2 and referencing the [NodeGit API docs](http://www.nodegit.org/) can also help. Looking at examples inside of `/examples` can show you how we wrap the libgit2 library and how you can call into it from JavaScript. The idea is to test the basic functionality of the field/function and to confirm that it's returning or setting the value(s) correctly. Bugs inside of libgit2 will have to either have a work-around or be ignored. -If a specific field or function is further wrapped via a file inside of `/lib` then as long as that wrapper is called and tested. +If a specific field or function is further wrapped via a file inside +of `/lib` then as long as that wrapper is called and tested it is OK. You can mark something to be ignored inside of the `/generate/missing-tests-ignore.json` file. @@ -48,7 +52,7 @@ After you write your test make sure to run `npm run generateMissingTests` again ### The test passes ### -Excellent!! Make sure that the test is working correctly and testing what you're expecting it to test and then move onto the [next section](https://github.com/nodegit/nodegit/tree/master/test#making-a-pull-request). +Excellent!! Make sure that the test is working correctly and testing what you're expecting it to test and then move onto the [next section](#making-a-pull-request). ### The test fails ### diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 43d9c7e820..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,56 +0,0 @@ -# appveyor file -# http://www.appveyor.com/docs/appveyor-yml - -# Try out "interactive-mode" -os: Windows Server 2012 R2 - -# build version format -version: "{build}" - -# Set a known clone folder -clone_folder: c:\projects\nodegit - -# fix lineendings in Windows -init: - - git config --global core.autocrlf input - - git config --global user.name "John Doe" - - git config --global user.email johndoe@example.com - -# what combinations to test -environment: - matrix: - # Node.js - - nodejs_version: "0.10" - - nodejs_version: "0.12" - # io.js - - nodejs_version: "1" - -matrix: - fast_finish: true - allow_failures: - - nodejs_version: "0.10" - - nodejs_version: "1" - -# Get the latest stable version of Node 0.STABLE.latest -install: - - ps: Install-Product node $env:nodejs_version - - cmd: SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH% - - cmd: SET PATH=c:\python27;%PATH% - - cmd: SET JOBS=4 - - cmd: SET BUILD_ONLY=true - - cmd: SET GIT_SSH=c:\projects\nodegit\vendor\plink.exe - - ps: Start-Process c:\projects\nodegit\vendor\pageant.exe c:\projects\nodegit\vendor\private.ppk - - cmd: npm install -g node-gyp - - npm install --msvs_version=2013 - -test_script: - - node --version - - npm --version - - cmd: npm test - -build: off - -branches: - only: - - master - - v0.3 diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000000..1b1fc2b328 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,4 @@ +## /examples + + List of examples of using NodeGit to implement common git core operations. + diff --git a/examples/add-and-commit.js b/examples/add-and-commit.js index 6366f3ba33..42215257b8 100644 --- a/examples/add-and-commit.js +++ b/examples/add-and-commit.js @@ -1,15 +1,9 @@ -var nodegit = require("../"); -var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -var fileName = "newfile.txt"; -var fileContent = "hello world"; -var directoryName = "salad/toast/strangerinastrangeland/theresnowaythisexists"; -// ensureDir is an alias to mkdirp, which has the callback with a weird name -// and in the 3rd position of 4 (the 4th being used for recursion). We have to -// force promisify it, because promisify-node won't detect it on its -// own and assumes sync -fse.ensureDir = promisify(fse.ensureDir); +const nodegit = require("../"); +const path = require("path"); +const fs = require("fs"); +const fileName = "newfile.txt"; +const fileContent = "hello world"; +const directoryName = "salad/toast/strangerinastrangeland/theresnowaythisexists"; /** * This example creates a certain file `newfile.txt`, adds it to the git @@ -17,60 +11,38 @@ fse.ensureDir = promisify(fse.ensureDir); * followed by a `git commit` **/ -var repo; -var index; -var oid; -nodegit.Repository.open(path.resolve(__dirname, "../.git")) -.then(function(repoResult) { - repo = repoResult; - return fse.ensureDir(path.join(repo.workdir(), directoryName)); -}).then(function(){ - return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); -}) -.then(function() { - return fse.writeFile( +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + + await fs.promises.mkdir(path.join(repo.workdir(), directoryName), { + recursive: true, + }); + + await fs.promises.writeFile(path.join(repo.workdir(), fileName), fileContent); + await fs.promises.writeFile( path.join(repo.workdir(), directoryName, fileName), fileContent ); -}) -.then(function() { - return repo.openIndex(); -}) -.then(function(indexResult) { - index = indexResult; - return index.read(1); -}) -.then(function() { + + const index = await repo.refreshIndex(); + // this file is in the root of the directory and doesn't need a full path - return index.addByPath(fileName); -}) -.then(function() { + await index.addByPath(fileName); // this file is in a subdirectory and can use a relative path - return index.addByPath(path.join(directoryName, fileName)); -}) -.then(function() { + await index.addByPath(path.posix.join(directoryName, fileName)); // this will write both files to the index - return index.write(); -}) -.then(function() { - return index.writeTree(); -}) -.then(function(oidResult) { - oid = oidResult; - return nodegit.Reference.nameToId(repo, "HEAD"); -}) -.then(function(head) { - return repo.getCommit(head); -}) -.then(function(parent) { - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); + await index.write(); + + const oid = await index.writeTree(); + + const parent = await repo.getHeadCommit(); + const author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + const committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); + + const commitId = await repo.createCommit("HEAD", author, committer, "message", oid, [parent]); - return repo.createCommit("HEAD", author, committer, "message", oid, [parent]); -}) -.done(function(commitId) { console.log("New Commit: ", commitId); -}); +})(); diff --git a/examples/checkout-remote-branch.js b/examples/checkout-remote-branch.js new file mode 100644 index 0000000000..4ebf9050be --- /dev/null +++ b/examples/checkout-remote-branch.js @@ -0,0 +1,26 @@ +var nodegit = require("../"); +var path = require("path"); + +var remoteBranchName = "REMOTE-BRANCH-NAME"; + +nodegit.Repository.open(path.resolve(__dirname, "../.git")) + .then(function(repo) { + + return repo.getHeadCommit() + .then(function (targetCommit) { + return repo.createBranch(remoteBranchName, targetCommit, false); + }) + .then(function (reference) { + return repo.checkoutBranch(reference, {}); + }) + .then(function () { + return repo.getReferenceCommit( + "refs/remotes/origin/" + remoteBranchName); + }) + .then(function (commit) { + nodegit.Reset.reset(repo, commit, 3, {}); + }); + + }).done(function() { + console.log("All done!"); +}); diff --git a/examples/clone.js b/examples/clone.js index b01ab99ab5..459713d942 100644 --- a/examples/clone.js +++ b/examples/clone.js @@ -1,6 +1,5 @@ var nodegit = require("../"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var path = "/tmp/nodegit-clone-demo"; fse.remove(path).then(function() { @@ -10,11 +9,13 @@ fse.remove(path).then(function() { "https://github.com/nodegit/nodegit.git", path, { - remoteCallbacks: { - certificateCheck: function() { - // github will fail cert check on some OSX machines - // this overrides that check - return 1; + fetchOpts: { + callbacks: { + certificateCheck: function() { + // github will fail cert check on some OSX machines + // this overrides that check + return 0; + } } } }) @@ -29,7 +30,7 @@ fse.remove(path).then(function() { return entry.getBlob(); }) .done(function(blob) { - console.log(entry.filename(), entry.sha(), blob.rawsize() + "b"); + console.log(entry.name(), entry.sha(), blob.rawsize() + "b"); console.log("========================================================\n\n"); var firstTenLines = blob.toString().split("\n").slice(0, 10).join("\n"); console.log(firstTenLines); diff --git a/examples/cloneFromGithubWith2Factor.js b/examples/cloneFromGithubWith2Factor.js index 8c8ca0829c..62e0df8073 100644 --- a/examples/cloneFromGithubWith2Factor.js +++ b/examples/cloneFromGithubWith2Factor.js @@ -1,6 +1,5 @@ var nodegit = require("../"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var path = "/tmp/nodegit-github-2factor-demo"; var token = "{Your GitHub user token}"; @@ -11,26 +10,18 @@ var repoName = "{The name of the repo}"; // over https, it can't be done with actual 2 factor. // https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth -// The token has to be included in the URL if the repo is private. -// Otherwise, github just wont respond, so a normal credential callback -// wont work. -var repoUrl = "https://" + token + - ":-oauth-basic@github.com/" + - repoOwner + "/" + - repoName + ".git"; - -var opts = { ignoreCertErrors: 1}; - // If the repo is public, you can use a callback instead var repoUrl = "https://github.com/" + repoOwner + "/" + repoName + ".git"; var opts = { - remoteCallbacks: { - credentials: function() { - return nodegit.Cred.userpassPlaintextNew (token, "x-oauth-basic"); - }, - certificateCheck: function() { - return 1; + fetchOpts: { + callbacks: { + credentials: function() { + return nodegit.Cred.userpassPlaintextNew(token, "x-oauth-basic"); + }, + certificateCheck: function() { + return 0; + } } } }; diff --git a/examples/create-branch.js b/examples/create-branch.js index 28ab6bea53..7374de053e 100644 --- a/examples/create-branch.js +++ b/examples/create-branch.js @@ -9,9 +9,7 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) return repo.createBranch( "new-branch", commit, - 0, - repo.defaultSignature(), - "Created new-branch on HEAD"); + 0); }); }).done(function() { console.log("All done!"); diff --git a/examples/create-new-repo.js b/examples/create-new-repo.js index 640bdc33a1..1df93fbbc8 100644 --- a/examples/create-new-repo.js +++ b/examples/create-new-repo.js @@ -1,50 +1,32 @@ -var nodegit = require("../"); -var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -var fileName = "newfile.txt"; -var fileContent = "hello world"; -var repoDir = "../../newRepo"; +const nodegit = require("../"); +const path = require("path"); +const fs = require("fs"); +const fileName = "newfile.txt"; +const fileContent = "hello world"; +const repoDir = "../newRepo"; -fse.ensureDir = promisify(fse.ensureDir); -var repository; -var index; +(async () => { + await fs.promises.mkdir(path.resolve(__dirname, repoDir), { + recursive: true, + }); + const repo = await nodegit.Repository.init(path.resolve(__dirname, repoDir), 0); + await fs.promises.writeFile(path.join(repo.workdir(), fileName), fileContent); + const index = await repo.refreshIndex(); + await index.addByPath(fileName); + await index.write(); + + const oid = await index.writeTree(); + + const author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + const committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); -fse.ensureDir(path.resolve(__dirname, repoDir)) -.then(function() { - return nodegit.Repository.init(path.resolve(__dirname, repoDir), 0); -}) -.then(function(repo) { - repository = repo; - return fse.writeFile(path.join(repository.workdir(), fileName), fileContent); -}) -.then(function(){ - return repository.openIndex(); -}) -.then(function(idx) { - index = idx; - return index.read(1); -}) -.then(function() { - return index.addByPath(fileName); -}) -.then(function() { - return index.write(); -}) -.then(function() { - return index.writeTree(); -}) -.then(function(oid) { - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); - - // Since we're creating an inital commit, it has no parents. Note that unlike + // Since we're creating an initial commit, it has no parents. Note that unlike // normal we don't get the head either, because there isn't one yet. - return repository.createCommit("HEAD", author, committer, "message", oid, []); -}) -.done(function(commitId) { + const commitId = await repo.createCommit("HEAD", author, committer, "message", oid, []); console.log("New Commit: ", commitId); -}); +})(); + + diff --git a/examples/details-for-tree-entry.js b/examples/details-for-tree-entry.js index 4055383898..13dcd4e210 100644 --- a/examples/details-for-tree-entry.js +++ b/examples/details-for-tree-entry.js @@ -1,29 +1,26 @@ -var nodegit = require("../"); -var path = require("path"); +const nodegit = require("../"); +const path = require("path"); /** * This shows how to get details from a tree entry or a blob **/ -nodegit.Repository.open(path.resolve(__dirname, "../.git")) - .then(function(repo) { - return repo.getTree("e1b0c7ea57bfc5e30ec279402a98168a27838ac9") - .then(function(tree) { - var treeEntry = tree.entryByIndex(0); +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + const tree = await repo.getTree("e1b0c7ea57bfc5e30ec279402a98168a27838ac9"); + const treeEntry = tree.entryByIndex(0); + + // Tree entry doesn't have any data associated with the actual entry + // To get that we need to get the index entry that this points to + const index = await repo.refreshIndex(); + const indexEntry = index.getByPath(treeEntry.path()); - // Tree entry doesn't have any data associated with the actual entry - // To get that we need to get the index entry that this points to - return repo.openIndex().then(function(index) { - var indexEntry = index.getByPath(treeEntry.path()); + // With the index entry we can now view the details for the tree entry + console.log("Entry path: " + indexEntry.path); + console.log("Entry time in seconds: " + indexEntry.mtime.seconds()); + console.log("Entry oid: " + indexEntry.id.toString()); + console.log("Entry size: " + indexEntry.fileSize); + + console.log("Done!"); +})(); - // With the index entry we can now view the details for the tree entry - console.log("Entry path: " + indexEntry.path()); - console.log("Entry time in seconds: " + indexEntry.mtime().seconds()); - console.log("Entry oid: " + indexEntry.id().toString()); - console.log("Entry size: " + indexEntry.fileSize()); - }); - }); - }) - .done(function() { - console.log("Done!"); - }); diff --git a/examples/diff-commits.js b/examples/diff-commits.js index 7d3153c1a6..b3d6d75107 100644 --- a/examples/diff-commits.js +++ b/examples/diff-commits.js @@ -1,34 +1,41 @@ -var nodegit = require("../"); -var path = require("path"); +const nodegit = require("../"); +const path = require("path"); // This code examines the diffs between a particular commit and all of its // parents. Since this commit is not a merge, it only has one parent. This is // similar to doing `git show`. -nodegit.Repository.open(path.resolve(__dirname, "../.git")) -.then(function(repo) { - return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); -}) -.then(function(commit) { +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")) + const commit = await repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); console.log("commit " + commit.sha()); - console.log("Author:", commit.author().name() + - " <" + commit.author().email() + ">"); + console.log( + "Author:", commit.author().name() + + " <" + commit.author().email() + ">" + ); console.log("Date:", commit.date()); console.log("\n " + commit.message()); - return commit.getDiff(); -}) -.done(function(diffList) { - diffList.forEach(function(diff) { - diff.patches().forEach(function(patch) { - console.log("diff", patch.oldFile().path(), patch.newFile().path()); - patch.hunks().forEach(function(hunk) { + const diffList = await commit.getDiff(); + for (const diff of diffList) { + const patches = await diff.patches(); + for (const patch of patches) { + const hunks = await patch.hunks(); + for (const hunk of hunks) { + const lines = await hunk.lines(); + console.log( + "diff", + patch.oldFile().path(), + patch.newFile().path() + ); console.log(hunk.header().trim()); - hunk.lines().forEach(function(line) { - console.log(String.fromCharCode(line.origin()) + - line.content().trim()); - }); - }); - }); - }); -}); + for (const line of lines) { + console.log( + String.fromCharCode(line.origin()) + + line.content().trim() + ); + } + } + } + } +})(); diff --git a/examples/fetch.js b/examples/fetch.js index fce801ee07..ffde30ee15 100644 --- a/examples/fetch.js +++ b/examples/fetch.js @@ -4,8 +4,10 @@ var path = require("path"); nodegit.Repository.open(path.resolve(__dirname, "../.git")) .then(function(repo) { return repo.fetch("origin", { - credentials: function(url, userName) { - return nodegit.Cred.sshKeyFromAgent(userName); + callbacks: { + credentials: function(url, userName) { + return nodegit.Cred.sshKeyFromAgent(userName); + } } }); }).done(function() { diff --git a/examples/general.js b/examples/general.js index 84c309c5a1..b06c4d7954 100644 --- a/examples/general.js +++ b/examples/general.js @@ -1,13 +1,10 @@ -var nodegit = require("../"); -var path = require("path"); -var Promise = require("nodegit-promise"); -var oid; -var odb; -var repo; +const nodegit = require("../"); +const path = require("path"); + // **nodegit** is a javascript library for node.js that wraps libgit2, a // pure C implementation of the Git core. It provides an asynchronous -// interface around any functions that do I/O, and a sychronous interface +// interface around any functions that do I/O, and a synchronous interface // around the rest. // // This file is an example of using that API in a real, JS file. @@ -20,348 +17,301 @@ var repo; // Nearly, all git operations in the context of a repository. // To open a repository, -nodegit.Repository.open(path.resolve(__dirname, "../.git")) - .then(function(repoResult) { - repo = repoResult; - console.log("Opened repository."); - - // ### SHA-1 Value Conversions - - // Objects in git (commits, blobs, etc.) are referred to by their SHA value - // **nodegit** uses a simple wrapper around hash values called an `Oid`. - // The oid validates that the SHA is well-formed. - - oid = nodegit.Oid.fromString("c27d9c35e3715539d941254f2ce57042b978c49c"); - - // Most functions in in **nodegit** that take an oid will also take a - // string, so for example, you can look up a commit by a string SHA or - // an Oid, but but any functions that create new SHAs will always return - // an Oid. - - // If you have a oid, you can easily get the hex value of the SHA again. - console.log("Sha hex string:", oid.toString()); - - // ### Working with the Object Database - - // **libgit2** provides [direct access][odb] to the object database. The - // object database is where the actual objects are stored in Git. For - // working with raw objects, we'll need to get this structure from the - // repository. - return repo.odb(); - }) - - .then(function(odbResult) { - odb = odbResult; - - // We can read raw objects directly from the object database if we have - // the oid (SHA) of the object. This allows us to access objects without - // knowing thier type and inspect the raw bytes unparsed. - - return odb.read(oid); - }) - - .then(function(object) { - // A raw object only has three properties - the type (commit, blob, tree - // or tag), the size of the raw data and the raw, unparsed data itself. - // For a commit or tag, that raw data is human readable plain ASCII - // text. For a blob it is just file contents, so it could be text or - // binary data. For a tree it is a special binary format, so it's unlikely - // to be hugely helpful as a raw object. - var data = object.data(); - var type = object.type(); - var size = object.size(); - - console.log("Object size and type:", size, type); - console.log("Raw data: ", data.toString().substring(100), "..."); - - }) - - .then(function() { - // You can also write raw object data to Git. This is pretty cool because - // it gives you direct access to the key/value properties of Git. Here - // we'll write a new blob object that just contains a simple string. - // Notice that we have to specify the object type. - return odb.write("test data", "test data".length, nodegit.Object.TYPE.BLOB); - }) - - .then(function(oid) { - // Now that we've written the object, we can check out what SHA1 was - // generated when the object was written to our database. - console.log("Written Object: ", oid.toString()); - }) - - .then(function() { - // ### Object Parsing - - // libgit2 has methods to parse every object type in Git so you don't have - // to work directly with the raw data. This is much faster and simpler - // than trying to deal with the raw data yourself. - - // #### Commit Parsing - - // [Parsing commit objects][pco] is simple and gives you access to all the - // data in the commit - the author (name, email, datetime), committer - // (same), tree, message, encoding and parent(s). - - oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); - - // Many methods in **nodegit** are asynchronous, because they do file - // or network I/O. By convention, all asynchronous methods are named - // imperatively, like `getCommit`, `open`, `read`, `write`, etc., whereas - // synchronous methods are named nominatively, like `type`, `size`, `name`. - - return repo.getCommit(oid); - }) - - .then(function(commit) { - // Each of the properties of the commit object are accessible via methods, - // including commonly needed variations, such as `git_commit_time` which - // returns the author time and `git_commit_message` which gives you the - // commit message. - console.log("Commit:", commit.message(), - commit.author().name(), commit.date()); - - // Commits can have zero or more parents. The first (root) commit will - // have no parents, most commits will have one (i.e. the commit it was - // based on) and merge commits will have two or more. Commits can - // technically have any number, though it's rare to have more than two. - return commit.getParents(); - }) - - .then(function(parents) { - parents.forEach(function(parent) { - console.log("Parent:", parent.toString()); - }); - }) - - .then(function() { - // #### Writing Commits - - // nodegit provides a couple of methods to create commit objects easily as - // well. - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); - - // Commit objects need a tree to point to and optionally one or more - // parents. Here we're creating oid objects to create the commit with, - // but you can also use existing ones: - var treeId = nodegit.Oid.fromString( - "4170d10f19600b9cb086504e8e05fe7d863358a2"); - var parentId = nodegit.Oid.fromString( - "eebd0ead15d62eaf0ba276da53af43bbc3ce43ab"); - - return repo.getTree(treeId).then(function(tree) { - return repo.getCommit(parentId).then(function(parent) { - // Here we actually create the commit object with a single call with all - // the values we need to create the commit. The SHA key is written to - // the `commit_id` variable here. - return repo.createCommit( - null /* do not update the HEAD */, - author, - committer, - "example commit", - tree, - [parent]); - }).then(function(oid) { - console.log("New Commit:", oid.toString()); - }); - }); - }) - - .then(function() { - // #### Tag Parsing - - // You can parse and create tags with the [tag management API][tm], which - // functions very similarly to the commit lookup, parsing and creation - // methods, since the objects themselves are very similar. - - oid = nodegit.Oid.fromString("dcc4aa9fcdaced037434cb149ed3b6eab4d0709d"); - return repo.getTag(oid); - }) - - .then(function(tag) { - // Now that we have the tag object, we can extract the information it - // generally contains: the target (usually a commit object), the type of - // the target object (usually "commit"), the name ("v1.0"), the tagger (a - // git_signature - name, email, timestamp), and the tag message. - console.log(tag.name(), tag.targetType(), tag.message()); - - return tag.target(); - }) - - .then(function (target) { - console.log("Target is commit:", target.isCommit()); - }) - - .then(function() { - // #### Tree Parsing - - // A Tree is how Git represents the state of the filesystem - // at a given revision. In general, a tree corresponds to a directory, - // and files in that directory are either files (blobs) or directories. - - // [Tree parsing][tp] is a bit different than the other objects, in that - // we have a subtype which is the tree entry. This is not an actual - // object type in Git, but a useful structure for parsing and traversing - // tree entries. - - oid = nodegit.Oid.fromString("e1b0c7ea57bfc5e30ec279402a98168a27838ac9"); - return repo.getTree(oid); - }) - - .then(function(tree) { - console.log("Tree Size:", tree.entryCount()); - - function dfs(tree) { - var promises = []; - - tree.entries().forEach(function(entry) { - if (entry.isDirectory()) { - promises.push(entry.getTree().then(dfs)); - } else if (entry.isFile()) { - console.log("Tree Entry:", entry.filename()); - } - }); - - return Promise.all(promises); +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + console.log("Opened repository."); + + // ### SHA-1 Value Conversions + + // Objects in git (commits, blobs, etc.) are referred to by their SHA value + // **nodegit** uses a simple wrapper around hash values called an `Oid`. + // The oid validates that the SHA is well-formed. + + let oid = nodegit.Oid.fromString("c27d9c35e3715539d941254f2ce57042b978c49c"); + + // Most functions in in **nodegit** that take an oid will also take a + // string, so for example, you can look up a commit by a string SHA or + // an Oid, but any functions that create new SHAs will always return + // an Oid. + + // If you have a oid, you can easily get the hex value of the SHA again. + console.log("Sha hex string:", oid.toString()); + + // ### Working with the Object Database + + // **libgit2** provides [direct access][odb] to the object database. The + // object database is where the actual objects are stored in Git. For + // working with raw objects, we'll need to get this structure from the + // repository. + const odb = await repo.odb(); + + // We can read raw objects directly from the object database if we have + // the oid (SHA) of the object. This allows us to access objects without + // knowing their type and inspect the raw bytes unparsed. + + const object = await odb.read(oid); + + // A raw object only has three properties - the type (commit, blob, tree + // or tag), the size of the raw data and the raw, unparsed data itself. + // For a commit or tag, that raw data is human readable plain ASCII + // text. For a blob it is just file contents, so it could be text or + // binary data. For a tree it is a special binary format, so it's unlikely + // to be hugely helpful as a raw object. + const data = object.data(); + const type = object.type(); + const size = object.size(); + + console.log("Object size and type:", size, type); + console.log("Raw data: ", data.toString().substring(100), "..."); + + // You can also write raw object data to Git. This is pretty cool because + // it gives you direct access to the key/value properties of Git. Here + // we'll write a new blob object that just contains a simple string. + // Notice that we have to specify the object type. + oid = await odb.write("test data", "test data".length, nodegit.Object.TYPE.BLOB); + + // Now that we've written the object, we can check out what SHA1 was + // generated when the object was written to our database. + console.log("Written Object: ", oid.toString()); + + // ### Object Parsing + + // libgit2 has methods to parse every object type in Git so you don't have + // to work directly with the raw data. This is much faster and simpler + // than trying to deal with the raw data yourself. + + // #### Commit Parsing + + // [Parsing commit objects][pco] is simple and gives you access to all the + // data in the commit - the author (name, email, datetime), committer + // (same), tree, message, encoding and parent(s). + + oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); + + // Many methods in **nodegit** are asynchronous, because they do file + // or network I/O. By convention, all asynchronous methods are named + // imperatively, like `getCommit`, `open`, `read`, `write`, etc., whereas + // synchronous methods are named nominatively, like `type`, `size`, `name`. + + const commit = await repo.getCommit(oid); + + // Each of the properties of the commit object are accessible via methods, + // including commonly needed variations, such as `git_commit_time` which + // returns the author time and `git_commit_message` which gives you the + // commit message. + console.log( + "Commit:", commit.message(), + commit.author().name(), commit.date() + ); + + // Commits can have zero or more parents. The first (root) commit will + // have no parents, most commits will have one (i.e. the commit it was + // based on) and merge commits will have two or more. Commits can + // technically have any number, though it's rare to have more than two. + const parents = await commit.getParents(); + for (const parent of parents) { + console.log("Parent:", parent.toString()); + } + + // #### Writing Commits + + // nodegit provides a couple of methods to create commit objects easily as + // well. + const author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + const committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); + + // Commit objects need a tree to point to and optionally one or more + // parents. Here we're creating oid objects to create the commit with, + // but you can also use existing ones: + const treeId = nodegit.Oid.fromString( + "4170d10f19600b9cb086504e8e05fe7d863358a2"); + const parentId = nodegit.Oid.fromString( + "eebd0ead15d62eaf0ba276da53af43bbc3ce43ab"); + + let tree = await repo.getTree(treeId); + const parent = await repo.getCommit(parentId); + // Here we actually create the commit object with a single call with all + // the values we need to create the commit. The SHA key is written to + // the `commit_id` variable here. + oid = await repo.createCommit( + null /* do not update the HEAD */, + author, + committer, + "example commit", + tree, + [parent] + ); + console.log("New Commit:", oid.toString()); + + // #### Tag Parsing + + // You can parse and create tags with the [tag management API][tm], which + // functions very similarly to the commit lookup, parsing and creation + // methods, since the objects themselves are very similar. + + oid = nodegit.Oid.fromString("dcc4aa9fcdaced037434cb149ed3b6eab4d0709d"); + const tag = await repo.getTag(oid); + + // Now that we have the tag object, we can extract the information it + // generally contains: the target (usually a commit object), the type of + // the target object (usually "commit"), the name ("v1.0"), the tagger (a + // git_signature - name, email, timestamp), and the tag message. + console.log(tag.name(), tag.targetType(), tag.message()); + + const target = await tag.target(); + console.log("Target is commit:", target.isCommit()); + + // #### Tree Parsing + + // A Tree is how Git represents the state of the filesystem + // at a given revision. In general, a tree corresponds to a directory, + // and files in that directory are either files (blobs) or directories. + + // [Tree parsing][tp] is a bit different than the other objects, in that + // we have a subtype which is the tree entry. This is not an actual + // object type in Git, but a useful structure for parsing and traversing + // tree entries. + + oid = nodegit.Oid.fromString("e1b0c7ea57bfc5e30ec279402a98168a27838ac9"); + tree = await repo.getTree(oid); + + console.log("Tree Size:", tree.entryCount()); + + /** + * @param {nodegit.Tree} tree + */ + function dfs(tree) { + const promises = []; + + for (const entry of tree.entries()) { + if (entry.isDirectory()) { + promises.push(entry.getTree().then(dfs)); + } else if (entry.isFile()) { + console.log("Tree Entry:", entry.name()); + } } - return dfs(tree).then(function() { - // You can also access tree entries by path if you know the path of the - // entry you're looking for. - return tree.getEntry("example/general.js").then(function(entry) { - // Entries which are files have blobs associated with them: - entry.getBlob(function(error, blob) { - console.log("Blob size:", blob.size()); - }); - }); - }); - }) - - .then(function() { - // #### Blob Parsing - - // The last object type is the simplest and requires the least parsing - // help. Blobs are just file contents and can contain anything, there is - // no structure to it. The main advantage to using the [simple blob - // api][ba] is that when you're creating blobs you don't have to calculate - // the size of the content. There is also a helper for reading a file - // from disk and writing it to the db and getting the oid back so you - // don't have to do all those steps yourself. - - oid = nodegit.Oid.fromString("991c06b7b1ec6f939488427e4b41a4fa3e1edd5f"); - return repo.getBlob(oid); - }) - - .then(function(blob) { - // You can access a node.js Buffer with the raw contents - // of the blob directly. Note that this buffer may not - // contain ASCII data for certain blobs (e.g. binary files). - var buffer = blob.content(); - - // If you know that the blob is UTF-8, however, - console.log("Blob contents:", blob.toString().slice(0, 38)); - console.log("Buffer:", buffer.toString().substring(100), "..."); - }) - - .then(function() { - // ### Revwalking - - // The libgit2 [revision walking api][rw] provides methods to traverse the - // directed graph created by the parent pointers of the commit objects. - // Since all commits point back to the commit that came directly before - // them, you can walk this parentage as a graph and find all the commits - // that were ancestors of (reachable from) a given starting point. This - // can allow you to create `git log` type functionality. - - oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); - - // To use the revwalker, create a new walker, tell it how you want to sort - // the output and then push one or more starting points onto the walker. - // If you want to emulate the output of `git log` you would push the SHA - // of the commit that HEAD points to into the walker and then start - // traversing them. You can also "hide" commits that you want to stop at - // or not see any of their ancestors. So if you want to emulate `git log - // branch1..branch2`, you would push the oid of `branch2` and hide the oid - // of `branch1`. - var revWalk = repo.createRevWalk(); - - revWalk.sorting(nodegit.Revwalk.SORT.TOPOLOGICAL, - nodegit.Revwalk.SORT.REVERSE); - - revWalk.push(oid); - - // Now that we have the starting point pushed onto the walker, we start - // asking for ancestors. It will return them in the sorting order we asked - // for as commit oids. We can then lookup and parse the commited pointed - // at by the returned OID; note that this operation is specially fast - // since the raw contents of the commit object will be cached in memory - - function walk() { - return revWalk.next().then(function(oid) { - if (!oid) { - return; - } - - return repo.getCommit(oid).then(function(commit) { - console.log("Commit:", commit.toString()); - return walk(); - }); - }); + return Promise.all(promises); + } + + await dfs(tree); + + // You can also access tree entries by path if you know the path of the + // entry you're looking for. + const entry = await tree.getEntry("example/general.js"); + // Entries which are files have blobs associated with them: + let blob = await entry.getBlob(); + console.log("Blob size:", blob.rawsize()); + + // #### Blob Parsing + + // The last object type is the simplest and requires the least parsing + // help. Blobs are just file contents and can contain anything, there is + // no structure to it. The main advantage to using the [simple blob + // api][ba] is that when you're creating blobs you don't have to calculate + // the size of the content. There is also a helper for reading a file + // from disk and writing it to the db and getting the oid back so you + // don't have to do all those steps yourself. + + oid = nodegit.Oid.fromString("991c06b7b1ec6f939488427e4b41a4fa3e1edd5f"); + blob = await repo.getBlob(oid); + // You can access a node.js Buffer with the raw contents + // of the blob directly. Note that this buffer may not + // contain ASCII data for certain blobs (e.g. binary files). + const buffer = blob.content(); + + // If you know that the blob is UTF-8, however, + console.log("Blob contents:", blob.toString().slice(0, 38)); + console.log("Buffer:", buffer.toString().substring(100), "..."); + + // ### Revwalking + + // The libgit2 [revision walking api][rw] provides methods to traverse the + // directed graph created by the parent pointers of the commit objects. + // Since all commits point back to the commit that came directly before + // them, you can walk this parentage as a graph and find all the commits + // that were ancestors of (reachable from) a given starting point. This + // can allow you to create `git log` type functionality. + + oid = nodegit.Oid.fromString("698c74e817243efe441a5d1f3cbaf3998282ca86"); + + // To use the revwalker, create a new walker, tell it how you want to sort + // the output and then push one or more starting points onto the walker. + // If you want to emulate the output of `git log` you would push the SHA + // of the commit that HEAD points to into the walker and then start + // traversing them. You can also "hide" commits that you want to stop at + // or not see any of their ancestors. So if you want to emulate `git log + // branch1..branch2`, you would push the oid of `branch2` and hide the oid + // of `branch1`. + const revWalk = repo.createRevWalk(); + + revWalk.sorting( + nodegit.Revwalk.SORT.TOPOLOGICAL, + nodegit.Revwalk.SORT.REVERSE + ); + + revWalk.push(oid); + + // Now that we have the starting point pushed onto the walker, we start + // asking for ancestors. It will return them in the sorting order we asked + // for as commit oids. We can then lookup and parse the commits pointed + // at by the returned OID; note that this operation is specially fast + // since the raw contents of the commit object will be cached in memory. + + async function walk() { + let oid; + try { + oid = await revWalk.next(); + } catch(error) { + if (error.errno !== nodegit.Error.CODE.ITEROVER) { + throw error; + } else { + return; + } } + const commit = await repo.getCommit(oid); + console.log("Commit:", commit.toString()); return walk(); - }) - - .then(function() { - // ### Index File Manipulation - - // The [index file API][gi] allows you to read, traverse, update and write - // the Git index file (sometimes thought of as the staging area). - return repo.openIndex(); - }) - - .then(function(index) { - // For each entry in the index, you can get a bunch of information - // including the SHA (oid), path and mode which map to the tree objects - // that are written out. It also has filesystem properties to help - // determine what to inspect for changes (ctime, mtime, dev, ino, uid, - // gid, file_size and flags) All these properties are exported publicly in - // the `IndexEntry` class - - index.entries().forEach(function(entry) { - console.log("Index Entry:", entry.path(), entry.mtime().seconds()); - }); - }) - - .then(function() { - // ### References - - // The [reference API][ref] allows you to list, resolve, create and update - // references such as branches, tags and remote references (everything in - // the .git/refs directory). - - return repo.getReferenceNames(nodegit.Reference.TYPE.ALL); - }) - - .then(function(referenceNames) { - var promises = []; - - referenceNames.forEach(function(referenceName) { - promises.push(repo.getReference(referenceName).then(function(reference) { - if (reference.isConcrete()) { - console.log("Reference:", referenceName, reference.target()); - } else if (reference.isSymbolic()) { - console.log("Reference:", referenceName, reference.symbolicTarget()); - } - })); - }); + } - return Promise.all(promises); - }) + await walk(); + + // ### Index File Manipulation + + // The [index file API][gi] allows you to read, traverse, update and write + // the Git index file (sometimes thought of as the staging area). + const index = await repo.refreshIndex(); + + // For each entry in the index, you can get a bunch of information + // including the SHA (oid), path and mode which map to the tree objects + // that are written out. It also has filesystem properties to help + // determine what to inspect for changes (ctime, mtime, dev, ino, uid, + // gid, file_size and flags) All these properties are exported publicly in + // the `IndexEntry` class + + for (const entry of index.entries()) { + console.log("Index Entry:", entry.path, entry.mtime.seconds()); + } + + // ### References + + // The [reference API][ref] allows you to list, resolve, create and update + // references such as branches, tags and remote references (everything in + // the .git/refs directory). + + const referenceNames = await repo.getReferenceNames(nodegit.Reference.TYPE.ALL); + + for (const referenceName of referenceNames) { + const reference = await repo.getReference(referenceName); + if (reference.isConcrete()) { + console.log("Reference:", referenceName, reference.target()); + } else if (reference.isSymbolic()) { + console.log("Reference:", referenceName, reference.symbolicTarget()); + } + } - .done(function() { - console.log("Done!"); - }); + console.log("Done!"); +})(); diff --git a/examples/index-add-and-remove.js b/examples/index-add-and-remove.js index 47eddd7683..74354ed5dc 100644 --- a/examples/index-add-and-remove.js +++ b/examples/index-add-and-remove.js @@ -1,12 +1,10 @@ var nodegit = require("../"); var path = require("path"); -var Promise = require("nodegit-promise"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); nodegit.Repository.open(path.resolve(__dirname, "../.git")) .then(function(repo) { - return repo.openIndex() + return repo.refreshIndex() .then(function(index) { var fileContent = { newFile1: "this has some content", diff --git a/examples/merge-cleanly.js b/examples/merge-cleanly.js index 096714e8e3..e277477bf8 100644 --- a/examples/merge-cleanly.js +++ b/examples/merge-cleanly.js @@ -1,8 +1,6 @@ var nodegit = require("../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -fse.ensureDir = promisify(fse.ensureDir); +var fse = require("fs-extra"); var ourFileName = "ourNewFile.txt"; var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; @@ -20,10 +18,10 @@ var theirCommit; var ourBranch; var theirBranch; -var ourSignature = nodegit.Signature.create("Ron Paul", - "RonPaul@TollRoadsRBest.info", 123456789, 60); -var theirSignature = nodegit.Signature.create("Greg Abbott", - "Gregggg@IllTollYourFace.us", 123456789, 60); +var ourSignature = nodegit.Signature.now("Ron Paul", + "RonPaul@TollRoadsRBest.info"); +var theirSignature = nodegit.Signature.now("Greg Abbott", + "Gregggg@IllTollYourFace.us"); // Create a new repository in a clean directory, and add our first file fse.remove(path.resolve(__dirname, repoDir)) @@ -43,14 +41,16 @@ fse.remove(path.resolve(__dirname, repoDir)) // Load up the repository index and make our initial commit to HEAD .then(function() { - return repository.openIndex(); + return repository.refreshIndex(); }) .then(function(index) { - index.read(1); - index.addByPath(ourFileName); - index.write(); - - return index.writeTree(); + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { return repository.createCommit("HEAD", ourSignature, @@ -79,14 +79,16 @@ fse.remove(path.resolve(__dirname, repoDir)) ); }) .then(function() { - return repository.openIndex(); + return repository.refreshIndex(); }) .then(function(index) { - index.read(1); - index.addByPath(theirFileName); - index.write(); - - return index.writeTree(); + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { // You don"t have to change head to make a commit to a different branch. @@ -112,7 +114,6 @@ fse.remove(path.resolve(__dirname, repoDir)) // the repository instead of just writing it. .then(function(index) { if (!index.hasConflicts()) { - index.write(); return index.writeTreeTo(repository); } }) diff --git a/examples/merge-with-conflicts.js b/examples/merge-with-conflicts.js index b1f8e95bae..55fb87d3b8 100644 --- a/examples/merge-with-conflicts.js +++ b/examples/merge-with-conflicts.js @@ -1,8 +1,6 @@ var nodegit = require("../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -fse.ensureDir = promisify(fse.ensureDir); +var fse = require("fs-extra"); var repoDir = "../../newRepo"; var fileName = "newFile.txt"; @@ -12,12 +10,12 @@ var ourFileContent = "Big Bobs are best, IMHO.\n"; var theirFileContent = "Nobody expects the small Bobquisition!\n"; var finalFileContent = "Big Bobs are beautiful and the small are unexpected!\n"; -var baseSignature = nodegit.Signature.create("Peaceful Bob", - "justchill@bob.net", 123456789, 60); -var ourSignature = nodegit.Signature.create("Big Bob", - "impressive@bob.net", 123456789, 60); -var theirSignature = nodegit.Signature.create("Small Bob", - "underestimated@bob.net", 123456789, 60); +var baseSignature = nodegit.Signature.now("Peaceful Bob", + "justchill@bob.net"); +var ourSignature = nodegit.Signature.now("Big Bob", + "impressive@bob.net"); +var theirSignature = nodegit.Signature.now("Small Bob", + "underestimated@bob.net"); var ourBranchName = "ours"; var theirBranchName = "theirs"; @@ -49,14 +47,16 @@ fse.remove(path.resolve(__dirname, repoDir)) // Load up the repository index and make our initial commit to HEAD .then(function() { - return repository.openIndex(); + return repository.refreshIndex(); }) .then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); - - return index.writeTree(); + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { return repository.createCommit("HEAD", baseSignature, @@ -94,13 +94,15 @@ fse.remove(path.resolve(__dirname, repoDir)) ); }) .then(function() { - return repository.openIndex() + return repository.refreshIndex() .then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); - - return index.writeTree(); + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }); }) .then(function(oid) { @@ -122,12 +124,15 @@ fse.remove(path.resolve(__dirname, repoDir)) ); }) .then(function() { - return repository.openIndex().then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); - - return index.writeTree(); + return repository.refreshIndex() + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }); }) .then(function(oid) { @@ -146,7 +151,7 @@ fse.remove(path.resolve(__dirname, repoDir)) return nodegit.Reference.lookup(repository, "HEAD"); }) .then(function(head) { - return head.symbolicSetTarget(ourBranch.name(), ourSignature, ""); + return head.symbolicSetTarget(ourBranch.name(), ""); }) @@ -170,16 +175,18 @@ fse.remove(path.resolve(__dirname, repoDir)) } }) -// we need to get a new index as the other one isnt backed to -// the repository in the usual fashion, and just behaves weirdly +// we need to get a new index as the other one is not backed to +// the repository in the usual fashion, and just behaves weirdly. .then(function() { - return repository.openIndex().then(function(index) { - - index.read(1); - index.addByPath(fileName); - index.write(); - - return index.writeTree(); + return repository.refreshIndex() + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }); }) .then(function(oid) { diff --git a/examples/pull.js b/examples/pull.js index 0ef5b133be..fe2d83411a 100644 --- a/examples/pull.js +++ b/examples/pull.js @@ -11,11 +11,13 @@ nodegit.Repository.open(path.resolve(__dirname, repoDir)) repository = repo; return repository.fetchAll({ - credentials: function(url, userName) { - return nodegit.Cred.sshKeyFromAgent(userName); - }, - certificateCheck: function() { - return 1; + callbacks: { + credentials: function(url, userName) { + return nodegit.Cred.sshKeyFromAgent(userName); + }, + certificateCheck: function() { + return 0; + } } }); }) diff --git a/examples/push.js b/examples/push.js index 1c9b2ee2ae..5c19b70349 100644 --- a/examples/push.js +++ b/examples/push.js @@ -1,8 +1,6 @@ var nodegit = require("../"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); -fse.ensureDir = promisify(fse.ensureDir); +var fse = require("fs-extra"); var fileName = "newFile.txt"; var fileContent = "hello world"; @@ -12,8 +10,8 @@ var repoDir = "../../newRepo"; var repository; var remote; -var signature = nodegit.Signature.create("Foo bar", - "foo@bar.com", 123456789, 60); +var signature = nodegit.Signature.now("Foo bar", + "foo@bar.com"); // Create a new repository in a clean directory, and add our first file fse.remove(path.resolve(__dirname, repoDir)) @@ -30,14 +28,16 @@ fse.remove(path.resolve(__dirname, repoDir)) // Load up the repository index and make our initial commit to HEAD .then(function() { - return repository.openIndex(); + return repository.refreshIndex(); }) .then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); - - return index.writeTree(); + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { return repository.createCommit("HEAD", signature, signature, @@ -51,18 +51,17 @@ fse.remove(path.resolve(__dirname, repoDir)) .then(function(remoteResult) { remote = remoteResult; - remote.setCallbacks({ - credentials: function(url, userName) { - return nodegit.Cred.sshKeyFromAgent(userName); - } - }); - // Create the push object for this remote return remote.push( ["refs/heads/master:refs/heads/master"], - null, - repository.defaultSignature(), - "Push to master"); + { + callbacks: { + credentials: function(url, userName) { + return nodegit.Cred.sshKeyFromAgent(userName); + } + } + } + ); }); }).done(function() { console.log("Done!"); diff --git a/examples/read-file.js b/examples/read-file.js index 4203a5cf4e..9da5ed1758 100644 --- a/examples/read-file.js +++ b/examples/read-file.js @@ -1,25 +1,19 @@ -var nodegit = require("../"), - path = require("path"); +const nodegit = require("../"); +const path = require("path"); // This example opens a certain file, `README.md`, at a particular commit, // and prints the first 10 lines as well as some metadata. -var _entry; -nodegit.Repository.open(path.resolve(__dirname, "../.git")) - .then(function(repo) { - return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); - }) - .then(function(commit) { - return commit.getEntry("README.md"); - }) - .then(function(entry) { - _entry = entry; - return _entry.getBlob(); - }) - .then(function(blob) { - console.log(_entry.filename(), _entry.sha(), blob.rawsize() + "b"); - console.log("========================================================\n\n"); - var firstTenLines = blob.toString().split("\n").slice(0, 10).join("\n"); - console.log(firstTenLines); - console.log("..."); - }) - .done(); + +(async () => { + const repo = await nodegit.Repository.open(path.resolve(__dirname, "../.git")); + const commit = await repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); + const entry = await commit.getEntry("README.md"); + const blob = await entry.getBlob(); + + console.log(entry.name(), entry.sha(), blob.rawsize() + "b"); + console.log("========================================================\n\n"); + const firstTenLines = blob.toString().split("\n").slice(0, 10).join("\n"); + console.log(firstTenLines); + console.log("..."); +})(); + diff --git a/examples/remove-and-commit.js b/examples/remove-and-commit.js index fd6ddc6b80..4ba8c777a5 100644 --- a/examples/remove-and-commit.js +++ b/examples/remove-and-commit.js @@ -17,15 +17,16 @@ var _oid; nodegit.Repository.open(path.resolve(__dirname, "../.git")) .then(function(repo) { _repository = repo; - return repo.openIndex(); + return repo.refreshIndex(); }) .then(function(index){ _index = index; - return _index.read(); }) .then(function() { //remove the file from the index... - _index.removeByPath(fileName); + return _index.removeByPath(fileName); + }) + .then(function() { return _index.write(); }) .then(function() { @@ -39,10 +40,10 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) return _repository.getCommit(head); }) .then(function(parent) { - var author = nodegit.Signature.create("Scott Chacon", - "schacon@gmail.com", 123456789, 60); - var committer = nodegit.Signature.create("Scott A Chacon", - "scott@github.com", 987654321, 90); + var author = nodegit.Signature.now("Scott Chacon", + "schacon@gmail.com"); + var committer = nodegit.Signature.now("Scott A Chacon", + "scott@github.com"); return _repository.createCommit("HEAD", author, committer, "message", _oid, [parent]); diff --git a/examples/walk-history-for-file.js b/examples/walk-history-for-file.js index b1c331ab16..f094154555 100644 --- a/examples/walk-history-for-file.js +++ b/examples/walk-history-for-file.js @@ -1,55 +1,62 @@ var nodegit = require("../"), - path = require("path"); + path = require("path"), + historyFile = "generate/input/descriptor.json", + walker, + historyCommits = [], + commit, + repo; // This code walks the history of the master branch and prints results // that look very similar to calling `git log` from the command line +function compileHistory(resultingArrayOfCommits) { + var lastSha; + if (historyCommits.length > 0) { + lastSha = historyCommits[historyCommits.length - 1].commit.sha(); + if ( + resultingArrayOfCommits.length == 1 && + resultingArrayOfCommits[0].commit.sha() == lastSha + ) { + return; + } + } + + resultingArrayOfCommits.forEach(function(entry) { + historyCommits.push(entry); + }); + + lastSha = historyCommits[historyCommits.length - 1].commit.sha(); + + walker = repo.createRevWalk(); + walker.push(lastSha); + walker.sorting(nodegit.Revwalk.SORT.TIME); + + return walker.fileHistoryWalk(historyFile, 500) + .then(compileHistory); +} + nodegit.Repository.open(path.resolve(__dirname, "../.git")) - .then(function(repo) { + .then(function(r) { + repo = r; return repo.getMasterCommit(); }) .then(function(firstCommitOnMaster){ // History returns an event. - var history = firstCommitOnMaster.history(nodegit.Revwalk.SORT.Time); - var commits = []; - - // History emits "commit" event for each commit in the branch's history - history.on("commit", function(commit) { - return commit.getDiff() - .then(function(diffList) { - var addCommit = diffList.reduce(function(prevVal, diff) { - var result = - prevVal || - diff.patches().reduce(function(prevValDiff, patch) { - - var result = - prevValDiff || - !!~patch.oldFile().path().indexOf("descriptor.json") || - !!~patch.newFile().path().indexOf("descriptor.json"); - - return result; - }, false); - - return result; - }, false); - - if (addCommit) { - commits.push(commit); - } - }); - }); + walker = repo.createRevWalk(); + walker.push(firstCommitOnMaster.sha()); + walker.sorting(nodegit.Revwalk.SORT.Time); - history.on("end", function() { - commits.forEach(function(commit) { - console.log("commit " + commit.sha()); - console.log("Author:", commit.author().name() + - " <" + commit.author().email() + ">"); - console.log("Date:", commit.date()); - console.log("\n " + commit.message()); - }); + return walker.fileHistoryWalk(historyFile, 500); + }) + .then(compileHistory) + .then(function() { + historyCommits.forEach(function(entry) { + commit = entry.commit; + console.log("commit " + commit.sha()); + console.log("Author:", commit.author().name() + + " <" + commit.author().email() + ">"); + console.log("Date:", commit.date()); + console.log("\n " + commit.message()); }); - - // Don't forget to call `start()`! - history.start(); }) .done(); diff --git a/examples/walk-history.js b/examples/walk-history.js index 2e41ce2da6..7bdab9fb96 100644 --- a/examples/walk-history.js +++ b/examples/walk-history.js @@ -10,7 +10,7 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) }) .then(function(firstCommitOnMaster){ // History returns an event. - var history = firstCommitOnMaster.history(nodegit.Revwalk.SORT.Time); + var history = firstCommitOnMaster.history(nodegit.Revwalk.SORT.TIME); // History emits "commit" event for each commit in the branch's history history.on("commit", function(commit) { diff --git a/generate/README.md b/generate/README.md new file mode 100644 index 0000000000..3ee5446d60 --- /dev/null +++ b/generate/README.md @@ -0,0 +1,21 @@ +## /generate + +The scripts and templates in this dir help generate the source code and tests for NodeGit. The major components of generate are: + + 1. Input + 2. Scripts + 3. Templates + +### Input + + All the **configuration** required for the parser to generate the source code and tests. For more details, check the Input directory. + +### Scripts + + The scripts that generate the final configuration (*snapshot of the library*) `idefs.json`, `missing-tests.json`. These configurations are then used to generate `src` for the library. + +### Templates + + All the Combyne templates are placed here. The filters, partials, templates all help NodeGit generate the source code. + + > For more information on Combyne: [tbranyen/combyne](https://github.com/tbranyen/combyne) diff --git a/generate/index.js b/generate/index.js index 5ca590172f..753897d5b7 100644 --- a/generate/index.js +++ b/generate/index.js @@ -1,11 +1,50 @@ var generateJson = require("./scripts/generateJson"); var generateNativeCode = require("./scripts/generateNativeCode"); var generateMissingTests = require("./scripts/generateMissingTests"); +var submoduleStatus = require("../lifecycleScripts/submodules/getStatus"); module.exports = function generate() { - generateJson(); - generateNativeCode(); - generateMissingTests(); + console.log("[nodegit] Generating native code"); + + function tryGenerate(numRetries = 3) { + // There appears to be a race condition in the generate code somewhere + // Until we fix that, we should try to generate a few times before + try { + generateJson(); + generateNativeCode(); + generateMissingTests(); + } catch (error) { + if (numRetries > 0) { + console.log("[nodegit] WARNING - Failed to generate native code, trying again"); + tryGenerate(numRetries - 1); + } else { + throw error; + } + } + } + + return submoduleStatus() + .then(function(statuses) { + var dirtySubmodules = statuses + .filter(function(status) { + return status.onNewCommit + || status.needsInitialization + || status.workDirDirty; + }); + + if (dirtySubmodules.length) { + console.warn("[nodegit] WARNING - Some submodules are out-of-sync"); + dirtySubmodules.forEach(function(submodule) { + console.warn("[nodegit]\t" + submodule.name); + }); + } + }) + .then(tryGenerate) + .catch(function(e) { + console.error("[nodegit] ERROR - Could not generate native code"); + console.error(e); + throw e; + }); } if (require.main === module) { diff --git a/generate/input/README.md b/generate/input/README.md new file mode 100644 index 0000000000..f0d7573eed --- /dev/null +++ b/generate/input/README.md @@ -0,0 +1,15 @@ +## /generate/input + This folder contains the main config files to generate NodeGit's JavaScript functions. + + #### callbacks.json + Add all meta data about the callbacks from libgit2 that need to be implemented in NodeGit. + + #### descriptor.json + Customize the generated code using this configuration file. Enter the function's signature, arguments and their metadata and which functions can be skipped in this file. If you are using a manual template, remove all of its references from this file. + + #### libgit2-docs.json + These are provided by the libgit2 team. It includes all the metadata about the API provided by the libgit2 library. To grab the latest version of this file, download https://libgit2.org/libgit2/HEAD.json. + + #### libgit2-supplement.json + Use this confiuration file to group and override parts of the generated code. NodeGit tries its best to generate the right classes and structs, if it is not quite right, then use this config file to group/remove the functions. + > If you're using manual templates, update the `cFile` reference to point to the manual template. diff --git a/generate/input/callbacks.json b/generate/input/callbacks.json index d9f0af8d98..aa08429954 100644 --- a/generate/input/callbacks.json +++ b/generate/input/callbacks.json @@ -1,13 +1,28 @@ { - "git_attr_foreach_cb": { + "git_apply_delta_cb": { "args": [ { - "name": "name", - "cType": "const char *" + "name": "delta", + "cType": "const git_diff_delta *" }, { - "name": "value", - "cType": "const char *" + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_apply_hunk_cb": { + "args": [ + { + "name": "hunk", + "cType": "const git_diff_hunk *" }, { "name": "payload", @@ -18,14 +33,19 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_blob_chunk_cb": { + "git_attr_foreach_cb": { "args": [ { - "name": "entry", - "cType": "const git_config_entry *" + "name": "name", + "cType": "const char *" + }, + { + "name": "value", + "cType": "const char *" }, { "name": "payload", @@ -36,7 +56,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_checkout_notify_cb": { @@ -70,7 +91,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": 0 } }, "git_checkout_progress_cb": { @@ -92,11 +114,73 @@ "cType": "void *" } ], + "return": { + "type": "void", + "throttle": 100 + } + }, + "git_checkout_perfdata_cb": { + "args": [ + { + "name": "perfdata", + "cType": "const git_checkout_perfdata *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "void", + "throttle": 100 + } + }, + "git_commit_create_cb": { + "args": [ + { + "name": "out", + "cType": "git_oid *", + "isReturn": true + }, + { + "name": "author", + "cType": "const git_signature *" + }, + { + "name": "committer", + "cType": "const git_signature *" + }, + { + "name": "message_encoding", + "cType": "const char *" + }, + { + "name": "message", + "cType": "const char *" + }, + { + "name": "tree", + "cType": "const git_tree *" + }, + { + "name": "parent_count", + "cType": "size_t" + }, + { + "name": "parents", + "cType": "const git_oid * []" + }, + { + "name": "payload", + "cType": "void *" + } + ], "return": { "type": "int", - "noResults": 1, + "noResults": -30, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_config_foreach_cb": { @@ -114,14 +198,15 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_cred_acquire_cb": { + "git_credential_acquire_cb": { "args": [ { - "name": "cred", - "cType": "git_cred **", + "name": "credential", + "cType": "git_credential **", "isReturn": true }, { @@ -145,7 +230,31 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_diff_binary_cb": { + "args": [ + { + "name": "delta", + "cType": "const git_diff_delta *" + }, + { + "name": "binary", + "cType": "const git_diff_binary *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1 } }, "git_diff_file_cb": { @@ -167,7 +276,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_diff_hunk_cb": { @@ -189,7 +299,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_diff_line_cb": { @@ -215,14 +326,16 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_diff_notify_cb": { "args": [ { "name": "diff_so_far", - "cType": "const git_diff *" + "cType": "const git_diff *", + "ignore": true }, { "name": "delta_to_add", @@ -241,7 +354,135 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_diff_progress_cb": { + "args": [ + { + "name": "diff_so_far", + "cType": "const git_diff *", + "ignore": true + }, + { + "name": "old_path", + "cType": "const char *" + }, + { + "name": "new_path", + "cType": "const char *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_filter_apply_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { + "name": "payload", + "cType": "void **" + }, + { + "name": "to", + "cType": "git_buf *" + }, + { + "name": "from", + "cType": "const git_buf *" + }, + { + "name": "src", + "cType": "const git_filter_source *" + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_filter_check_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { + "name": "payload", + "cType": "void **" + }, + { + "name": "src", + "cType": "const git_filter_source *" + }, + { + "name": "attr_values", + "cType": "const char **" + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_filter_cleanup_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "void" + } + }, + "git_filter_init_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_filter_shutdown_fn": { + "args": [ + { + "name": "self", + "cType": "git_filter *" + } + ], + "return": { + "type": "void" } }, "git_index_matched_path_cb": { @@ -263,7 +504,28 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_indexer_progress_cb": { + "args": [ + { + "name": "stats", + "cType": "const git_indexer_progress *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1, + "throttle": 100 } }, "git_note_foreach_cb": { @@ -285,7 +547,27 @@ "type": "int", "noResults": 0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_odb_foreach_cb": { + "args": [ + { + "name": "id", + "cType": "const git_oid *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1 } }, "git_packbuilder_foreach_cb": { @@ -307,9 +589,114 @@ "type": "int", "noResults": 1, "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_push_update_reference_cb": { + "args": [ + { + "name": "refname", + "cType": "const char *" + }, + { + "name": "status", + "cType": "const char *" + }, + { + "name": "data", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_remote_create_cb": { + "args": [ + { + "name": "out", + "cType": "git_remote **", + "isReturn": true + }, + { + "name": "repo", + "cType": "git_repository *" + }, + { + "name": "name", + "cType": "const char *" + }, + { + "name": "url", + "cType": "const char *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1 + } + }, + "git_remote_ready_cb": { + "args": [ + { + "name": "remote", + "cType": "git_remote *" + }, + { + "name": "direction", + "cType": "int" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "success": 0, "error": -1 } }, + "git_repository_create_cb": { + "args": [ + { + "name": "out", + "cType": "git_repository **", + "isReturn": true + }, + { + "name": "path", + "cType": "const char *" + }, + { + "name": "bare", + "cType": "int" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": 1, + "cancel": -1 + } + }, "git_reference_foreach_cb": { "args": [ { @@ -325,7 +712,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_reference_foreach_name_cb": { @@ -343,7 +731,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_repository_fetchhead_foreach_cb": { @@ -373,7 +762,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": 1 + "error": -1, + "cancel": -1 } }, "git_repository_mergehead_foreach_cb": { @@ -391,7 +781,8 @@ "type": "int", "noResults": 0, "success": 0, - "error": 1 + "error": -1, + "cancel": -1 } }, "git_revwalk_hide_cb": { @@ -409,7 +800,28 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_stash_apply_progress_cb": { + "args": [ + { + "name": "progress", + "cType": "git_stash_apply_progress_t" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults":0, + "success": 0, + "error": -1, + "cancel": -1, + "throttle": 100 } }, "git_stash_cb": { @@ -435,7 +847,8 @@ "type": "int", "noResults":0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_status_cb": { @@ -457,7 +870,31 @@ "type": "int", "noResults": 0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_submodule_cb": { + "args": [ + { + "name": "sm", + "cType": "git_submodule *" + }, + { + "name": "name", + "cType": "const char *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 0, + "success": 0, + "error": -1, + "cancel": -1 } }, "git_tag_foreach_cb": { @@ -479,25 +916,36 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, - "git_transfer_progress_cb": { + "git_push_transfer_progress_cb": { "args": [ { - "name": "stats", - "cType": "const git_transfer_progress *" + "name": "current", + "type": "unsigned int" + }, + { + "name": "total", + "type": "unsigned int" + }, + { + "name": "bytes", + "type": "size_t" }, { "name": "payload", - "cType": "void *" + "type": "void *" } ], "return": { "type": "int", "noResults": 0, "success": 0, - "error": -1 + "error": -1, + "cancel": -1, + "throttle": 100 } }, "git_transport_cb": { @@ -520,7 +968,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_transport_certificate_check_cb": { @@ -546,7 +995,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_transport_message_cb": { @@ -568,7 +1018,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 } }, "git_treebuilder_filter_cb": { @@ -586,7 +1037,8 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": 0 } }, "git_treewalk_cb": { @@ -608,7 +1060,35 @@ "type": "int", "noResults": 1, "success": 0, - "error": -1 + "error": -1, + "cancel": -1 + } + }, + "git_url_resolve_cb": { + "args": [ + { + "name": "url_resolved", + "cType": "git_buf *" + }, + { + "name": "url", + "cType": "const char *" + }, + { + "name": "direction", + "cType": "int" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": -30, + "success": 0, + "error": -1, + "cancel": -30 } } } diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index 05938ae73b..99837534db 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -4,6 +4,19 @@ "JsName": "STATES", "isMask": false }, + "blob_filter_flag": { + "values": { + "GIT_BLOB_FILTER_CHECK_FOR_BINARY": { + "JsName": "CHECK_FOR_BINARY" + }, + "GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES": { + "JsName": "NO_SYSTEM_ATTRIBUTES" + }, + "GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD": { + "JsName": "ATTTRIBUTES_FROM_HEAD" + } + } + }, "branch": { "JsName": "BRANCH", "isMask": false @@ -20,6 +33,10 @@ } } }, + "credential": { + "JsName": "TYPE", + "owner": "Credential" + }, "describe_strategy": { "ignore": true }, @@ -48,12 +65,20 @@ "repository_init_flag": { "removeString": "INIT_" }, - "otype": { + "object": { "JsName": "TYPE", "owner": "Object", "removeString": "OBJ_" }, - "ref": { + "oid": { + "JsName": "TYPE", + "owner": "Oid" + }, + "proxy": { + "JsName": "PROXY", + "isMask": false + }, + "reference": { "owner": "Reference", "JsName": "TYPE" }, @@ -61,25 +86,95 @@ "JsName": "TYPE", "isMask": false }, + "revspec": { + "JsName": "TYPE", + "isMask": false + }, "sort": { "owner": "Revwalk" }, "status": { "JsName": "STATUS", "isMask": false + }, + "stream": { + "ignore": true } }, "types": { - "annotated": { + "allocator": { + "ignore": true + }, + "annotated_commit": { + "selfFreeing": true, "functions": { "git_annotated_commit_free": { "ignore": true + }, + "git_annotated_commit_id": { + "return": { + "ownedByThis": true + } + }, + "git_annotated_commit_from_ref": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_annotated_commit_from_fetchhead": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_annotated_commit_lookup": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_annotated_commit_from_revspec": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + } + } + }, + "apply_options": { + "hasConstructor": true + }, + "apply": { + "functions": { + "git_apply": { + "args": { + "options": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_apply_options_init": { + "ignore": true } } }, "attr": { "functions": { + "git_attr_cache_flush": { + "return": { + "isErrorCode": true + } + }, "git_attr_foreach": { "ignore": true }, @@ -89,20 +184,66 @@ "value_out": { "isReturn": true } + }, + "return": { + "isErrorCode": true } }, "git_attr_get_many": { + "isAsync": true, "args": { "values_out": { "isReturn": true, "jsClassName": "Array" } + }, + "return": { + "isErrorCode": true } } } }, "blame": { - "cType": "git_blame" + "selfFreeing": true, + "cType": "git_blame", + "functions": { + "git_blame_buffer": { + "args": { + "out": { + "ownedBy": ["reference"] + } + } + }, + "git_blame_file": { + "args": { + "out": { + "ownedBy": ["repo"] + }, + "options": { + "isOptional": true + } + } + }, + "git_blame_free": { + "ignore": true + }, + "git_blame_get_hunk_byindex": { + "return": { + "ownedByThis": true + } + }, + "git_blame_get_hunk_byline": { + "return": { + "ownedByThis": true + } + }, + "git_blame_init_options": { + "ignore": true + }, + "git_blame_options_init": { + "ignore": true + } + } }, "blame_hunk": { "fields": { @@ -112,9 +253,14 @@ } }, "blob": { + "selfFreeing": true, + "ownerFn": { + "name": "git_blob_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { - "git_blob_create_frombuffer": { - "isAsync": false, + "git_blob_create_from_buffer": { + "isAsync": true, "args": { "id": { "isReturn": true @@ -123,16 +269,114 @@ "cppClassName": "Buffer", "jsClassName": "Buffer" } + }, + "return": { + "isErrorCode": true + } + }, + "git_blob_create_from_workdir": { + "isAsync": true, + "args": { + "id": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_blob_create_fromworkdir": { + "ignore": true + }, + "git_blob_create_from_disk": { + "isAsync": true, + "args": { + "id": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_blob_create_from_stream": { + "ignore": true + }, + "git_blob_create_from_stream_commit": { + "ignore": true + }, + "git_blob_filter": { + "isAsync": true, + "isPrototypeMethod": true, + "args": { + "out": { + "isReturn": true, + "cppClassName": "GitBuf", + "jsClassName": "Buffer", + "shouldAlloc": true + }, + "blob": { + "cppClassName": "GitBlob", + "jsClassName": "Blob", + "isSelf": true + }, + "as_path": { + "cppClassName": "String", + "jsClassName": "String", + "cType": "const char *" + }, + "opts": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true } }, - "git_blob_create_fromchunks": { + "git_blob_filter_options_init": { "ignore": true }, "git_blob_filtered_content": { + "isAsync": true, + "isPrototypeMethod": false, + "args": { + "out": { + "isReturn": true, + "cppClassName": "GitBuf", + "jsClassName": "Buffer", + "shouldAlloc": true + }, + "blob": { + "cppClassName": "GitBlob", + "jsClassName": "Blob", + "isSelf": false + }, + "as_path": { + "cppClassName": "String", + "jsClassName": "String", + "cType": "const char *" + }, + "check_for_binary_data": { + "cppClassName": "Number", + "jsClassName": "Number", + "cType": "int" + } + }, + "return": { + "isErrorCode": true + } + }, + "git_blob_free": { "ignore": true }, + "git_blob_id": { + "return": { + "ownedByThis": true + } + }, "git_blob_rawcontent": { "return": { + "ownedByThis": true, "cppClassName": "Wrapper", "jsClassName": "Buffer" } @@ -143,11 +387,11 @@ "node_buffer.h" ] }, + "blob_filter_options": { + "hasConstructor": true + }, "branch": { "functions": { - "git_branch_iterator_free": { - "ignore": true - }, "git_branch_create": { "args": { "force": { @@ -161,35 +405,87 @@ } } }, + "git_branch_create_from_annotated": { + "isAsync": true, + "args": { + "ref_out": { + "isReturn": true + }, + "repository": {}, + "branch_name": {}, + "commit": {}, + "force": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_branch_iterator_free": { + "ignore": true + }, + "git_branch_iterator_new": { + "ignore": true + }, "git_branch_next": { "ignore": true }, + "git_branch_remote_name": { + "cppFunctionName": "RemoteName", + "jsFunctionName": "remoteName", + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "cppClassName": "GitBuf", + "jsClassName": "Buffer", + "cType": "git_buf *", + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } + }, "git_branch_set_upstream": { - "isAsync": false, + "isAsync": true, "args": { - "upstream_name": { + "branch_name": { "isOptional": true } + }, + "return" : { + "isReturn": true, + "isErrorCode": true } }, "git_branch_upstream": { - "isAsync": false, + "isAsync": true, "return" : { + "isReturn": true, "isErrorCode": true } } - } + }, + "dependencies": [ + "../include/buf.h" + ] }, "buf": { + "freeFunctionName": "git_buf_dispose", "functions": { + "git_buf_free": { + "ignore": true + }, "git_buf_grow": { "cppFunctionName": "Grow", "jsFunctionName": "grow", "args": { "buffer": { - "isReturn": true, - "isSelf": false, - "shouldAlloc": true + "isReturn": false, + "isSelf": true, + "shouldAlloc": false } }, "return": { @@ -197,16 +493,16 @@ "jsClassName": "Number", "isErrorCode": true }, - "isAsync": true + "isAsync": false }, "git_buf_set": { "cppFunctionName": "Set", "jsFunctionName": "set", "args": { "buffer": { - "isReturn": true, - "isSelf": false, - "shouldAlloc": true + "isReturn": false, + "isSelf": true, + "shouldAlloc": false }, "data": { "cppClassName": "Buffer", @@ -218,9 +514,15 @@ "jsClassName": "Number", "isErrorCode": true }, - "isAsync": true + "isAsync": false } - } + }, + "dependencies": [ + "../include/git_buf_converter.h" + ] + }, + "cert": { + "needsForwardDeclaration": false }, "cert_hostkey": { "fields": { @@ -231,6 +533,10 @@ "hash_sha1": { "cppClassName": "String", "size": 20 + }, + "hash_sha256": { + "cppClassName": "String", + "size": 32 } } }, @@ -260,6 +566,23 @@ } }, "git_checkout_index": { + "args": { + "index": { + "isOptional": true + }, + "opts": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_checkout_init_options": { + "ignore": true + }, + "git_checkout_options_init": { "ignore": true }, "git_checkout_tree": { @@ -278,18 +601,52 @@ } } }, - "clone": { + "cherrypick": { "functions": { - "git_clone": { + "git_cherrypick": { "args": { - "options": { + "cherrypick_options": { "isOptional": true } + }, + "isAsync": true, + "return": { + "isErrorCode": true } - } - } - }, - "clone_options": { + }, + "git_cherrypick_commit": { + "args": { + "merge_options": { + "isOptional": true + } + } + }, + "git_cherrypick_init_options": { + "ignore": true + }, + "git_cherrypick_options_init": { + "ignore": true + } + } + }, + "clone": { + "functions": { + "git_clone": { + "args": { + "options": { + "isOptional": true + } + } + }, + "git_clone_init_options": { + "ignore": true + }, + "git_clone_options_init": { + "ignore": true + } + } + }, + "clone_options": { "fields": { "repository_cb": { "ignore": true @@ -306,7 +663,51 @@ } }, "commit": { + "selfFreeing": true, + "ownerFn": { + "name": "git_commit_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { + "git_commit_amend": { + "isAsync": true, + "args": { + "author": { + "isOptional": true + }, + "committer": { + "isOptional": true + }, + "id": { + "isReturn": true + }, + "message_encoding": { + "isOptional": true + }, + "message": { + "isOptional": true + }, + "tree": { + "isOptional": true + }, + "update_ref": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_commit_author": { + "return": { + "ownedByThis": true + } + }, + "git_commit_committer": { + "return": { + "ownedByThis": true + } + }, "git_commit_create": { "args": { "id": { @@ -324,6 +725,33 @@ "update_ref": { "isOptional": true } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_commit_create_buffer": { + "args": { + "out": { + "isReturn": true, + "cppClassName": "GitBuf", + "jsClassName": "Buffer", + "shouldAlloc": true + }, + "message_encoding": { + "isOptional": true + }, + "parents": { + "cType": "const git_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitCommit" + } + }, + "isAsync": true, + "return": { + "isErrorCode": true } }, "git_commit_create_from_callback": { @@ -331,10 +759,58 @@ }, "git_commit_create_from_ids": { "ignore": true + }, + "git_commit_create_from_v": { + "ignore": true + }, + "git_commit_extract_signature": { + "isAsync": true + }, + "git_commit_free": { + "ignore": true + }, + "git_commit_id": { + "return": { + "ownedByThis": true + } + }, + "git_commit_parent_id": { + "return": { + "ownedByThis": true + } + }, + "git_commit_tree_id": { + "return": { + "ownedByThis": true + } + }, + "git_commit_header_field": { + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "isSelf": false, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } + } + } + }, + "commitarray": { + "fields": { + "commits": { + "ignore": true + }, + "count": { + "ignore": true } } }, "config": { + "selfFreeing": true, "functions": { "git_config_add_backend": { "ignore": true @@ -346,19 +822,66 @@ "ignore": true }, "git_config_delete_entry": { - "ignore": true + "return": { + "isErrorCode": true + } }, "git_config_delete_multivar": { + "return": { + "isErrorCode": true + } + }, + "git_config_entry_free": { "ignore": true }, "git_config_find_global": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_find_programdata": { + "isAsync": true, + "return": { + "isErrorCode": true + }, + "args": { + "out": { + "isReturn": true, + "isSelf": false, + "shouldAlloc": true + } + } }, "git_config_find_system": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_find_xdg": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_foreach": { "ignore": true @@ -370,16 +893,44 @@ "ignore": true }, "git_config_get_bool": { - "ignore": true + "args": { + "out": { + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_entry": { - "ignore": true + "args": { + "out": { + "isReturn": true, + "ownedByThis": true + } + } }, "git_config_get_int32": { - "ignore": true + "args": { + "out": { + "cType": "int32_t *", + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_int64": { - "ignore": true + "args": { + "out": { + "cType": "int64_t *", + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_get_mapped": { "ignore": true @@ -388,35 +939,53 @@ "ignore": true }, "git_config_get_string": { + "ignore": true + }, + "git_config_get_string_buf": { "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, "return": { "isErrorCode": true } }, - "git_config_iterator_free": { - "ignore": true - }, - "git_config_iterator_glob_new": { - "ignore": true - }, - "git_config_iterator_new": { - "ignore": true + "git_config_get_path": { + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_config_init_backend": { "ignore": true }, - "git_config_lookup_map_value": { - "ignore": true + "git_config_lock": { + "isAsync": true, + "args": { + "tx": { + "isReturn": true, + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } }, - "git_config_multivar_iterator_new": { + "git_config_lookup_map_value": { "ignore": true }, "git_config_new": { "ignore": true }, - "git_config_next": { - "ignore": true - }, "git_config_open_default": { "isAsync": true, "return": { @@ -430,7 +999,15 @@ "ignore": true }, "git_config_open_ondisk": { - "ignore": true + "isAsync": true, + "return": { + "isErrorCode": true + }, + "args": { + "out": { + "isReturn": true + } + } }, "git_config_parse_bool": { "ignore": true @@ -441,84 +1018,197 @@ "git_config_parse_int64": { "ignore": true }, - "git_config_refresh": { + "git_config_parse_path": { "ignore": true }, "git_config_set_bool": { - "ignore": true - }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_config_set_int32": { - "ignore": true + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_config_set_int64": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_config_set_multivar": { + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_config_set_string": { "isAsync": true, "return": { "isErrorCode": true } + }, + "git_config_snapshot": { + "args": { + "out": { + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } } - } + }, + "dependencies": [ + "../include/git_buf_converter.h" + ] }, "config_backend": { "ignore": true }, + "config_entry": { + "selfFreeing": true + }, "config_iterator": { - "ignore": true + "needsForwardDeclaration": false, + "selfFreeing": true, + "fields": { + "backend": { + "ignore": true + }, + "flags": { + "ignore": true + }, + "free": { + "ignore": true + }, + "next": { + "ignore": true + } + }, + "functions": { + "git_config_iterator_free": { + "ignore": true + }, + "git_config_iterator_new": { + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_iterator_glob_new": { + "jsFunctionName": "createGlob", + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_multivar_iterator_new": { + "jsFunctionName": "createMultivar", + "args": { + "out": { + "ownedBy": ["cfg"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_config_next": { + "jsFunctionName": "next", + "args": { + "entry": { + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } + } + } + }, + "config_backend_memory_options": { + "selfFreeing": true, + "cDependencies": [ + "git2/sys/config.h" + ] }, - "cred": { - "cType": "git_cred", + "credential": { + "needsForwardDeclaration": false, + "selfFreeing": true, + "cType": "git_credential", + "fields": { + "free": { + "ignore": true + } + }, "functions": { - "git_cred_default_new": { + "git_credential_default_new": { "isAsync": false }, - "git_cred_ssh_custom_new": { + "git_credential_free": { + "ignore": true + }, + "git_credential_ssh_custom_new": { "ignore": true }, - "git_cred_ssh_interactive_new": { + "git_credential_ssh_interactive_new": { "ignore": true }, - "git_cred_ssh_key_from_agent": { + "git_credential_ssh_key_from_agent": { "isAsync": false }, - "git_cred_ssh_key_new": { + "git_credential_ssh_key_new": { "isAsync": false }, - "git_cred_userpass": { + "git_credential_userpass": { "ignore": true }, - "git_cred_userpass_plaintext_new": { + "git_credential_userpass_plaintext_new": { "isAsync": false } } }, - "cred_ssh_custom": { + "credential_default": { "ignore": true }, - "cred_ssh_interactive": { + "credential_ssh_custom": { "ignore": true }, - "cred_ssh_key": { + "credential_ssh_interactive": { "ignore": true }, - "cred_username": { - "fields": { - "username": { - "cppClassName": "String", - "cType": "char *" - } - } + "credential_ssh_key": { + "ignore": true }, - "cred_userpass_payload": { - "cDependencies": [ - "git2/cred_helpers.h" - ] + "credential_username": { + "ignore": true + }, + "credential_userpass_payload": { + "ignore": true }, - "cred_userpass_plaintext": { + "credential_userpass_plaintext": { "ignore": true }, "describe": { "ignore": true }, + "describe_format_options": { + "hasConstructor": true + }, "diff": { + "selfFreeing": true, "cDependencies": [ "git2/sys/diff.h" ], @@ -546,6 +1236,9 @@ "file_cb" : { "isOptional": true }, + "binary_cb": { + "isOptional": true + }, "hunk_cb" : { "isOptional": true }, @@ -570,6 +1263,9 @@ "git_diff_find_init_options": { "ignore": true }, + "git_diff_find_options_init": { + "ignore": true + }, "git_diff_find_similar": { "args": { "diff": { @@ -595,14 +1291,54 @@ "git_diff_format_email_init_options": { "ignore": true }, + "git_diff_format_email_options_init": { + "ignore": true + }, "git_diff_free": { "ignore": true }, + "git_diff_get_perfdata": { + "isAsync": false, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + }, + "diff": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, "git_diff_get_stats": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "ownedByThis": true + }, + "diff": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_diff_index_to_index": { + "args": { + "diff": { + "ownedBy": ["repo"] + } + } }, "git_diff_index_to_workdir": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "index": { "isOptional": true }, @@ -614,44 +1350,62 @@ "git_diff_init_options": { "ignore": true }, - "git_diff_is_sorted_icase": { - "ignore": true - }, "git_diff_merge": { - "ignore": true + "isAsync": true, + "args": { + "from": { + "ownedByThis": true + }, + "onto": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } }, "git_diff_num_deltas_of_type": { "ignore": true }, - "git_diff_print": { - "ignore": true - }, - "git_diff_print_callback__to_buf": { - "ignore": true - }, - "git_diff_print_callback__to_file_handle": { + "git_diff_options_init": { "ignore": true }, - "git_diff_stats_deletions": { + "git_diff_patchid_init_options": { "ignore": true }, - "git_diff_stats_files_changed": { + "git_diff_patchid_options_init": { "ignore": true }, - "git_diff_stats_free": { + "git_diff_print": { "ignore": true }, - "git_diff_stats_insertions": { + "git_diff_print_callback__to_buf": { "ignore": true }, - "git_diff_stats_to_buf": { + "git_diff_print_callback__to_file_handle": { "ignore": true }, "git_diff_status_char": { "ignore": true }, + "git_diff_to_buf": { + "isAsync": true, + "return": { + "isErrorCode": true + }, + "args": { + "out": { + "isReturn": true, + "isSelf": false, + "shouldAlloc": true + } + } + }, "git_diff_tree_to_index": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -665,6 +1419,9 @@ }, "git_diff_tree_to_tree": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -678,6 +1435,9 @@ }, "git_diff_tree_to_workdir": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -688,6 +1448,9 @@ }, "git_diff_tree_to_workdir_with_index": { "args": { + "diff": { + "ownedBy": ["repo"] + }, "old_tree": { "isOptional": true }, @@ -710,6 +1473,7 @@ "ignore": true }, "diff_perfdata": { + "selfFreeing": true, "cDependencies": [ "git2/sys/diff.h" ] @@ -717,6 +1481,44 @@ "diff_similarity_metric": { "ignore": true }, + "diff_stats": { + "selfFreeing": true, + "functions": { + "git_diff_stats_deletions": { + "args": { + "stats": { + "isSelf": true + } + } + }, + "git_diff_stats_files_changed": { + "args": { + "stats": { + "isSelf": true + } + } + }, + "git_diff_stats_free": { + "ignore": true + }, + "git_diff_stats_insertions": { + "args": { + "stats": { + "isSelf": true + } + } + }, + "git_diff_stats_to_buf": { + "cppFunctionName": "DiffStatsToBuf", + "isAsync": true, + "args": { + "stats": { + "isSelf": true + } + } + } + } + }, "error_code": { "values": { "GIT_ERROR": { @@ -724,67 +1526,154 @@ } } }, - "filter": { + "email": { + "cDependencies": [ + "git2/sys/email.h" + ] + }, + "email_create_options": { + "hasConstructor": true + }, + "fetch": { "functions": { - "git_filter_list_apply_to_blob": { - "ignore": true - }, - "git_filter_list_apply_to_data": { - "ignore": true - }, - "git_filter_list_apply_to_file": { + "git_fetch_init_options": { "ignore": true }, - "git_filter_list_free": { - "ignore": true - }, - "git_filter_list_load": { + "git_fetch_options_init": { "ignore": true - }, - "git_filter_list_push": { + } + } + }, + "fetch_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, + "filter": { + "selfFreeing": false, + "hasConstructor": true, + "cDependencies": [ + "git2/sys/filter.h" + ], + "fields": { + "cleanup": { "ignore": true }, - "git_filter_source_filemode": { + "stream": { "ignore": true + } + } + }, + "filter_source": { + "functions": { + "git_filter_source_filemode": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } + }, + "git_filter_source_flags": { + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } }, "git_filter_source_id": { - "ignore": true + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + }, + "return": { + "ownedByThis": true + } }, "git_filter_source_mode": { - "ignore": true - }, - "git_filter_source_options": { - "ignore": true + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } }, "git_filter_source_path": { - "ignore": true + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } }, "git_filter_source_repo": { - "ignore": true + "isPrototypeMethod": true, + "args": { + "src": { + "isSelf": true + } + } } }, - "fields": { - "initialize": { - "ignore": true + "cDependencies": [ + "git2/sys/filter.h" + ] + }, + "filter_list": { + "selfFreeing": true, + "functions": { + "git_filter_list_apply_to_blob": { + "isPrototypeMethod": true, + "args": { + "filters": { + "isSelf": true + }, + "out": { + "shouldAlloc": true + } + } }, - "shutdown": { - "ignore": true + "git_filter_list_apply_to_data": { + "isPrototypeMethod": true, + "args": { + "filters": { + "isSelf": true + }, + "out": { + "shouldAlloc": true + } + } + }, + "git_filter_list_apply_to_file": { + "isPrototypeMethod": true, + "args": { + "filters": { + "isSelf": true + }, + "out": { + "shouldAlloc": true + } + } }, - "check": { + "git_filter_list_free": { "ignore": true }, - "apply": { + "git_filter_list_new": { "ignore": true }, - "cleanup": { + "git_filter_list_push": { "ignore": true } }, - "cDependencies": [ - "git2/sys/filter.h" + "dependencies": [ + "../include/git_buf_converter.h", + "../include/filter_registry.h" ] }, - "filter_source": { + "giterr": { "ignore": true }, "graph": { @@ -804,10 +1693,49 @@ "return": { "isErrorCode": true } + }, + "git_graph_descendant_of": { + "isAsync": true, + "return": { + "isResultOrError": true + } + }, + "git_graph_reachable_from_any": { + "args": { + "descendant_array": { + "cType": "git_oid *", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitOid" + } + }, + "isAsync": true, + "return": { + "isResultOrError": true + } } } }, "hashsig": { + "selfFreeing": true, + "freeFunctionName": "git_hashsig_free", + "functions": { + "git_hashsig_create": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_hashsig_create_fromfile": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_hashsig_free": { + "ignore": true + } + }, "cDependencies": [ "git2/sys/hashsig.h" ] @@ -815,12 +1743,38 @@ "ignore": { "functions": { "git_ignore_path_is_ignored": { - "ignore": true + "args": { + "ignored": { + "shouldAlloc": true, + "isReturn": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } } } }, + "imaxdiv": { + "ignore": true + }, + "imaxdiv_t": { + "ignore": true + }, "index": { + "selfFreeing": true, + "ownerFn": { + "name": "git_index_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { + "git_index_add": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_index_add_all": { "args": { "pathspec": { @@ -838,9 +1792,75 @@ "isErrorCode": true } }, - "git_index_conflict_get": { + "git_index_add_bypath": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_add_frombuffer": { "ignore": true }, + "git_index_add_from_buffer": { + "ignore": true + }, + "git_index_checksum": { + "return": { + "ownedByThis": true + } + }, + "git_index_clear": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_conflict_add": { + "isAsync": true, + "args": { + "index": { + "isSelf": true + }, + "ancestor_entry": { + "isOptional": true + }, + "our_entry": { + "isOptional": true + }, + "their_entry": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_index_conflict_cleanup": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_conflict_get": { + "args": { + "ancestor_out": { + "isReturn": true, + "ownedBy": ["index"] + }, + "our_out": { + "isReturn": true, + "ownedBy": ["index"] + }, + "their_out": { + "isReturn": true, + "ownedBy": ["index"] + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_index_conflict_iterator_free": { "ignore": true }, @@ -850,11 +1870,38 @@ "git_index_conflict_next": { "ignore": true }, + "git_index_conflict_remove": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_index_entrycount": { "jsFunctionName": "entryCount" }, "git_index_find": { - "ignore": true + "isAsync": true, + "args": { + "at_pos": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_index_find_prefix": { + "isAsync": true, + "args": { + "at_pos": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } }, "git_index_free": { "ignore": true @@ -869,11 +1916,37 @@ "git_index_new": { "ignore": true }, + "git_index_open": { + "isAsync": true, + "return": { + "selfOwned": true, + "isErrorCode": true + } + }, + "git_index_owner": { + "ignore": true + }, "git_index_read": { "args": { "force": { "isOptional": true } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_read_tree": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_remove": { + "isAsync": true, + "return": { + "isErrorCode": true } }, "git_index_remove_all": { @@ -893,6 +1966,18 @@ "isErrorCode": true } }, + "git_index_remove_bypath": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_remove_directory": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_index_update_all": { "args": { "pathspec": { @@ -915,45 +2000,361 @@ "force": { "isOptional": true } - } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_write_tree": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_write_tree_to": { + "isAsync": true, + "return": { + "isErrorCode": true + } } }, "dependencies": [ "../include/str_array_converter.h" ] }, - "index_entry": { - "hasConstructor": true, - "ignoreInit": true - }, - "indexer": { - "cType": "git_indexer", + "index_conflict_iterator": { + "selfFreeing": true, + "freeFunctionName": "git_index_conflict_iterator_free", "functions": { - "git_indexer_append": { + "git_index_conflict_iterator_free": { "ignore": true }, - "git_indexer_new": { - "ignore": true - } - } + "git_index_conflict_iterator_new": { + "args": { + "iterator_out": { + "ownedBy": ["index"] + } + } + }, + "git_index_conflict_next": { + "isAsync": false, + "jsFunctionName": "next", + "cppFunctionName": "Next", + "args": { + "ancestor_out": { + "isReturn": true, + "ownedByThis": true + }, + "our_out": { + "isReturn": true, + "ownedByThis": true + }, + "their_out": { + "isReturn": true, + "ownedByThis": true + } + } + } + } }, - "mempack": { + "index_entry": { + "isReturnable": true, + "hasConstructor": true, + "ignoreInit": true + }, + "index_iterator": { + "selfFreeing": true, + "freeFunctionName": "git_index_iterator_free", "functions": { - "git_mempack_new": { + "git_index_iterator_free": { "ignore": true }, - "git_mempack_reset": { + "git_index_iterator_new": { + "args": { + "iterator_out": { + "ownedBy": ["index"] + } + } + }, + "git_index_iterator_next": { + "isAsync": false, + "args": { + "out": { + "ownedByThis": true + } + } + } + } + }, + "index_name_entry": { + "functions": { + "git_index_name_add": { + "cppFunctionName": "Add", + "jsFunctionName": "add", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_name_clear": { + "cppFunctionName": "Clear", + "jsFunctionName": "clear", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_name_entrycount": { + "cppFunctionName": "Entrycount", + "jsFunctionName": "entryCount" + }, + "git_index_name_get_byindex": { + "cppFunctionName": "GetByIndex", + "jsFunctionName": "getByIndex", + "isPrototypeMethod": false + } + }, + "cDependencies": [ + "git2/sys/index.h" + ] + }, + "index_reuc_entry": { + "fields": { + "mode": { + "cType": "uint32_t [3]" + } + }, + "functions": { + "git_index_reuc_add": { + "cppFunctionName": "Add", + "jsFunctionName": "add", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_clear": { + "cppFunctionName": "Clear", + "jsFunctionName": "clear", + "isAsync": true, + "isPrototypeMethod": false, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_entrycount": { + "cppFunctionName": "Entrycount", + "jsFunctionName": "entryCount" + }, + "git_index_reuc_find": { + "args": { + "at_pos": { + "isReturn": true, + "shouldAlloc": true + } + }, + "cppFunctionName": "Find", + "jsFunctionName": "find", + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_index_reuc_get_byindex": { + "cppFunctionName": "GetByIndex", + "jsFunctionName": "getByIndex", + "isPrototypeMethod": false + }, + "git_index_reuc_get_bypath": { + "cppFunctionName": "GetByPath", + "jsFunctionName": "getByPath", + "isPrototypeMethod": false + }, + "git_index_reuc_remove": { + "cppFunctionName": "Remove", + "jsFunctionName": "remove", + "isAsync": true, + "isPrototypeMethod": false, + "return": { + "isErrorCode": true + } + } + }, + "cDependencies": [ + "git2/sys/index.h" + ] + }, + "index_time": { + "isReturnable": true, + "hasConstructor": true, + "ignoreInit": true + }, + "indexer": { + "ignore": true + }, + "indexer_options": { + "ignore": true + }, + "LIBSSH2_SESSION": { + "ignore": true + }, + "LIBSSH2_USERAUTH_KBDINT_PROMPT": { + "ignore": true + }, + "LIBSSH2_USERAUTH_KBDINT_RESPONSE": { + "ignore": true + }, + "_LIBSSH2_SESSION": { + "ignore": true + }, + "_LIBSSH2_USERAUTH_KBDINT_PROMPT": { + "ignore": true + }, + "_LIBSSH2_USERAUTH_KBDINT_RESPONSE": { + "ignore": true + }, + "mailmap": { + "selfFreeing": true, + "freeFunctionName": "git_mailmap_free", + "functions": { + "git_mailmap_add_entry": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_free": { "ignore": true + }, + "git_mailmap_from_buffer": { + "return": { + "isErrorCode": true + } + }, + "git_mailmap_from_repository": { + "args": { + "out": { + "ownedBy": ["repo"] + } + }, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_resolve": { + "args": { + "real_name": { + "isReturn": true + }, + "real_email": { + "isReturn": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_mailmap_resolve_signature": { + "return": { + "isErrorCode": true + } } } }, + "mempack": { + "ignore": true + }, "merge": { "functions": { "git_merge": { - "ignore": true + "isAsync": true, + "args": { + "repo": { + "cppClassName": "GitRepository", + "cType": "git_repository *", + "jsClassName": "Repo" + }, + "their_heads": { + "cType": "const git_annotated_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitAnnotatedCommit" + }, + "their_heads_len": { + "cType": "size_t", + "cppClassName": "Number", + "jsClassName": "Number" + }, + "merge_opts": { + "isOptional": true, + "cType": "git_merge_options *", + "cppClassName": "GitMergeOptions" + }, + "checkout_opts": { + "isOptional": true, + "cType": "git_checkout_options *", + "cppClassName": "GitCheckoutOptions" + } + }, + "return": { + "isErrorCode": true + } }, "git_merge_analysis": { - "ignore": true + "isAsync": true, + "args": { + "analysis_out": { + "isReturn": true, + "shouldAlloc": true + }, + "preference_out": { + "isReturn": true, + "shouldAlloc": true + }, + "their_heads": { + "cType": "const git_annotated_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitAnnotatedCommit" + }, + "their_heads_len": { + "cType": "size_t", + "cppClassName": "Number", + "jsClassName": "Number" + } + }, + "return": { + "isErrorCode": true + } + }, + "git_merge_analysis_for_ref": { + "isAsync": true, + "args": { + "analysis_out": { + "isReturn": true, + "shouldAlloc": true + }, + "preference_out": { + "isReturn": true, + "shouldAlloc": true + }, + "their_heads": { + "cType": "const git_annotated_commit **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitAnnotatedCommit" + }, + "their_heads_len": { + "cType": "size_t", + "cppClassName": "Number", + "jsClassName": "Number" + } + }, + "return": { + "isErrorCode": true + } }, "git_merge_base_many": { "ignore": true @@ -977,25 +2378,92 @@ "git_merge_file_from_index": { "ignore": true }, + "git_merge_file_input_init": { + "ignore": true + }, + "git_merge_file_init_input": { + "ignore": true + }, "git_merge_file_init_options": { "ignore": true }, - "git_merge_file_result_free": { + "git_merge_file_options_init": { "ignore": true + }, + "git_merge_init_options": { + "ignore": true + }, + "git_merge_options_init": { + "ignore": true + }, + "git_merge_trees": { + "args": { + "ancestor_tree": { + "isOptional": true + }, + "opts": { + "isOptional": true + } + } } } }, + "merge_driver": { + "ignore": true + }, + "merge_driver_source": { + "ignore": true + }, + "merge_file_result": { + "ignore": true + }, + "merge_result": { + "ignore": true + }, "message": { - "functions": { - "git_message_prettify": { - "ignore": true - } - } + "ignore": true + }, + "message_trailer": { + "ignore": true + }, + "message_trailer_array": { + "ignore": true }, "note": { + "selfFreeing": true, "functions": { - "git_note_iterator_free": { - "ignore": true + "git_note_author": { + "return": { + "ownedByThis": true + } + }, + "git_note_commit_create": { + "args": { + "notes_commit_out": { + "isReturn": true, + "shouldAlloc": true + }, + "notes_blob_out": { + "isReturn": true, + "shouldAlloc": true + } + } + }, + "git_note_commit_remove": { + "isAsync": true, + "args": { + "notes_commit_out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_note_comitter": { + "return": { + "ownedByThis": true + } }, "git_note_create": { "args": { @@ -1004,13 +2472,30 @@ } } }, - "git_note_remove": { + "git_note_foreach": { "isAsync": true, "return": { "isErrorCode": true } }, - "git_note_foreach": { + "git_note_free": { + "ignore": true + }, + "git_note_id": { + "return": { + "ownedByThis": true + } + }, + "git_note_iterator_free": { + "ignore": true + }, + "git_note_iterator_new": { + "ignore": true + }, + "git_note_next": { + "ignore": true + }, + "git_note_remove": { "isAsync": true, "return": { "isErrorCode": true @@ -1019,7 +2504,20 @@ } }, "object": { + "selfFreeing": true, + "ownerFn": { + "name": "git_object_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { + "git_object_free": { + "ignore": true + }, + "git_object_id": { + "return": { + "ownedByThis": true + } + }, "git_object_short_id": { "args": { "out": { @@ -1030,6 +2528,7 @@ } }, "odb": { + "selfFreeing": true, "functions": { "git_odb_add_alternate": { "ignore": true @@ -1037,24 +2536,44 @@ "git_odb_add_backend": { "ignore": true }, - "git_odb_backend_loose": { - "ignore": true - }, - "git_odb_backend_one_pack": { - "ignore": true - }, - "git_odb_backend_pack": { - "ignore": true + "git_odb_add_disk_alternate": { + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_odb_exists": { - "ignore": true + "ignore": true, + "isAsync": true, + "args": { + "db": { + "isSelf": true + } + } }, "git_odb_exists_prefix": { + "isAsync": true, + "args": { + "db": { + "isSelf": true + }, + "out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_odb_expand_ids": { "ignore": true }, "git_odb_foreach": { "ignore": true }, + "git_odb_free": { + "ignore": true + }, "git_odb_get_backend": { "ignore": true }, @@ -1062,7 +2581,15 @@ "ignore": true }, "git_odb_hashfile": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } }, "git_odb_init_backend": { "ignore": true @@ -1079,27 +2606,29 @@ "git_odb_open_wstream": { "ignore": true }, + "git_odb_read": { + "isAsync": true, + "cppFunctionName": "OdbRead", + "args": { + "obj": { + "isReturn": true, + "ownedByThis": true + } + } + }, "git_odb_read_header": { "ignore": true }, "git_odb_read_prefix": { - "ignore": true + "args": { + "out": { + "ownedByThis": true + } + } }, "git_odb_refresh": { "ignore": true }, - "git_odb_stream_finalize_write": { - "ignore": true - }, - "git_odb_stream_free": { - "ignore": true - }, - "git_odb_stream_read": { - "ignore": true - }, - "git_odb_stream_write": { - "ignore": true - }, "git_odb_write": { "args": { "data": { @@ -1124,13 +2653,29 @@ }, "ignore": true }, + "odb_expand_id": { + "ignore": true + }, "odb_object": { + "selfFreeing": true, "functions": { "git_odb_object_data": { "return": { + "ownedByThis": true, "cppClassName": "Wrapper", "jsClassName": "Buffer" } + }, + "git_odb_object_dup": { + "ignore": true + }, + "git_odb_object_free": { + "ignore": true + }, + "git_odb_object_id": { + "return": { + "ownedByThis": true + } } }, "dependencies": [ @@ -1145,13 +2690,23 @@ "ignore": true }, "oid": { + "selfFreeing": true, + "cpyFunction": "git_oid_cpy", + "freeFunctionName": "free", "shouldAlloc": true, "functions": { "git_oid_cpy": { + "isAsync": false, "args": { + "src": { + "shouldAlloc": false + }, "out": { "isReturn": true } + }, + "return": { + "isErrorCode": true } }, "git_oid_fmt": { @@ -1161,13 +2716,25 @@ "ignore": true }, "git_oid_fromstr": { - "isAsync": false + "ignore": true }, "git_oid_fromstrn": { "ignore": true }, "git_oid_fromstrp": { - "ignore": true + "isAsync": false, + "jsFunctionName": "fromString", + "args": { + "out": { + "isReturn": true + }, + "str": { + "shouldAlloc": false + } + }, + "return": { + "isErrorCode": true + } }, "git_oid_nfmt": { "ignore": true @@ -1175,15 +2742,6 @@ "git_oid_pathfmt": { "ignore": true }, - "git_oid_shorten_add": { - "ignore": true - }, - "git_oid_shorten_free": { - "ignore": true - }, - "git_oid_shorten_new": { - "ignore": true - }, "git_oid_tostr": { "ignore": true } @@ -1194,16 +2752,73 @@ } } }, + "oid_shorten": { + "selfFreeing": true, + "functions": { + "git_oid_shorten_new": { + "isPrototypeMethod": false + }, + "git_oid_shorten_add": { + "args": { + "os": { + "isSelf": true + } + } + }, + "git_oid_shorten_free": { + "ignore": true + } + } + }, + "oidarray": { + "selfFreeing": true, + "functions": { + "git_oidarray_free": { + "ignore": true + } + } + }, "openssl": { - "cDependencies": [ - "git2/sys/openssl.h" - ] + "ignore": true }, "packbuilder": { + "selfFreeing": true, "functions": { "git_packbuilder_foreach": { "ignore": true }, + "git_packbuilder_free": { + "ignore": true + }, + "git_packbuilder_hash": { + "return": { + "ownedByThis": true + } + }, + "git_packbuilder_insert": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_packbuilder_insert_commit": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_packbuilder_insert_recur": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_packbuilder_insert_walk": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_packbuilder_new": { "isAsync": false }, @@ -1212,36 +2827,110 @@ }, "git_packbuilder_write": { "ignore": true + }, + "git_packbuilder_write_buf": { + "ignore": true } } }, "patch": { + "selfFreeing": true, + "dependencies": [ + "../include/convenient_patch.h" + ], + "ownerFn": { + "name": "git_patch_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_patch_free": { "ignore": true }, + "git_patch_from_blobs": { + "isAsync": true, + "args": { + "out": { + "isReturn": true + }, + "old_blob": { + "isOptional": true + }, + "old_as_path": { + "isOptional": true + }, + "new_blob": { + "isOptional": true + }, + "new_as_path": { + "isOptional": true + }, + "opts": { + "isOptional": true + } + } + }, + "git_patch_from_blob_and_buffer": { + "ignore": true + }, "git_patch_from_buffers": { "ignore": true }, "git_patch_from_diff": { - "isAsync": false + "isAsync": true, + "args": { + "out": { + "ownedBy": ["diff"] + } + } + }, + "git_patch_get_delta": { + "return": { + "ownedByThis": true + } }, "git_patch_get_hunk": { "args": { "out": { - "returnName": "hunk" + "returnName": "hunk", + "ownedByThis": true }, "lines_in_hunk": { + "shouldAlloc": true, + "returnName": "linesInHunk", "isReturn": true } }, - "isAsync": false + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_patch_get_line_in_hunk": { - "isAsync": false + "isAsync": true, + "args": { + "out": { + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } }, "git_patch_line_stats": { - "ignore": true + "args": { + "total_context": { + "isReturn": true + }, + "total_additions": { + "isReturn": true + }, + "total_deletions": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } }, "git_patch_print": { "ignore": true @@ -1251,38 +2940,276 @@ } } }, + "path": { + "cDependencies": [ + "git2/sys/path.h" + ] + }, "pathspec": { + "selfFreeing": true, + "dependencies": [ + "../include/str_array_converter.h" + ], "functions": { - "git_pathspec_match_list_free": { + "git_pathspec_free": { "ignore": true }, + "git_pathspec_match_diff": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["diff"], + "ownedByThis": true + } + } + }, + "git_pathspec_match_index": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["index"], + "ownedByThis": true + } + } + }, "git_pathspec_new": { "isAsync": false + }, + "git_pathspec_match_tree": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["tree"], + "ownedByThis": true + } + } + }, + "git_pathspec_match_workdir": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["repo"], + "ownedByThis": true + } + } + } + } + }, + "pathspec_match_list": { + "selfFreeing": true, + "functions": { + "git_pathspec_match_list_diff_entry": { + "return": { + "ownedByThis": true + } + }, + "git_pathspec_match_list_free": { + "ignore": true + } + } + }, + "proxy": { + "functions": { + "git_proxy_init_options": { + "ignore": true + }, + "git_proxy_options_init": { + "ignore": true } } }, "push": { - "cType": "git_push", + "ignore": true + }, + "push_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, + "rebase": { + "hasConstructor": false, + "selfFreeing": true, "functions": { - "git_push_finish": { + "git_rebase_abort": { + "isAsync": true, + "args": { + "rebase": { + "cType": "git_rebase *", + "cppClassName": "GitRebase", + "jsClassName": "Rebase", + "isOptional": false, + "isSelf": true, + "isReturn": false + } + }, + "return": { + "isErrorCode": true + } + }, + "git_rebase_commit": { "isAsync": true, + "args": { + "id": { + "cType": "git_oid *", + "cppClassName": "GitOid", + "jsClassName": "Oid", + "isReturn": true, + "shouldAlloc": true + }, + "author": { + "isOptional": true + }, + "message_encoding": { + "isOptional": true + }, + "message": { + "isOptional": true + } + }, "return": { "isErrorCode": true } }, - "git_push_set_callbacks": { + "git_rebase_finish": { + "args": { + "signature": { + "isOptional": true + } + } + }, + "git_rebase_free": { + "ignore": true + }, + "git_rebase_init": { + "args": { + "out": { + "isSelf": true, + "ownedBy": ["repo"] + }, + "upstream": { + "isOptional": true + }, + "onto": { + "isOptional": true + }, + "signature": { + "isOptional": true + }, + "opts": { + "preserveOnThis": true, + "isOptional": true + } + } + }, + "git_rebase_init_options": { "ignore": true }, - "git_push_status_foreach": { + "git_rebase_inmemory_index": { + "args": { + "out": { + "ownedByThis": true + } + } + }, + "git_rebase_next": { + "isAsync": true, + "args": { + "operation": { + "isReturn": true, + "ownedByThis": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_rebase_open": { + "args": { + "out": { + "isSelf": true, + "ownedBy": ["repo"] + }, + "opts": { + "isOptional": true, + "preserveOnThis": true + } + } + }, + "git_rebase_operation_byindex": { + "return": { + "ownedByThis": true + } + }, + "git_rebase_operation_current": { + "return": { + "ownedByThis": true + } + }, + "git_rebase_options_init": { + "ignore": true + } + } + }, + "rebase_options": { + "fields": { + "signing_cb": { "ignore": true + }, + "commit_create_cb": { + "args": [ + { + "name": "out", + "cType": "git_oid *" + }, + { + "name": "author", + "cType": "const git_signature *" + }, + { + "name": "committer", + "cType": "const git_signature *" + }, + { + "name": "message_encoding", + "cType": "const char *" + }, + { + "name": "message", + "cType": "const char *" + }, + { + "name": "tree", + "cType": "const git_tree *" + }, + { + "name": "parent_count", + "cType": "size_t" + }, + { + "name": "parents", + "cType": "const git_oid **", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitOid", + "arrayLengthArgumentName": "parent_count" + }, + { + "name": "payload", + "cType": "void *" + } + ] } } }, "refdb": { + "selfFreeing": true, "functions": { "git_refdb_backend_fs": { "ignore": true }, + "git_refdb_free": { + "ignore": true + }, "git_refdb_init_backend": { "ignore": true }, @@ -1291,6 +3218,13 @@ }, "git_refdb_new": { "ignore": true + }, + "git_refdb_open": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } } } }, @@ -1299,6 +3233,11 @@ }, "reference": { "cppClassName": "GitRefs", + "selfFreeing": true, + "ownerFn": { + "name": "git_reference_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_reference__alloc": { "ignore": true @@ -1338,7 +3277,10 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_reference_next": { "ignore": true @@ -1348,13 +3290,20 @@ }, "git_reference_symbolic_set_target": { "args": { - "signature": { - "isOptional": true - }, "log_message": { "isOptional": true } } + }, + "git_reference_target": { + "return": { + "ownedByThis": true + } + }, + "git_reference_target_peel": { + "return": { + "ownedByThis": true + } } } }, @@ -1365,13 +3314,71 @@ "needsForwardDeclaration": false, "ignore": true }, + "reflog": { + "selfFreeing": true, + "functions": { + "git_reflog_entry_byindex": { + "return": { + "ownedByThis": true + } + }, + "git_reflog_free": { + "ignore": true + }, + "git_reflog_read": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_reflog_write": { + "isAsync": true, + "isSelf": true, + "return": { + "isErrorCode": true + } + } + } + }, + "reflog_entry": { + "functions": { + "git_reflog_entry_committer": { + "return": { + "ownedByThis": true + } + }, + "git_reflog_entry_id_new": { + "return": { + "ownedByThis": true + } + }, + "git_reflog_entry_id_old": { + "return": { + "ownedByThis": true + } + } + } + }, "refspec": { + "selfFreeing": true, "cType": "git_refspec", "functions": { - "git_refspec_rtransform": { + "git_refspec_free": { "ignore": true }, - "git_refspec_string": { + "git_refspec_parse": { + "isAsync": true, + "args": { + "refspec": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_refspec_rtransform": { "ignore": true }, "git_refspec_transform": { @@ -1380,24 +3387,82 @@ } }, "remote": { + "dependencies": [ + "../include/str_array_converter.h", + "../include/remote_head.h" + ], "cType": "git_remote", + "selfFreeing": true, + "ownerFn": { + "name": "git_remote_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { "git_remote_create": { - "isAsync": false + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_remote_create_detached": { + "isAsync": true, + "args": { + "out": { + "selfOwned": true + } + } + }, + "git_remote_create_init_options": { + "ignore": true + }, + "git_remote_create_options_init": { + "ignore": true + }, + "git_remote_create_with_opts": { + "args": { + "opts": { + "isOptional": true + } + } }, "git_remote_connect": { "isAsync": true, + "args": { + "callbacks": { + "isOptional": true, + "preserveOnThis": true + }, + "proxy_opts": { + "isOptional": true, + "preserveOnThis": true + }, + "custom_headers": { + "isOptional": true + } + }, "return": { "isErrorCode": true } }, - "git_remote_disconnect": { + "git_remote_connect_ext": { "isAsync": true }, + "git_remote_connect_options_init": { + "ignore": true + }, + "git_remote_disconnect": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_remote_download": { "args": { "refspecs": { "isOptional": true + }, + "opts": { + "isOptional": true } }, "isAsync": true, @@ -1406,7 +3471,20 @@ } }, "git_remote_default_branch": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true, + "isSelf": false + }, + "remote": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } }, "git_remote_delete": { "isAsync": true, @@ -1416,6 +3494,9 @@ }, "git_remote_fetch": { "args": { + "opts": { + "isOptional": true + }, "reflog_message": { "isOptional": true }, @@ -1428,6 +3509,9 @@ "isErrorCode": true } }, + "git_remote_free": { + "ignore": true + }, "git_remote_get_fetch_refspecs": { "args": { "array": { @@ -1439,7 +3523,10 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_remote_get_push_refspecs": { "args": { @@ -1452,7 +3539,19 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_remote_get_refspec": { + "return": { + "selfFreeing": false, + "ownedByThis": true + } + }, + "git_remote_init_callbacks": { + "ignore": true }, "git_remote_list": { "args": { @@ -1470,23 +3569,43 @@ "ignore": true }, "git_remote_rename": { - "ignore": true - }, - "git_remote_push": { "isAsync": true, + "args": { + "problems": { + "isReturn": true, + "shouldAlloc": true, + "cppClassName": "Array", + "jsClassName": "Array", + "size": "count", + "key": "strings" + } + }, "return": { "isErrorCode": true - }, + } + }, + "git_remote_prune": { "args": { - "opts": { + "callbacks": { "isOptional": true } + }, + "isAsync": true, + "return": { + "isErrorCode": true } }, - "git_remote_set_callbacks": { + "git_remote_push": { + "isAsync": true, + "return": { + "isErrorCode": true + }, "args": { - "callbacks": { - "saveArg": true + "refspecs": { + "isOptional": true + }, + "opts": { + "isOptional": true } } }, @@ -1498,9 +3617,41 @@ }, "git_remote_set_push_refspecs": { "ignore": true + }, + "git_remote_stats": { + "return": { + "ownedByThis": true + } + }, + "git_remote_update_tips": { + "isAsync": true, + "args": { + "reflog_message": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_remote_upload": { + "args": { + "refspecs": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } } } }, + "remote_connect_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, "remote_callbacks": { "fields": { "completion": { @@ -1509,14 +3660,11 @@ "pack_progress": { "ignore": true }, - "push_transfer_progress": { - "ignore": true - }, - "push_update_reference": { + "push_negotiation": { "ignore": true }, "sideband_progress": { - "ignore": true + "ignore": false }, "update_tips": { "ignore": true @@ -1524,15 +3672,72 @@ } }, "remote_head": { - "ignore": true + "dependencies": [ + "../include/functions/free.h" + ], + "freeFunctionName": "git_remote_head_free", + "selfFreeing": true }, "repository": { + "hasConstructor": false, + "selfFreeing": true, + "isSingleton": true, + "dependencies": [ + "git2/sys/repository.h", + "../include/commit.h", + "../include/submodule.h", + "../include/remote.h" + ], "functions": { - "git_repository_init_init_options": { + "git_repository__cleanup": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_repository_commit_parents": { + "isAsync": true, + "args": { + "commits": { + "shouldAlloc": true, + "selfFreeing": true, + "isReturn": true, + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitCommit", + "size": "count", + "key": "commits" + } + }, + "return": { + "isErrorCode": true + } + }, + "git_repository_config": { + "args": { + "out": { + "ownedByThis": true + } + } + }, + "git_repository_config_snapshot": { "ignore": true }, "git_repository_discover": { - "ignore": true + "isAsync": true, + "return": { + "isErrorCode": true + }, + "args": { + "ceiling_dirs": { + "isOptional": true + }, + "out": { + "isReturn": true, + "isSelf": false, + "shouldAlloc": true + } + } }, "git_repository_fetchhead_foreach": { "isAsync": true, @@ -1540,27 +3745,138 @@ "isErrorCode": true } }, + "git_repository_free": { + "ignore": true + }, "git_repository_hashfile": { "ignore": true }, - "git_repository_mergehead_foreach": { + "git_repository_ident": { + "args": { + "name": { + "isReturn": true + }, + "email": { + "isReturn": true + } + }, + "isAsync": false + }, + "git_repository_init_options_init": { "ignore": true }, + "git_repository_mergehead_foreach": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_repository_message": { "ignore": true }, + "git_repository_new": { + "ignore": true + }, + "git_repository_odb": { + "isAsync": true, + "args": { + "odb": { + "ownedByThis": true + }, + "repo": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_repository_refdb": { + "isAsync": true, + "args": { + "out": { + "ownedByThis": true + }, + "repo": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_repository_reinit_filesystem": { + "ignore": true + }, + "git_repository_set_bare": { + "ignore": true + }, + "git_repository_set_config": { + "ignore": true + }, "git_repository_set_head": { "isAsync": true, "return": { "isErrorCode": true } - } - } - }, - "revert": { - "functions": { + }, + "git_repository_set_index": { + "args": { + "index": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_repository_set_odb": { + "ignore": true + }, + "git_repository_set_refdb": { + "ignore": true + }, + "git_repository_statistics": { + "isAsync": true + }, + "git_repository_submodule_cache_all": { + "return": { + "isErrorCode": true + } + }, + "git_repository_submodule_cache_clear": { + "return": { + "isErrorCode": true + } + } + } + }, + "revert": { + "functions": { + "git_revert": { + "isAsync": true, + "args": { + "given_opts": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_revert_commit": { + "isAsync": true, + "args": { + "merge_options": { + "isOptional": true + } + } + }, "git_revert_init_options": { "ignore": true + }, + "git_revert_options_init": { + "ignore": true } } }, @@ -1572,8 +3888,12 @@ } }, "reset": { + "dependencies": [ + "../include/str_array_converter.h" + ], "functions": { "git_reset": { + "isCollectionRoot": true, "args": { "checkout_opts": { "isOptional": true @@ -1600,13 +3920,30 @@ "return": { "isErrorCode": true } + }, + "git_reset_from_annotated": { + "args": { + "checkout_opts": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } } } }, - "revspec": { - "ignore": true - }, "revwalk": { + "selfFreeing": true, + "ownerFn": { + "name": "git_revwalk_repository", + "singletonCppClassName": "GitRepository" + }, + "dependencies": [ + "../include/commit.h", + "../include/functions/copy.h" + ], "functions": { "git_revwalk_add_hide_cb": { "ignore": true @@ -1618,18 +3955,36 @@ "isAsync": false } } - }, "signature": { + "selfFreeing": true, + "dupFunction": "git_signature_dup", "functions": { "git_signature_default": { - "isAsync": false + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_signature_dup": { + "ignore": true + }, + "git_signature_free": { + "ignore": true }, "git_signature_new": { "isAsync": false }, "git_signature_now": { - "isAsync": false + "isAsync": false, + "args": { + "sig_out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } } } }, @@ -1646,35 +4001,102 @@ } } }, + "smart_subtransport": { + "ignore": true + }, "smart_subtransport_definition": { "ignore": true }, + "smart_subtransport_stream": { + "ignore": true + }, "stash": { "functions": { + "git_stash_apply": { + "args": { + "options": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_stash_apply_init_options": { + "ignore": true + }, + "git_stash_apply_options_init": { + "ignore": true + }, + "git_stash_save_options_init": { + "ignore": true + }, + "git_stash_drop": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_stash_foreach": { "isAsync": true, "return": { "isErrorCode": true } + }, + "git_stash_pop": { + "args": { + "options": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_stash_save": { + "args": { + "message": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } } } }, + "stash_save_options": { + "dependencies": [ + "../include/str_array_converter.h" + ] + }, + "stdalloc": { + "ignore": true + }, "status": { "cDependencies": [ "git2/sys/diff.h" ], "functions": { "git_status_byindex": { - "isAsync": false + "isAsync": false, + "return": { + "ownedBy": ["statuslist"] + } }, "git_status_file": { + "isAsync": true, "args": { "status_flags": { - "isReturn": true - }, - "return": { - "isErrorCode": true + "isReturn": true, + "shouldAlloc": true } + }, + "return": { + "isErrorCode": true } }, "git_status_foreach": { @@ -1691,14 +4113,39 @@ }, "git_status_init_options": { "ignore": true + }, + "git_status_options_init": { + "ignore": true } } }, "status_list": { + "selfFreeing": true, "functions": { - "git_status_list_new": { + "git_status_list_free": { + "ignore": true + }, + "git_status_list_get_perfdata": { "isAsync": false, "args": { + "out": { + "isReturn": true, + "shouldAlloc": true + }, + "status": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_status_list_new": { + "isAsync": true, + "args": { + "out": { + "ownedBy": ["repo"] + }, "opts": { "isOptional": true } @@ -1710,6 +4157,16 @@ } }, "strarray": { + "selfFreeing": true, + "freeFunctionName": "git_strarray_dispose", + "functions": { + "git_strarray_dispose": { + "ignore": true + }, + "git_strarray_free": { + "ignore": true + } + }, "dependencies": [ "../include/str_array_converter.h" ] @@ -1720,23 +4177,184 @@ "git2/sys/stream.h" ] }, + "stream_registration": { + "ignore": true + }, "submodule": { + "hasConstructor": false, + "selfFreeing": true, + "ownerFn": { + "name": "git_submodule_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { + "git_submodule_add_to_index": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_submodule_add_finalize": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_submodule_head_id": { + "return": { + "ownedByThis": true + } + }, + "git_submodule_init": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, "git_submodule_foreach": { + "isAsync": true, + "args": { + "callback": { + "type": "git_submodule_cb", + "cType": "git_submodule_cb", + "cppClassName": "git_submodule_cb" + } + }, + "return": { + "isErrorCode": true, + "type": "int" + } + }, + "git_submodule_free": { "ignore": true }, + "git_submodule_index_id": { + "return": { + "ownedByThis": true + } + }, + "git_submodule_wd_id": { + "return": { + "ownedByThis": true + } + }, "git_submodule_location": { - "ignore": true + "isAsync": true, + "args": { + "location_status": { + "shouldAlloc": true, + "isReturn": true + }, + "submodule": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_submodule_open": { + "isAsync": true, + "args": { + "repo": { + "isReturn": true + }, + "submodule": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_submodule_resolve_url": { + "isAsync": true, + "args": { + "out": { + "isReturn": true, + "shouldAlloc": true, + "isSelf": false + } + }, + "return": { + "isErrorCode": true + } + }, + "git_submodule_update": { + "isAsync": true, + "args": { + "options": { + "isOptional": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_submodule_set_ignore": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_submodule_set_update": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_submodule_set_url": { + "isAsync": true, + "return": { + "isErrorCode": true + } }, "git_submodule_status": { + "isAsync": true, + "args": { + "status": { + "isReturn": true, + "shouldAlloc": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_submodule_sync": { + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_submodule_update_init_options": { + "ignore": true + }, + "git_submodule_update_options_init": { "ignore": true } } }, "tag": { + "dependencies": [ + "../include/str_array_converter.h" + ], + "selfFreeing": true, + "ownerFn": { + "name": "git_tag_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { - "git_tag_foreach": { - "ignore": true + "git_tag_annotation_create": { + "args": { + "oid": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + }, + "isAsync": true }, "git_tag_create": { "args": { @@ -1749,10 +4367,7 @@ }, "isAsync": true }, - "git_tag_create_frombuffer": { - "ignore": true - }, - "git_tag_create_lightweight": { + "git_tag_create_from_buffer": { "args": { "oid": { "isReturn": true @@ -1763,7 +4378,7 @@ }, "isAsync": true }, - "git_tag_annotation_create": { + "git_tag_create_lightweight": { "args": { "oid": { "isReturn": true @@ -1774,6 +4389,17 @@ }, "isAsync": true }, + "git_tag_foreach": { + "ignore": true + }, + "git_tag_free": { + "ignore": true + }, + "git_tag_id": { + "return": { + "ownedByThis": true + } + }, "git_tag_list": { "args": { "tag_names": { @@ -1785,13 +4411,46 @@ "key": "strings" } }, - "isAsync": true + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_tag_list_match": { + "args": { + "tag_names": { + "isReturn": true, + "shouldAlloc": true, + "cppClassName": "Array", + "jsClassName": "Array", + "size": "count", + "key": "strings" + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + }, + "git_tag_tagger": { + "return": { + "ownedByThis": true + } }, "git_tag_target": { + "isAsync": true, "args": { "target_out": { "isReturn": true } + }, + "return": { + "isErrorCode": true + } + }, + "git_tag_target_id": { + "return": { + "ownedByThis": true } }, "git_tag_delete": { @@ -1799,6 +4458,25 @@ "isErrorCode": true }, "isAsync": true + }, + "git_tag_peel": { + "args": { + "tag_target_out": { + "isReturn": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + } + } + }, + "time": { + "dupFunction": "git_time_dup", + "functions": { + "git_time_sign": { + "ignore": true } } }, @@ -1809,12 +4487,75 @@ } } }, + "transaction": { + "selfFreeing": true, + "functions": { + "git_transaction_free": { + "ignore": true + }, + "git_transaction_new": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + } + } + }, + "transfer_progress": { + "dupFunction": "git_transfer_progress_dup" + }, "transport": { "cType": "git_transport", + "needsForwardDeclaration": false, + "fields": { + "cancel": { + "ignore": true + }, + "close": { + "ignore": true + }, + "connect": { + "ignore": true + }, + "download_pack": { + "ignore": true + }, + "free": { + "ignore": true + }, + "is_connected": { + "ignore": true + }, + "ls": { + "ignore": true + }, + "negotiate_fetch": { + "ignore": true + }, + "push": { + "ignore": true + }, + "read_flags": { + "ignore": true + }, + "set_callbacks": { + "ignore": true + }, + "set_custom_headers": { + "ignore": true + }, + "version": { + "ignore": true + } + }, "functions": { "git_transport_dummy": { "ignore": true }, + "git_transport_init": { + "ignore": true + }, "git_transport_local": { "ignore": true }, @@ -1826,6 +4567,12 @@ }, "git_transport_smart": { "ignore": true + }, + "git_transport_ssh_with_paths": { + "ignore": true + }, + "git_transport_unregister": { + "ignore": true } }, "cDependencies": [ @@ -1833,25 +4580,236 @@ ] }, "tree": { + "selfFreeing": true, + "ownerFn": { + "name": "git_tree_owner", + "singletonCppClassName": "GitRepository" + }, "functions": { - "git_tree_entry_free": { - "ignore": true + "git_tree_create_updated": { + "args": { + "updates": { + "cType": "git_tree_update *", + "cppClassName": "Array", + "jsClassName": "Array", + "arrayElementCppClassName": "GitTreeUpdate" + } + } + }, + "git_tree_entry_byid": { + "return": { + "ownedByThis": true + } }, "git_tree_entry_byindex": { - "jsFunctionName": "_entryByIndex" + "jsFunctionName": "_entryByIndex", + "return": { + "ownedByThis": true + } + }, + "git_tree_entry_byname": { + "jsFunctionName": "_entryByName", + "return": { + "ownedByThis": true + } + }, + "git_tree_entry_bypath": { + "isAsync": true, + "args": { + "out": { + "ownedByThis": true + }, + "root": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } }, "git_tree_entrycount": { "jsFunctionName": "entryCount" }, + "git_tree_free": { + "ignore": true + }, + "git_tree_id": { + "return": { + "ownedByThis": true + } + }, "git_tree_walk": { "ignore": true } } }, "treebuilder": { + "selfFreeing": true, "functions": { + "git_treebuilder_clear": { + "return": { + "isErrorCode": true + } + }, "git_treebuilder_filter": { "ignore": true + }, + "git_treebuilder_free": { + "ignore": true + }, + "git_treebuilder_get": { + "return": { + "ownedByThis": true + } + }, + "git_treebuilder_insert": { + "isAsync": false, + "args": { + "out": { + "selfFreeing": false, + "ownedByThis": true + } + } + }, + "git_treebuilder_write": { + "isAsync": true, + "args": { + "id": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + } + }, + "git_treebuilder_write_with_buffer": { + "ignore": true + }, + "git_treebuilder_new": { + "args": { + "out": { + "ownedBy": ["repo"] + }, + "source": { + "isOptional": true + } + } + } + } + }, + "tree_entry": { + "selfFreeing": true, + "dupFunction": "git_tree_entry_dup", + "freeFunctionName": "git_tree_entry_free", + "functions": { + "git_tree_entry_dup": { + "ignore": true + }, + "git_tree_entry_free": { + "ignore": true + }, + "git_tree_entry_id": { + "return": { + "ownedByThis": true + } + }, + "git_tree_entry_to_object": { + "args": { + "object_out": { + "isReturn": true + } + }, + "return": { + "isErrorCode": true + }, + "isAsync": true + } + } + }, + "win32": { + "ignore": true + }, + "worktree": { + "selfFreeing": true, + "cType": "git_worktree", + "freeFunctionName": "git_worktree_free", + "functions": { + "git_worktree_add": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_worktree_add_init_options": { + "ignore": true + }, + "git_worktree_add_options_init": { + "ignore": true + }, + "git_worktree_free": { + "ignore": true + }, + "git_worktree_is_prunable": { + "args": { + "opts": { + "isOptional": true + } + }, + "isAsync": true + }, + "git_worktree_lookup": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_worktree_open_from_repository": { + "args": { + "out": { + "ownedBy": ["repo"] + } + } + }, + "git_worktree_prune_init_options": { + "ignore": true + }, + "git_worktree_prune_options_init": { + "ignore": true + }, + "git_worktree_prune": { + "args": { + "opts": { + "isOptional": true + } + }, + "isAsync": true, + "return": { + "isErrorCode": true + } + } + }, + "dependencies": [ + "../include/git_buf_converter.h" + ] + }, + "tree_update": { + "hasConstructor": true, + "ignoreInit": true + }, + "writestream": { + "cType": "git_writestream", + "needsForwardDeclaration": false, + "fields": { + "close": { + "ignore": true + }, + "free": { + "ignore": true + }, + "write": { + "ignore": true } } } diff --git a/generate/input/libgit2-docs.json b/generate/input/libgit2-docs.json new file mode 100644 index 0000000000..e1969402e7 --- /dev/null +++ b/generate/input/libgit2-docs.json @@ -0,0 +1,37933 @@ +{ + "files": [ + { + "file": "git2/annotated_commit.h", + "functions": [ + "git_annotated_commit_from_ref", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_lookup", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_ref", + "git_annotated_commit_free" + ], + "meta": {}, + "lines": 128 + }, + { + "file": "git2/apply.h", + "functions": [ + "git_apply_delta_cb", + "git_apply_hunk_cb", + "git_apply_options_init", + "git_apply_to_tree", + "git_apply" + ], + "meta": {}, + "lines": 182 + }, + { + "file": "git2/attr.h", + "functions": [ + "git_attr_value", + "git_attr_get", + "git_attr_get_ext", + "git_attr_get_many", + "git_attr_get_many_ext", + "git_attr_foreach_cb", + "git_attr_foreach", + "git_attr_foreach_ext", + "git_attr_cache_flush", + "git_attr_add_macro" + ], + "meta": {}, + "lines": 378 + }, + { + "file": "git2/blame.h", + "functions": [ + "git_blame_options_init", + "git_blame_linecount", + "git_blame_hunkcount", + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_line_byindex", + "git_blame_get_hunk_count", + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_buffer", + "git_blame_free" + ], + "meta": {}, + "lines": 385 + }, + { + "file": "git2/blob.h", + "functions": [ + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_blob_free", + "git_blob_id", + "git_blob_owner", + "git_blob_rawcontent", + "git_blob_rawsize", + "git_blob_filter_options_init", + "git_blob_filter", + "git_blob_create_from_workdir", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", + "git_blob_create_from_buffer", + "git_blob_is_binary", + "git_blob_data_is_binary", + "git_blob_dup" + ], + "meta": {}, + "lines": 350 + }, + { + "file": "git2/branch.h", + "functions": [ + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_delete", + "git_branch_iterator_new", + "git_branch_next", + "git_branch_iterator_free", + "git_branch_move", + "git_branch_lookup", + "git_branch_name", + "git_branch_upstream", + "git_branch_set_upstream", + "git_branch_upstream_name", + "git_branch_is_head", + "git_branch_is_checked_out", + "git_branch_remote_name", + "git_branch_upstream_remote", + "git_branch_upstream_merge", + "git_branch_name_is_valid" + ], + "meta": {}, + "lines": 339 + }, + { + "file": "git2/buffer.h", + "functions": ["git_buf_dispose"], + "meta": {}, + "lines": 71 + }, + { + "file": "git2/cert.h", + "functions": ["git_transport_certificate_check_cb"], + "meta": {}, + "lines": 168 + }, + { + "file": "git2/checkout.h", + "functions": [ + "git_checkout_notify_cb", + "git_checkout_progress_cb", + "git_checkout_perfdata_cb", + "git_checkout_options_init", + "git_checkout_head", + "git_checkout_index", + "git_checkout_tree" + ], + "meta": {}, + "lines": 463 + }, + { + "file": "git2/cherrypick.h", + "functions": [ + "git_cherrypick_options_init", + "git_cherrypick_commit", + "git_cherrypick" + ], + "meta": {}, + "lines": 94 + }, + { + "file": "git2/clone.h", + "functions": [ + "git_remote_create_cb", + "git_repository_create_cb", + "git_clone_options_init", + "git_clone" + ], + "meta": {}, + "lines": 220 + }, + { + "file": "git2/commit.h", + "functions": [ + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_commit_free", + "git_commit_id", + "git_commit_owner", + "git_commit_message_encoding", + "git_commit_message", + "git_commit_message_raw", + "git_commit_summary", + "git_commit_body", + "git_commit_time", + "git_commit_time_offset", + "git_commit_committer", + "git_commit_author", + "git_commit_committer_with_mailmap", + "git_commit_author_with_mailmap", + "git_commit_raw_header", + "git_commit_tree", + "git_commit_tree_id", + "git_commit_parentcount", + "git_commit_parent", + "git_commit_parent_id", + "git_commit_nth_gen_ancestor", + "git_commit_header_field", + "git_commit_extract_signature", + "git_commit_create", + "git_commit_create_v", + "git_commit_create_from_stage", + "git_commit_amend", + "git_commit_create_buffer", + "git_commit_create_with_signature", + "git_commit_dup", + "git_commit_create_cb", + "git_commitarray_dispose" + ], + "meta": {}, + "lines": 670 + }, + { + "file": "git2/common.h", + "functions": [ + "git_libgit2_version", + "git_libgit2_prerelease", + "git_libgit2_features", + "git_libgit2_feature_backend", + "git_libgit2_opts" + ], + "meta": {}, + "lines": 569 + }, + { + "file": "git2/config.h", + "functions": [ + "git_config_entry_free", + "git_config_foreach_cb", + "git_config_find_global", + "git_config_find_xdg", + "git_config_find_system", + "git_config_find_programdata", + "git_config_open_default", + "git_config_new", + "git_config_add_file_ondisk", + "git_config_open_ondisk", + "git_config_open_level", + "git_config_open_global", + "git_config_set_writeorder", + "git_config_snapshot", + "git_config_free", + "git_config_get_entry", + "git_config_get_int32", + "git_config_get_int64", + "git_config_get_bool", + "git_config_get_path", + "git_config_get_string", + "git_config_get_string_buf", + "git_config_get_multivar_foreach", + "git_config_multivar_iterator_new", + "git_config_next", + "git_config_iterator_free", + "git_config_set_int32", + "git_config_set_int64", + "git_config_set_bool", + "git_config_set_string", + "git_config_set_multivar", + "git_config_delete_entry", + "git_config_delete_multivar", + "git_config_foreach", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_foreach_match", + "git_config_get_mapped", + "git_config_lookup_map_value", + "git_config_parse_bool", + "git_config_parse_int32", + "git_config_parse_int64", + "git_config_parse_path", + "git_config_backend_foreach_match", + "git_config_lock" + ], + "meta": {}, + "lines": 847 + }, + { + "file": "git2/credential.h", + "functions": [ + "git_credential_acquire_cb", + "git_credential_free", + "git_credential_has_username", + "git_credential_get_username", + "git_credential_userpass_plaintext_new", + "git_credential_default_new", + "git_credential_username_new", + "git_credential_ssh_key_new", + "git_credential_ssh_key_memory_new", + "git_credential_ssh_interactive_cb", + "git_credential_ssh_interactive_new", + "git_credential_ssh_key_from_agent", + "git_credential_sign_cb", + "git_credential_ssh_custom_new" + ], + "meta": {}, + "lines": 338 + }, + { + "file": "git2/credential_helpers.h", + "functions": ["git_credential_userpass"], + "meta": {}, + "lines": 49 + }, + { + "file": "git2/deprecated.h", + "functions": [ + "git_blob_filtered_content", + "git_filter_list_stream_data", + "git_filter_list_apply_to_data", + "git_treebuilder_write_with_buffer", + "git_buf_grow", + "git_buf_set", + "git_buf_is_binary", + "git_buf_contains_nul", + "git_buf_free", + "git_commit_signing_cb", + "git_diff_format_email", + "git_diff_commit_as_email", + "git_diff_format_email_options_init", + "giterr_last", + "giterr_clear", + "giterr_set_str", + "giterr_set_oom", + "git_object__size", + "git_remote_is_valid_name", + "git_reference_is_valid_name", + "git_oidarray_free", + "git_headlist_cb", + "git_strarray_copy", + "git_strarray_free", + "git_blame_init_options" + ], + "meta": {}, + "lines": 1035 + }, + { + "file": "git2/describe.h", + "functions": [ + "git_describe_options_init", + "git_describe_format_options_init", + "git_describe_commit", + "git_describe_workdir", + "git_describe_format", + "git_describe_result_free" + ], + "meta": {}, + "lines": 201 + }, + { + "file": "git2/diff.h", + "functions": [ + "git_diff_notify_cb", + "git_diff_progress_cb", + "git_diff_options_init", + "git_diff_file_cb", + "git_diff_binary_cb", + "git_diff_hunk_cb", + "git_diff_line_cb", + "git_diff_find_options_init", + "git_diff_free", + "git_diff_tree_to_tree", + "git_diff_tree_to_index", + "git_diff_index_to_workdir", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_diff_index_to_index", + "git_diff_merge", + "git_diff_find_similar", + "git_diff_num_deltas", + "git_diff_num_deltas_of_type", + "git_diff_get_delta", + "git_diff_is_sorted_icase", + "git_diff_foreach", + "git_diff_status_char", + "git_diff_print", + "git_diff_to_buf", + "git_diff_blobs", + "git_diff_blob_to_buffer", + "git_diff_buffers", + "git_diff_from_buffer", + "git_diff_get_stats", + "git_diff_stats_files_changed", + "git_diff_stats_insertions", + "git_diff_stats_deletions", + "git_diff_stats_to_buf", + "git_diff_stats_free", + "git_diff_patchid_options_init", + "git_diff_patchid" + ], + "meta": {}, + "lines": 1502 + }, + { + "file": "git2/email.h", + "functions": ["git_email_create_from_commit"], + "meta": {}, + "lines": 102 + }, + { + "file": "git2/errors.h", + "functions": ["git_error_last"], + "meta": {}, + "lines": 149 + }, + { + "file": "git2/filter.h", + "functions": [ + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_contains", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_file", + "git_filter_list_apply_to_blob", + "git_filter_list_stream_buffer", + "git_filter_list_stream_file", + "git_filter_list_stream_blob", + "git_filter_list_free" + ], + "meta": {}, + "lines": 278 + }, + { + "file": "git2/global.h", + "functions": ["git_libgit2_init", "git_libgit2_shutdown"], + "meta": {}, + "lines": 45 + }, + { + "file": "git2/graph.h", + "functions": [ + "git_graph_ahead_behind", + "git_graph_descendant_of", + "git_graph_reachable_from_any" + ], + "meta": {}, + "lines": 73 + }, + { + "file": "git2/ignore.h", + "functions": [ + "git_ignore_add_rule", + "git_ignore_clear_internal_rules", + "git_ignore_path_is_ignored" + ], + "meta": {}, + "lines": 83 + }, + { + "file": "git2/index.h", + "functions": [ + "git_index_matched_path_cb", + "git_index_open", + "git_index_new", + "git_index_free", + "git_index_owner", + "git_index_caps", + "git_index_set_caps", + "git_index_version", + "git_index_set_version", + "git_index_read", + "git_index_write", + "git_index_path", + "git_index_checksum", + "git_index_read_tree", + "git_index_write_tree", + "git_index_write_tree_to", + "git_index_entrycount", + "git_index_clear", + "git_index_get_byindex", + "git_index_get_bypath", + "git_index_remove", + "git_index_remove_directory", + "git_index_add", + "git_index_entry_stage", + "git_index_entry_is_conflict", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_iterator_free", + "git_index_add_bypath", + "git_index_add_from_buffer", + "git_index_remove_bypath", + "git_index_add_all", + "git_index_remove_all", + "git_index_update_all", + "git_index_find", + "git_index_find_prefix", + "git_index_conflict_add", + "git_index_conflict_get", + "git_index_conflict_remove", + "git_index_conflict_cleanup", + "git_index_has_conflicts", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_conflict_iterator_free" + ], + "meta": {}, + "lines": 928 + }, + { + "file": "git2/indexer.h", + "functions": [ + "git_indexer_progress_cb", + "git_indexer_options_init", + "git_indexer_new", + "git_indexer_append", + "git_indexer_commit", + "git_indexer_hash", + "git_indexer_name", + "git_indexer_free" + ], + "meta": {}, + "lines": 207 + }, + { + "file": "git2/mailmap.h", + "functions": [ + "git_mailmap_new", + "git_mailmap_free", + "git_mailmap_add_entry", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" + ], + "meta": {}, + "lines": 116 + }, + { + "file": "git2/merge.h", + "functions": [ + "git_merge_file_input_init", + "git_merge_file_options_init", + "git_merge_options_init", + "git_merge_analysis", + "git_merge_analysis_for_ref", + "git_merge_base", + "git_merge_bases", + "git_merge_base_many", + "git_merge_bases_many", + "git_merge_base_octopus", + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_result_free", + "git_merge_trees", + "git_merge_commits", + "git_merge" + ], + "meta": {}, + "lines": 666 + }, + { + "file": "git2/message.h", + "functions": [ + "git_message_prettify", + "git_message_trailers", + "git_message_trailer_array_free" + ], + "meta": {}, + "lines": 81 + }, + { "file": "git2/net.h", "functions": [], "meta": {}, "lines": 51 }, + { + "file": "git2/notes.h", + "functions": [ + "git_note_foreach_cb", + "git_note_iterator_free", + "git_note_next" + ], + "meta": {}, + "lines": 91 + }, + { + "file": "git2/object.h", + "functions": [ + "git_object_lookup", + "git_object_lookup_prefix", + "git_object_lookup_bypath", + "git_object_id", + "git_object_short_id", + "git_object_type", + "git_object_owner", + "git_object_free", + "git_object_type2string", + "git_object_string2type", + "git_object_typeisloose", + "git_object_peel", + "git_object_dup", + "git_object_rawcontent_is_valid" + ], + "meta": {}, + "lines": 274 + }, + { + "file": "git2/odb.h", + "functions": [ + "git_odb_foreach_cb", + "git_odb_new", + "git_odb_open", + "git_odb_add_disk_alternate", + "git_odb_free", + "git_odb_read", + "git_odb_read_prefix", + "git_odb_read_header", + "git_odb_exists", + "git_odb_exists_ext", + "git_odb_exists_prefix", + "git_odb_expand_ids", + "git_odb_refresh", + "git_odb_foreach", + "git_odb_write", + "git_odb_open_wstream", + "git_odb_stream_write", + "git_odb_stream_finalize_write", + "git_odb_stream_read", + "git_odb_stream_free", + "git_odb_open_rstream", + "git_odb_write_pack", + "git_odb_write_multi_pack_index", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_object_dup", + "git_odb_object_free", + "git_odb_object_id", + "git_odb_object_data", + "git_odb_object_size", + "git_odb_object_type", + "git_odb_add_backend", + "git_odb_add_alternate", + "git_odb_num_backends", + "git_odb_get_backend", + "git_odb_set_commit_graph" + ], + "meta": {}, + "lines": 691 + }, + { + "file": "git2/odb_backend.h", + "functions": [ + "git_odb_backend_pack", + "git_odb_backend_one_pack", + "git_odb_backend_loose" + ], + "meta": {}, + "lines": 246 + }, + { + "file": "git2/oid.h", + "functions": [ + "git_oid_fromstr", + "git_oid_fromstrp", + "git_oid_fromstrn", + "git_oid_fromraw", + "git_oid_fmt", + "git_oid_nfmt", + "git_oid_pathfmt", + "git_oid_tostr_s", + "git_oid_tostr", + "git_oid_cpy", + "git_oid_cmp", + "git_oid_equal", + "git_oid_ncmp", + "git_oid_streq", + "git_oid_strcmp", + "git_oid_is_zero", + "git_oid_shorten_new", + "git_oid_shorten_add", + "git_oid_shorten_free" + ], + "meta": {}, + "lines": 366 + }, + { + "file": "git2/oidarray.h", + "functions": ["git_oidarray_dispose"], + "meta": {}, + "lines": 38 + }, + { + "file": "git2/pack.h", + "functions": [ + "git_packbuilder_new", + "git_packbuilder_set_threads", + "git_packbuilder_insert", + "git_packbuilder_insert_tree", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_walk", + "git_packbuilder_insert_recur", + "git_packbuilder_write_buf", + "git_packbuilder_write", + "git_packbuilder_hash", + "git_packbuilder_name", + "git_packbuilder_foreach_cb", + "git_packbuilder_foreach", + "git_packbuilder_object_count", + "git_packbuilder_written", + "git_packbuilder_progress", + "git_packbuilder_set_callbacks", + "git_packbuilder_free" + ], + "meta": {}, + "lines": 274 + }, + { + "file": "git2/patch.h", + "functions": [ + "git_patch_owner", + "git_patch_from_diff", + "git_patch_from_blobs", + "git_patch_from_blob_and_buffer", + "git_patch_from_buffers", + "git_patch_free", + "git_patch_get_delta", + "git_patch_num_hunks", + "git_patch_line_stats", + "git_patch_get_hunk", + "git_patch_num_lines_in_hunk", + "git_patch_get_line_in_hunk", + "git_patch_size", + "git_patch_print", + "git_patch_to_buf" + ], + "meta": {}, + "lines": 284 + }, + { + "file": "git2/pathspec.h", + "functions": [ + "git_pathspec_new", + "git_pathspec_free", + "git_pathspec_matches_path", + "git_pathspec_match_workdir", + "git_pathspec_match_index", + "git_pathspec_match_tree", + "git_pathspec_match_diff", + "git_pathspec_match_list_free", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_failed_entry" + ], + "meta": {}, + "lines": 284 + }, + { + "file": "git2/proxy.h", + "functions": ["git_proxy_options_init"], + "meta": {}, + "lines": 103 + }, + { + "file": "git2/rebase.h", + "functions": [ + "git_rebase_options_init", + "git_rebase_init", + "git_rebase_open", + "git_rebase_orig_head_name", + "git_rebase_orig_head_id", + "git_rebase_onto_name", + "git_rebase_onto_id", + "git_rebase_operation_entrycount", + "git_rebase_operation_current", + "git_rebase_operation_byindex", + "git_rebase_next", + "git_rebase_inmemory_index", + "git_rebase_commit", + "git_rebase_abort", + "git_rebase_finish", + "git_rebase_free" + ], + "meta": {}, + "lines": 397 + }, + { + "file": "git2/refdb.h", + "functions": [ + "git_refdb_new", + "git_refdb_open", + "git_refdb_compress", + "git_refdb_free" + ], + "meta": {}, + "lines": 66 + }, + { + "file": "git2/reflog.h", + "functions": [ + "git_reflog_read", + "git_reflog_write", + "git_reflog_append", + "git_reflog_rename", + "git_reflog_delete", + "git_reflog_entrycount", + "git_reflog_entry_byindex", + "git_reflog_drop", + "git_reflog_entry_id_old", + "git_reflog_entry_id_new", + "git_reflog_entry_committer", + "git_reflog_entry_message", + "git_reflog_free" + ], + "meta": {}, + "lines": 166 + }, + { + "file": "git2/refs.h", + "functions": [ + "git_reference_lookup", + "git_reference_name_to_id", + "git_reference_dwim", + "git_reference_symbolic_create_matching", + "git_reference_symbolic_create", + "git_reference_create", + "git_reference_create_matching", + "git_reference_target", + "git_reference_target_peel", + "git_reference_symbolic_target", + "git_reference_type", + "git_reference_name", + "git_reference_resolve", + "git_reference_owner", + "git_reference_symbolic_set_target", + "git_reference_set_target", + "git_reference_rename", + "git_reference_delete", + "git_reference_remove", + "git_reference_list", + "git_reference_foreach_cb", + "git_reference_foreach_name_cb", + "git_reference_foreach", + "git_reference_foreach_name", + "git_reference_dup", + "git_reference_free", + "git_reference_cmp", + "git_reference_iterator_new", + "git_reference_iterator_glob_new", + "git_reference_next", + "git_reference_next_name", + "git_reference_iterator_free", + "git_reference_foreach_glob", + "git_reference_has_log", + "git_reference_ensure_log", + "git_reference_is_branch", + "git_reference_is_remote", + "git_reference_is_tag", + "git_reference_is_note", + "git_reference_normalize_name", + "git_reference_peel", + "git_reference_name_is_valid", + "git_reference_shorthand" + ], + "meta": {}, + "lines": 769 + }, + { + "file": "git2/refspec.h", + "functions": [ + "git_refspec_parse", + "git_refspec_free", + "git_refspec_src", + "git_refspec_dst", + "git_refspec_string", + "git_refspec_force", + "git_refspec_direction", + "git_refspec_src_matches_negative", + "git_refspec_src_matches", + "git_refspec_dst_matches", + "git_refspec_transform", + "git_refspec_rtransform" + ], + "meta": {}, + "lines": 126 + }, + { + "file": "git2/remote.h", + "functions": [ + "git_remote_create", + "git_remote_create_options_init", + "git_remote_create_with_opts", + "git_remote_create_with_fetchspec", + "git_remote_create_anonymous", + "git_remote_create_detached", + "git_remote_lookup", + "git_remote_dup", + "git_remote_owner", + "git_remote_name", + "git_remote_url", + "git_remote_pushurl", + "git_remote_set_url", + "git_remote_set_pushurl", + "git_remote_set_instance_url", + "git_remote_set_instance_pushurl", + "git_remote_add_fetch", + "git_remote_get_fetch_refspecs", + "git_remote_add_push", + "git_remote_get_push_refspecs", + "git_remote_refspec_count", + "git_remote_get_refspec", + "git_remote_ls", + "git_remote_connected", + "git_remote_stop", + "git_remote_disconnect", + "git_remote_free", + "git_remote_list", + "git_push_transfer_progress_cb", + "git_push_negotiation", + "git_push_update_reference_cb", + "git_url_resolve_cb", + "git_remote_ready_cb", + "git_remote_init_callbacks", + "git_fetch_options_init", + "git_push_options_init", + "git_remote_connect_options_init", + "git_remote_connect", + "git_remote_connect_ext", + "git_remote_download", + "git_remote_upload", + "git_remote_update_tips", + "git_remote_fetch", + "git_remote_prune", + "git_remote_push", + "git_remote_stats", + "git_remote_autotag", + "git_remote_set_autotag", + "git_remote_prune_refs", + "git_remote_rename", + "git_remote_name_is_valid", + "git_remote_delete", + "git_remote_default_branch" + ], + "meta": {}, + "lines": 1244 + }, + { + "file": "git2/repository.h", + "functions": [ + "git_repository_open", + "git_repository_open_from_worktree", + "git_repository_wrap_odb", + "git_repository_discover", + "git_repository_open_ext", + "git_repository_open_bare", + "git_repository_free", + "git_repository_init", + "git_repository_init_options_init", + "git_repository_init_ext", + "git_repository_head", + "git_repository_head_for_worktree", + "git_repository_head_detached", + "git_repository_head_detached_for_worktree", + "git_repository_head_unborn", + "git_repository_is_empty", + "git_repository_item_path", + "git_repository_path", + "git_repository_workdir", + "git_repository_commondir", + "git_repository_set_workdir", + "git_repository_is_bare", + "git_repository_is_worktree", + "git_repository_config", + "git_repository_config_snapshot", + "git_repository_odb", + "git_repository_refdb", + "git_repository_index", + "git_repository_message", + "git_repository_message_remove", + "git_repository_state_cleanup", + "git_repository_fetchhead_foreach_cb", + "git_repository_fetchhead_foreach", + "git_repository_mergehead_foreach_cb", + "git_repository_mergehead_foreach", + "git_repository_hashfile", + "git_repository_set_head", + "git_repository_set_head_detached", + "git_repository_set_head_detached_from_annotated", + "git_repository_detach_head", + "git_repository_state", + "git_repository_set_namespace", + "git_repository_get_namespace", + "git_repository_is_shallow", + "git_repository_ident", + "git_repository_set_ident", + "git_repository_oid_type", + "git_repository_commit_parents" + ], + "meta": {}, + "lines": 1014 + }, + { + "file": "git2/reset.h", + "functions": [ + "git_reset", + "git_reset_from_annotated", + "git_reset_default" + ], + "meta": {}, + "lines": 119 + }, + { + "file": "git2/revert.h", + "functions": [ + "git_revert_options_init", + "git_revert_commit", + "git_revert" + ], + "meta": {}, + "lines": 91 + }, + { + "file": "git2/revparse.h", + "functions": ["git_revparse_single", "git_revparse_ext", "git_revparse"], + "meta": {}, + "lines": 108 + }, + { + "file": "git2/revwalk.h", + "functions": [ + "git_revwalk_new", + "git_revwalk_reset", + "git_revwalk_push", + "git_revwalk_push_glob", + "git_revwalk_push_head", + "git_revwalk_hide", + "git_revwalk_hide_glob", + "git_revwalk_hide_head", + "git_revwalk_push_ref", + "git_revwalk_hide_ref", + "git_revwalk_next", + "git_revwalk_sorting", + "git_revwalk_push_range", + "git_revwalk_simplify_first_parent", + "git_revwalk_free", + "git_revwalk_repository", + "git_revwalk_hide_cb", + "git_revwalk_add_hide_cb" + ], + "meta": {}, + "lines": 298 + }, + { + "file": "git2/signature.h", + "functions": [ + "git_signature_new", + "git_signature_now", + "git_signature_default_from_env", + "git_signature_default", + "git_signature_from_buffer", + "git_signature_dup", + "git_signature_free" + ], + "meta": {}, + "lines": 143 + }, + { + "file": "git2/stash.h", + "functions": [ + "git_stash_save", + "git_stash_save_options_init", + "git_stash_save_with_opts", + "git_stash_apply_progress_cb", + "git_stash_apply_options_init", + "git_stash_apply", + "git_stash_cb", + "git_stash_foreach", + "git_stash_drop", + "git_stash_pop" + ], + "meta": {}, + "lines": 323 + }, + { + "file": "git2/status.h", + "functions": [ + "git_status_cb", + "git_status_options_init", + "git_status_foreach", + "git_status_foreach_ext", + "git_status_file", + "git_status_list_new", + "git_status_list_entrycount", + "git_status_byindex", + "git_status_list_free", + "git_status_should_ignore" + ], + "meta": {}, + "lines": 451 + }, + { + "file": "git2/strarray.h", + "functions": ["git_strarray_dispose"], + "meta": {}, + "lines": 37 + }, + { + "file": "git2/submodule.h", + "functions": [ + "git_submodule_cb", + "git_submodule_update_options_init", + "git_submodule_update", + "git_submodule_lookup", + "git_submodule_dup", + "git_submodule_free", + "git_submodule_foreach", + "git_submodule_add_setup", + "git_submodule_clone", + "git_submodule_add_finalize", + "git_submodule_add_to_index", + "git_submodule_owner", + "git_submodule_name", + "git_submodule_path", + "git_submodule_url", + "git_submodule_resolve_url", + "git_submodule_branch", + "git_submodule_set_branch", + "git_submodule_set_url", + "git_submodule_index_id", + "git_submodule_head_id", + "git_submodule_wd_id", + "git_submodule_ignore", + "git_submodule_set_ignore", + "git_submodule_update_strategy", + "git_submodule_set_update", + "git_submodule_fetch_recurse_submodules", + "git_submodule_set_fetch_recurse_submodules", + "git_submodule_init", + "git_submodule_repo_init", + "git_submodule_sync", + "git_submodule_open", + "git_submodule_reload", + "git_submodule_status", + "git_submodule_location" + ], + "meta": {}, + "lines": 674 + }, + { + "file": "git2/sys/commit_graph.h", + "functions": [], + "meta": {}, + "lines": 99 + }, + { "file": "git2/sys/config.h", "functions": [], "meta": {}, "lines": 162 }, + { "file": "git2/sys/filter.h", "functions": [], "meta": {}, "lines": 109 }, + { "file": "git2/sys/hashsig.h", "functions": [], "meta": {}, "lines": 55 }, + { "file": "git2/sys/merge.h", "functions": [], "meta": {}, "lines": 49 }, + { "file": "git2/sys/path.h", "functions": [], "meta": {}, "lines": 51 }, + { "file": "git2/sys/stream.h", "functions": [], "meta": {}, "lines": 105 }, + { + "file": "git2/sys/transport.h", + "functions": [], + "meta": {}, + "lines": 328 + }, + { + "file": "git2/tag.h", + "functions": [ + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_tag_free", + "git_tag_id", + "git_tag_owner", + "git_tag_target", + "git_tag_target_id", + "git_tag_target_type", + "git_tag_name", + "git_tag_tagger", + "git_tag_message", + "git_tag_create", + "git_tag_annotation_create", + "git_tag_create_from_buffer", + "git_tag_create_lightweight", + "git_tag_delete", + "git_tag_list", + "git_tag_list_match", + "git_tag_foreach_cb", + "git_tag_foreach", + "git_tag_peel", + "git_tag_dup", + "git_tag_name_is_valid" + ], + "meta": {}, + "lines": 380 + }, + { + "file": "git2/trace.h", + "functions": ["git_trace_cb", "git_trace_set"], + "meta": {}, + "lines": 68 + }, + { + "file": "git2/transaction.h", + "functions": [ + "git_transaction_new", + "git_transaction_lock_ref", + "git_transaction_set_target", + "git_transaction_set_symbolic_target", + "git_transaction_set_reflog", + "git_transaction_remove", + "git_transaction_commit", + "git_transaction_free" + ], + "meta": {}, + "lines": 117 + }, + { + "file": "git2/transport.h", + "functions": ["git_transport_message_cb", "git_transport_cb"], + "meta": {}, + "lines": 45 + }, + { + "file": "git2/tree.h", + "functions": [ + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_tree_free", + "git_tree_id", + "git_tree_owner", + "git_tree_entrycount", + "git_tree_entry_byname", + "git_tree_entry_byindex", + "git_tree_entry_byid", + "git_tree_entry_bypath", + "git_tree_entry_dup", + "git_tree_entry_free", + "git_tree_entry_name", + "git_tree_entry_id", + "git_tree_entry_type", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_cmp", + "git_tree_entry_to_object", + "git_treebuilder_new", + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_remove", + "git_treebuilder_filter_cb", + "git_treebuilder_filter", + "git_treebuilder_write", + "git_treewalk_cb", + "git_tree_walk", + "git_tree_dup", + "git_tree_create_updated" + ], + "meta": {}, + "lines": 481 + }, + { "file": "git2/types.h", "functions": [], "meta": {}, "lines": 382 }, + { + "file": "git2/worktree.h", + "functions": [ + "git_worktree_list", + "git_worktree_lookup", + "git_worktree_open_from_repository", + "git_worktree_free", + "git_worktree_validate", + "git_worktree_add_options_init", + "git_worktree_add", + "git_worktree_lock", + "git_worktree_unlock", + "git_worktree_is_locked", + "git_worktree_name", + "git_worktree_path", + "git_worktree_prune_options_init", + "git_worktree_is_prunable", + "git_worktree_prune" + ], + "meta": {}, + "lines": 273 + } + ], + "functions": { + "git_annotated_commit_from_ref": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 40, + "lineto": 43, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given reference" + }, + { + "name": "ref", + "type": "const git_reference *", + "comment": "reference to use to lookup the git_annotated_commit" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const git_reference *ref", + "sig": "git_annotated_commit **::git_repository *::const git_reference *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Creates a git_annotated_commit from the given reference.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", + "comments": "", + "group": "annotated", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_annotated_commit_from_ref-1" + ] + } + }, + "git_annotated_commit_from_fetchhead": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 57, + "lineto": 62, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given commit" + }, + { + "name": "branch_name", + "type": "const char *", + "comment": "name of the (remote) branch" + }, + { + "name": "remote_url", + "type": "const char *", + "comment": "url of the remote" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the commit object id of the remote branch" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const char *branch_name, const char *remote_url, const git_oid *id", + "sig": "git_annotated_commit **::git_repository *::const char *::const char *::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Creates a git_annotated_commit from the given fetch head data.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", + "comments": "", + "group": "annotated" + }, + "git_annotated_commit_lookup": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 82, + "lineto": 85, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given commit" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the commit object id to lookup" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const git_oid *id", + "sig": "git_annotated_commit **::git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Creates a git_annotated_commit from the given commit id.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", + "comments": "

An annotated commit contains information about how it was looked up, which may be useful for functions like merge or rebase to provide context to the operation. For example, conflict files will include the name of the source or target branches being merged. It is therefore preferable to use the most specific function (eg git_annotated_commit_from_ref) instead of this one when that data is known.

\n", + "group": "annotated" + }, + "git_annotated_commit_from_revspec": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 99, + "lineto": 102, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given commit" + }, + { + "name": "revspec", + "type": "const char *", + "comment": "the extended sha syntax string to use to lookup the commit" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const char *revspec", + "sig": "git_annotated_commit **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Creates a git_annotated_commit from a revision string.

\n", + "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n", + "group": "annotated" + }, + "git_annotated_commit_id": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 110, + "lineto": 111, + "args": [ + { + "name": "commit", + "type": "const git_annotated_commit *", + "comment": "the given annotated commit" + } + ], + "argline": "const git_annotated_commit *commit", + "sig": "const git_annotated_commit *", + "return": { "type": "const git_oid *", "comment": " commit id" }, + "description": "

Gets the commit ID that the given git_annotated_commit refers to.

\n", + "comments": "", + "group": "annotated", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_annotated_commit_id-2"], + "merge.c": [ + "ex/v1.9.1/merge.html#git_annotated_commit_id-1", + "ex/v1.9.1/merge.html#git_annotated_commit_id-2", + "ex/v1.9.1/merge.html#git_annotated_commit_id-3" + ] + } + }, + "git_annotated_commit_ref": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 119, + "lineto": 120, + "args": [ + { + "name": "commit", + "type": "const git_annotated_commit *", + "comment": "the given annotated commit" + } + ], + "argline": "const git_annotated_commit *commit", + "sig": "const git_annotated_commit *", + "return": { "type": "const char *", "comment": " ref name." }, + "description": "

Get the refname that the given git_annotated_commit refers to.

\n", + "comments": "", + "group": "annotated", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_annotated_commit_ref-3", + "ex/v1.9.1/checkout.html#git_annotated_commit_ref-4", + "ex/v1.9.1/checkout.html#git_annotated_commit_ref-5" + ] + } + }, + "git_annotated_commit_free": { + "type": "function", + "file": "git2/annotated_commit.h", + "line": 127, + "lineto": 128, + "args": [ + { + "name": "commit", + "type": "git_annotated_commit *", + "comment": "annotated commit to free" + } + ], + "argline": "git_annotated_commit *commit", + "sig": "git_annotated_commit *", + "return": { "type": "void", "comment": null }, + "description": "

Frees a git_annotated_commit.

\n", + "comments": "", + "group": "annotated", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_annotated_commit_free-6"] + } + }, + "git_apply_options_init": { + "type": "function", + "file": "git2/apply.h", + "line": 127, + "lineto": 127, + "args": [ + { + "name": "opts", + "type": "git_apply_options *", + "comment": "The `git_apply_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_APPLY_OPTIONS_VERSION`" + } + ], + "argline": "git_apply_options *opts, unsigned int version", + "sig": "git_apply_options *::unsigned int", + "return": { "type": "int", "comment": " 0 on success or -1 on failure." }, + "description": "

Initialize git_apply_options structure

\n", + "comments": "

Initialize a git_apply_options with default values. Equivalent to creating an instance with GIT_APPLY_OPTIONS_INIT.

\n", + "group": "apply" + }, + "git_apply_to_tree": { + "type": "function", + "file": "git2/apply.h", + "line": 140, + "lineto": 145, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "the postimage of the application" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to apply" + }, + { + "name": "preimage", + "type": "git_tree *", + "comment": "the tree to apply the diff to" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "the diff to apply" + }, + { + "name": "options", + "type": "const git_apply_options *", + "comment": "the options for the apply (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, git_tree *preimage, git_diff *diff, const git_apply_options *options", + "sig": "git_index **::git_repository *::git_tree *::git_diff *::const git_apply_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Apply a git_diff to a git_tree, and return the resulting image\n as an index.

\n", + "comments": "", + "group": "apply" + }, + "git_apply": { + "type": "function", + "file": "git2/apply.h", + "line": 178, + "lineto": 182, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to apply to" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "the diff to apply" + }, + { + "name": "location", + "type": "git_apply_location_t", + "comment": "the location to apply (workdir, index or both)" + }, + { + "name": "options", + "type": "const git_apply_options *", + "comment": "the options for the apply (or null for defaults)" + } + ], + "argline": "git_repository *repo, git_diff *diff, git_apply_location_t location, const git_apply_options *options", + "sig": "git_repository *::git_diff *::git_apply_location_t::const git_apply_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Apply a git_diff to the given repository, making changes directly\n in the working directory, the index, or both.

\n", + "comments": "", + "group": "apply" + }, + "git_attr_value": { + "type": "function", + "file": "git2/attr.h", + "line": 106, + "lineto": 106, + "args": [ + { "name": "attr", "type": "const char *", "comment": "The attribute" } + ], + "argline": "const char *attr", + "sig": "const char *", + "return": { + "type": "git_attr_value_t", + "comment": " the value type for the attribute" + }, + "description": "

Return the value type for a given attribute.

\n", + "comments": "

This can be either TRUE, FALSE, UNSPECIFIED (if the attribute was not set at all), or VALUE, if the attribute was set to an actual string.

\n\n

If the attribute has a VALUE string, it can be accessed normally as a NULL-terminated C string.

\n", + "group": "attr" + }, + "git_attr_get": { + "type": "function", + "file": "git2/attr.h", + "line": 195, + "lineto": 200, + "args": [ + { + "name": "value_out", + "type": "const char **", + "comment": "Output of the value of the attribute. Use the GIT_ATTR_...\n macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just\n use the string value for attributes set to a value. You\n should NOT modify or free this value." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "A combination of GIT_ATTR_CHECK... flags." + }, + { + "name": "path", + "type": "const char *", + "comment": "The path to check for attributes. Relative paths are\n interpreted relative to the repo root. The file does\n not have to exist, but if it does not, then it will be\n treated as a plain file (not a directory)." + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the attribute to look up." + } + ], + "argline": "const char **value_out, git_repository *repo, uint32_t flags, const char *path, const char *name", + "sig": "const char **::git_repository *::uint32_t::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Look up the value of one git attribute for path.

\n", + "comments": "", + "group": "attr" + }, + "git_attr_get_ext": { + "type": "function", + "file": "git2/attr.h", + "line": 218, + "lineto": 223, + "args": [ + { + "name": "value_out", + "type": "const char **", + "comment": "Output of the value of the attribute. Use the GIT_ATTR_...\n macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just\n use the string value for attributes set to a value. You\n should NOT modify or free this value." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "opts", + "type": "git_attr_options *", + "comment": "The `git_attr_options` to use when querying these attributes." + }, + { + "name": "path", + "type": "const char *", + "comment": "The path to check for attributes. Relative paths are\n interpreted relative to the repo root. The file does\n not have to exist, but if it does not, then it will be\n treated as a plain file (not a directory)." + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the attribute to look up." + } + ], + "argline": "const char **value_out, git_repository *repo, git_attr_options *opts, const char *path, const char *name", + "sig": "const char **::git_repository *::git_attr_options *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Look up the value of one git attribute for path with extended options.

\n", + "comments": "", + "group": "attr" + }, + "git_attr_get_many": { + "type": "function", + "file": "git2/attr.h", + "line": 255, + "lineto": 261, + "args": [ + { + "name": "values_out", + "type": "const char **", + "comment": "An array of num_attr entries that will have string\n pointers written into it for the values of the attributes.\n You should not modify or free the values that are written\n into this array (although of course, you should free the\n array itself if you allocated it)." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "A combination of GIT_ATTR_CHECK... flags." + }, + { + "name": "path", + "type": "const char *", + "comment": "The path inside the repo to check attributes. This\n does not have to exist, but if it does not, then\n it will be treated as a plain file (i.e. not a directory)." + }, + { + "name": "num_attr", + "type": "size_t", + "comment": "The number of attributes being looked up" + }, + { + "name": "names", + "type": "const char **", + "comment": "An array of num_attr strings containing attribute names." + } + ], + "argline": "const char **values_out, git_repository *repo, uint32_t flags, const char *path, size_t num_attr, const char **names", + "sig": "const char **::git_repository *::uint32_t::const char *::size_t::const char **", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Look up a list of git attributes for path.

\n", + "comments": "

Use this if you have a known list of attributes that you want to look up in a single call. This is somewhat more efficient than calling git_attr_get() multiple times.

\n\n

For example, you might write:

\n\n
 const char *attrs[] = { "crlf", "diff", "foo" };     const char **values[3];     git_attr_get_many(values, repo, 0, "my/fun/file.c", 3, attrs);\n
\n\n

Then you could loop through the 3 values to get the settings for the three attributes you asked about.

\n", + "group": "attr" + }, + "git_attr_get_many_ext": { + "type": "function", + "file": "git2/attr.h", + "line": 280, + "lineto": 286, + "args": [ + { + "name": "values_out", + "type": "const char **", + "comment": "An array of num_attr entries that will have string\n pointers written into it for the values of the attributes.\n You should not modify or free the values that are written\n into this array (although of course, you should free the\n array itself if you allocated it)." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "opts", + "type": "git_attr_options *", + "comment": "The `git_attr_options` to use when querying these attributes." + }, + { + "name": "path", + "type": "const char *", + "comment": "The path inside the repo to check attributes. This\n does not have to exist, but if it does not, then\n it will be treated as a plain file (i.e. not a directory)." + }, + { + "name": "num_attr", + "type": "size_t", + "comment": "The number of attributes being looked up" + }, + { + "name": "names", + "type": "const char **", + "comment": "An array of num_attr strings containing attribute names." + } + ], + "argline": "const char **values_out, git_repository *repo, git_attr_options *opts, const char *path, size_t num_attr, const char **names", + "sig": "const char **::git_repository *::git_attr_options *::const char *::size_t::const char **", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Look up a list of git attributes for path with extended options.

\n", + "comments": "", + "group": "attr" + }, + "git_attr_foreach": { + "type": "function", + "file": "git2/attr.h", + "line": 319, + "lineto": 324, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "A combination of GIT_ATTR_CHECK... flags." + }, + { + "name": "path", + "type": "const char *", + "comment": "Path inside the repo to check attributes. This does not have\n to exist, but if it does not, then it will be treated as a\n plain file (i.e. not a directory)." + }, + { + "name": "callback", + "type": "git_attr_foreach_cb", + "comment": "Function to invoke on each attribute name and value.\n See git_attr_foreach_cb." + }, + { + "name": "payload", + "type": "void *", + "comment": "Passed on as extra parameter to callback function." + } + ], + "argline": "git_repository *repo, uint32_t flags, const char *path, git_attr_foreach_cb callback, void *payload", + "sig": "git_repository *::uint32_t::const char *::git_attr_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Loop over all the git attributes for a path.

\n", + "comments": "", + "group": "attr" + }, + "git_attr_foreach_ext": { + "type": "function", + "file": "git2/attr.h", + "line": 339, + "lineto": 344, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the path." + }, + { + "name": "opts", + "type": "git_attr_options *", + "comment": "The `git_attr_options` to use when querying these attributes." + }, + { + "name": "path", + "type": "const char *", + "comment": "Path inside the repo to check attributes. This does not have\n to exist, but if it does not, then it will be treated as a\n plain file (i.e. not a directory)." + }, + { + "name": "callback", + "type": "git_attr_foreach_cb", + "comment": "Function to invoke on each attribute name and value.\n See git_attr_foreach_cb." + }, + { + "name": "payload", + "type": "void *", + "comment": "Passed on as extra parameter to callback function." + } + ], + "argline": "git_repository *repo, git_attr_options *opts, const char *path, git_attr_foreach_cb callback, void *payload", + "sig": "git_repository *::git_attr_options *::const char *::git_attr_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Loop over all the git attributes for a path with extended options.

\n", + "comments": "", + "group": "attr" + }, + "git_attr_cache_flush": { + "type": "function", + "file": "git2/attr.h", + "line": 357, + "lineto": 358, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the gitattributes cache" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Flush the gitattributes cache.

\n", + "comments": "

Call this if you have reason to believe that the attributes files on disk no longer match the cached contents of memory. This will cause the attributes files to be reloaded the next time that an attribute access function is called.

\n", + "group": "attr" + }, + "git_attr_add_macro": { + "type": "function", + "file": "git2/attr.h", + "line": 375, + "lineto": 378, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository to add the macro in." + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the macro." + }, + { + "name": "values", + "type": "const char *", + "comment": "The value for the macro." + } + ], + "argline": "git_repository *repo, const char *name, const char *values", + "sig": "git_repository *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Add a macro definition.

\n", + "comments": "

Macros will automatically be loaded from the top level .gitattributes file of the repository (plus the built-in "binary" macro). This function allows you to add others. For example, to add the default macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n", + "group": "attr" + }, + "git_blame_options_init": { + "type": "function", + "file": "git2/blame.h", + "line": 146, + "lineto": 148, + "args": [ + { + "name": "opts", + "type": "git_blame_options *", + "comment": "The `git_blame_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_BLAME_OPTIONS_VERSION`." + } + ], + "argline": "git_blame_options *opts, unsigned int version", + "sig": "git_blame_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_blame_options structure

\n", + "comments": "

Initializes a git_blame_options with default values. Equivalent to creating an instance with GIT_BLAME_OPTIONS_INIT.

\n", + "group": "blame" + }, + "git_blame_linecount": { + "type": "function", + "file": "git2/blame.h", + "line": 244, + "lineto": 244, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "The blame structure to query." + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { "type": "size_t", "comment": " The number of line." }, + "description": "

Gets the number of lines that exist in the blame structure.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_hunkcount": { + "type": "function", + "file": "git2/blame.h", + "line": 252, + "lineto": 252, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "The blame structure to query." + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { "type": "size_t", "comment": " The number of hunks." }, + "description": "

Gets the number of hunks that exist in the blame structure.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_hunk_byindex": { + "type": "function", + "file": "git2/blame.h", + "line": 261, + "lineto": 263, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "index", + "type": "size_t", + "comment": "index of the hunk to retrieve" + } + ], + "argline": "git_blame *blame, size_t index", + "sig": "git_blame *::size_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk at the given index, or NULL on error" + }, + "description": "

Gets the blame hunk at the given index.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_hunk_byline": { + "type": "function", + "file": "git2/blame.h", + "line": 273, + "lineto": 275, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "lineno", + "type": "size_t", + "comment": "the (1-based) line number to find a hunk for" + } + ], + "argline": "git_blame *blame, size_t lineno", + "sig": "git_blame *::size_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk that contains the given line, or NULL on error" + }, + "description": "

Gets the hunk that relates to the given line number in the newest\n commit.

\n", + "comments": "", + "group": "blame", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_blame_hunk_byline-1"] + } + }, + "git_blame_line_byindex": { + "type": "function", + "file": "git2/blame.h", + "line": 284, + "lineto": 286, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "idx", + "type": "size_t", + "comment": "the (1-based) line number" + } + ], + "argline": "git_blame *blame, size_t idx", + "sig": "git_blame *::size_t", + "return": { + "type": "const git_blame_line *", + "comment": " the blamed line, or NULL on error" + }, + "description": "

Gets the information about the line in the blame.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_count": { + "type": "function", + "file": "git2/blame.h", + "line": 296, + "lineto": 296, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "The blame structure to query." + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { "type": "uint32_t", "comment": " The number of hunks." }, + "description": "

Gets the number of hunks that exist in the blame structure.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_byindex": { + "type": "function", + "file": "git2/blame.h", + "line": 305, + "lineto": 307, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "index", + "type": "uint32_t", + "comment": "index of the hunk to retrieve" + } + ], + "argline": "git_blame *blame, uint32_t index", + "sig": "git_blame *::uint32_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk at the given index, or NULL on error" + }, + "description": "

Gets the blame hunk at the given index.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_byline": { + "type": "function", + "file": "git2/blame.h", + "line": 316, + "lineto": 318, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "lineno", + "type": "size_t", + "comment": "the (1-based) line number to find a hunk for" + } + ], + "argline": "git_blame *blame, size_t lineno", + "sig": "git_blame *::size_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk that contains the given line, or NULL on error" + }, + "description": "

Gets the hunk that relates to the given line number in the newest commit.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_buffer": { + "type": "function", + "file": "git2/blame.h", + "line": 374, + "lineto": 378, + "args": [ + { + "name": "out", + "type": "git_blame **", + "comment": "pointer that will receive the resulting blame data" + }, + { + "name": "base", + "type": "git_blame *", + "comment": "cached blame from the history of the file (usually the output\n from git_blame_file)" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "the (possibly) modified contents of the file" + }, + { + "name": "buffer_len", + "type": "size_t", + "comment": "number of valid bytes in the buffer" + } + ], + "argline": "git_blame **out, git_blame *base, const char *buffer, size_t buffer_len", + "sig": "git_blame **::git_blame *::const char *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, or an error code. (use git_error_last for information\n about the error)" + }, + "description": "

Get blame data for a file that has been modified in memory. The blame\n parameter is a pre-calculated blame for the in-odb history of the file.\n This means that once a file blame is completed (which can be expensive),\n updating the buffer blame is very fast.

\n", + "comments": "

Lines that differ between the buffer and the committed version are marked as having a zero OID for their final_commit_id.

\n", + "group": "blame" + }, + "git_blame_free": { + "type": "function", + "file": "git2/blame.h", + "line": 385, + "lineto": 385, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to free" + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { "type": "void", "comment": null }, + "description": "

Free memory allocated by git_blame_file or git_blame_buffer.

\n", + "comments": "", + "group": "blame", + "examples": { "blame.c": ["ex/v1.9.1/blame.html#git_blame_free-2"] } + }, + "git_blob_lookup": { + "type": "function", + "file": "git2/blob.h", + "line": 37, + "lineto": 40, + "args": [ + { + "name": "blob", + "type": "git_blob **", + "comment": "pointer to the looked up blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the blob." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the blob to locate." + } + ], + "argline": "git_blob **blob, git_repository *repo, const git_oid *id", + "sig": "git_blob **::git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a blob object from a repository.

\n", + "comments": "", + "group": "blob", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_blob_lookup-3"], + "general.c": ["ex/v1.9.1/general.html#git_blob_lookup-1"] + } + }, + "git_blob_lookup_prefix": { + "type": "function", + "file": "git2/blob.h", + "line": 54, + "lineto": 54, + "args": [ + { + "name": "blob", + "type": "git_blob **", + "comment": "pointer to the looked up blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the blob." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the blob to locate." + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the short identifier" + } + ], + "argline": "git_blob **blob, git_repository *repo, const git_oid *id, size_t len", + "sig": "git_blob **::git_repository *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a blob object from a repository,\n given a prefix of its identifier (short id).

\n", + "comments": "", + "group": "blob" + }, + "git_blob_free": { + "type": "function", + "file": "git2/blob.h", + "line": 67, + "lineto": 67, + "args": [ + { "name": "blob", "type": "git_blob *", "comment": "the blob to close" } + ], + "argline": "git_blob *blob", + "sig": "git_blob *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open blob

\n", + "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT: It is necessary to call this method when you stop using a blob. Failure to do so will cause a memory leak.

\n", + "group": "blob", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_blob_free-4"], + "general.c": ["ex/v1.9.1/general.html#git_blob_free-2"] + } + }, + "git_blob_id": { + "type": "function", + "file": "git2/blob.h", + "line": 75, + "lineto": 75, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "a previously loaded blob." + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "const git_oid *", + "comment": " SHA1 hash for this blob." + }, + "description": "

Get the id of a blob.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_owner": { + "type": "function", + "file": "git2/blob.h", + "line": 83, + "lineto": 83, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "A previously loaded blob." + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this blob." + }, + "description": "

Get the repository that contains the blob.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_rawcontent": { + "type": "function", + "file": "git2/blob.h", + "line": 96, + "lineto": 96, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "pointer to the blob" + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "const void *", + "comment": " \n\n `unsigned char *` the pointer, or NULL on error" + }, + "description": "

Get a read-only buffer with the raw content of a blob.

\n", + "comments": "

A pointer to the raw content of a blob is returned; this pointer is owned internally by the object and shall not be free'd. The pointer may be invalidated at a later time.

\n", + "group": "blob", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_blob_rawcontent-5"], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_blob_rawcontent-1"], + "general.c": ["ex/v1.9.1/general.html#git_blob_rawcontent-3"] + } + }, + "git_blob_rawsize": { + "type": "function", + "file": "git2/blob.h", + "line": 104, + "lineto": 104, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "pointer to the blob" + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { "type": "git_object_size_t", "comment": " size in bytes" }, + "description": "

Get the size in bytes of the contents of a blob

\n", + "comments": "", + "group": "blob", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_blob_rawsize-6"], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_blob_rawsize-2"], + "general.c": [ + "ex/v1.9.1/general.html#git_blob_rawsize-4", + "ex/v1.9.1/general.html#git_blob_rawsize-5" + ] + } + }, + "git_blob_filter_options_init": { + "type": "function", + "file": "git2/blob.h", + "line": 201, + "lineto": 203, + "args": [ + { + "name": "opts", + "type": "git_blob_filter_options *", + "comment": "The `git_blob_filter_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass GIT_BLOB_FILTER_OPTIONS_VERSION" + } + ], + "argline": "git_blob_filter_options *opts, unsigned int version", + "sig": "git_blob_filter_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_blob_filter_options structure

\n", + "comments": "

Initializes a git_blob_filter_options with default values. Equivalent to creating an instance with GIT_BLOB_FILTER_OPTIONS_INIT.

\n", + "group": "blob" + }, + "git_blob_filter": { + "type": "function", + "file": "git2/blob.h", + "line": 227, + "lineto": 231, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The git_buf to be filled in" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "Pointer to the blob" + }, + { + "name": "as_path", + "type": "const char *", + "comment": "Path used for file attribute lookups, etc." + }, + { + "name": "opts", + "type": "git_blob_filter_options *", + "comment": "Options to use for filtering the blob" + } + ], + "argline": "git_buf *out, git_blob *blob, const char *as_path, git_blob_filter_options *opts", + "sig": "git_buf *::git_blob *::const char *::git_blob_filter_options *", + "return": { + "type": "int", + "comment": " \n\n[enum] git_error_code 0 on success or an error code" + }, + "description": "

Get a buffer with the filtered content of a blob.

\n", + "comments": "

This applies filters as if the blob was being checked out to the working directory under the specified filename. This may apply CRLF filtering or other types of changes depending on the file attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must dispose when done (via git_buf_dispose).

\n\n

If no filters need to be applied, then the out buffer will just be populated with a pointer to the raw content of the blob. In that case, be careful to not free the blob until done with the buffer or copy it into memory you own.

\n", + "group": "blob" + }, + "git_blob_create_from_workdir": { + "type": "function", + "file": "git2/blob.h", + "line": 244, + "lineto": 244, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "return the id of the written blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository where the blob will be written.\n\tthis repository cannot be bare" + }, + { + "name": "relative_path", + "type": "const char *", + "comment": "file from which the blob will be created,\n\trelative to the repository's working dir" + } + ], + "argline": "git_oid *id, git_repository *repo, const char *relative_path", + "sig": "git_oid *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a file from the working folder of a repository and write it\n to the object database.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_create_from_disk": { + "type": "function", + "file": "git2/blob.h", + "line": 257, + "lineto": 260, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "return the id of the written blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository where the blob will be written.\n\tthis repository can be bare or not" + }, + { + "name": "path", + "type": "const char *", + "comment": "file from which the blob will be created" + } + ], + "argline": "git_oid *id, git_repository *repo, const char *path", + "sig": "git_oid *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a file from the filesystem (not necessarily inside the\n working folder of the repository) and write it to the object\n database.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_create_from_stream": { + "type": "function", + "file": "git2/blob.h", + "line": 287, + "lineto": 290, + "args": [ + { + "name": "out", + "type": "git_writestream **", + "comment": "the stream into which to write" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where the blob will be written.\n This repository can be bare or not." + }, + { + "name": "hintpath", + "type": "const char *", + "comment": "If not NULL, will be used to select data filters\n to apply onto the content of the blob to be created." + } + ], + "argline": "git_writestream **out, git_repository *repo, const char *hintpath", + "sig": "git_writestream **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or error code" }, + "description": "

Create a stream to write a new blob into the object database.

\n", + "comments": "

This function may need to buffer the data on disk and will in general not be the right choice if you know the size of the data to write. If you have data in memory, use git_blob_create_from_buffer(). If you do not, but know the size of the contents (and don't want/need to perform filtering), use git_odb_open_wstream().

\n\n

Don't close this stream yourself but pass it to git_blob_create_from_stream_commit() to commit the write to the object db and get the object id.

\n\n

If the hintpath parameter is filled, it will be used to determine what git filters should be applied to the object before it is written to the object database.

\n", + "group": "blob" + }, + "git_blob_create_from_stream_commit": { + "type": "function", + "file": "git2/blob.h", + "line": 301, + "lineto": 303, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "the id of the new blob" + }, + { + "name": "stream", + "type": "git_writestream *", + "comment": "the stream to close" + } + ], + "argline": "git_oid *out, git_writestream *stream", + "sig": "git_oid *::git_writestream *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Close the stream and finalize writing the blob to the object database.

\n", + "comments": "

The stream will be closed and freed.

\n", + "group": "blob" + }, + "git_blob_create_from_buffer": { + "type": "function", + "file": "git2/blob.h", + "line": 314, + "lineto": 315, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "return the id of the written blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository where the blob will be written" + }, + { + "name": "buffer", + "type": "const void *", + "comment": "data to be written into the blob" + }, + { "name": "len", "type": "size_t", "comment": "length of the data" } + ], + "argline": "git_oid *id, git_repository *repo, const void *buffer, size_t len", + "sig": "git_oid *::git_repository *::const void *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an in-memory buffer to the object database as a blob.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_is_binary": { + "type": "function", + "file": "git2/blob.h", + "line": 328, + "lineto": 328, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "The blob which content should be analyzed" + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "int", + "comment": " \n\n bool 1 if the content of the blob is detected\n as binary; 0 otherwise." + }, + "description": "

Determine if the blob content is most likely binary or not.

\n", + "comments": "

The heuristic used to guess if a file is binary is taken from core git: Searching for NUL bytes and looking for a reasonable ratio of printable to non-printable characters among the first 8000 bytes.

\n", + "group": "blob" + }, + "git_blob_data_is_binary": { + "type": "function", + "file": "git2/blob.h", + "line": 340, + "lineto": 340, + "args": [ + { + "name": "data", + "type": "const char *", + "comment": "The blob data which content should be analyzed" + }, + { "name": "len", "type": "size_t", "comment": "The length of the data" } + ], + "argline": "const char *data, size_t len", + "sig": "const char *::size_t", + "return": { + "type": "int", + "comment": " 1 if the content of the blob is detected\n as binary; 0 otherwise." + }, + "description": "

Determine if the given content is most certainly binary or not;\n this is the same mechanism used by git_blob_is_binary but only\n looking at raw data.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_dup": { + "type": "function", + "file": "git2/blob.h", + "line": 350, + "lineto": 350, + "args": [ + { + "name": "out", + "type": "git_blob **", + "comment": "Pointer to store the copy of the object" + }, + { + "name": "source", + "type": "git_blob *", + "comment": "Original object to copy" + } + ], + "argline": "git_blob **out, git_blob *source", + "sig": "git_blob **::git_blob *", + "return": { "type": "int", "comment": " 0." }, + "description": "

Create an in-memory copy of a blob. The copy must be explicitly\n free'd or it will leak.

\n", + "comments": "", + "group": "blob" + }, + "git_branch_create": { + "type": "function", + "file": "git2/branch.h", + "line": 53, + "lineto": 58, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer where to store the underlying reference." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to create the branch in." + }, + { + "name": "branch_name", + "type": "const char *", + "comment": "Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name." + }, + { + "name": "target", + "type": "const git_commit *", + "comment": "Commit to which this branch should point. This object\n must belong to the given `repo`." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing branch." + } + ], + "argline": "git_reference **out, git_repository *repo, const char *branch_name, const git_commit *target, int force", + "sig": "git_reference **::git_repository *::const char *::const git_commit *::int", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC or an error code.\n A proper reference is written in the refs/heads namespace\n pointing to the provided target commit." + }, + "description": "

Create a new branch pointing at a target commit

\n", + "comments": "

A new direct reference will be created pointing to this target commit. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The returned reference must be freed by the user.

\n\n

The branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "group": "branch" + }, + "git_branch_create_from_annotated": { + "type": "function", + "file": "git2/branch.h", + "line": 77, + "lineto": 82, + "args": [ + { + "name": "ref_out", + "type": "git_reference **", + "comment": "Pointer where to store the underlying reference." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to create the branch in." + }, + { + "name": "branch_name", + "type": "const char *", + "comment": "Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name." + }, + { + "name": "target", + "type": "const git_annotated_commit *", + "comment": "Annotated commit to which this branch should point. This\n object must belong to the given `repo`." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing branch." + } + ], + "argline": "git_reference **ref_out, git_repository *repo, const char *branch_name, const git_annotated_commit *target, int force", + "sig": "git_reference **::git_repository *::const char *::const git_annotated_commit *::int", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC or an error code." + }, + "description": "

Create a new branch pointing at a target commit

\n", + "comments": "

This behaves like git_branch_create() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n", + "group": "branch", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_branch_create_from_annotated-7" + ] + } + }, + "git_branch_delete": { + "type": "function", + "file": "git2/branch.h", + "line": 94, + "lineto": 94, + "args": [ + { + "name": "branch", + "type": "git_reference *", + "comment": "A valid reference representing a branch" + } + ], + "argline": "git_reference *branch", + "sig": "git_reference *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code." + }, + "description": "

Delete an existing branch reference.

\n", + "comments": "

Note that if the deletion succeeds, the reference object will not be valid anymore, and should be freed immediately by the user using git_reference_free().

\n", + "group": "branch" + }, + "git_branch_iterator_new": { + "type": "function", + "file": "git2/branch.h", + "line": 110, + "lineto": 113, + "args": [ + { + "name": "out", + "type": "git_branch_iterator **", + "comment": "the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the branches." + }, + { + "name": "list_flags", + "type": "git_branch_t", + "comment": "Filtering flags for the branch\n listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE\n or GIT_BRANCH_ALL." + } + ], + "argline": "git_branch_iterator **out, git_repository *repo, git_branch_t list_flags", + "sig": "git_branch_iterator **::git_repository *::git_branch_t", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Create an iterator which loops over the requested branches.

\n", + "comments": "", + "group": "branch" + }, + "git_branch_next": { + "type": "function", + "file": "git2/branch.h", + "line": 123, + "lineto": 123, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "the reference" + }, + { + "name": "out_type", + "type": "git_branch_t *", + "comment": "the type of branch (local or remote-tracking)" + }, + { + "name": "iter", + "type": "git_branch_iterator *", + "comment": "the branch iterator" + } + ], + "argline": "git_reference **out, git_branch_t *out_type, git_branch_iterator *iter", + "sig": "git_reference **::git_branch_t *::git_branch_iterator *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ITEROVER if there are no more branches or an error code." + }, + "description": "

Retrieve the next branch from the iterator

\n", + "comments": "", + "group": "branch" + }, + "git_branch_iterator_free": { + "type": "function", + "file": "git2/branch.h", + "line": 130, + "lineto": 130, + "args": [ + { + "name": "iter", + "type": "git_branch_iterator *", + "comment": "the iterator to free" + } + ], + "argline": "git_branch_iterator *iter", + "sig": "git_branch_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Free a branch iterator

\n", + "comments": "", + "group": "branch" + }, + "git_branch_move": { + "type": "function", + "file": "git2/branch.h", + "line": 153, + "lineto": 157, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "New reference object for the updated name." + }, + { + "name": "branch", + "type": "git_reference *", + "comment": "Current underlying reference of the branch." + }, + { + "name": "new_branch_name", + "type": "const char *", + "comment": "Target name of the branch once the move\n is performed; this name is validated for consistency." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing branch." + } + ], + "argline": "git_reference **out, git_reference *branch, const char *new_branch_name, int force", + "sig": "git_reference **::git_reference *::const char *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code." + }, + "description": "

Move/rename an existing local branch reference.

\n", + "comments": "

The new branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n\n

Note that if the move succeeds, the old reference object will not be valid anymore, and should be freed immediately by the user using git_reference_free().

\n", + "group": "branch" + }, + "git_branch_lookup": { + "type": "function", + "file": "git2/branch.h", + "line": 177, + "lineto": 181, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer to the looked-up branch reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to look up the branch" + }, + { + "name": "branch_name", + "type": "const char *", + "comment": "Name of the branch to be looked-up;\n this name is validated for consistency." + }, + { + "name": "branch_type", + "type": "git_branch_t", + "comment": "Type of the considered branch. This should\n be valued with either GIT_BRANCH_LOCAL or GIT_BRANCH_REMOTE." + } + ], + "argline": "git_reference **out, git_repository *repo, const char *branch_name, git_branch_t branch_type", + "sig": "git_reference **::git_repository *::const char *::git_branch_t", + "return": { + "type": "int", + "comment": " 0 on success; GIT_ENOTFOUND when no matching branch\n exists, GIT_EINVALIDSPEC, otherwise an error code." + }, + "description": "

Lookup a branch by its name in a repository.

\n", + "comments": "

The generated reference must be freed by the user. The branch name will be checked for validity.

\n", + "group": "branch" + }, + "git_branch_name": { + "type": "function", + "file": "git2/branch.h", + "line": 198, + "lineto": 200, + "args": [ + { + "name": "out", + "type": "const char **", + "comment": "Pointer to the abbreviated reference name.\n Owned by ref, do not free." + }, + { + "name": "ref", + "type": "const git_reference *", + "comment": "A reference object, ideally pointing to a branch" + } + ], + "argline": "const char **out, const git_reference *ref", + "sig": "const char **::const git_reference *", + "return": { + "type": "int", + "comment": " 0 on success; GIT_EINVALID if the reference isn't either a local or\n remote branch, otherwise an error code." + }, + "description": "

Get the branch name

\n", + "comments": "

Given a reference object, this will check that it really is a branch (ie. it lives under "refs/heads/" or "refs/remotes/"), and return the branch part of it.

\n", + "group": "branch", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_branch_name-4"] } + }, + "git_branch_upstream": { + "type": "function", + "file": "git2/branch.h", + "line": 216, + "lineto": 218, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer where to store the retrieved reference." + }, + { + "name": "branch", + "type": "const git_reference *", + "comment": "Current underlying reference of the branch." + } + ], + "argline": "git_reference **out, const git_reference *branch", + "sig": "git_reference **::const git_reference *", + "return": { + "type": "int", + "comment": " 0 on success; GIT_ENOTFOUND when no remote tracking\n reference exists, otherwise an error code." + }, + "description": "

Get the upstream of a branch

\n", + "comments": "

Given a reference, this will return a new reference object corresponding to its remote tracking branch. The reference must be a local branch.

\n", + "group": "branch" + }, + "git_branch_set_upstream": { + "type": "function", + "file": "git2/branch.h", + "line": 235, + "lineto": 237, + "args": [ + { + "name": "branch", + "type": "git_reference *", + "comment": "the branch to configure" + }, + { + "name": "branch_name", + "type": "const char *", + "comment": "remote-tracking or local branch to set as upstream." + } + ], + "argline": "git_reference *branch, const char *branch_name", + "sig": "git_reference *::const char *", + "return": { + "type": "int", + "comment": " \n\n git_error_t 0 on success; GIT_ENOTFOUND if there's no branch named `branch_name`\n or an error code" + }, + "description": "

Set a branch's upstream branch

\n", + "comments": "

This will update the configuration to set the branch named branch_name as the upstream of branch. Pass a NULL name to unset the upstream information.

\n", + "group": "branch" + }, + "git_branch_upstream_name": { + "type": "function", + "file": "git2/branch.h", + "line": 253, + "lineto": 256, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer into which the name will be written." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the branches live." + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference name of the local branch." + } + ], + "argline": "git_buf *out, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND when no remote tracking reference exists,\n or an error code." + }, + "description": "

Get the upstream name of a branch

\n", + "comments": "

Given a local branch, this will return its remote-tracking branch information, as a full reference name, ie. "feature/nice" would become "refs/remote/origin/feature/nice", depending on that branch's configuration.

\n", + "group": "branch" + }, + "git_branch_is_head": { + "type": "function", + "file": "git2/branch.h", + "line": 266, + "lineto": 267, + "args": [ + { + "name": "branch", + "type": "const git_reference *", + "comment": "A reference to a local branch." + } + ], + "argline": "const git_reference *branch", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 if HEAD points at the branch, 0 if it isn't, or a negative value\n \t\t as an error code." + }, + "description": "

Determine if HEAD points to the given branch

\n", + "comments": "", + "group": "branch" + }, + "git_branch_is_checked_out": { + "type": "function", + "file": "git2/branch.h", + "line": 279, + "lineto": 280, + "args": [ + { + "name": "branch", + "type": "const git_reference *", + "comment": "A reference to a local branch." + } + ], + "argline": "const git_reference *branch", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 if branch is checked out, 0 if it isn't, an error code otherwise." + }, + "description": "

Determine if any HEAD points to the current branch

\n", + "comments": "

This will iterate over all known linked repositories (usually in the form of worktrees) and report whether any HEAD is pointing at the current branch.

\n", + "group": "branch" + }, + "git_branch_remote_name": { + "type": "function", + "file": "git2/branch.h", + "line": 298, + "lineto": 301, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The buffer into which the name will be written." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository where the branch lives." + }, + { + "name": "refname", + "type": "const char *", + "comment": "complete name of the remote tracking branch." + } + ], + "argline": "git_buf *out, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND when no matching remote was found,\n GIT_EAMBIGUOUS when the branch maps to several remotes,\n otherwise an error code." + }, + "description": "

Find the remote name of a remote-tracking branch

\n", + "comments": "

This will return the name of the remote whose fetch refspec is matching the given branch. E.g. given a branch "refs/remotes/test/master", it will extract the "test" part. If refspecs from multiple remotes match, the function will return GIT_EAMBIGUOUS.

\n", + "group": "branch" + }, + "git_branch_upstream_remote": { + "type": "function", + "file": "git2/branch.h", + "line": 314, + "lineto": 314, + "args": [ + { + "name": "buf", + "type": "git_buf *", + "comment": "the buffer into which to write the name" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the full name of the branch" + } + ], + "argline": "git_buf *buf, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Retrieve the upstream remote of a local branch

\n", + "comments": "

This will return the currently configured "branch.*.remote" for a given branch. This branch must be local.

\n", + "group": "branch" + }, + "git_branch_upstream_merge": { + "type": "function", + "file": "git2/branch.h", + "line": 327, + "lineto": 327, + "args": [ + { + "name": "buf", + "type": "git_buf *", + "comment": "the buffer into which to write the name" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the full name of the branch" + } + ], + "argline": "git_buf *buf, git_repository *repo, const char *refname", + "sig": "git_buf *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Retrieve the upstream merge of a local branch

\n", + "comments": "

This will return the currently configured "branch.*.merge" for a given branch. This branch must be local.

\n", + "group": "branch" + }, + "git_branch_name_is_valid": { + "type": "function", + "file": "git2/branch.h", + "line": 339, + "lineto": 339, + "args": [ + { + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given branch name" + }, + { + "name": "name", + "type": "const char *", + "comment": "a branch name to test" + } + ], + "argline": "int *valid, const char *name", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Determine whether a branch name is valid, meaning that (when prefixed\n with refs/heads/) that it is a valid reference name, and that any\n additional branch name restrictions are imposed (eg, it cannot start\n with a -).

\n", + "comments": "", + "group": "branch" + }, + "git_buf_dispose": { + "type": "function", + "file": "git2/buffer.h", + "line": 71, + "lineto": 71, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to deallocate" + } + ], + "argline": "git_buf *buffer", + "sig": "git_buf *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_buf.

\n", + "comments": "

Note that this does not free the git_buf itself, just the memory pointed to by buffer->ptr.

\n", + "group": "buf", + "examples": { + "diff.c": [ + "ex/v1.9.1/diff.html#git_buf_dispose-1", + "ex/v1.9.1/diff.html#git_buf_dispose-2" + ], + "tag.c": ["ex/v1.9.1/tag.html#git_buf_dispose-1"] + } + }, + "git_checkout_options_init": { + "type": "function", + "file": "git2/checkout.h", + "line": 410, + "lineto": 412, + "args": [ + { + "name": "opts", + "type": "git_checkout_options *", + "comment": "The `git_checkout_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_CHECKOUT_OPTIONS_VERSION`." + } + ], + "argline": "git_checkout_options *opts, unsigned int version", + "sig": "git_checkout_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_checkout_options structure

\n", + "comments": "

Initializes a git_checkout_options with default values. Equivalent to creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n", + "group": "checkout" + }, + "git_checkout_head": { + "type": "function", + "file": "git2/checkout.h", + "line": 431, + "lineto": 433, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to check out (must be non-bare)" + }, + { + "name": "opts", + "type": "const git_checkout_options *", + "comment": "specifies checkout options (may be NULL)" + } + ], + "argline": "git_repository *repo, const git_checkout_options *opts", + "sig": "git_repository *::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use git_error_last for error details)" + }, + "description": "

Updates files in the index and the working tree to match the content of\n the commit pointed at by HEAD.

\n", + "comments": "

Note that this is not the correct mechanism used to switch branches; do not change your HEAD and then call this method, that would leave you with checkout conflicts since your working directory would then appear to be dirty. Instead, checkout the target of the branch and then update HEAD using git_repository_set_head to point to the branch you checked out.

\n", + "group": "checkout" + }, + "git_checkout_index": { + "type": "function", + "file": "git2/checkout.h", + "line": 444, + "lineto": 447, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "repository into which to check out (must be non-bare)" + }, + { + "name": "index", + "type": "git_index *", + "comment": "index to be checked out (or NULL to use repository index)" + }, + { + "name": "opts", + "type": "const git_checkout_options *", + "comment": "specifies checkout options (may be NULL)" + } + ], + "argline": "git_repository *repo, git_index *index, const git_checkout_options *opts", + "sig": "git_repository *::git_index *::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use git_error_last for error details)" + }, + "description": "

Updates files in the working tree to match the content of the index.

\n", + "comments": "", + "group": "checkout" + }, + "git_checkout_tree": { + "type": "function", + "file": "git2/checkout.h", + "line": 460, + "lineto": 463, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to check out (must be non-bare)" + }, + { + "name": "treeish", + "type": "const git_object *", + "comment": "a commit, tag or tree which content will be used to update\n the working directory (or NULL to use HEAD)" + }, + { + "name": "opts", + "type": "const git_checkout_options *", + "comment": "specifies checkout options (may be NULL)" + } + ], + "argline": "git_repository *repo, const git_object *treeish, const git_checkout_options *opts", + "sig": "git_repository *::const git_object *::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use git_error_last for error details)" + }, + "description": "

Updates files in the index and working tree to match the content of the\n tree pointed at by the treeish.

\n", + "comments": "", + "group": "checkout", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_checkout_tree-8"], + "merge.c": ["ex/v1.9.1/merge.html#git_checkout_tree-5"] + } + }, + "git_cherrypick_options_init": { + "type": "function", + "file": "git2/cherrypick.h", + "line": 57, + "lineto": 59, + "args": [ + { + "name": "opts", + "type": "git_cherrypick_options *", + "comment": "The `git_cherrypick_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`." + } + ], + "argline": "git_cherrypick_options *opts, unsigned int version", + "sig": "git_cherrypick_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_cherrypick_options structure

\n", + "comments": "

Initializes a git_cherrypick_options with default values. Equivalent to creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n", + "group": "cherrypick" + }, + "git_cherrypick_commit": { + "type": "function", + "file": "git2/cherrypick.h", + "line": 75, + "lineto": 81, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository that contains the given commits" + }, + { + "name": "cherrypick_commit", + "type": "git_commit *", + "comment": "the commit to cherry-pick" + }, + { + "name": "our_commit", + "type": "git_commit *", + "comment": "the commit to cherry-pick against (eg, HEAD)" + }, + { + "name": "mainline", + "type": "unsigned int", + "comment": "the parent of the `cherrypick_commit`, if it is a merge" + }, + { + "name": "merge_options", + "type": "const git_merge_options *", + "comment": "the merge options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, git_commit *cherrypick_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options", + "sig": "git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Cherry-picks the given commit against the given "our" commit, producing an\n index that reflects the result of the cherry-pick.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "cherrypick" + }, + "git_cherrypick": { + "type": "function", + "file": "git2/cherrypick.h", + "line": 91, + "lineto": 94, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to cherry-pick" + }, + { + "name": "commit", + "type": "git_commit *", + "comment": "the commit to cherry-pick" + }, + { + "name": "cherrypick_options", + "type": "const git_cherrypick_options *", + "comment": "the cherry-pick options (or null for defaults)" + } + ], + "argline": "git_repository *repo, git_commit *commit, const git_cherrypick_options *cherrypick_options", + "sig": "git_repository *::git_commit *::const git_cherrypick_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Cherry-pick the given commit, producing changes in the index and working directory.

\n", + "comments": "", + "group": "cherrypick" + }, + "git_clone_options_init": { + "type": "function", + "file": "git2/clone.h", + "line": 192, + "lineto": 194, + "args": [ + { + "name": "opts", + "type": "git_clone_options *", + "comment": "The `git_clone_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_CLONE_OPTIONS_VERSION`." + } + ], + "argline": "git_clone_options *opts, unsigned int version", + "sig": "git_clone_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_clone_options structure

\n", + "comments": "

Initializes a git_clone_options with default values. Equivalent to creating an instance with GIT_CLONE_OPTIONS_INIT.

\n", + "group": "clone" + }, + "git_clone": { + "type": "function", + "file": "git2/clone.h", + "line": 216, + "lineto": 220, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "pointer that will receive the resulting repository object" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote repository to clone" + }, + { + "name": "local_path", + "type": "const char *", + "comment": "local directory to clone to" + }, + { + "name": "options", + "type": "const git_clone_options *", + "comment": "configuration options for the clone. If NULL, the\n function works as though GIT_OPTIONS_INIT were passed." + } + ], + "argline": "git_repository **out, const char *url, const char *local_path, const git_clone_options *options", + "sig": "git_repository **::const char *::const char *::const git_clone_options *", + "return": { + "type": "int", + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `git_error_last` for a detailed error message)" + }, + "description": "

Clone a remote repository.

\n", + "comments": "

By default this creates its repository and initial remote to match git's defaults. You can use the options in the callback to customize how these are created.

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "clone" + }, + "git_commit_lookup": { + "type": "function", + "file": "git2/commit.h", + "line": 40, + "lineto": 41, + "args": [ + { + "name": "commit", + "type": "git_commit **", + "comment": "pointer to the looked up commit" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the commit." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the commit to locate. If the object is\n\t\tan annotated tag it will be peeled back to the commit." + } + ], + "argline": "git_commit **commit, git_repository *repo, const git_oid *id", + "sig": "git_commit **::git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a commit object from a repository.

\n", + "comments": "

The returned object should be released with git_commit_free when no longer needed.

\n", + "group": "commit", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_commit_lookup-9"], + "general.c": [ + "ex/v1.9.1/general.html#git_commit_lookup-6", + "ex/v1.9.1/general.html#git_commit_lookup-7", + "ex/v1.9.1/general.html#git_commit_lookup-8" + ], + "log.c": ["ex/v1.9.1/log.html#git_commit_lookup-1"], + "merge.c": ["ex/v1.9.1/merge.html#git_commit_lookup-6"] + } + }, + "git_commit_lookup_prefix": { + "type": "function", + "file": "git2/commit.h", + "line": 59, + "lineto": 60, + "args": [ + { + "name": "commit", + "type": "git_commit **", + "comment": "pointer to the looked up commit" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the commit." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the commit to locate. If the object is\n\t\tan annotated tag it will be peeled back to the commit." + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the short identifier" + } + ], + "argline": "git_commit **commit, git_repository *repo, const git_oid *id, size_t len", + "sig": "git_commit **::git_repository *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a commit object from a repository, given a prefix of its\n identifier (short id).

\n", + "comments": "

The returned object should be released with git_commit_free when no longer needed.

\n", + "group": "commit" + }, + "git_commit_free": { + "type": "function", + "file": "git2/commit.h", + "line": 74, + "lineto": 74, + "args": [ + { + "name": "commit", + "type": "git_commit *", + "comment": "the commit to close" + } + ], + "argline": "git_commit *commit", + "sig": "git_commit *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open commit

\n", + "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT: It is necessary to call this method when you stop using a commit. Failure to do so will cause a memory leak.

\n", + "group": "commit", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_commit_free-10"], + "general.c": [ + "ex/v1.9.1/general.html#git_commit_free-9", + "ex/v1.9.1/general.html#git_commit_free-10", + "ex/v1.9.1/general.html#git_commit_free-11", + "ex/v1.9.1/general.html#git_commit_free-12", + "ex/v1.9.1/general.html#git_commit_free-13" + ], + "log.c": [ + "ex/v1.9.1/log.html#git_commit_free-2", + "ex/v1.9.1/log.html#git_commit_free-3", + "ex/v1.9.1/log.html#git_commit_free-4", + "ex/v1.9.1/log.html#git_commit_free-5" + ] + } + }, + "git_commit_id": { + "type": "function", + "file": "git2/commit.h", + "line": 82, + "lineto": 82, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const git_oid *", + "comment": " object identity for the commit." + }, + "description": "

Get the id of a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_commit_id-14"], + "log.c": ["ex/v1.9.1/log.html#git_commit_id-6"] + } + }, + "git_commit_owner": { + "type": "function", + "file": "git2/commit.h", + "line": 90, + "lineto": 90, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "A previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this commit." + }, + "description": "

Get the repository that contains the commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "log.c": [ + "ex/v1.9.1/log.html#git_commit_owner-7", + "ex/v1.9.1/log.html#git_commit_owner-8" + ] + } + }, + "git_commit_message_encoding": { + "type": "function", + "file": "git2/commit.h", + "line": 102, + "lineto": 102, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { "type": "const char *", "comment": " NULL, or the encoding" }, + "description": "

Get the encoding for the message of a commit,\n as a string representing a standard encoding name.

\n", + "comments": "

The encoding may be NULL if the encoding header in the commit is missing; in that case UTF-8 is assumed.

\n", + "group": "commit" + }, + "git_commit_message": { + "type": "function", + "file": "git2/commit.h", + "line": 113, + "lineto": 113, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const char *", + "comment": " the message of a commit" + }, + "description": "

Get the full message of a commit.

\n", + "comments": "

The returned message will be slightly prettified by removing any potential leading newlines.

\n", + "group": "commit", + "examples": { + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_commit_message-3", + "ex/v1.9.1/cat-file.html#git_commit_message-4" + ], + "general.c": [ + "ex/v1.9.1/general.html#git_commit_message-15", + "ex/v1.9.1/general.html#git_commit_message-16", + "ex/v1.9.1/general.html#git_commit_message-17" + ], + "log.c": [ + "ex/v1.9.1/log.html#git_commit_message-9", + "ex/v1.9.1/log.html#git_commit_message-10", + "ex/v1.9.1/log.html#git_commit_message-11" + ], + "tag.c": ["ex/v1.9.1/tag.html#git_commit_message-2"] + } + }, + "git_commit_message_raw": { + "type": "function", + "file": "git2/commit.h", + "line": 121, + "lineto": 121, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const char *", + "comment": " the raw message of a commit" + }, + "description": "

Get the full raw message of a commit.

\n", + "comments": "", + "group": "commit" + }, + "git_commit_summary": { + "type": "function", + "file": "git2/commit.h", + "line": 132, + "lineto": 132, + "args": [ + { + "name": "commit", + "type": "git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "git_commit *commit", + "sig": "git_commit *", + "return": { + "type": "const char *", + "comment": " the summary of a commit or NULL on error" + }, + "description": "

Get the short "summary" of the git commit message.

\n", + "comments": "

The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.

\n", + "group": "commit" + }, + "git_commit_body": { + "type": "function", + "file": "git2/commit.h", + "line": 145, + "lineto": 145, + "args": [ + { + "name": "commit", + "type": "git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "git_commit *commit", + "sig": "git_commit *", + "return": { + "type": "const char *", + "comment": " the body of a commit or NULL when no the message only\n consists of a summary" + }, + "description": "

Get the long "body" of the git commit message.

\n", + "comments": "

The returned message is the body of the commit, comprising everything but the first paragraph of the message. Leading and trailing whitespaces are trimmed.

\n", + "group": "commit" + }, + "git_commit_time": { + "type": "function", + "file": "git2/commit.h", + "line": 153, + "lineto": 153, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { "type": "git_time_t", "comment": " the time of a commit" }, + "description": "

Get the commit time (i.e. committer time) of a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_commit_time-18", + "ex/v1.9.1/general.html#git_commit_time-19" + ] + } + }, + "git_commit_time_offset": { + "type": "function", + "file": "git2/commit.h", + "line": 161, + "lineto": 161, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "int", + "comment": " positive or negative timezone offset, in minutes from UTC" + }, + "description": "

Get the commit timezone offset (i.e. committer's preferred timezone) of a commit.

\n", + "comments": "", + "group": "commit" + }, + "git_commit_committer": { + "type": "function", + "file": "git2/commit.h", + "line": 169, + "lineto": 169, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const git_signature *", + "comment": " the committer of a commit" + }, + "description": "

Get the committer of a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_committer-5"], + "general.c": ["ex/v1.9.1/general.html#git_commit_committer-20"], + "log.c": ["ex/v1.9.1/log.html#git_commit_committer-12"] + } + }, + "git_commit_author": { + "type": "function", + "file": "git2/commit.h", + "line": 177, + "lineto": 177, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const git_signature *", + "comment": " the author of a commit" + }, + "description": "

Get the author of a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_author-6"], + "general.c": [ + "ex/v1.9.1/general.html#git_commit_author-21", + "ex/v1.9.1/general.html#git_commit_author-22" + ], + "log.c": [ + "ex/v1.9.1/log.html#git_commit_author-13", + "ex/v1.9.1/log.html#git_commit_author-14" + ] + } + }, + "git_commit_committer_with_mailmap": { + "type": "function", + "file": "git2/commit.h", + "line": 190, + "lineto": 191, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "a pointer to store the resolved signature." + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "mailmap", + "type": "const git_mailmap *", + "comment": "the mailmap to resolve with. (may be NULL)" + } + ], + "argline": "git_signature **out, const git_commit *commit, const git_mailmap *mailmap", + "sig": "git_signature **::const git_commit *::const git_mailmap *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the committer of a commit, using the mailmap to map names and email\n addresses to canonical real names and email addresses.

\n", + "comments": "

Call git_signature_free to free the signature.

\n", + "group": "commit" + }, + "git_commit_author_with_mailmap": { + "type": "function", + "file": "git2/commit.h", + "line": 204, + "lineto": 205, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "a pointer to store the resolved signature." + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "mailmap", + "type": "const git_mailmap *", + "comment": "the mailmap to resolve with. (may be NULL)" + } + ], + "argline": "git_signature **out, const git_commit *commit, const git_mailmap *mailmap", + "sig": "git_signature **::const git_commit *::const git_mailmap *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the author of a commit, using the mailmap to map names and email\n addresses to canonical real names and email addresses.

\n", + "comments": "

Call git_signature_free to free the signature.

\n", + "group": "commit" + }, + "git_commit_raw_header": { + "type": "function", + "file": "git2/commit.h", + "line": 213, + "lineto": 213, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit" + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const char *", + "comment": " the header text of the commit" + }, + "description": "

Get the full raw text of the commit header.

\n", + "comments": "", + "group": "commit" + }, + "git_commit_tree": { + "type": "function", + "file": "git2/commit.h", + "line": 222, + "lineto": 222, + "args": [ + { + "name": "tree_out", + "type": "git_tree **", + "comment": "pointer where to store the tree object" + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "git_tree **tree_out, const git_commit *commit", + "sig": "git_tree **::const git_commit *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the tree pointed to by a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "log.c": [ + "ex/v1.9.1/log.html#git_commit_tree-15", + "ex/v1.9.1/log.html#git_commit_tree-16", + "ex/v1.9.1/log.html#git_commit_tree-17", + "ex/v1.9.1/log.html#git_commit_tree-18", + "ex/v1.9.1/log.html#git_commit_tree-19" + ] + } + }, + "git_commit_tree_id": { + "type": "function", + "file": "git2/commit.h", + "line": 232, + "lineto": 232, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const git_oid *", + "comment": " the id of tree pointed to by commit." + }, + "description": "

Get the id of the tree pointed to by a commit. This differs from\n git_commit_tree in that no attempts are made to fetch an object\n from the ODB.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_tree_id-7"] + } + }, + "git_commit_parentcount": { + "type": "function", + "file": "git2/commit.h", + "line": 240, + "lineto": 240, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "unsigned int", + "comment": " integer of count of parents" + }, + "description": "

Get the number of parents of this commit

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_parentcount-8"], + "general.c": ["ex/v1.9.1/general.html#git_commit_parentcount-23"], + "log.c": [ + "ex/v1.9.1/log.html#git_commit_parentcount-20", + "ex/v1.9.1/log.html#git_commit_parentcount-21" + ] + } + }, + "git_commit_parent": { + "type": "function", + "file": "git2/commit.h", + "line": 250, + "lineto": 253, + "args": [ + { + "name": "out", + "type": "git_commit **", + "comment": "Pointer where to store the parent commit" + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "n", + "type": "unsigned int", + "comment": "the position of the parent (from 0 to `parentcount`)" + } + ], + "argline": "git_commit **out, const git_commit *commit, unsigned int n", + "sig": "git_commit **::const git_commit *::unsigned int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the specified parent of the commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_commit_parent-24"], + "log.c": [ + "ex/v1.9.1/log.html#git_commit_parent-22", + "ex/v1.9.1/log.html#git_commit_parent-23" + ] + } + }, + "git_commit_parent_id": { + "type": "function", + "file": "git2/commit.h", + "line": 264, + "lineto": 266, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "n", + "type": "unsigned int", + "comment": "the position of the parent (from 0 to `parentcount`)" + } + ], + "argline": "const git_commit *commit, unsigned int n", + "sig": "const git_commit *::unsigned int", + "return": { + "type": "const git_oid *", + "comment": " the id of the parent, NULL on error." + }, + "description": "

Get the oid of a specified parent for a commit. This is different from\n git_commit_parent, which will attempt to load the parent commit from\n the ODB.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_commit_parent_id-9"], + "log.c": ["ex/v1.9.1/log.html#git_commit_parent_id-24"] + } + }, + "git_commit_nth_gen_ancestor": { + "type": "function", + "file": "git2/commit.h", + "line": 282, + "lineto": 285, + "args": [ + { + "name": "ancestor", + "type": "git_commit **", + "comment": "Pointer where to store the ancestor commit" + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "n", + "type": "unsigned int", + "comment": "the requested generation" + } + ], + "argline": "git_commit **ancestor, const git_commit *commit, unsigned int n", + "sig": "git_commit **::const git_commit *::unsigned int", + "return": { + "type": "int", + "comment": " 0 on success; GIT_ENOTFOUND if no matching ancestor exists\n or an error code" + }, + "description": "

Get the commit object that is the \n<n

\n\n
\n

th generation ancestor\n of the named commit object, following only the first parents.\n The returned commit has to be freed by the caller.

\n
\n", + "comments": "

Passing 0 as the generation number returns another instance of the base commit itself.

\n", + "group": "commit" + }, + "git_commit_header_field": { + "type": "function", + "file": "git2/commit.h", + "line": 297, + "lineto": 297, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer to fill; existing content will be\n overwritten" + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "the commit to look in" + }, + { + "name": "field", + "type": "const char *", + "comment": "the header field to return" + } + ], + "argline": "git_buf *out, const git_commit *commit, const char *field", + "sig": "git_buf *::const git_commit *::const char *", + "return": { + "type": "int", + "comment": " 0 on succeess, GIT_ENOTFOUND if the field does not exist,\n or an error code" + }, + "description": "

Get an arbitrary header field

\n", + "comments": "", + "group": "commit" + }, + "git_commit_extract_signature": { + "type": "function", + "file": "git2/commit.h", + "line": 317, + "lineto": 317, + "args": [ + { + "name": "signature", + "type": "git_buf *", + "comment": "the signature block; existing content will be\n overwritten" + }, + { + "name": "signed_data", + "type": "git_buf *", + "comment": "signed data; this is the commit contents minus the signature block;\n existing content will be overwritten" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which the commit exists" + }, + { + "name": "commit_id", + "type": "git_oid *", + "comment": "the commit from which to extract the data" + }, + { + "name": "field", + "type": "const char *", + "comment": "the name of the header field containing the signature\n block; pass `NULL` to extract the default 'gpgsig'" + } + ], + "argline": "git_buf *signature, git_buf *signed_data, git_repository *repo, git_oid *commit_id, const char *field", + "sig": "git_buf *::git_buf *::git_repository *::git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if the id is not for a commit\n or the commit does not have a signature." + }, + "description": "

Extract the signature from a commit

\n", + "comments": "

If the id is not for a commit, the error class will be GIT_ERROR_INVALID. If the commit does not have a signature, the error class will be GIT_ERROR_OBJECT.

\n", + "group": "commit" + }, + "git_commit_create": { + "type": "function", + "file": "git2/commit.h", + "line": 363, + "lineto": 373, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer in which to store the OID of the newly created commit" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the commit" + }, + { + "name": "update_ref", + "type": "const char *", + "comment": "If not NULL, name of the reference that\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch." + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "Signature with author and author time of commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "Signature with committer and * commit time of commit" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed." + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this commit" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`." + }, + { + "name": "parent_count", + "type": "size_t", + "comment": "Number of parents for this commit" + }, + { + "name": "parents", + "type": "const git_commit *[]", + "comment": "Array of `parent_count` pointers to `git_commit`\n objects that will be used as the parents for this commit. This\n array may be NULL if `parent_count` is 0 (root commit). All the\n given commits must be owned by the `repo`." + } + ], + "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]", + "return": { + "type": "int", + "comment": " 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it" + }, + "description": "

Create new commit in the repository from a list of git_object pointers

\n", + "comments": "

The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.

\n", + "group": "commit", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_commit_create-7"] } + }, + "git_commit_create_v": { + "type": "function", + "file": "git2/commit.h", + "line": 420, + "lineto": 430, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer in which to store the OID of the newly created commit" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the commit" + }, + { + "name": "update_ref", + "type": "const char *", + "comment": "If not NULL, name of the reference that\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch." + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "Signature with author and author time of commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "Signature with committer and * commit time of commit" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed." + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this commit" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`." + }, + { + "name": "parent_count", + "type": "size_t", + "comment": "Number of parents for this commit" + } + ], + "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t", + "return": { + "type": "int", + "comment": " 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it" + }, + "description": "

Create new commit in the repository using a variable argument list.

\n", + "comments": "

The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.

\n\n

The parents for the commit are specified as a variable list of pointers to const git_commit *. Note that this is a convenience method which may not be safe to export for certain languages or compilers

\n\n

All other parameters remain the same as git_commit_create().

\n", + "group": "commit", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_commit_create_v-1"], + "general.c": ["ex/v1.9.1/general.html#git_commit_create_v-25"], + "init.c": ["ex/v1.9.1/init.html#git_commit_create_v-1"] + } + }, + "git_commit_create_from_stage": { + "type": "function", + "file": "git2/commit.h", + "line": 472, + "lineto": 476, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "pointer to store the new commit's object id" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to commit changes in" + }, + { + "name": "message", + "type": "const char *", + "comment": "the commit message" + }, + { + "name": "opts", + "type": "const git_commit_create_options *", + "comment": "options for creating the commit" + } + ], + "argline": "git_oid *id, git_repository *repo, const char *message, const git_commit_create_options *opts", + "sig": "git_oid *::git_repository *::const char *::const git_commit_create_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNCHANGED if there were no changes to commit, or an error code" + }, + "description": "

Commits the staged changes in the repository; this is a near analog to\n git commit -m message.

\n", + "comments": "

By default, empty commits are not allowed.

\n", + "group": "commit" + }, + "git_commit_amend": { + "type": "function", + "file": "git2/commit.h", + "line": 528, + "lineto": 536, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer in which to store the OID of the newly created commit" + }, + { + "name": "commit_to_amend", + "type": "const git_commit *", + "comment": "The commit to amend" + }, + { + "name": "update_ref", + "type": "const char *", + "comment": "If not NULL, name of the reference that\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch." + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "Signature with author and author time of commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "Signature with committer and * commit time of commit" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed." + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this commit" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`." + } + ], + "argline": "git_oid *id, const git_commit *commit_to_amend, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree", + "sig": "git_oid *::const git_commit *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *", + "return": { + "type": "int", + "comment": " 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it" + }, + "description": "

Amend an existing commit by replacing only non-NULL values.

\n", + "comments": "

This creates a new commit that is exactly the same as the old commit, except that any non-NULL values will be updated. The new commit has the same parents as the old commit.

\n\n

The update_ref value works as in the regular git_commit_create(), updating the ref to point to the newly rewritten commit. If you want to amend a commit that is not currently the tip of the branch and then rewrite the following commits to reach a ref, pass this as NULL and update the rest of the commit chain and ref separately.

\n\n

Unlike git_commit_create(), the author, committer, message, message_encoding, and tree parameters can be NULL in which case this will use the values from the original commit_to_amend.

\n\n

All parameters have the same meanings as in git_commit_create().

\n", + "group": "commit" + }, + "git_commit_create_buffer": { + "type": "function", + "file": "git2/commit.h", + "line": 573, + "lineto": 582, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer into which to write the commit object content" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where the referenced tree and parents live" + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "Signature with author and author time of commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "Signature with committer and * commit time of commit" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed." + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this commit" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`." + }, + { + "name": "parent_count", + "type": "size_t", + "comment": "Number of parents for this commit" + }, + { + "name": "parents", + "type": "const git_commit *[]", + "comment": "Array of `parent_count` pointers to `git_commit`\n objects that will be used as the parents for this commit. This\n array may be NULL if `parent_count` is 0 (root commit). All the\n given commits must be owned by the `repo`." + } + ], + "argline": "git_buf *out, git_repository *repo, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents", + "sig": "git_buf *::git_repository *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a commit and write it into a buffer

\n", + "comments": "

Create a commit as with git_commit_create() but instead of writing it to the objectdb, write the contents of the object into a buffer.

\n", + "group": "commit" + }, + "git_commit_create_with_signature": { + "type": "function", + "file": "git2/commit.h", + "line": 600, + "lineto": 605, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "the resulting commit id" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to create the commit in." + }, + { + "name": "commit_content", + "type": "const char *", + "comment": "the content of the unsigned commit object" + }, + { + "name": "signature", + "type": "const char *", + "comment": "the signature to add to the commit. Leave `NULL`\n to create a commit without adding a signature field." + }, + { + "name": "signature_field", + "type": "const char *", + "comment": "which header field should contain this\n signature. Leave `NULL` for the default of \"gpgsig\"" + } + ], + "argline": "git_oid *out, git_repository *repo, const char *commit_content, const char *signature, const char *signature_field", + "sig": "git_oid *::git_repository *::const char *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a commit object from the given buffer and signature

\n", + "comments": "

Given the unsigned commit object's contents, its signature and the header field in which to store the signature, attach the signature to the commit and write it into the given repository.

\n", + "group": "commit" + }, + "git_commit_dup": { + "type": "function", + "file": "git2/commit.h", + "line": 615, + "lineto": 615, + "args": [ + { + "name": "out", + "type": "git_commit **", + "comment": "Pointer to store the copy of the commit" + }, + { + "name": "source", + "type": "git_commit *", + "comment": "Original commit to copy" + } + ], + "argline": "git_commit **out, git_commit *source", + "sig": "git_commit **::git_commit *", + "return": { "type": "int", "comment": " 0" }, + "description": "

Create an in-memory copy of a commit. The copy must be explicitly\n free'd or it will leak.

\n", + "comments": "", + "group": "commit" + }, + "git_commitarray_dispose": { + "type": "function", + "file": "git2/commit.h", + "line": 670, + "lineto": 670, + "args": [ + { + "name": "array", + "type": "git_commitarray *", + "comment": "The git_commitarray that contains commits to free" + } + ], + "argline": "git_commitarray *array", + "sig": "git_commitarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the commits contained in a commit array. This method should\n be called on git_commitarray objects that were provided by the\n library. Not doing so will result in a memory leak.

\n", + "comments": "

This does not free the git_commitarray itself, since the library will never allocate that object directly itself.

\n", + "group": "commitarray" + }, + "git_libgit2_version": { + "type": "function", + "file": "git2/common.h", + "line": 119, + "lineto": 119, + "args": [ + { + "name": "major", + "type": "int *", + "comment": "Store the major version number" + }, + { + "name": "minor", + "type": "int *", + "comment": "Store the minor version number" + }, + { + "name": "rev", + "type": "int *", + "comment": "Store the revision (patch) number" + } + ], + "argline": "int *major, int *minor, int *rev", + "sig": "int *::int *::int *", + "return": { + "type": "int", + "comment": " 0 on success or an error code on failure" + }, + "description": "

Return the version of the libgit2 library\n being currently used.

\n", + "comments": "", + "group": "libgit2" + }, + "git_libgit2_prerelease": { + "type": "function", + "file": "git2/common.h", + "line": 130, + "lineto": 130, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "const char *", + "comment": " the name of the prerelease state or NULL" + }, + "description": "

Return the prerelease state of the libgit2 library currently being\n used. For nightly builds during active development, this will be\n "alpha". Releases may have a "beta" or release candidate ("rc1",\n "rc2", etc) prerelease. For a final release, this function returns\n NULL.

\n", + "comments": "", + "group": "libgit2" + }, + "git_libgit2_features": { + "type": "function", + "file": "git2/common.h", + "line": 184, + "lineto": 184, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " A combination of GIT_FEATURE_* values." + }, + "description": "

Query compile time options for libgit2.

\n", + "comments": "", + "group": "libgit2" + }, + "git_libgit2_feature_backend": { + "type": "function", + "file": "git2/common.h", + "line": 205, + "lineto": 206, + "args": [ + { + "name": "feature", + "type": "git_feature_t", + "comment": "the feature to query details for" + } + ], + "argline": "git_feature_t feature", + "sig": "git_feature_t", + "return": { + "type": "const char *", + "comment": " the provider details, or NULL if the feature is not supported" + }, + "description": "

Query the backend details for the compile-time feature in libgit2.

\n", + "comments": "

This will return the "backend" for the feature, which is useful for things like HTTPS or SSH support, that can have multiple backends that could be compiled in.

\n\n

For example, when libgit2 is compiled with dynamic OpenSSL support, the feature backend will be openssl-dynamic. The feature backend names reflect the compilation options specified to the build system (though in all lower case). The backend may be "builtin" for features that are provided by libgit2 itself.

\n\n

If the feature is not supported by the library, this API returns NULL.

\n", + "group": "libgit2" + }, + "git_libgit2_opts": { + "type": "function", + "file": "git2/common.h", + "line": 569, + "lineto": 569, + "args": [{ "name": "option", "type": "int", "comment": "Option key" }], + "argline": "int option", + "sig": "int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Set or query a library global option

\n", + "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    > Set the maximum amount of memory that can be mapped at any time       > by the library\n\n* opts(GIT_OPT_GET_MWINDOW_FILE_LIMIT, size_t *):\n\n    > Get the maximum number of files that will be mapped at any time by the        > library\n\n* opts(GIT_OPT_SET_MWINDOW_FILE_LIMIT, size_t):\n\n    > Set the maximum number of files that can be mapped at any time        > by the library. The default (0) is unlimited.\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_object_t type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJECT_BLOB (i.e. won't cache blobs) and 4k     > for GIT_OBJECT_COMMIT, GIT_OBJECT_TREE, and GIT_OBJECT_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Calling `GIT_OPT_ADD_SSL_X509_CERT` may override the      > data in `path`.       >       > Either parameter may be `NULL`, but not both.\n
\n\n\n\n

opts(GIT_OPT_SET_ODB_PACKED_PRIORITY, int priority) > Override the default priority of the packed ODB backend which > is added when default backends are assigned to a repository

\n\n

opts(GIT_OPT_SET_ODB_LOOSE_PRIORITY, int priority) > Override the default priority of the loose ODB backend which > is added when default backends are assigned to a repository

\n\n

opts(GIT_OPT_GET_EXTENSIONS, git_strarray *out) > Returns the list of git extensions that are supported. This > is the list of built-in extensions supported by libgit2 and > custom extensions that have been added with > GIT_OPT_SET_EXTENSIONS. Extensions that have been negated > will not be returned. The returned list should be released > with git_strarray_dispose.

\n\n

opts(GIT_OPT_SET_EXTENSIONS, const char **extensions, size_t len) > Set that the given git extensions are supported by the caller. > Extensions supported by libgit2 may be negated by prefixing > them with a !. For example: setting extensions to > { "!noop", "newext" } indicates that the caller does not want > to support repositories with the noop extension but does want > to support repositories with the newext extension.

\n\n

opts(GIT_OPT_GET_OWNER_VALIDATION, int *enabled) > Gets the owner validation setting for repository > directories.

\n\n

opts(GIT_OPT_SET_OWNER_VALIDATION, int enabled) > Set that repository directories should be owned by the current > user. The default is to validate ownership.

\n\n

opts(GIT_OPT_GET_HOMEDIR, git_buf *out) > Gets the current user's home directory, as it will be used > for file lookups. The path is written to the out buffer.

\n\n

opts(GIT_OPT_SET_HOMEDIR, const char *path) > Sets the directory used as the current user's home directory, > for file lookups. > > - path directory of home directory.

\n\n

opts(GIT_OPT_GET_SERVER_CONNECT_TIMEOUT, int *timeout) > Gets the timeout (in milliseconds) to attempt connections to > a remote server.

\n\n

opts(GIT_OPT_SET_SERVER_CONNECT_TIMEOUT, int timeout) > Sets the timeout (in milliseconds) to attempt connections to > a remote server. Set to 0 to use the system default. Note that > this may not be able to be configured longer than the system > default, typically 75 seconds.

\n\n

opts(GIT_OPT_GET_SERVER_TIMEOUT, int *timeout) > Gets the timeout (in milliseconds) for reading from and writing > to a remote server.

\n\n

opts(GIT_OPT_SET_SERVER_TIMEOUT, int timeout) > Sets the timeout (in milliseconds) for reading from and writing > to a remote server. Set to 0 to use the system default.

\n", + "group": "libgit2" + }, + "git_config_entry_free": { + "type": "function", + "file": "git2/config.h", + "line": 131, + "lineto": 131, + "args": [ + { + "name": "entry", + "type": "git_config_entry *", + "comment": "The entry to free." + } + ], + "argline": "git_config_entry *entry", + "sig": "git_config_entry *", + "return": { "type": "void", "comment": null }, + "description": "

Free a config entry.

\n", + "comments": "", + "group": "config", + "examples": { + "config.c": [ + "ex/v1.9.1/config.html#git_config_entry_free-1", + "ex/v1.9.1/config.html#git_config_entry_free-2" + ] + } + }, + "git_config_find_global": { + "type": "function", + "file": "git2/config.h", + "line": 183, + "lineto": 183, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a global configuration file has been found. Its path will be stored in `out`." + }, + "description": "

Locate the path to the global configuration file

\n", + "comments": "

The user or global configuration file is usually located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that file, if the file exists. The returned path may be used on any git_config call to load the global configuration file.

\n\n

This method will not guess the path to the xdg compatible config file (.config/git/config).

\n", + "group": "config" + }, + "git_config_find_xdg": { + "type": "function", + "file": "git2/config.h", + "line": 200, + "lineto": 200, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a xdg compatible configuration file has been\n\tfound. Its path will be stored in `out`." + }, + "description": "

Locate the path to the global xdg compatible configuration file

\n", + "comments": "

The xdg compatible configuration file is usually located in $HOME/.config/git/config.

\n\n

This method will try to guess the full path to that file, if the file exists. The returned path may be used on any git_config call to load the xdg compatible configuration file.

\n", + "group": "config" + }, + "git_config_find_system": { + "type": "function", + "file": "git2/config.h", + "line": 212, + "lineto": 212, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a system configuration file has been\n\tfound. Its path will be stored in `out`." + }, + "description": "

Locate the path to the system configuration file

\n", + "comments": "

If /etc/gitconfig doesn't exist, it will look for %PROGRAMFILES%.

\n", + "group": "config" + }, + "git_config_find_programdata": { + "type": "function", + "file": "git2/config.h", + "line": 223, + "lineto": 223, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a ProgramData configuration file has been\n\tfound. Its path will be stored in `out`." + }, + "description": "

Locate the path to the configuration file in ProgramData

\n", + "comments": "

Look for the file in %PROGRAMDATA% used by portable git.

\n", + "group": "config" + }, + "git_config_open_default": { + "type": "function", + "file": "git2/config.h", + "line": 235, + "lineto": 235, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "Pointer to store the config instance" + } + ], + "argline": "git_config **out", + "sig": "git_config **", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open the global, XDG and system configuration files

\n", + "comments": "

Utility wrapper that finds the global, XDG and system configuration files and opens them into a single prioritized config object that can be used when accessing default config data outside a repository.

\n", + "group": "config" + }, + "git_config_new": { + "type": "function", + "file": "git2/config.h", + "line": 246, + "lineto": 246, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "pointer to the new configuration" + } + ], + "argline": "git_config **out", + "sig": "git_config **", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Allocate a new configuration object

\n", + "comments": "

This object is empty, so you have to add a file to it before you can do anything with it.

\n", + "group": "config" + }, + "git_config_add_file_ondisk": { + "type": "function", + "file": "git2/config.h", + "line": 275, + "lineto": 280, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration to add the file to" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to the configuration file to add" + }, + { + "name": "level", + "type": "git_config_level_t", + "comment": "the priority level of the backend" + }, + { + "name": "repo", + "type": "const git_repository *", + "comment": "optional repository to allow parsing of\n conditional includes" + }, + { + "name": "force", + "type": "int", + "comment": "replace config file at the given priority level" + } + ], + "argline": "git_config *cfg, const char *path, git_config_level_t level, const git_repository *repo, int force", + "sig": "git_config *::const char *::git_config_level_t::const git_repository *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0),\n GIT_ENOTFOUND when the file doesn't exist or error code" + }, + "description": "

Add an on-disk config file instance to an existing config

\n", + "comments": "

The on-disk file pointed at by path will be opened and parsed; it's expected to be a native Git config file following the default Git config syntax (see man git-config).

\n\n

If the file does not exist, the file will still be added and it will be created the first time we write to it.

\n\n

Note that the configuration object will free the file automatically.

\n\n

Further queries on this config object will access each of the config file instances in order (instances with a higher priority level will be accessed first).

\n", + "group": "config" + }, + "git_config_open_ondisk": { + "type": "function", + "file": "git2/config.h", + "line": 294, + "lineto": 294, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "The configuration instance to create" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to the on-disk file to open" + } + ], + "argline": "git_config **out, const char *path", + "sig": "git_config **::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Create a new config instance containing a single on-disk file

\n", + "comments": "

This method is a simple utility wrapper for the following sequence of calls: - git_config_new - git_config_add_file_ondisk

\n", + "group": "config", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_config_open_ondisk-26"] + } + }, + "git_config_open_level": { + "type": "function", + "file": "git2/config.h", + "line": 312, + "lineto": 315, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "The configuration instance to create" + }, + { + "name": "parent", + "type": "const git_config *", + "comment": "Multi-level config to search for the given level" + }, + { + "name": "level", + "type": "git_config_level_t", + "comment": "Configuration level to search for" + } + ], + "argline": "git_config **out, const git_config *parent, git_config_level_t level", + "sig": "git_config **::const git_config *::git_config_level_t", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the passed level cannot be found in the\n multi-level parent config, or an error code" + }, + "description": "

Build a single-level focused config object from a multi-level one.

\n", + "comments": "

The returned config object can be used to perform get/set/delete operations on a single specific level.

\n\n

Getting several times the same level from the same parent multi-level config will return different config instances, but containing the same config_file instance.

\n", + "group": "config" + }, + "git_config_open_global": { + "type": "function", + "file": "git2/config.h", + "line": 330, + "lineto": 330, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "pointer in which to store the config object" + }, + { + "name": "config", + "type": "git_config *", + "comment": "the config object in which to look" + } + ], + "argline": "git_config **out, git_config *config", + "sig": "git_config **::git_config *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Open the global/XDG configuration file according to git's rules

\n", + "comments": "

Git allows you to store your global configuration at $HOME/.gitconfig or $XDG_CONFIG_HOME/git/config. For backwards compatibility, the XDG file shouldn't be used unless the use has created it explicitly. With this function you'll open the correct one to write to.

\n", + "group": "config" + }, + "git_config_set_writeorder": { + "type": "function", + "file": "git2/config.h", + "line": 343, + "lineto": 346, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration to change write order of" + }, + { + "name": "levels", + "type": "git_config_level_t *", + "comment": "the ordering of levels for writing" + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the levels array" + } + ], + "argline": "git_config *cfg, git_config_level_t *levels, size_t len", + "sig": "git_config *::git_config_level_t *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the write order for configuration backends. By default, the\n write ordering does not match the read ordering; for example, the\n worktree configuration is a high-priority for reading, but is not\n written to unless explicitly chosen.

\n", + "comments": "", + "group": "config" + }, + "git_config_snapshot": { + "type": "function", + "file": "git2/config.h", + "line": 362, + "lineto": 362, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "pointer in which to store the snapshot config object" + }, + { + "name": "config", + "type": "git_config *", + "comment": "configuration to snapshot" + } + ], + "argline": "git_config **out, git_config *config", + "sig": "git_config **::git_config *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a snapshot of the configuration

\n", + "comments": "

Create a snapshot of the current state of a configuration, which allows you to look into a consistent view of the configuration for looking up complex values (e.g. a remote, submodule).

\n\n

The string returned when querying such a config object is valid until it is freed.

\n", + "group": "config" + }, + "git_config_free": { + "type": "function", + "file": "git2/config.h", + "line": 369, + "lineto": 369, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration to free" + } + ], + "argline": "git_config *cfg", + "sig": "git_config *", + "return": { "type": "void", "comment": null }, + "description": "

Free the configuration and its associated memory and files

\n", + "comments": "", + "group": "config", + "examples": { + "config.c": ["ex/v1.9.1/config.html#git_config_free-3"], + "general.c": [ + "ex/v1.9.1/general.html#git_config_free-27", + "ex/v1.9.1/general.html#git_config_free-28" + ] + } + }, + "git_config_get_entry": { + "type": "function", + "file": "git2/config.h", + "line": 381, + "lineto": 384, + "args": [ + { + "name": "out", + "type": "git_config_entry **", + "comment": "pointer to the variable git_config_entry" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "git_config_entry **out, const git_config *cfg, const char *name", + "sig": "git_config_entry **::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the git_config_entry of a config variable.

\n", + "comments": "

Free the git_config_entry after use with git_config_entry_free().

\n", + "group": "config", + "examples": { + "config.c": ["ex/v1.9.1/config.html#git_config_get_entry-4"] + } + }, + "git_config_get_int32": { + "type": "function", + "file": "git2/config.h", + "line": 398, + "lineto": 398, + "args": [ + { + "name": "out", + "type": "int32_t *", + "comment": "pointer to the variable where the value should be stored" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "int32_t *out, const git_config *cfg, const char *name", + "sig": "int32_t *::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the value of an integer config variable.

\n", + "comments": "

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", + "group": "config", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_config_get_int32-29", + "ex/v1.9.1/general.html#git_config_get_int32-30" + ] + } + }, + "git_config_get_int64": { + "type": "function", + "file": "git2/config.h", + "line": 412, + "lineto": 412, + "args": [ + { + "name": "out", + "type": "int64_t *", + "comment": "pointer to the variable where the value should be stored" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "int64_t *out, const git_config *cfg, const char *name", + "sig": "int64_t *::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the value of a long integer config variable.

\n", + "comments": "

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_bool": { + "type": "function", + "file": "git2/config.h", + "line": 429, + "lineto": 429, + "args": [ + { + "name": "out", + "type": "int *", + "comment": "pointer to the variable where the value should be stored" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "int *out, const git_config *cfg, const char *name", + "sig": "int *::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the value of a boolean config variable.

\n", + "comments": "

This function uses the usual C convention of 0 being false and anything else true.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_path": { + "type": "function", + "file": "git2/config.h", + "line": 447, + "lineto": 447, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer in which to store the result" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "git_buf *out, const git_config *cfg, const char *name", + "sig": "git_buf *::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the value of a path config variable.

\n", + "comments": "

A leading '~' will be expanded to the global search path (which defaults to the user's home directory but can be overridden via git_libgit2_opts().

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_string": { + "type": "function", + "file": "git2/config.h", + "line": 465, + "lineto": 465, + "args": [ + { + "name": "out", + "type": "const char **", + "comment": "pointer to the string" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "const char **out, const git_config *cfg, const char *name", + "sig": "const char **::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the value of a string config variable.

\n", + "comments": "

This function can only be used on snapshot config objects. The string is owned by the config and should not be freed by the user. The pointer will be valid until the config is freed.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", + "group": "config", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_config_get_string-31", + "ex/v1.9.1/general.html#git_config_get_string-32" + ] + } + }, + "git_config_get_string_buf": { + "type": "function", + "file": "git2/config.h", + "line": 481, + "lineto": 481, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer in which to store the string" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "git_buf *out, const git_config *cfg, const char *name", + "sig": "git_buf *::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the value of a string config variable.

\n", + "comments": "

The value of the config will be copied into the buffer.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_multivar_foreach": { + "type": "function", + "file": "git2/config.h", + "line": 500, + "lineto": 500, + "args": [ + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "regular expression to filter which variables we're\n interested in. Use NULL to indicate all" + }, + { + "name": "callback", + "type": "git_config_foreach_cb", + "comment": "the function to be called on each value of the variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "opaque pointer to pass to the callback" + } + ], + "argline": "const git_config *cfg, const char *name, const char *regexp, git_config_foreach_cb callback, void *payload", + "sig": "const git_config *::const char *::const char *::git_config_foreach_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Get each value of a multivar in a foreach callback

\n", + "comments": "

The callback will be called on each variable found

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", + "group": "config" + }, + "git_config_multivar_iterator_new": { + "type": "function", + "file": "git2/config.h", + "line": 516, + "lineto": 516, + "args": [ + { + "name": "out", + "type": "git_config_iterator **", + "comment": "pointer to store the iterator" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "regular expression to filter which variables we're\n interested in. Use NULL to indicate all" + } + ], + "argline": "git_config_iterator **out, const git_config *cfg, const char *name, const char *regexp", + "sig": "git_config_iterator **::const git_config *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Get each value of a multivar

\n", + "comments": "

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", + "group": "config" + }, + "git_config_next": { + "type": "function", + "file": "git2/config.h", + "line": 528, + "lineto": 528, + "args": [ + { + "name": "entry", + "type": "git_config_entry **", + "comment": "pointer to store the entry" + }, + { + "name": "iter", + "type": "git_config_iterator *", + "comment": "the iterator" + } + ], + "argline": "git_config_entry **entry, git_config_iterator *iter", + "sig": "git_config_entry **::git_config_iterator *", + "return": { + "type": "int", + "comment": " 0 or an error code. GIT_ITEROVER if the iteration has completed" + }, + "description": "

Return the current entry and advance the iterator

\n", + "comments": "

The pointers returned by this function are valid until the next call to git_config_next or until the iterator is freed.

\n", + "group": "config" + }, + "git_config_iterator_free": { + "type": "function", + "file": "git2/config.h", + "line": 535, + "lineto": 535, + "args": [ + { + "name": "iter", + "type": "git_config_iterator *", + "comment": "the iterator to free" + } + ], + "argline": "git_config_iterator *iter", + "sig": "git_config_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Free a config iterator

\n", + "comments": "", + "group": "config" + }, + "git_config_set_int32": { + "type": "function", + "file": "git2/config.h", + "line": 546, + "lineto": 546, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "value", + "type": "int32_t", + "comment": "Integer value for the variable" + } + ], + "argline": "git_config *cfg, const char *name, int32_t value", + "sig": "git_config *::const char *::int32_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the value of an integer config variable in the config file\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_set_int64": { + "type": "function", + "file": "git2/config.h", + "line": 557, + "lineto": 557, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "value", + "type": "int64_t", + "comment": "Long integer value for the variable" + } + ], + "argline": "git_config *cfg, const char *name, int64_t value", + "sig": "git_config *::const char *::int64_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the value of a long integer config variable in the config file\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_set_bool": { + "type": "function", + "file": "git2/config.h", + "line": 568, + "lineto": 568, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { "name": "value", "type": "int", "comment": "the value to store" } + ], + "argline": "git_config *cfg, const char *name, int value", + "sig": "git_config *::const char *::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the value of a boolean config variable in the config file\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_set_string": { + "type": "function", + "file": "git2/config.h", + "line": 582, + "lineto": 582, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "value", + "type": "const char *", + "comment": "the string to store." + } + ], + "argline": "git_config *cfg, const char *name, const char *value", + "sig": "git_config *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the value of a string config variable in the config file\n with the highest level (usually the local one).

\n", + "comments": "

A copy of the string is made and the user is free to use it afterwards.

\n", + "group": "config", + "examples": { + "config.c": ["ex/v1.9.1/config.html#git_config_set_string-5"] + } + }, + "git_config_set_multivar": { + "type": "function", + "file": "git2/config.h", + "line": 595, + "lineto": 595, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "a regular expression to indicate which values to replace" + }, + { "name": "value", "type": "const char *", "comment": "the new value." } + ], + "argline": "git_config *cfg, const char *name, const char *regexp, const char *value", + "sig": "git_config *::const char *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Set a multivar in the local config file.

\n", + "comments": "

The regular expression is applied case-sensitively on the value.

\n", + "group": "config" + }, + "git_config_delete_entry": { + "type": "function", + "file": "git2/config.h", + "line": 605, + "lineto": 605, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable to delete" + } + ], + "argline": "git_config *cfg, const char *name", + "sig": "git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Delete a config variable from the config file\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_delete_multivar": { + "type": "function", + "file": "git2/config.h", + "line": 618, + "lineto": 618, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "where to look for the variables" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "a regular expression to indicate which values to delete" + } + ], + "argline": "git_config *cfg, const char *name, const char *regexp", + "sig": "git_config *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Deletes one or several entries from a multivar in the local config file.

\n", + "comments": "

The regular expression is applied case-sensitively on the value.

\n", + "group": "config" + }, + "git_config_foreach": { + "type": "function", + "file": "git2/config.h", + "line": 636, + "lineto": 639, + "args": [ + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to get the variables from" + }, + { + "name": "callback", + "type": "git_config_foreach_cb", + "comment": "the function to call on each variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "the data to pass to the callback" + } + ], + "argline": "const git_config *cfg, git_config_foreach_cb callback, void *payload", + "sig": "const git_config *::git_config_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Perform an operation on each config variable.

\n", + "comments": "

The callback receives the normalized name and value of each variable in the config backend, and the data pointer passed to this function. If the callback returns a non-zero value, the function stops iterating and returns that value to the caller.

\n\n

The pointers passed to the callback are only valid as long as the iteration is ongoing.

\n", + "group": "config" + }, + "git_config_iterator_new": { + "type": "function", + "file": "git2/config.h", + "line": 651, + "lineto": 651, + "args": [ + { + "name": "out", + "type": "git_config_iterator **", + "comment": "pointer to store the iterator" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to get the variables from" + } + ], + "argline": "git_config_iterator **out, const git_config *cfg", + "sig": "git_config_iterator **::const git_config *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Iterate over all the config variables

\n", + "comments": "

Use git_config_next to advance the iteration and git_config_iterator_free when done.

\n", + "group": "config" + }, + "git_config_iterator_glob_new": { + "type": "function", + "file": "git2/config.h", + "line": 668, + "lineto": 668, + "args": [ + { + "name": "out", + "type": "git_config_iterator **", + "comment": "pointer to store the iterator" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to ge the variables from" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "regular expression to match the names" + } + ], + "argline": "git_config_iterator **out, const git_config *cfg, const char *regexp", + "sig": "git_config_iterator **::const git_config *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Iterate over all the config variables whose name matches a pattern

\n", + "comments": "

Use git_config_next to advance the iteration and git_config_iterator_free when done.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", + "group": "config" + }, + "git_config_foreach_match": { + "type": "function", + "file": "git2/config.h", + "line": 690, + "lineto": 694, + "args": [ + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to get the variables from" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "regular expression to match against config names" + }, + { + "name": "callback", + "type": "git_config_foreach_cb", + "comment": "the function to call on each variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "the data to pass to the callback" + } + ], + "argline": "const git_config *cfg, const char *regexp, git_config_foreach_cb callback, void *payload", + "sig": "const git_config *::const char *::git_config_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 or the return value of the callback which didn't return 0" + }, + "description": "

Perform an operation on each config variable matching a regular expression.

\n", + "comments": "

This behaves like git_config_foreach with an additional filter of a regular expression that filters which config keys are passed to the callback.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the case-insensitive parts are lower-case.

\n", + "group": "config" + }, + "git_config_get_mapped": { + "type": "function", + "file": "git2/config.h", + "line": 730, + "lineto": 735, + "args": [ + { + "name": "out", + "type": "int *", + "comment": "place to store the result of the mapping" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "config file to get the variables from" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the config variable to lookup" + }, + { + "name": "maps", + "type": "const git_configmap *", + "comment": "array of `git_configmap` objects specifying the possible mappings" + }, + { + "name": "map_n", + "type": "size_t", + "comment": "number of mapping objects in `maps`" + } + ], + "argline": "int *out, const git_config *cfg, const char *name, const git_configmap *maps, size_t map_n", + "sig": "int *::const git_config *::const char *::const git_configmap *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, error code otherwise" + }, + "description": "

Query the value of a config variable and return it mapped to\n an integer constant.

\n", + "comments": "

This is a helper method to easily map different possible values to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_configmap autocrlf_mapping[] = {        {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},        {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},      {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},        {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison), the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be returned.

\n", + "group": "config" + }, + "git_config_lookup_map_value": { + "type": "function", + "file": "git2/config.h", + "line": 746, + "lineto": 750, + "args": [ + { + "name": "out", + "type": "int *", + "comment": "place to store the result of the parsing" + }, + { + "name": "maps", + "type": "const git_configmap *", + "comment": "array of `git_configmap` objects specifying the possible mappings" + }, + { + "name": "map_n", + "type": "size_t", + "comment": "number of mapping objects in `maps`" + }, + { "name": "value", "type": "const char *", "comment": "value to parse" } + ], + "argline": "int *out, const git_configmap *maps, size_t map_n, const char *value", + "sig": "int *::const git_configmap *::size_t::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Maps a string value to an integer constant

\n", + "comments": "", + "group": "config" + }, + "git_config_parse_bool": { + "type": "function", + "file": "git2/config.h", + "line": 763, + "lineto": 763, + "args": [ + { + "name": "out", + "type": "int *", + "comment": "place to store the result of the parsing" + }, + { "name": "value", "type": "const char *", "comment": "value to parse" } + ], + "argline": "int *out, const char *value", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Parse a string value as a bool.

\n", + "comments": "

Valid values for true are: 'true', 'yes', 'on', 1 or any number different from 0 Valid values for false are: 'false', 'no', 'off', 0

\n", + "group": "config" + }, + "git_config_parse_int32": { + "type": "function", + "file": "git2/config.h", + "line": 776, + "lineto": 776, + "args": [ + { + "name": "out", + "type": "int32_t *", + "comment": "place to store the result of the parsing" + }, + { "name": "value", "type": "const char *", "comment": "value to parse" } + ], + "argline": "int32_t *out, const char *value", + "sig": "int32_t *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Parse a string value as an int32.

\n", + "comments": "

An optional value suffix of 'k', 'm', or 'g' will cause the value to be multiplied by 1024, 1048576, or 1073741824 prior to output.

\n", + "group": "config" + }, + "git_config_parse_int64": { + "type": "function", + "file": "git2/config.h", + "line": 789, + "lineto": 789, + "args": [ + { + "name": "out", + "type": "int64_t *", + "comment": "place to store the result of the parsing" + }, + { "name": "value", "type": "const char *", "comment": "value to parse" } + ], + "argline": "int64_t *out, const char *value", + "sig": "int64_t *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Parse a string value as an int64.

\n", + "comments": "

An optional value suffix of 'k', 'm', or 'g' will cause the value to be multiplied by 1024, 1048576, or 1073741824 prior to output.

\n", + "group": "config" + }, + "git_config_parse_path": { + "type": "function", + "file": "git2/config.h", + "line": 805, + "lineto": 805, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "placae to store the result of parsing" + }, + { + "name": "value", + "type": "const char *", + "comment": "the path to evaluate" + } + ], + "argline": "git_buf *out, const char *value", + "sig": "git_buf *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Parse a string value as a path.

\n", + "comments": "

A leading '~' will be expanded to the global search path (which defaults to the user's home directory but can be overridden via git_libgit2_opts().

\n\n

If the value does not begin with a tilde, the input will be returned.

\n", + "group": "config" + }, + "git_config_backend_foreach_match": { + "type": "function", + "file": "git2/config.h", + "line": 824, + "lineto": 828, + "args": [ + { + "name": "backend", + "type": "git_config_backend *", + "comment": "where to get the variables from" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "regular expression to match against config names (can be NULL)" + }, + { + "name": "callback", + "type": "git_config_foreach_cb", + "comment": "the function to call on each variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "the data to pass to the callback" + } + ], + "argline": "git_config_backend *backend, const char *regexp, git_config_foreach_cb callback, void *payload", + "sig": "git_config_backend *::const char *::git_config_foreach_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Perform an operation on each config variable in a given config backend,\n matching a regular expression.

\n", + "comments": "

This behaves like git_config_foreach_match except that only config entries from the given backend entry are enumerated.

\n\n

The regular expression is applied case-sensitively on the normalized form of the variable name: the section and variable parts are lower-cased. The subsection is left unchanged.

\n", + "group": "config" + }, + "git_config_lock": { + "type": "function", + "file": "git2/config.h", + "line": 847, + "lineto": 847, + "args": [ + { + "name": "tx", + "type": "git_transaction **", + "comment": "the resulting transaction, use this to commit or undo the\n changes" + }, + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration in which to lock" + } + ], + "argline": "git_transaction **tx, git_config *cfg", + "sig": "git_transaction **::git_config *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lock the backend with the highest priority

\n", + "comments": "

Locking disallows anybody else from writing to that backend. Any updates made after locking will not be visible to a reader until the file is unlocked.

\n\n

You can apply the changes by calling git_transaction_commit() before freeing the transaction. Either of these actions will unlock the config.

\n", + "group": "config" + }, + "git_credential_free": { + "type": "function", + "file": "git2/credential.h", + "line": 149, + "lineto": 149, + "args": [ + { + "name": "cred", + "type": "git_credential *", + "comment": "the object to free" + } + ], + "argline": "git_credential *cred", + "sig": "git_credential *", + "return": { "type": "void", "comment": null }, + "description": "

Free a credential.

\n", + "comments": "

This is only necessary if you own the object; that is, if you are a transport.

\n", + "group": "credential" + }, + "git_credential_has_username": { + "type": "function", + "file": "git2/credential.h", + "line": 157, + "lineto": 157, + "args": [ + { + "name": "cred", + "type": "git_credential *", + "comment": "object to check" + } + ], + "argline": "git_credential *cred", + "sig": "git_credential *", + "return": { + "type": "int", + "comment": " 1 if the credential object has non-NULL username, 0 otherwise" + }, + "description": "

Check whether a credential object contains username information.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_get_username": { + "type": "function", + "file": "git2/credential.h", + "line": 165, + "lineto": 165, + "args": [ + { + "name": "cred", + "type": "git_credential *", + "comment": "object to check" + } + ], + "argline": "git_credential *cred", + "sig": "git_credential *", + "return": { + "type": "const char *", + "comment": " the credential username, or NULL if not applicable" + }, + "description": "

Return the username associated with a credential object.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_userpass_plaintext_new": { + "type": "function", + "file": "git2/credential.h", + "line": 176, + "lineto": 179, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "The username of the credential." + }, + { + "name": "password", + "type": "const char *", + "comment": "The password of the credential." + } + ], + "argline": "git_credential **out, const char *username, const char *password", + "sig": "git_credential **::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new plain-text username and password credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_default_new": { + "type": "function", + "file": "git2/credential.h", + "line": 188, + "lineto": 188, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + } + ], + "argline": "git_credential **out", + "sig": "git_credential **", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a "default" credential usable for Negotiate mechanisms like NTLM\n or Kerberos authentication.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_username_new": { + "type": "function", + "file": "git2/credential.h", + "line": 200, + "lineto": 200, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "The username to authenticate with" + } + ], + "argline": "git_credential **out, const char *username", + "sig": "git_credential **::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a credential to specify a username.

\n", + "comments": "

This is used with ssh authentication to query for the username if none is specified in the url.

\n", + "group": "credential" + }, + "git_credential_ssh_key_new": { + "type": "function", + "file": "git2/credential.h", + "line": 213, + "lineto": 218, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The path to the public key of the credential." + }, + { + "name": "privatekey", + "type": "const char *", + "comment": "The path to the private key of the credential." + }, + { + "name": "passphrase", + "type": "const char *", + "comment": "The passphrase of the credential." + } + ], + "argline": "git_credential **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", + "sig": "git_credential **::const char *::const char *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new passphrase-protected ssh key credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_ssh_key_memory_new": { + "type": "function", + "file": "git2/credential.h", + "line": 230, + "lineto": 235, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate." + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The public key of the credential." + }, + { + "name": "privatekey", + "type": "const char *", + "comment": "The private key of the credential." + }, + { + "name": "passphrase", + "type": "const char *", + "comment": "The passphrase of the credential." + } + ], + "argline": "git_credential **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", + "sig": "git_credential **::const char *::const char *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new ssh key credential object reading the keys from memory.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_ssh_interactive_new": { + "type": "function", + "file": "git2/credential.h", + "line": 278, + "lineto": 282, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "Username to use to authenticate." + }, + { + "name": "prompt_callback", + "type": "git_credential_ssh_interactive_cb", + "comment": "The callback method used for prompts." + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback." + } + ], + "argline": "git_credential **out, const char *username, git_credential_ssh_interactive_cb prompt_callback, void *payload", + "sig": "git_credential **::const char *::git_credential_ssh_interactive_cb::void *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure." + }, + "description": "

Create a new ssh keyboard-interactive based credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_ssh_key_from_agent": { + "type": "function", + "file": "git2/credential.h", + "line": 292, + "lineto": 294, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" + } + ], + "argline": "git_credential **out, const char *username", + "sig": "git_credential **::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new ssh key credential object used for querying an ssh-agent.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "credential" + }, + "git_credential_ssh_custom_new": { + "type": "function", + "file": "git2/credential.h", + "line": 332, + "lineto": 338, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The bytes of the public key." + }, + { + "name": "publickey_len", + "type": "size_t", + "comment": "The length of the public key in bytes." + }, + { + "name": "sign_callback", + "type": "git_credential_sign_cb", + "comment": "The callback method to sign the data during the challenge." + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback." + } + ], + "argline": "git_credential **out, const char *username, const char *publickey, size_t publickey_len, git_credential_sign_cb sign_callback, void *payload", + "sig": "git_credential **::const char *::const char *::size_t::git_credential_sign_cb::void *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create an ssh key credential with a custom signing function.

\n", + "comments": "

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n", + "group": "credential" + }, + "git_credential_userpass": { + "type": "function", + "file": "git2/credential_helpers.h", + "line": 44, + "lineto": 49, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "url", + "type": "const char *", + "comment": "The resource for which we are demanding a credential." + }, + { + "name": "user_from_url", + "type": "const char *", + "comment": "The username that was embedded in a \"user\n@\nhost\"\n remote url, or NULL if not included." + }, + { + "name": "allowed_types", + "type": "unsigned int", + "comment": "A bitmask stating which credential types are OK to return." + }, + { + "name": "payload", + "type": "void *", + "comment": "The payload provided when specifying this callback. (This is\n interpreted as a `git_credential_userpass_payload*`.)" + } + ], + "argline": "git_credential **out, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload", + "sig": "git_credential **::const char *::const char *::unsigned int::void *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Stock callback usable as a git_credential_acquire_cb. This calls\n git_cred_userpass_plaintext_new unless the protocol has not specified\n GIT_CREDENTIAL_USERPASS_PLAINTEXT as an allowed type.

\n", + "comments": "", + "group": "credential" + }, + "git_blob_filtered_content": { + "type": "function", + "file": "git2/deprecated.h", + "line": 124, + "lineto": 128, + "args": [ + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "blob", "type": "git_blob *", "comment": null }, + { "name": "as_path", "type": "const char *", "comment": null }, + { "name": "check_for_binary_data", "type": "int", "comment": null } + ], + "argline": "git_buf *out, git_blob *blob, const char *as_path, int check_for_binary_data", + "sig": "git_buf *::git_blob *::const char *::int", + "return": { "type": "int", "comment": null }, + "description": "

Deprecated in favor of git_blob_filter.

\n", + "comments": "", + "group": "blob" + }, + "git_filter_list_stream_data": { + "type": "function", + "file": "git2/deprecated.h", + "line": 148, + "lineto": 151, + "args": [ + { "name": "filters", "type": "git_filter_list *", "comment": null }, + { "name": "data", "type": "git_buf *", "comment": null }, + { "name": "target", "type": "git_writestream *", "comment": null } + ], + "argline": "git_filter_list *filters, git_buf *data, git_writestream *target", + "sig": "git_filter_list *::git_buf *::git_writestream *", + "return": { "type": "int", "comment": null }, + "description": "

Deprecated in favor of git_filter_list_stream_buffer.

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_apply_to_data": { + "type": "function", + "file": "git2/deprecated.h", + "line": 158, + "lineto": 161, + "args": [ + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "filters", "type": "git_filter_list *", "comment": null }, + { "name": "in", "type": "git_buf *", "comment": null } + ], + "argline": "git_buf *out, git_filter_list *filters, git_buf *in", + "sig": "git_buf *::git_filter_list *::git_buf *", + "return": { "type": "int", "comment": null }, + "description": "

Deprecated in favor of git_filter_list_apply_to_buffer.

\n", + "comments": "", + "group": "filter" + }, + "git_treebuilder_write_with_buffer": { + "type": "function", + "file": "git2/deprecated.h", + "line": 187, + "lineto": 188, + "args": [ + { "name": "oid", "type": "git_oid *", "comment": null }, + { "name": "bld", "type": "git_treebuilder *", "comment": null }, + { "name": "tree", "type": "git_buf *", "comment": null } + ], + "argline": "git_oid *oid, git_treebuilder *bld, git_buf *tree", + "sig": "git_oid *::git_treebuilder *::git_buf *", + "return": { "type": "int", "comment": null }, + "description": "

Write the contents of the tree builder as a tree object.\n This is an alias of git_treebuilder_write and is preserved\n for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "treebuilder" + }, + "git_buf_grow": { + "type": "function", + "file": "git2/deprecated.h", + "line": 229, + "lineto": 229, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to be resized; may or may not be allocated yet" + }, + { + "name": "target_size", + "type": "size_t", + "comment": "The desired available size" + } + ], + "argline": "git_buf *buffer, size_t target_size", + "sig": "git_buf *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, -1 on allocation failure" + }, + "description": "

Resize the buffer allocation to make more space.

\n", + "comments": "

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e. the asize field is zero), then ptr will be replaced with a newly allocated block of data. Be careful so that memory allocated by the caller is not lost. As a special variant, if you pass target_size as 0 and the memory is not allocated by libgit2, this will allocate a new buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be marked as invalid for future operations, invaliding the contents.

\n", + "group": "buf" + }, + "git_buf_set": { + "type": "function", + "file": "git2/deprecated.h", + "line": 239, + "lineto": 240, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to set" + }, + { + "name": "data", + "type": "const void *", + "comment": "The data to copy into the buffer" + }, + { + "name": "datalen", + "type": "size_t", + "comment": "The length of the data to copy into the buffer" + } + ], + "argline": "git_buf *buffer, const void *data, size_t datalen", + "sig": "git_buf *::const void *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, -1 on allocation failure" + }, + "description": "

Set buffer to a copy of some raw data.

\n", + "comments": "", + "group": "buf" + }, + "git_buf_is_binary": { + "type": "function", + "file": "git2/deprecated.h", + "line": 248, + "lineto": 248, + "args": [ + { + "name": "buf", + "type": "const git_buf *", + "comment": "Buffer to check" + } + ], + "argline": "const git_buf *buf", + "sig": "const git_buf *", + "return": { + "type": "int", + "comment": " 1 if buffer looks like non-text data" + }, + "description": "

Check quickly if buffer looks like it contains binary data

\n", + "comments": "", + "group": "buf" + }, + "git_buf_contains_nul": { + "type": "function", + "file": "git2/deprecated.h", + "line": 256, + "lineto": 256, + "args": [ + { + "name": "buf", + "type": "const git_buf *", + "comment": "Buffer to check" + } + ], + "argline": "const git_buf *buf", + "sig": "const git_buf *", + "return": { + "type": "int", + "comment": " 1 if buffer contains a NUL byte" + }, + "description": "

Check quickly if buffer contains a NUL byte

\n", + "comments": "", + "group": "buf" + }, + "git_buf_free": { + "type": "function", + "file": "git2/deprecated.h", + "line": 268, + "lineto": 268, + "args": [{ "name": "buffer", "type": "git_buf *", "comment": null }], + "argline": "git_buf *buffer", + "sig": "git_buf *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_buf. This is an alias of\n git_buf_dispose and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "buf" + }, + "git_diff_format_email": { + "type": "function", + "file": "git2/deprecated.h", + "line": 374, + "lineto": 377, + "args": [ + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "diff", "type": "git_diff *", "comment": null }, + { + "name": "opts", + "type": "const git_diff_format_email_options *", + "comment": null + } + ], + "argline": "git_buf *out, git_diff *diff, const git_diff_format_email_options *opts", + "sig": "git_buf *::git_diff *::const git_diff_format_email_options *", + "return": { "type": "int", "comment": null }, + "description": "

Create an e-mail ready patch from a diff.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_commit_as_email": { + "type": "function", + "file": "git2/deprecated.h", + "line": 385, + "lineto": 392, + "args": [ + { "name": "out", "type": "git_buf *", "comment": null }, + { "name": "repo", "type": "git_repository *", "comment": null }, + { "name": "commit", "type": "git_commit *", "comment": null }, + { "name": "patch_no", "type": "size_t", "comment": null }, + { "name": "total_patches", "type": "size_t", "comment": null }, + { "name": "flags", "type": "uint32_t", "comment": null }, + { + "name": "diff_opts", + "type": "const git_diff_options *", + "comment": null + } + ], + "argline": "git_buf *out, git_repository *repo, git_commit *commit, size_t patch_no, size_t total_patches, uint32_t flags, const git_diff_options *diff_opts", + "sig": "git_buf *::git_repository *::git_commit *::size_t::size_t::uint32_t::const git_diff_options *", + "return": { "type": "int", "comment": null }, + "description": "

Create an e-mail ready patch for a commit.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_format_email_options_init": { + "type": "function", + "file": "git2/deprecated.h", + "line": 404, + "lineto": 406, + "args": [ + { + "name": "opts", + "type": "git_diff_format_email_options *", + "comment": "The `git_blame_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`." + } + ], + "argline": "git_diff_format_email_options *opts, unsigned int version", + "sig": "git_diff_format_email_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_diff_format_email_options structure

\n", + "comments": "

Initializes a git_diff_format_email_options with default values. Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n", + "group": "diff" + }, + "giterr_last": { + "type": "function", + "file": "git2/deprecated.h", + "line": 503, + "lineto": 503, + "args": [], + "argline": "", + "sig": "", + "return": { "type": "const git_error *", "comment": null }, + "description": "

Return the last git_error object that was generated for the\n current thread. This is an alias of git_error_last and is\n preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_clear": { + "type": "function", + "file": "git2/deprecated.h", + "line": 515, + "lineto": 515, + "args": [], + "argline": "", + "sig": "", + "return": { "type": "void", "comment": null }, + "description": "

Clear the last error. This is an alias of git_error_last and is\n preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_set_str": { + "type": "function", + "file": "git2/deprecated.h", + "line": 527, + "lineto": 527, + "args": [ + { "name": "error_class", "type": "int", "comment": null }, + { "name": "string", "type": "const char *", "comment": null } + ], + "argline": "int error_class, const char *string", + "sig": "int::const char *", + "return": { "type": "void", "comment": null }, + "description": "

Sets the error message to the given string. This is an alias of\n git_error_set_str and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "giterr_set_oom": { + "type": "function", + "file": "git2/deprecated.h", + "line": 539, + "lineto": 539, + "args": [], + "argline": "", + "sig": "", + "return": { "type": "void", "comment": null }, + "description": "

Indicates that an out-of-memory situation occurred. This is an alias\n of git_error_set_oom and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "giterr" + }, + "git_object__size": { + "type": "function", + "file": "git2/deprecated.h", + "line": 666, + "lineto": 666, + "args": [ + { + "name": "type", + "type": "git_object_t", + "comment": "object type to get its size" + } + ], + "argline": "git_object_t type", + "sig": "git_object_t", + "return": { "type": "size_t", "comment": " size in bytes of the object" }, + "description": "

Get the size in bytes for the structure which\n acts as an in-memory representation of any given\n object type.

\n", + "comments": "

For all the core types, this would the equivalent of calling sizeof(git_commit) if the core types were not opaque on the external API.

\n", + "group": "object" + }, + "git_remote_is_valid_name": { + "type": "function", + "file": "git2/deprecated.h", + "line": 687, + "lineto": 687, + "args": [ + { + "name": "remote_name", + "type": "const char *", + "comment": "name to be checked." + } + ], + "argline": "const char *remote_name", + "sig": "const char *", + "return": { + "type": "int", + "comment": " 1 if the reference name is acceptable; 0 if it isn't" + }, + "description": "

Ensure the remote name is well-formed.

\n", + "comments": "", + "group": "remote" + }, + "git_reference_is_valid_name": { + "type": "function", + "file": "git2/deprecated.h", + "line": 741, + "lineto": 741, + "args": [ + { + "name": "refname", + "type": "const char *", + "comment": "name to be checked." + } + ], + "argline": "const char *refname", + "sig": "const char *", + "return": { + "type": "int", + "comment": " 1 if the reference name is acceptable; 0 if it isn't" + }, + "description": "

Ensure the reference name is well-formed.

\n", + "comments": "

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n", + "group": "reference" + }, + "git_oidarray_free": { + "type": "function", + "file": "git2/deprecated.h", + "line": 922, + "lineto": 922, + "args": [{ "name": "array", "type": "git_oidarray *", "comment": null }], + "argline": "git_oidarray *array", + "sig": "git_oidarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_oidarray. This is an alias of\n git_oidarray_dispose and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "oidarray" + }, + "git_strarray_copy": { + "type": "function", + "file": "git2/deprecated.h", + "line": 991, + "lineto": 991, + "args": [ + { "name": "tgt", "type": "git_strarray *", "comment": "target" }, + { "name": "src", "type": "const git_strarray *", "comment": "source" } + ], + "argline": "git_strarray *tgt, const git_strarray *src", + "sig": "git_strarray *::const git_strarray *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n 0 on allocation failure" + }, + "description": "

Copy a string array object from source to target.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "strarray" + }, + "git_strarray_free": { + "type": "function", + "file": "git2/deprecated.h", + "line": 1003, + "lineto": 1003, + "args": [{ "name": "array", "type": "git_strarray *", "comment": null }], + "argline": "git_strarray *array", + "sig": "git_strarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory referred to by the git_strarray. This is an alias of\n git_strarray_dispose and is preserved for backward compatibility.

\n", + "comments": "

This function is deprecated, but there is no plan to remove this function at this time.

\n", + "group": "strarray" + }, + "git_blame_init_options": { + "type": "function", + "file": "git2/deprecated.h", + "line": 1035, + "lineto": 1035, + "args": [ + { "name": "opts", "type": "git_blame_options *", "comment": null }, + { "name": "version", "type": "unsigned int", "comment": null } + ], + "argline": "git_blame_options *opts, unsigned int version", + "sig": "git_blame_options *::unsigned int", + "return": { "type": "int", "comment": null }, + "description": "", + "comments": "

These functions are retained for backward compatibility. The newer versions of these functions should be preferred in all new code.

\n\n

There is no plan to remove these backward compatibility functions at this time.

\n\n

@{

\n", + "group": "blame" + }, + "git_describe_options_init": { + "type": "function", + "file": "git2/describe.h", + "line": 91, + "lineto": 91, + "args": [ + { + "name": "opts", + "type": "git_describe_options *", + "comment": "The `git_describe_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`." + } + ], + "argline": "git_describe_options *opts, unsigned int version", + "sig": "git_describe_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_describe_options structure

\n", + "comments": "

Initializes a git_describe_options with default values. Equivalent to creating an instance with GIT_DESCRIBE_OPTIONS_INIT.

\n", + "group": "describe", + "examples": { + "describe.c": ["ex/v1.9.1/describe.html#git_describe_options_init-1"] + } + }, + "git_describe_format_options_init": { + "type": "function", + "file": "git2/describe.h", + "line": 141, + "lineto": 141, + "args": [ + { + "name": "opts", + "type": "git_describe_format_options *", + "comment": "The `git_describe_format_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`." + } + ], + "argline": "git_describe_format_options *opts, unsigned int version", + "sig": "git_describe_format_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_describe_format_options structure

\n", + "comments": "

Initializes a git_describe_format_options with default values. Equivalent to creating an instance with GIT_DESCRIBE_FORMAT_OPTIONS_INIT.

\n", + "group": "describe", + "examples": { + "describe.c": [ + "ex/v1.9.1/describe.html#git_describe_format_options_init-2" + ] + } + }, + "git_describe_commit": { + "type": "function", + "file": "git2/describe.h", + "line": 159, + "lineto": 162, + "args": [ + { + "name": "result", + "type": "git_describe_result **", + "comment": "pointer to store the result. You must free this once\n you're done with it." + }, + { + "name": "committish", + "type": "git_object *", + "comment": "a committish to describe" + }, + { + "name": "opts", + "type": "git_describe_options *", + "comment": "the lookup options (or NULL for defaults)" + } + ], + "argline": "git_describe_result **result, git_object *committish, git_describe_options *opts", + "sig": "git_describe_result **::git_object *::git_describe_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Describe a commit

\n", + "comments": "

Perform the describe operation on the given committish object.

\n", + "group": "describe", + "examples": { + "describe.c": ["ex/v1.9.1/describe.html#git_describe_commit-3"] + } + }, + "git_describe_workdir": { + "type": "function", + "file": "git2/describe.h", + "line": 177, + "lineto": 180, + "args": [ + { + "name": "out", + "type": "git_describe_result **", + "comment": "pointer to store the result. You must free this once\n you're done with it." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the describe" + }, + { + "name": "opts", + "type": "git_describe_options *", + "comment": "the lookup options (or NULL for defaults)" + } + ], + "argline": "git_describe_result **out, git_repository *repo, git_describe_options *opts", + "sig": "git_describe_result **::git_repository *::git_describe_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Describe a commit

\n", + "comments": "

Perform the describe operation on the current commit and the worktree. After performing describe on HEAD, a status is run and the description is considered to be dirty if there are.

\n", + "group": "describe", + "examples": { + "describe.c": ["ex/v1.9.1/describe.html#git_describe_workdir-4"] + } + }, + "git_describe_format": { + "type": "function", + "file": "git2/describe.h", + "line": 191, + "lineto": 194, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The buffer to store the result" + }, + { + "name": "result", + "type": "const git_describe_result *", + "comment": "the result from `git_describe_commit()` or\n `git_describe_workdir()`." + }, + { + "name": "opts", + "type": "const git_describe_format_options *", + "comment": "the formatting options (or NULL for defaults)" + } + ], + "argline": "git_buf *out, const git_describe_result *result, const git_describe_format_options *opts", + "sig": "git_buf *::const git_describe_result *::const git_describe_format_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Print the describe result to a buffer

\n", + "comments": "", + "group": "describe", + "examples": { + "describe.c": ["ex/v1.9.1/describe.html#git_describe_format-5"] + } + }, + "git_describe_result_free": { + "type": "function", + "file": "git2/describe.h", + "line": 201, + "lineto": 201, + "args": [ + { + "name": "result", + "type": "git_describe_result *", + "comment": "The result to free." + } + ], + "argline": "git_describe_result *result", + "sig": "git_describe_result *", + "return": { "type": "void", "comment": null }, + "description": "

Free the describe result.

\n", + "comments": "", + "group": "describe" + }, + "git_diff_options_init": { + "type": "function", + "file": "git2/diff.h", + "line": 492, + "lineto": 494, + "args": [ + { + "name": "opts", + "type": "git_diff_options *", + "comment": "The `git_diff_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_OPTIONS_VERSION`." + } + ], + "argline": "git_diff_options *opts, unsigned int version", + "sig": "git_diff_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_diff_options structure

\n", + "comments": "

Initializes a git_diff_options with default values. Equivalent to creating an instance with GIT_DIFF_OPTIONS_INIT.

\n", + "group": "diff" + }, + "git_diff_find_options_init": { + "type": "function", + "file": "git2/diff.h", + "line": 846, + "lineto": 848, + "args": [ + { + "name": "opts", + "type": "git_diff_find_options *", + "comment": "The `git_diff_find_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`." + } + ], + "argline": "git_diff_find_options *opts, unsigned int version", + "sig": "git_diff_find_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_diff_find_options structure

\n", + "comments": "

Initializes a git_diff_find_options with default values. Equivalent to creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n", + "group": "diff" + }, + "git_diff_free": { + "type": "function", + "file": "git2/diff.h", + "line": 862, + "lineto": 862, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "The previously created diff; cannot be used after free." + } + ], + "argline": "git_diff *diff", + "sig": "git_diff *", + "return": { "type": "void", "comment": null }, + "description": "

Deallocate a diff.

\n", + "comments": "", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_free-3"], + "log.c": [ + "ex/v1.9.1/log.html#git_diff_free-25", + "ex/v1.9.1/log.html#git_diff_free-26" + ] + } + }, + "git_diff_tree_to_tree": { + "type": "function", + "file": "git2/diff.h", + "line": 881, + "lineto": 886, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the trees." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "new_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff to, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_tree *new_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::git_tree *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff with the difference between two tree objects.

\n", + "comments": "

This is equivalent to git diff <old-tree> <new-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the second tree will be used for the "new_file" side of the delta. You can pass NULL to indicate an empty tree, although it is an error to pass NULL for both the old_tree and new_tree.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_tree-4"], + "log.c": [ + "ex/v1.9.1/log.html#git_diff_tree_to_tree-27", + "ex/v1.9.1/log.html#git_diff_tree_to_tree-28" + ] + } + }, + "git_diff_tree_to_index": { + "type": "function", + "file": "git2/diff.h", + "line": 908, + "lineto": 913, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree and index." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to diff with; repo index used if NULL." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_index *index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::git_index *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between a tree and repository index.

\n", + "comments": "

This is equivalent to git diff --cached <treeish> or if you pass the HEAD tree, then like git diff --cached.

\n\n

The tree you pass will be used for the "old_file" side of the delta, and the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_index-5"] } + }, + "git_diff_index_to_workdir": { + "type": "function", + "file": "git2/diff.h", + "line": 936, + "lineto": 940, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository." + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to diff from; repo index used if NULL." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_index *index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_index *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between the repository index and the workdir directory.

\n", + "comments": "

This matches the git diff command. See the note below on git_diff_tree_to_workdir for a discussion of the difference between git diff and git diff HEAD and how to emulate a git diff <treeish> using libgit2.

\n\n

The index will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_index_to_workdir-6"] + } + }, + "git_diff_tree_to_workdir": { + "type": "function", + "file": "git2/diff.h", + "line": 966, + "lineto": 970, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between a tree and the working directory.

\n", + "comments": "

The tree you provide will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side.

\n\n

This is not the same as git diff <treeish> or git diff-index <treeish>. Those commands use information from the index, whereas this function strictly returns the differences between the tree and the files in the working directory, regardless of the state of the index. Use git_diff_tree_to_workdir_with_index to emulate those commands.

\n\n

To see difference between this and git_diff_tree_to_workdir_with_index, consider the example of a staged file deletion where the file has then been put back into the working dir and further modified. The tree-to-workdir diff for that file is 'modified', but git diff would show status 'deleted' since there is a staged delete.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_workdir-7"] + } + }, + "git_diff_tree_to_workdir_with_index": { + "type": "function", + "file": "git2/diff.h", + "line": 986, + "lineto": 990, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff between a tree and the working directory using index data\n to account for staged deletes, tracked files, etc.

\n", + "comments": "

This emulates git diff <tree> by diffing the tree to the index and the index to the working directory and blending the results into a single diff that includes staged deleted, etc.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_tree_to_workdir_with_index-8"] + } + }, + "git_diff_index_to_index": { + "type": "function", + "file": "git2/diff.h", + "line": 1005, + "lineto": 1010, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the indexes." + }, + { + "name": "old_index", + "type": "git_index *", + "comment": "A git_index object to diff from." + }, + { + "name": "new_index", + "type": "git_index *", + "comment": "A git_index object to diff to." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_index *old_index, git_index *new_index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_index *::git_index *::const git_diff_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a diff with the difference between two index objects.

\n", + "comments": "

The first index will be used for the "old_file" side of the delta and the second index will be used for the "new_file" side of the delta.

\n", + "group": "diff" + }, + "git_diff_merge": { + "type": "function", + "file": "git2/diff.h", + "line": 1026, + "lineto": 1028, + "args": [ + { + "name": "onto", + "type": "git_diff *", + "comment": "Diff to merge into." + }, + { + "name": "from", + "type": "const git_diff *", + "comment": "Diff to merge." + } + ], + "argline": "git_diff *onto, const git_diff *from", + "sig": "git_diff *::const git_diff *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Merge one diff into another.

\n", + "comments": "

This merges items from the "from" list into the "onto" list. The resulting diff will have all items that appear in either list. If an item appears in both lists, then it will be "merged" to appear as if the old version was from the "onto" list and the new version is from the "from" list (with the exception that if the item has a pending DELETE in the middle, then it will show as deleted).

\n", + "group": "diff" + }, + "git_diff_find_similar": { + "type": "function", + "file": "git2/diff.h", + "line": 1042, + "lineto": 1044, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "diff to run detection algorithms on" + }, + { + "name": "options", + "type": "const git_diff_find_options *", + "comment": "Control how detection should be run, NULL for defaults" + } + ], + "argline": "git_diff *diff, const git_diff_find_options *options", + "sig": "git_diff *::const git_diff_find_options *", + "return": { "type": "int", "comment": " 0 on success, -1 on failure" }, + "description": "

Transform a diff marking file renames, copies, etc.

\n", + "comments": "

This modifies a diff in place, replacing old entries that look like renames or copies with new entries reflecting those changes. This also will, if requested, break modified files into add/remove pairs if the amount of change is above a threshold.

\n", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_find_similar-9"] } + }, + "git_diff_num_deltas": { + "type": "function", + "file": "git2/diff.h", + "line": 1062, + "lineto": 1062, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "A git_diff generated by one of the above functions" + } + ], + "argline": "const git_diff *diff", + "sig": "const git_diff *", + "return": { + "type": "size_t", + "comment": " Count of number of deltas in the list" + }, + "description": "

Query how many diff records are there in a diff.

\n", + "comments": "", + "group": "diff", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_diff_num_deltas-29"] } + }, + "git_diff_num_deltas_of_type": { + "type": "function", + "file": "git2/diff.h", + "line": 1075, + "lineto": 1076, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "A git_diff generated by one of the above functions" + }, + { + "name": "type", + "type": "git_delta_t", + "comment": "A git_delta_t value to filter the count" + } + ], + "argline": "const git_diff *diff, git_delta_t type", + "sig": "const git_diff *::git_delta_t", + "return": { + "type": "size_t", + "comment": " Count of number of deltas matching delta_t type" + }, + "description": "

Query how many diff deltas are there in a diff filtered by type.

\n", + "comments": "

This works just like git_diff_num_deltas() with an extra parameter that is a git_delta_t and returns just the count of how many deltas match that particular type.

\n", + "group": "diff" + }, + "git_diff_get_delta": { + "type": "function", + "file": "git2/diff.h", + "line": 1095, + "lineto": 1096, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "Diff list object" + }, + { "name": "idx", "type": "size_t", "comment": "Index into diff list" } + ], + "argline": "const git_diff *diff, size_t idx", + "sig": "const git_diff *::size_t", + "return": { + "type": "const git_diff_delta *", + "comment": " Pointer to git_diff_delta (or NULL if `idx` out of range)" + }, + "description": "

Return the diff delta for an entry in the diff list.

\n", + "comments": "

The git_diff_delta pointer points to internal data and you do not have to release it when you are done with it. It will go away when the * git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary content or not may not be set if there are no attributes set for the file and there has been no reason to load the file data at this point. For now, if you need those flags to be up to date, your only option is to either use git_diff_foreach or create a git_patch.

\n", + "group": "diff" + }, + "git_diff_is_sorted_icase": { + "type": "function", + "file": "git2/diff.h", + "line": 1104, + "lineto": 1104, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "diff to check" + } + ], + "argline": "const git_diff *diff", + "sig": "const git_diff *", + "return": { + "type": "int", + "comment": " 0 if case sensitive, 1 if case is ignored" + }, + "description": "

Check if deltas are sorted case sensitively or insensitively.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_foreach": { + "type": "function", + "file": "git2/diff.h", + "line": 1132, + "lineto": 1138, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback function to make per file in the diff." + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Optional callback to make for binary files." + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Optional callback to make per hunk of text diff. This\n callback is called to describe a range of lines in the\n diff. It will not be issued for binary files." + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Optional callback to make per line of diff text. This\n same callback will be made for context lines, added, and\n removed lines, and even for a deleted trailing newline." + }, + { + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callbacks." + } + ], + "argline": "git_diff *diff, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "git_diff *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Loop over all deltas in a diff issuing callbacks.

\n", + "comments": "

This will iterate through all of the files described in a diff. You should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the files will only be calculated if they are not NULL. Of course, these callbacks will not be invoked for binary files on the diff or for files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate the iteration and return the value to the user.

\n", + "group": "diff" + }, + "git_diff_status_char": { + "type": "function", + "file": "git2/diff.h", + "line": 1151, + "lineto": 1151, + "args": [ + { + "name": "status", + "type": "git_delta_t", + "comment": "The git_delta_t value to look up" + } + ], + "argline": "git_delta_t status", + "sig": "git_delta_t", + "return": { + "type": "char", + "comment": " The single character label for that code" + }, + "description": "

Look up the single character abbreviation for a delta status code.

\n", + "comments": "

When you run git diff --name-status it uses single letter codes in the output such as 'A' for added, 'D' for deleted, 'M' for modified, etc. This function converts a git_delta_t value into these letters for your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n", + "group": "diff" + }, + "git_diff_print": { + "type": "function", + "file": "git2/diff.h", + "line": 1177, + "lineto": 1181, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + }, + { + "name": "format", + "type": "git_diff_format_t", + "comment": "A git_diff_format_t value to pick the text format." + }, + { + "name": "print_cb", + "type": "git_diff_line_cb", + "comment": "Callback to make per line of diff text." + }, + { + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callback." + } + ], + "argline": "git_diff *diff, git_diff_format_t format, git_diff_line_cb print_cb, void *payload", + "sig": "git_diff *::git_diff_format_t::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Iterate over a diff generating formatted text output.

\n", + "comments": "

Returning a non-zero value from the callbacks will terminate the iteration and return the non-zero value to the caller.

\n", + "group": "diff", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_diff_print-10"], + "log.c": ["ex/v1.9.1/log.html#git_diff_print-30"] + } + }, + "git_diff_to_buf": { + "type": "function", + "file": "git2/diff.h", + "line": 1193, + "lineto": 1196, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "A pointer to a user-allocated git_buf that will\n contain the diff text" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + }, + { + "name": "format", + "type": "git_diff_format_t", + "comment": "A git_diff_format_t value to pick the text format." + } + ], + "argline": "git_buf *out, git_diff *diff, git_diff_format_t format", + "sig": "git_buf *::git_diff *::git_diff_format_t", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Produce the complete formatted text output from a diff into a\n buffer.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_blobs": { + "type": "function", + "file": "git2/diff.h", + "line": 1232, + "lineto": 1242, + "args": [ + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "new_blob", + "type": "const git_blob *", + "comment": "Blob for new side of diff, or NULL for empty blob" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat new blob as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" + } + ], + "argline": "const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Directly run a diff on two blobs.

\n", + "comments": "

Compared to a file, a blob lacks some contextual information. As such, the git_diff_file given to the callback will have some fake data; i.e. mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated as an empty blob, with the oid set to NULL in the git_diff_file data. Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob looks like binary data, the git_diff_delta binary attribute will be set to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass GIT_DIFF_FORCE_TEXT of course).

\n", + "group": "diff" + }, + "git_diff_blob_to_buffer": { + "type": "function", + "file": "git2/diff.h", + "line": 1269, + "lineto": 1280, + "args": [ + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "buffer_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "buffer_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" + } + ], + "argline": "const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Directly run a diff between a blob and a buffer.

\n", + "comments": "

As with git_diff_blobs, comparing a blob and buffer lacks some context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the entire content of the buffer added). Passing NULL to the buffer will do the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n", + "group": "diff" + }, + "git_diff_buffers": { + "type": "function", + "file": "git2/diff.h", + "line": 1303, + "lineto": 1315, + "args": [ + { + "name": "old_buffer", + "type": "const void *", + "comment": "Raw data for old side of diff, or NULL for empty" + }, + { + "name": "old_len", + "type": "size_t", + "comment": "Length of the raw data for old side of the diff" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old buffer as if it had this filename; can be NULL" + }, + { + "name": "new_buffer", + "type": "const void *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "new_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" + } + ], + "argline": "const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Directly run a diff between two buffers.

\n", + "comments": "

Even more than with git_diff_blobs, comparing two buffer lacks context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n", + "group": "diff" + }, + "git_diff_from_buffer": { + "type": "function", + "file": "git2/diff.h", + "line": 1355, + "lineto": 1362, + "args": [ + { + "name": "out", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "content", + "type": "const char *", + "comment": "The contents of a patch file" + }, + { + "name": "content_len", + "type": "size_t", + "comment": "The length of the patch file contents" + } + ], + "argline": "git_diff **out, const char *content, size_t content_len", + "sig": "git_diff **::const char *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read the contents of a git patch file into a git_diff object.

\n", + "comments": "

The diff object produced is similar to the one that would be produced if you actually produced it computationally by comparing two trees, however there may be subtle differences. For example, a patch file likely contains abbreviated object IDs, so the object IDs in a git_diff_delta produced by this function will also be abbreviated.

\n\n

This function will only read patch files created by a git implementation, it will not read unified diffs produced by the diff program, nor any other types of patch files.

\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v1.9.1/diff.html#git_diff_from_buffer-11", + "ex/v1.9.1/diff.html#git_diff_from_buffer-12" + ] + } + }, + "git_diff_get_stats": { + "type": "function", + "file": "git2/diff.h", + "line": 1398, + "lineto": 1400, + "args": [ + { + "name": "out", + "type": "git_diff_stats **", + "comment": "Structure containing the diff statistics." + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + } + ], + "argline": "git_diff_stats **out, git_diff *diff", + "sig": "git_diff_stats **::git_diff *", + "return": { + "type": "int", + "comment": " 0 on success; non-zero on error" + }, + "description": "

Accumulate diff statistics for all patches.

\n", + "comments": "", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_get_stats-13"] } + }, + "git_diff_stats_files_changed": { + "type": "function", + "file": "git2/diff.h", + "line": 1408, + "lineto": 1409, + "args": [ + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + } + ], + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", + "return": { + "type": "size_t", + "comment": " total number of files changed in the diff" + }, + "description": "

Get the total number of files changed in a diff

\n", + "comments": "", + "group": "diff" + }, + "git_diff_stats_insertions": { + "type": "function", + "file": "git2/diff.h", + "line": 1417, + "lineto": 1418, + "args": [ + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + } + ], + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", + "return": { + "type": "size_t", + "comment": " total number of insertions in the diff" + }, + "description": "

Get the total number of insertions in a diff

\n", + "comments": "", + "group": "diff" + }, + "git_diff_stats_deletions": { + "type": "function", + "file": "git2/diff.h", + "line": 1426, + "lineto": 1427, + "args": [ + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + } + ], + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", + "return": { + "type": "size_t", + "comment": " total number of deletions in the diff" + }, + "description": "

Get the total number of deletions in a diff

\n", + "comments": "", + "group": "diff" + }, + "git_diff_stats_to_buf": { + "type": "function", + "file": "git2/diff.h", + "line": 1438, + "lineto": 1442, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the formatted diff statistics in." + }, + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + }, + { + "name": "format", + "type": "git_diff_stats_format_t", + "comment": "Formatting option." + }, + { + "name": "width", + "type": "size_t", + "comment": "Target width for output (only affects GIT_DIFF_STATS_FULL)" + } + ], + "argline": "git_buf *out, const git_diff_stats *stats, git_diff_stats_format_t format, size_t width", + "sig": "git_buf *::const git_diff_stats *::git_diff_stats_format_t::size_t", + "return": { + "type": "int", + "comment": " 0 on success; non-zero on error" + }, + "description": "

Print diff statistics to a git_buf.

\n", + "comments": "", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_stats_to_buf-14"] } + }, + "git_diff_stats_free": { + "type": "function", + "file": "git2/diff.h", + "line": 1450, + "lineto": 1450, + "args": [ + { + "name": "stats", + "type": "git_diff_stats *", + "comment": "The previously created statistics object;\n cannot be used after free." + } + ], + "argline": "git_diff_stats *stats", + "sig": "git_diff_stats *", + "return": { "type": "void", "comment": null }, + "description": "

Deallocate a git_diff_stats.

\n", + "comments": "", + "group": "diff", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_diff_stats_free-15"] } + }, + "git_diff_patchid_options_init": { + "type": "function", + "file": "git2/diff.h", + "line": 1479, + "lineto": 1481, + "args": [ + { + "name": "opts", + "type": "git_diff_patchid_options *", + "comment": "The `git_diff_patchid_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`." + } + ], + "argline": "git_diff_patchid_options *opts, unsigned int version", + "sig": "git_diff_patchid_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_diff_patchid_options structure

\n", + "comments": "

Initializes a git_diff_patchid_options with default values. Equivalent to creating an instance with GIT_DIFF_PATCHID_OPTIONS_INIT.

\n", + "group": "diff" + }, + "git_diff_patchid": { + "type": "function", + "file": "git2/diff.h", + "line": 1502, + "lineto": 1502, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Pointer where the calculated patch ID should be stored" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "The diff to calculate the ID for" + }, + { + "name": "opts", + "type": "git_diff_patchid_options *", + "comment": "Options for how to calculate the patch ID. This is\n intended for future changes, as currently no options are\n available." + } + ], + "argline": "git_oid *out, git_diff *diff, git_diff_patchid_options *opts", + "sig": "git_oid *::git_diff *::git_diff_patchid_options *", + "return": { + "type": "int", + "comment": " 0 on success, an error code otherwise." + }, + "description": "

Calculate the patch ID for the given patch.

\n", + "comments": "

Calculate a stable patch ID for the given patch by summing the hash of the file diffs, ignoring whitespace and line numbers. This can be used to derive whether two diffs are the same with a high probability.

\n\n

Currently, this function only calculates stable patch IDs, as defined in git-patch-id(1), and should in fact generate the same IDs as the upstream git project does.

\n", + "group": "diff" + }, + "git_email_create_from_commit": { + "type": "function", + "file": "git2/email.h", + "line": 99, + "lineto": 102, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the e-mail patch in" + }, + { + "name": "commit", + "type": "git_commit *", + "comment": "commit to create a patch for" + }, + { + "name": "opts", + "type": "const git_email_create_options *", + "comment": "email creation options" + } + ], + "argline": "git_buf *out, git_commit *commit, const git_email_create_options *opts", + "sig": "git_buf *::git_commit *::const git_email_create_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a diff for a commit in mbox format for sending via email.\n The commit must not be a merge commit.

\n", + "comments": "", + "group": "email" + }, + "git_error_last": { + "type": "function", + "file": "git2/errors.h", + "line": 149, + "lineto": 149, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "const git_error *", + "comment": " A pointer to a `git_error` object that describes the error." + }, + "description": "

Return the last git_error object that was generated for the\n current thread.

\n", + "comments": "

This function will never return NULL.

\n\n

Callers should not rely on this to determine whether an error has occurred. For error checking, callers should examine the return codes of libgit2 functions.

\n\n

This call can only reliably report error messages when an error has occurred. (It may contain stale information if it is called after a different function that succeeds.)

\n\n

The memory for this object is managed by libgit2. It should not be freed.

\n", + "group": "error", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_error_last-11", + "ex/v1.9.1/checkout.html#git_error_last-12", + "ex/v1.9.1/checkout.html#git_error_last-13", + "ex/v1.9.1/checkout.html#git_error_last-14" + ], + "commit.c": ["ex/v1.9.1/commit.html#git_error_last-2"], + "config.c": [ + "ex/v1.9.1/config.html#git_error_last-6", + "ex/v1.9.1/config.html#git_error_last-7", + "ex/v1.9.1/config.html#git_error_last-8" + ], + "general.c": ["ex/v1.9.1/general.html#git_error_last-33"], + "merge.c": [ + "ex/v1.9.1/merge.html#git_error_last-8", + "ex/v1.9.1/merge.html#git_error_last-9" + ] + } + }, + "git_filter_list_load": { + "type": "function", + "file": "git2/filter.h", + "line": 138, + "lineto": 144, + "args": [ + { + "name": "filters", + "type": "git_filter_list **", + "comment": "Output newly created git_filter_list (or NULL)" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object that contains `path`" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "The blob to which the filter will be applied (if known)" + }, + { + "name": "path", + "type": "const char *", + "comment": "Relative path of the file to be filtered" + }, + { + "name": "mode", + "type": "git_filter_mode_t", + "comment": "Filtering direction (WT->ODB or ODB->WT)" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of `git_filter_flag_t` flags" + } + ], + "argline": "git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, uint32_t flags", + "sig": "git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::uint32_t", + "return": { + "type": "int", + "comment": " 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error" + }, + "description": "

Load the filter list for a given path.

\n", + "comments": "

This will return 0 (success) but set the output git_filter_list to NULL if no filters are requested for the given file.

\n", + "group": "filter" + }, + "git_filter_list_load_ext": { + "type": "function", + "file": "git2/filter.h", + "line": 161, + "lineto": 167, + "args": [ + { + "name": "filters", + "type": "git_filter_list **", + "comment": "Output newly created git_filter_list (or NULL)" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object that contains `path`" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "The blob to which the filter will be applied (if known)" + }, + { + "name": "path", + "type": "const char *", + "comment": "Relative path of the file to be filtered" + }, + { + "name": "mode", + "type": "git_filter_mode_t", + "comment": "Filtering direction (WT->ODB or ODB->WT)" + }, + { + "name": "opts", + "type": "git_filter_options *", + "comment": "The `git_filter_options` to use when loading filters" + } + ], + "argline": "git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, git_filter_options *opts", + "sig": "git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::git_filter_options *", + "return": { + "type": "int", + "comment": " 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error" + }, + "description": "

Load the filter list for a given path.

\n", + "comments": "

This will return 0 (success) but set the output git_filter_list to NULL if no filters are requested for the given file.

\n", + "group": "filter" + }, + "git_filter_list_contains": { + "type": "function", + "file": "git2/filter.h", + "line": 181, + "lineto": 183, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "A loaded git_filter_list (or NULL)" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the filter to query" + } + ], + "argline": "git_filter_list *filters, const char *name", + "sig": "git_filter_list *::const char *", + "return": { + "type": "int", + "comment": " 1 if the filter is in the list, 0 otherwise" + }, + "description": "

Query the filter list to see if a given filter (by name) will run.\n The built-in filters "crlf" and "ident" can be queried, otherwise this\n is the name of the filter specified by the filter attribute.

\n", + "comments": "

This will return 0 if the given filter is not in the list, or 1 if the filter will be applied.

\n", + "group": "filter" + }, + "git_filter_list_apply_to_buffer": { + "type": "function", + "file": "git2/filter.h", + "line": 194, + "lineto": 198, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Buffer to store the result of the filtering" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "A loaded git_filter_list (or NULL)" + }, + { + "name": "in", + "type": "const char *", + "comment": "Buffer containing the data to filter" + }, + { + "name": "in_len", + "type": "size_t", + "comment": "The length of the input buffer" + } + ], + "argline": "git_buf *out, git_filter_list *filters, const char *in, size_t in_len", + "sig": "git_buf *::git_filter_list *::const char *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, an error code otherwise" + }, + "description": "

Apply filter list to a data buffer.

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_apply_to_file": { + "type": "function", + "file": "git2/filter.h", + "line": 210, + "lineto": 214, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer into which to store the filtered file" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the filtering" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" + } + ], + "argline": "git_buf *out, git_filter_list *filters, git_repository *repo, const char *path", + "sig": "git_buf *::git_filter_list *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to the contents of a file on disk

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_apply_to_blob": { + "type": "function", + "file": "git2/filter.h", + "line": 224, + "lineto": 227, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer into which to store the filtered file" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "the blob to filter" + } + ], + "argline": "git_buf *out, git_filter_list *filters, git_blob *blob", + "sig": "git_buf *::git_filter_list *::git_blob *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to the contents of a blob

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_stream_buffer": { + "type": "function", + "file": "git2/filter.h", + "line": 238, + "lineto": 242, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "the buffer to filter" + }, + { + "name": "len", + "type": "size_t", + "comment": "the size of the buffer" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" + } + ], + "argline": "git_filter_list *filters, const char *buffer, size_t len, git_writestream *target", + "sig": "git_filter_list *::const char *::size_t::git_writestream *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to an arbitrary buffer as a stream

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_stream_file": { + "type": "function", + "file": "git2/filter.h", + "line": 254, + "lineto": 258, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the filtering" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" + } + ], + "argline": "git_filter_list *filters, git_repository *repo, const char *path, git_writestream *target", + "sig": "git_filter_list *::git_repository *::const char *::git_writestream *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to a file as a stream

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_stream_blob": { + "type": "function", + "file": "git2/filter.h", + "line": 268, + "lineto": 271, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "the blob to filter" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" + } + ], + "argline": "git_filter_list *filters, git_blob *blob, git_writestream *target", + "sig": "git_filter_list *::git_blob *::git_writestream *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Apply a filter list to a blob as a stream

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_free": { + "type": "function", + "file": "git2/filter.h", + "line": 278, + "lineto": 278, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "A git_filter_list created by `git_filter_list_load`" + } + ], + "argline": "git_filter_list *filters", + "sig": "git_filter_list *", + "return": { "type": "void", "comment": null }, + "description": "

Free a git_filter_list

\n", + "comments": "", + "group": "filter" + }, + "git_libgit2_init": { + "type": "function", + "file": "git2/global.h", + "line": 32, + "lineto": 32, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " the number of initializations of the library, or an error code." + }, + "description": "

Init the global state

\n", + "comments": "

This function must be called before any other libgit2 function in order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number of times the initialization has been called (including this one) that have not subsequently been shutdown.

\n", + "group": "libgit2", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_libgit2_init-34"] + } + }, + "git_libgit2_shutdown": { + "type": "function", + "file": "git2/global.h", + "line": 45, + "lineto": 45, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " the number of remaining initializations of the library, or an\n error code." + }, + "description": "

Shutdown the global state

\n", + "comments": "

Clean up the global state and threading context after calling it as many times as git_libgit2_init() was called - it will return the number of remainining initializations that have not been shutdown (after this one).

\n", + "group": "libgit2" + }, + "git_graph_ahead_behind": { + "type": "function", + "file": "git2/graph.h", + "line": 38, + "lineto": 38, + "args": [ + { + "name": "ahead", + "type": "size_t *", + "comment": "number of unique from commits in `upstream`" + }, + { + "name": "behind", + "type": "size_t *", + "comment": "number of unique from commits in `local`" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "local", + "type": "const git_oid *", + "comment": "the commit for local" + }, + { + "name": "upstream", + "type": "const git_oid *", + "comment": "the commit for upstream" + } + ], + "argline": "size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream", + "sig": "size_t *::size_t *::git_repository *::const git_oid *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Count the number of unique commits between two commit objects

\n", + "comments": "

There is no need for branches containing the commits to have any upstream relationship, but it helps to think of one as a branch and the other as its upstream, the ahead and behind values will be what git would report for the branches.

\n", + "group": "graph" + }, + "git_graph_descendant_of": { + "type": "function", + "file": "git2/graph.h", + "line": 53, + "lineto": 56, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "commit", + "type": "const git_oid *", + "comment": "a previously loaded commit" + }, + { + "name": "ancestor", + "type": "const git_oid *", + "comment": "a potential ancestor commit" + } + ], + "argline": "git_repository *repo, const git_oid *commit, const git_oid *ancestor", + "sig": "git_repository *::const git_oid *::const git_oid *", + "return": { + "type": "int", + "comment": " 1 if the given commit is a descendant of the potential ancestor,\n 0 if not, error code otherwise." + }, + "description": "

Determine if a commit is the descendant of another commit.

\n", + "comments": "

Note that a commit is not considered a descendant of itself, in contrast to git merge-base --is-ancestor.

\n", + "group": "graph" + }, + "git_graph_reachable_from_any": { + "type": "function", + "file": "git2/graph.h", + "line": 69, + "lineto": 73, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "commit", + "type": "const git_oid *", + "comment": "a previously loaded commit" + }, + { + "name": "descendant_array", + "type": "const git_oid []", + "comment": "oids of the commits" + }, + { + "name": "length", + "type": "size_t", + "comment": "the number of commits in the provided `descendant_array`" + } + ], + "argline": "git_repository *repo, const git_oid *commit, const git_oid [] descendant_array, size_t length", + "sig": "git_repository *::const git_oid *::const git_oid []::size_t", + "return": { + "type": "int", + "comment": " 1 if the given commit is an ancestor of any of the given potential\n descendants, 0 if not, error code otherwise." + }, + "description": "

Determine if a commit is reachable from any of a list of commits by\n following parent edges.

\n", + "comments": "", + "group": "graph" + }, + "git_ignore_add_rule": { + "type": "function", + "file": "git2/ignore.h", + "line": 46, + "lineto": 48, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository to add ignore rules to." + }, + { + "name": "rules", + "type": "const char *", + "comment": "Text of rules, the contents to add on a .gitignore file.\n It is okay to have multiple rules in the text; if so,\n each rule should be terminated with a newline." + } + ], + "argline": "git_repository *repo, const char *rules", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 on success" }, + "description": "

Add ignore rules for a repository.

\n", + "comments": "

Excludesfile rules (i.e. .gitignore rules) are generally read from .gitignore files in the repository tree or from a shared system file only if a "core.excludesfile" config value is set. The library also keeps a set of per-repository internal ignores that can be configured in-memory and will not persist. This function allows you to add to that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c/ with space");\n
\n\n

This would add three rules to the ignores.

\n", + "group": "ignore" + }, + "git_ignore_clear_internal_rules": { + "type": "function", + "file": "git2/ignore.h", + "line": 61, + "lineto": 62, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository to remove ignore rules from." + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "int", "comment": " 0 on success" }, + "description": "

Clear ignore rules that were explicitly added.

\n", + "comments": "

Resets to the default internal ignore rules. This will not turn off rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n", + "group": "ignore" + }, + "git_ignore_path_is_ignored": { + "type": "function", + "file": "git2/ignore.h", + "line": 80, + "lineto": 83, + "args": [ + { + "name": "ignored", + "type": "int *", + "comment": "boolean returning 0 if the file is not ignored, 1 if it is" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + }, + { + "name": "path", + "type": "const char *", + "comment": "the file to check ignores for, relative to the repo's workdir." + } + ], + "argline": "int *ignored, git_repository *repo, const char *path", + "sig": "int *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." + }, + "description": "

Test if the ignore rules apply to a given path.

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git check-ignore --no-index" on the given file, would it be shown or not?

\n", + "group": "ignore" + }, + "git_index_open": { + "type": "function", + "file": "git2/index.h", + "line": 278, + "lineto": 278, + "args": [ + { + "name": "index_out", + "type": "git_index **", + "comment": "the pointer for the new index" + }, + { + "name": "index_path", + "type": "const char *", + "comment": "the path to the index file in disk" + } + ], + "argline": "git_index **index_out, const char *index_path", + "sig": "git_index **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new bare Git index object as a memory representation\n of the Git index file in 'index_path', without a repository\n to back it.

\n", + "comments": "

Since there is no ODB or working directory behind this index, any Index methods which rely on these (e.g. index_add_bypath) will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository, use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n", + "group": "index" + }, + "git_index_new": { + "type": "function", + "file": "git2/index.h", + "line": 291, + "lineto": 291, + "args": [ + { + "name": "index_out", + "type": "git_index **", + "comment": "the pointer for the new index" + } + ], + "argline": "git_index **index_out", + "sig": "git_index **", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an in-memory index object.

\n", + "comments": "

This index object cannot be read/written to the filesystem, but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n", + "group": "index" + }, + "git_index_free": { + "type": "function", + "file": "git2/index.h", + "line": 300, + "lineto": 300, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "void", "comment": null }, + "description": "

Free an existing index object.

\n", + "comments": "", + "group": "index", + "examples": { + "add.c": ["ex/v1.9.1/add.html#git_index_free-1"], + "commit.c": ["ex/v1.9.1/commit.html#git_index_free-3"], + "general.c": ["ex/v1.9.1/general.html#git_index_free-35"], + "init.c": ["ex/v1.9.1/init.html#git_index_free-2"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_free-1"] + } + }, + "git_index_owner": { + "type": "function", + "file": "git2/index.h", + "line": 308, + "lineto": 308, + "args": [ + { "name": "index", "type": "const git_index *", "comment": "The index" } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "git_repository *", + "comment": " A pointer to the repository" + }, + "description": "

Get the repository this index relates to

\n", + "comments": "", + "group": "index" + }, + "git_index_caps": { + "type": "function", + "file": "git2/index.h", + "line": 316, + "lineto": 316, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": "An existing index object" + } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "int", + "comment": " A combination of GIT_INDEX_CAPABILITY values" + }, + "description": "

Read index capabilities flags.

\n", + "comments": "", + "group": "index" + }, + "git_index_set_caps": { + "type": "function", + "file": "git2/index.h", + "line": 329, + "lineto": 329, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "caps", + "type": "int", + "comment": "A combination of GIT_INDEX_CAPABILITY values" + } + ], + "argline": "git_index *index, int caps", + "sig": "git_index *::int", + "return": { "type": "int", "comment": " 0 on success, -1 on failure" }, + "description": "

Set index capabilities flags.

\n", + "comments": "

If you pass GIT_INDEX_CAPABILITY_FROM_OWNER for the caps, then capabilities will be read from the config of the owner object, looking at core.ignorecase, core.filemode, core.symlinks.

\n", + "group": "index" + }, + "git_index_version": { + "type": "function", + "file": "git2/index.h", + "line": 341, + "lineto": 341, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "unsigned int", "comment": " the index version" }, + "description": "

Get index on-disk version.

\n", + "comments": "

Valid return values are 2, 3, or 4. If 3 is returned, an index with version 2 may be written instead, if the extension data in version 3 is not necessary.

\n", + "group": "index" + }, + "git_index_set_version": { + "type": "function", + "file": "git2/index.h", + "line": 354, + "lineto": 354, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The new version number" + } + ], + "argline": "git_index *index, unsigned int version", + "sig": "git_index *::unsigned int", + "return": { "type": "int", "comment": " 0 on success, -1 on failure" }, + "description": "

Set index on-disk version.

\n", + "comments": "

Valid values are 2, 3, or 4. If 2 is given, git_index_write may write an index with version 3 instead, if necessary to accurately represent the index.

\n", + "group": "index" + }, + "git_index_read": { + "type": "function", + "file": "git2/index.h", + "line": 373, + "lineto": 373, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "force", + "type": "int", + "comment": "if true, always reload, vs. only read if file has changed" + } + ], + "argline": "git_index *index, int force", + "sig": "git_index *::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Update the contents of an existing index object in memory by reading\n from the hard disk.

\n", + "comments": "

If force is true, this performs a "hard" read that discards in-memory changes and always reloads the on-disk index data. If there is no on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index data from disk only if it has changed since the last time it was loaded. Purely in-memory index data will be untouched. Be aware: if there are changes on disk, unwritten in-memory changes are discarded.

\n", + "group": "index" + }, + "git_index_write": { + "type": "function", + "file": "git2/index.h", + "line": 382, + "lineto": 382, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an existing index object from memory back to disk\n using an atomic file lock.

\n", + "comments": "", + "group": "index", + "examples": { + "add.c": ["ex/v1.9.1/add.html#git_index_write-2"], + "commit.c": ["ex/v1.9.1/commit.html#git_index_write-4"] + } + }, + "git_index_path": { + "type": "function", + "file": "git2/index.h", + "line": 390, + "lineto": 390, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": "an existing index object" + } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "const char *", + "comment": " path to index file or NULL for in-memory index" + }, + "description": "

Get the full path to the index file on disk.

\n", + "comments": "", + "group": "index" + }, + "git_index_checksum": { + "type": "function", + "file": "git2/index.h", + "line": 404, + "lineto": 404, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { + "type": "const git_oid *", + "comment": " a pointer to the checksum of the index" + }, + "description": "

Get the checksum of the index

\n", + "comments": "

This checksum is the SHA-1 hash over the index file (except the last 20 bytes which are the checksum itself). In cases where the index does not exist on-disk, it will be zeroed out.

\n", + "group": "index" + }, + "git_index_read_tree": { + "type": "function", + "file": "git2/index.h", + "line": 416, + "lineto": 416, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "tree to read" + } + ], + "argline": "git_index *index, const git_tree *tree", + "sig": "git_index *::const git_tree *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a tree into the index file with stats

\n", + "comments": "

The current index contents will be replaced by the specified tree.

\n", + "group": "index" + }, + "git_index_write_tree": { + "type": "function", + "file": "git2/index.h", + "line": 437, + "lineto": 437, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the written tree" + }, + { "name": "index", "type": "git_index *", "comment": "Index to write" } + ], + "argline": "git_oid *out, git_index *index", + "sig": "git_oid *::git_index *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" + }, + "description": "

Write the index as a tree

\n", + "comments": "

This method will scan the index and write a representation of its current state back to disk; it recursively creates tree objects for each of the subtrees stored in the index, but only returns the OID of the root tree. This is the OID that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated to an existing repository.

\n\n

The index must not contain any file in conflict.

\n", + "group": "index", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_index_write_tree-5"], + "init.c": ["ex/v1.9.1/init.html#git_index_write_tree-3"], + "merge.c": ["ex/v1.9.1/merge.html#git_index_write_tree-10"] + } + }, + "git_index_write_tree_to": { + "type": "function", + "file": "git2/index.h", + "line": 454, + "lineto": 454, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Pointer where to store OID of the written tree" + }, + { "name": "index", "type": "git_index *", "comment": "Index to write" }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to write the tree" + } + ], + "argline": "git_oid *out, git_index *index, git_repository *repo", + "sig": "git_oid *::git_index *::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" + }, + "description": "

Write the index as a tree to the given repository

\n", + "comments": "

This method will do the same as git_index_write_tree, but letting the user choose the repository where the tree will be written.

\n\n

The index must not contain any file in conflict.

\n", + "group": "index" + }, + "git_index_entrycount": { + "type": "function", + "file": "git2/index.h", + "line": 473, + "lineto": 473, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": "an existing index object" + } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "size_t", + "comment": " integer of count of current entries" + }, + "description": "

Get the count of entries currently in the index

\n", + "comments": "", + "group": "index", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_index_entrycount-36"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_entrycount-2"] + } + }, + "git_index_clear": { + "type": "function", + "file": "git2/index.h", + "line": 484, + "lineto": 484, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { + "type": "int", + "comment": " 0 on success, error code \n<\n 0 on failure" + }, + "description": "

Clear the contents (all the entries) of an index object.

\n", + "comments": "

This clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently.

\n", + "group": "index" + }, + "git_index_get_byindex": { + "type": "function", + "file": "git2/index.h", + "line": 497, + "lineto": 498, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "n", + "type": "size_t", + "comment": "the position of the entry" + } + ], + "argline": "git_index *index, size_t n", + "sig": "git_index *::size_t", + "return": { + "type": "const git_index_entry *", + "comment": " a pointer to the entry; NULL if out of bounds" + }, + "description": "

Get a pointer to one of the entries in the index

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", + "group": "index", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_index_get_byindex-37"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_get_byindex-3"] + } + }, + "git_index_get_bypath": { + "type": "function", + "file": "git2/index.h", + "line": 512, + "lineto": 513, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { "name": "path", "type": "const char *", "comment": "path to search" }, + { "name": "stage", "type": "int", "comment": "stage to search" } + ], + "argline": "git_index *index, const char *path, int stage", + "sig": "git_index *::const char *::int", + "return": { + "type": "const git_index_entry *", + "comment": " a pointer to the entry; NULL if it was not found" + }, + "description": "

Get a pointer to one of the entries in the index

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", + "group": "index", + "examples": { + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_index_get_bypath-4"] + } + }, + "git_index_remove": { + "type": "function", + "file": "git2/index.h", + "line": 523, + "lineto": 523, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { "name": "path", "type": "const char *", "comment": "path to search" }, + { "name": "stage", "type": "int", "comment": "stage to search" } + ], + "argline": "git_index *index, const char *path, int stage", + "sig": "git_index *::const char *::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove an entry from the index

\n", + "comments": "", + "group": "index" + }, + "git_index_remove_directory": { + "type": "function", + "file": "git2/index.h", + "line": 533, + "lineto": 534, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "dir", + "type": "const char *", + "comment": "container directory path" + }, + { "name": "stage", "type": "int", "comment": "stage to search" } + ], + "argline": "git_index *index, const char *dir, int stage", + "sig": "git_index *::const char *::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove all entries from the index under a given directory

\n", + "comments": "", + "group": "index" + }, + "git_index_add": { + "type": "function", + "file": "git2/index.h", + "line": 550, + "lineto": 550, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "source_entry", + "type": "const git_index_entry *", + "comment": "new entry object" + } + ], + "argline": "git_index *index, const git_index_entry *source_entry", + "sig": "git_index *::const git_index_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an index entry from an in-memory struct

\n", + "comments": "

If a previous index entry exists that has the same path and stage as the given 'source_entry', it will be replaced. Otherwise, the 'source_entry' will be added.

\n\n

A full copy (including the 'path' string) of the given 'source_entry' will be inserted on the index.

\n", + "group": "index" + }, + "git_index_entry_stage": { + "type": "function", + "file": "git2/index.h", + "line": 562, + "lineto": 562, + "args": [ + { + "name": "entry", + "type": "const git_index_entry *", + "comment": "The entry" + } + ], + "argline": "const git_index_entry *entry", + "sig": "const git_index_entry *", + "return": { "type": "int", "comment": " the stage number" }, + "description": "

Return the stage number from a git index entry

\n", + "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags & GIT_INDEX_ENTRY_STAGEMASK) >> GIT_INDEX_ENTRY_STAGESHIFT\n
\n", + "group": "index" + }, + "git_index_entry_is_conflict": { + "type": "function", + "file": "git2/index.h", + "line": 571, + "lineto": 571, + "args": [ + { + "name": "entry", + "type": "const git_index_entry *", + "comment": "The entry" + } + ], + "argline": "const git_index_entry *entry", + "sig": "const git_index_entry *", + "return": { + "type": "int", + "comment": " 1 if the entry is a conflict entry, 0 otherwise" + }, + "description": "

Return whether the given index entry is a conflict (has a high stage\n entry). This is simply shorthand for git_index_entry_stage > 0.

\n", + "comments": "", + "group": "index" + }, + "git_index_iterator_new": { + "type": "function", + "file": "git2/index.h", + "line": 592, + "lineto": 594, + "args": [ + { + "name": "iterator_out", + "type": "git_index_iterator **", + "comment": "The newly created iterator" + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to iterate" + } + ], + "argline": "git_index_iterator **iterator_out, git_index *index", + "sig": "git_index_iterator **::git_index *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create an iterator that will return every entry contained in the\n index at the time of creation. Entries are returned in order,\n sorted by path. This iterator is backed by a snapshot that allows\n callers to modify the index while iterating without affecting the\n iterator.

\n", + "comments": "", + "group": "index" + }, + "git_index_iterator_next": { + "type": "function", + "file": "git2/index.h", + "line": 603, + "lineto": 605, + "args": [ + { + "name": "out", + "type": "const git_index_entry **", + "comment": "Pointer to store the index entry in" + }, + { + "name": "iterator", + "type": "git_index_iterator *", + "comment": "The iterator" + } + ], + "argline": "const git_index_entry **out, git_index_iterator *iterator", + "sig": "const git_index_entry **::git_index_iterator *", + "return": { + "type": "int", + "comment": " 0, GIT_ITEROVER on iteration completion or an error code" + }, + "description": "

Return the next index entry in-order from the iterator.

\n", + "comments": "", + "group": "index" + }, + "git_index_iterator_free": { + "type": "function", + "file": "git2/index.h", + "line": 612, + "lineto": 612, + "args": [ + { + "name": "iterator", + "type": "git_index_iterator *", + "comment": "The iterator to free" + } + ], + "argline": "git_index_iterator *iterator", + "sig": "git_index_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Free the index iterator

\n", + "comments": "", + "group": "index" + }, + "git_index_add_bypath": { + "type": "function", + "file": "git2/index.h", + "line": 643, + "lineto": 643, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { "name": "path", "type": "const char *", "comment": "filename to add" } + ], + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an index entry from a file on disk

\n", + "comments": "

The file path must be relative to the repository's working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" + }, + "git_index_add_from_buffer": { + "type": "function", + "file": "git2/index.h", + "line": 671, + "lineto": 674, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "entry", + "type": "const git_index_entry *", + "comment": "filename to add" + }, + { + "name": "buffer", + "type": "const void *", + "comment": "data to be written into the blob" + }, + { "name": "len", "type": "size_t", "comment": "length of the data" } + ], + "argline": "git_index *index, const git_index_entry *entry, const void *buffer, size_t len", + "sig": "git_index *::const git_index_entry *::const void *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an index entry from a buffer in memory

\n", + "comments": "

This method will create a blob in the repository that owns the index and then add the index entry to the index. The path of the entry represents the position of the blob relative to the repository's root folder.

\n\n

If a previous index entry exists that has the same path as the given 'entry', it will be replaced. Otherwise, the 'entry' will be added.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" + }, + "git_index_remove_bypath": { + "type": "function", + "file": "git2/index.h", + "line": 690, + "lineto": 690, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "path", + "type": "const char *", + "comment": "filename to remove" + } + ], + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove an index entry corresponding to a file on disk

\n", + "comments": "

The file path must be relative to the repository's working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" + }, + "git_index_add_all": { + "type": "function", + "file": "git2/index.h", + "line": 738, + "lineto": 743, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" + }, + { + "name": "flags", + "type": "unsigned int", + "comment": "combination of git_index_add_option_t flags" + }, + { + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each added/updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." + }, + { + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" + } + ], + "argline": "git_index *index, const git_strarray *pathspec, unsigned int flags, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::unsigned int::git_index_matched_path_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, negative callback return value, or error code" + }, + "description": "

Add or update index entries matching files in the working directory.

\n", + "comments": "

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will be matched against files in the repository's working directory. Each file that matches will be added to the index (either updating an existing entry or adding a new entry). You can disable glob expansion and force exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath). If a file is already tracked in the index, then it will be updated even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains the exact path of an ignored file (when not using FORCE), add the GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry in the pathspec that is an exact match to a filename on disk is either not ignored or already in the index. If this check fails, the function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files will no longer be marked as conflicting. The data about the conflicts will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching item in the working directory immediately before it is added to / updated in the index. Returning zero will add the item to the index, greater than zero will skip the item, and less than zero will abort the scan and return that value to the caller.

\n", + "group": "index", + "examples": { "add.c": ["ex/v1.9.1/add.html#git_index_add_all-3"] } + }, + "git_index_remove_all": { + "type": "function", + "file": "git2/index.h", + "line": 760, + "lineto": 764, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" + }, + { + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each removed path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." + }, + { + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" + } + ], + "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, negative callback return value, or error code" + }, + "description": "

Remove all matching index entries.

\n", + "comments": "

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is removed. Return 0 to remove the item, > 0 to skip the item, and < 0 to abort the scan.

\n", + "group": "index" + }, + "git_index_update_all": { + "type": "function", + "file": "git2/index.h", + "line": 789, + "lineto": 793, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" + }, + { + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." + }, + { + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" + } + ], + "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, negative callback return value, or error code" + }, + "description": "

Update all index entries to match the working directory

\n", + "comments": "

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the working directory, deleting them if the corresponding working directory file no longer exists otherwise updating the information (including adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is updated (either refreshed or removed depending on working directory state). Return 0 to proceed with updating the item, > 0 to skip the item, and < 0 to abort the scan.

\n", + "group": "index", + "examples": { "add.c": ["ex/v1.9.1/add.html#git_index_update_all-4"] } + }, + "git_index_find": { + "type": "function", + "file": "git2/index.h", + "line": 804, + "lineto": 804, + "args": [ + { + "name": "at_pos", + "type": "size_t *", + "comment": "the address to which the position of the index entry is written (optional)" + }, + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { "name": "path", "type": "const char *", "comment": "path to search" } + ], + "argline": "size_t *at_pos, git_index *index, const char *path", + "sig": "size_t *::git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Find the first position of any entries which point to given\n path in the Git index.

\n", + "comments": "", + "group": "index" + }, + "git_index_find_prefix": { + "type": "function", + "file": "git2/index.h", + "line": 815, + "lineto": 815, + "args": [ + { + "name": "at_pos", + "type": "size_t *", + "comment": "the address to which the position of the index entry is written (optional)" + }, + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "prefix", + "type": "const char *", + "comment": "the prefix to search for" + } + ], + "argline": "size_t *at_pos, git_index *index, const char *prefix", + "sig": "size_t *::git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Find the first position of any entries matching a prefix. To find the first position\n of a path inside a given folder, suffix the prefix with a '/'.

\n", + "comments": "", + "group": "index" + }, + "git_index_conflict_add": { + "type": "function", + "file": "git2/index.h", + "line": 840, + "lineto": 844, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "ancestor_entry", + "type": "const git_index_entry *", + "comment": "the entry data for the ancestor of the conflict" + }, + { + "name": "our_entry", + "type": "const git_index_entry *", + "comment": "the entry data for our side of the merge conflict" + }, + { + "name": "their_entry", + "type": "const git_index_entry *", + "comment": "the entry data for their side of the merge conflict" + } + ], + "argline": "git_index *index, const git_index_entry *ancestor_entry, const git_index_entry *our_entry, const git_index_entry *their_entry", + "sig": "git_index *::const git_index_entry *::const git_index_entry *::const git_index_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update index entries to represent a conflict. Any staged\n entries that exist at the given paths will be removed.

\n", + "comments": "

The entries are the entries from the tree included in the merge. Any entry may be null to indicate that that file was not present in the trees during the merge. For example, ancestor_entry may be NULL to indicate that a file was added in both branches and must be resolved.

\n", + "group": "index" + }, + "git_index_conflict_get": { + "type": "function", + "file": "git2/index.h", + "line": 860, + "lineto": 865, + "args": [ + { + "name": "ancestor_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the ancestor entry" + }, + { + "name": "our_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the our entry" + }, + { + "name": "their_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the their entry" + }, + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { "name": "path", "type": "const char *", "comment": "path to search" } + ], + "argline": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index *index, const char *path", + "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the index entries that represent a conflict of a single file.

\n", + "comments": "

The entries are not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", + "group": "index" + }, + "git_index_conflict_remove": { + "type": "function", + "file": "git2/index.h", + "line": 874, + "lineto": 874, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to remove conflicts for" + } + ], + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Removes the index entries that represent a conflict of a single file.

\n", + "comments": "", + "group": "index" + }, + "git_index_conflict_cleanup": { + "type": "function", + "file": "git2/index.h", + "line": 882, + "lineto": 882, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove all conflicts in the index (entries with a stage greater than 0).

\n", + "comments": "", + "group": "index" + }, + "git_index_has_conflicts": { + "type": "function", + "file": "git2/index.h", + "line": 890, + "lineto": 890, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": "An existing index object." + } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "int", + "comment": " 1 if at least one conflict is found, 0 otherwise." + }, + "description": "

Determine if the index contains entries representing file conflicts.

\n", + "comments": "", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_has_conflicts-11"] + } + }, + "git_index_conflict_iterator_new": { + "type": "function", + "file": "git2/index.h", + "line": 901, + "lineto": 903, + "args": [ + { + "name": "iterator_out", + "type": "git_index_conflict_iterator **", + "comment": "The newly created conflict iterator" + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to scan" + } + ], + "argline": "git_index_conflict_iterator **iterator_out, git_index *index", + "sig": "git_index_conflict_iterator **::git_index *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an iterator for the conflicts in the index.

\n", + "comments": "

The index must not be modified while iterating; the results are undefined.

\n", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_conflict_iterator_new-12"] + } + }, + "git_index_conflict_next": { + "type": "function", + "file": "git2/index.h", + "line": 916, + "lineto": 920, + "args": [ + { + "name": "ancestor_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the ancestor side of the conflict" + }, + { + "name": "our_out", + "type": "const git_index_entry **", + "comment": "Pointer to store our side of the conflict" + }, + { + "name": "their_out", + "type": "const git_index_entry **", + "comment": "Pointer to store their side of the conflict" + }, + { + "name": "iterator", + "type": "git_index_conflict_iterator *", + "comment": "The conflict iterator." + } + ], + "argline": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index_conflict_iterator *iterator", + "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index_conflict_iterator *", + "return": { + "type": "int", + "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" + }, + "description": "

Returns the current conflict (ancestor, ours and theirs entry) and\n advance the iterator internally to the next value.

\n", + "comments": "", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_conflict_next-13"] + } + }, + "git_index_conflict_iterator_free": { + "type": "function", + "file": "git2/index.h", + "line": 927, + "lineto": 928, + "args": [ + { + "name": "iterator", + "type": "git_index_conflict_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_index_conflict_iterator *iterator", + "sig": "git_index_conflict_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Frees a git_index_conflict_iterator.

\n", + "comments": "", + "group": "index", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_index_conflict_iterator_free-14"] + } + }, + "git_indexer_options_init": { + "type": "function", + "file": "git2/indexer.h", + "line": 116, + "lineto": 118, + "args": [ + { + "name": "opts", + "type": "git_indexer_options *", + "comment": "the `git_indexer_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION`" + } + ], + "argline": "git_indexer_options *opts, unsigned int version", + "sig": "git_indexer_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_indexer_options with default values. Equivalent to\n creating an instance with GIT_INDEXER_OPTIONS_INIT.

\n", + "comments": "", + "group": "indexer" + }, + "git_indexer_new": { + "type": "function", + "file": "git2/indexer.h", + "line": 147, + "lineto": 152, + "args": [ + { + "name": "out", + "type": "git_indexer **", + "comment": "where to store the indexer instance" + }, + { + "name": "path", + "type": "const char *", + "comment": "to the directory where the packfile should be stored" + }, + { + "name": "mode", + "type": "unsigned int", + "comment": "permissions to use creating packfile or 0 for defaults" + }, + { + "name": "odb", + "type": "git_odb *", + "comment": "object database from which to read base objects when\n fixing thin packs. Pass NULL if no thin pack is expected (an error\n will be returned if there are bases missing)" + }, + { + "name": "opts", + "type": "git_indexer_options *", + "comment": "Optional structure containing additional options. See\n `git_indexer_options` above." + } + ], + "argline": "git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_indexer_options *opts", + "sig": "git_indexer **::const char *::unsigned int::git_odb *::git_indexer_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Create a new indexer instance

\n", + "comments": "", + "group": "indexer" + }, + "git_indexer_append": { + "type": "function", + "file": "git2/indexer.h", + "line": 164, + "lineto": 164, + "args": [ + { "name": "idx", "type": "git_indexer *", "comment": "the indexer" }, + { + "name": "data", + "type": "const void *", + "comment": "the data to add" + }, + { + "name": "size", + "type": "size_t", + "comment": "the size of the data in bytes" + }, + { + "name": "stats", + "type": "git_indexer_progress *", + "comment": "stat storage" + } + ], + "argline": "git_indexer *idx, const void *data, size_t size, git_indexer_progress *stats", + "sig": "git_indexer *::const void *::size_t::git_indexer_progress *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Add data to the indexer

\n", + "comments": "", + "group": "indexer" + }, + "git_indexer_commit": { + "type": "function", + "file": "git2/indexer.h", + "line": 175, + "lineto": 175, + "args": [ + { "name": "idx", "type": "git_indexer *", "comment": "the indexer" }, + { + "name": "stats", + "type": "git_indexer_progress *", + "comment": "Stat storage." + } + ], + "argline": "git_indexer *idx, git_indexer_progress *stats", + "sig": "git_indexer *::git_indexer_progress *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Finalize the pack and index

\n", + "comments": "

Resolve any pending deltas and write out the index file

\n", + "group": "indexer" + }, + "git_indexer_hash": { + "type": "function", + "file": "git2/indexer.h", + "line": 188, + "lineto": 188, + "args": [ + { + "name": "idx", + "type": "const git_indexer *", + "comment": "the indexer instance" + } + ], + "argline": "const git_indexer *idx", + "sig": "const git_indexer *", + "return": { + "type": "const git_oid *", + "comment": " the packfile's hash" + }, + "description": "

Get the packfile's hash

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the index has been finalized.

\n", + "group": "indexer" + }, + "git_indexer_name": { + "type": "function", + "file": "git2/indexer.h", + "line": 200, + "lineto": 200, + "args": [ + { + "name": "idx", + "type": "const git_indexer *", + "comment": "the indexer instance" + } + ], + "argline": "const git_indexer *idx", + "sig": "const git_indexer *", + "return": { + "type": "const char *", + "comment": " a NUL terminated string for the packfile name" + }, + "description": "

Get the unique name for the resulting packfile.

\n", + "comments": "

The packfile's name is derived from the packfile's content. This is only correct after the index has been finalized.

\n", + "group": "indexer" + }, + "git_indexer_free": { + "type": "function", + "file": "git2/indexer.h", + "line": 207, + "lineto": 207, + "args": [ + { + "name": "idx", + "type": "git_indexer *", + "comment": "the indexer to free" + } + ], + "argline": "git_indexer *idx", + "sig": "git_indexer *", + "return": { "type": "void", "comment": null }, + "description": "

Free the indexer and its resources

\n", + "comments": "", + "group": "indexer" + }, + "git_mailmap_new": { + "type": "function", + "file": "git2/mailmap.h", + "line": 37, + "lineto": 37, + "args": [ + { + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" + } + ], + "argline": "git_mailmap **out", + "sig": "git_mailmap **", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Allocate a new mailmap object.

\n", + "comments": "

This object is empty, so you'll have to add a mailmap file before you can do anything with it. The mailmap must be freed with 'git_mailmap_free'.

\n", + "group": "mailmap" + }, + "git_mailmap_free": { + "type": "function", + "file": "git2/mailmap.h", + "line": 44, + "lineto": 44, + "args": [ + { + "name": "mm", + "type": "git_mailmap *", + "comment": "the mailmap to free" + } + ], + "argline": "git_mailmap *mm", + "sig": "git_mailmap *", + "return": { "type": "void", "comment": null }, + "description": "

Free the mailmap and its associated memory.

\n", + "comments": "", + "group": "mailmap" + }, + "git_mailmap_add_entry": { + "type": "function", + "file": "git2/mailmap.h", + "line": 57, + "lineto": 59, + "args": [ + { + "name": "mm", + "type": "git_mailmap *", + "comment": "mailmap to add the entry to" + }, + { + "name": "real_name", + "type": "const char *", + "comment": "the real name to use, or NULL" + }, + { + "name": "real_email", + "type": "const char *", + "comment": "the real email to use, or NULL" + }, + { + "name": "replace_name", + "type": "const char *", + "comment": "the name to replace, or NULL" + }, + { + "name": "replace_email", + "type": "const char *", + "comment": "the email to replace" + } + ], + "argline": "git_mailmap *mm, const char *real_name, const char *real_email, const char *replace_name, const char *replace_email", + "sig": "git_mailmap *::const char *::const char *::const char *::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Add a single entry to the given mailmap object. If the entry already exists,\n it will be replaced with the new entry.

\n", + "comments": "", + "group": "mailmap" + }, + "git_mailmap_from_buffer": { + "type": "function", + "file": "git2/mailmap.h", + "line": 69, + "lineto": 70, + "args": [ + { + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" + }, + { + "name": "buf", + "type": "const char *", + "comment": "buffer to parse the mailmap from" + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the input buffer" + } + ], + "argline": "git_mailmap **out, const char *buf, size_t len", + "sig": "git_mailmap **::const char *::size_t", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Create a new mailmap instance containing a single mailmap file

\n", + "comments": "", + "group": "mailmap" + }, + "git_mailmap_from_repository": { + "type": "function", + "file": "git2/mailmap.h", + "line": 86, + "lineto": 87, + "args": [ + { + "name": "out", + "type": "git_mailmap **", + "comment": "pointer to store the new mailmap" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to load mailmap information from" + } + ], + "argline": "git_mailmap **out, git_repository *repo", + "sig": "git_mailmap **::git_repository *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Create a new mailmap instance from a repository, loading mailmap files based\n on the repository's configuration.

\n", + "comments": "

Mailmaps are loaded in the following order: 1. '.mailmap' in the root of the repository's working directory, if present. 2. The blob object identified by the 'mailmap.blob' config entry, if set. [NOTE: 'mailmap.blob' defaults to 'HEAD:.mailmap' in bare repositories] 3. The path in the 'mailmap.file' config entry, if set.

\n", + "group": "mailmap" + }, + "git_mailmap_resolve": { + "type": "function", + "file": "git2/mailmap.h", + "line": 101, + "lineto": 103, + "args": [ + { + "name": "real_name", + "type": "const char **", + "comment": "pointer to store the real name" + }, + { + "name": "real_email", + "type": "const char **", + "comment": "pointer to store the real email" + }, + { + "name": "mm", + "type": "const git_mailmap *", + "comment": "the mailmap to perform a lookup with (may be NULL)" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name to look up" + }, + { + "name": "email", + "type": "const char *", + "comment": "the email to look up" + } + ], + "argline": "const char **real_name, const char **real_email, const git_mailmap *mm, const char *name, const char *email", + "sig": "const char **::const char **::const git_mailmap *::const char *::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Resolve a name and email to the corresponding real name and email.

\n", + "comments": "

The lifetime of the strings are tied to mm, name, and email parameters.

\n", + "group": "mailmap" + }, + "git_mailmap_resolve_signature": { + "type": "function", + "file": "git2/mailmap.h", + "line": 115, + "lineto": 116, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature" + }, + { + "name": "mm", + "type": "const git_mailmap *", + "comment": "mailmap to resolve with" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to resolve" + } + ], + "argline": "git_signature **out, const git_mailmap *mm, const git_signature *sig", + "sig": "git_signature **::const git_mailmap *::const git_signature *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Resolve a signature to use real names and emails with a mailmap.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "mailmap" + }, + "git_merge_file_input_init": { + "type": "function", + "file": "git2/merge.h", + "line": 66, + "lineto": 68, + "args": [ + { + "name": "opts", + "type": "git_merge_file_input *", + "comment": "the `git_merge_file_input` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_MERGE_FILE_INPUT_VERSION` here." + } + ], + "argline": "git_merge_file_input *opts, unsigned int version", + "sig": "git_merge_file_input *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_merge_file_input with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_INPUT_INIT.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_file_options_init": { + "type": "function", + "file": "git2/merge.h", + "line": 243, + "lineto": 243, + "args": [ + { + "name": "opts", + "type": "git_merge_file_options *", + "comment": "The `git_merge_file_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_MERGE_FILE_OPTIONS_VERSION`." + } + ], + "argline": "git_merge_file_options *opts, unsigned int version", + "sig": "git_merge_file_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_merge_file_options structure

\n", + "comments": "

Initializes a git_merge_file_options with default values. Equivalent to creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n", + "group": "merge" + }, + "git_merge_options_init": { + "type": "function", + "file": "git2/merge.h", + "line": 342, + "lineto": 342, + "args": [ + { + "name": "opts", + "type": "git_merge_options *", + "comment": "The `git_merge_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_MERGE_OPTIONS_VERSION`." + } + ], + "argline": "git_merge_options *opts, unsigned int version", + "sig": "git_merge_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_merge_options structure

\n", + "comments": "

Initializes a git_merge_options with default values. Equivalent to creating an instance with GIT_MERGE_OPTIONS_INIT.

\n", + "group": "merge" + }, + "git_merge_analysis": { + "type": "function", + "file": "git2/merge.h", + "line": 412, + "lineto": 417, + "args": [ + { + "name": "analysis_out", + "type": "git_merge_analysis_t *", + "comment": "analysis enumeration that the result is written into" + }, + { + "name": "preference_out", + "type": "git_merge_preference_t *", + "comment": "One of the `git_merge_preference_t` flag." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to merge" + }, + { + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, + { + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" + } + ], + "argline": "git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len", + "sig": "git_merge_analysis_t *::git_merge_preference_t *::git_repository *::const git_annotated_commit **::size_t", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Analyzes the given branch(es) and determines the opportunities for\n merging them into the HEAD of the repository.

\n", + "comments": "", + "group": "merge", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_merge_analysis-15"] } + }, + "git_merge_analysis_for_ref": { + "type": "function", + "file": "git2/merge.h", + "line": 431, + "lineto": 437, + "args": [ + { + "name": "analysis_out", + "type": "git_merge_analysis_t *", + "comment": "analysis enumeration that the result is written into" + }, + { + "name": "preference_out", + "type": "git_merge_preference_t *", + "comment": "One of the `git_merge_preference_t` flag." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to merge" + }, + { + "name": "our_ref", + "type": "git_reference *", + "comment": "the reference to perform the analysis from" + }, + { + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, + { + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" + } + ], + "argline": "git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, git_reference *our_ref, const git_annotated_commit **their_heads, size_t their_heads_len", + "sig": "git_merge_analysis_t *::git_merge_preference_t *::git_repository *::git_reference *::const git_annotated_commit **::size_t", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Analyzes the given branch(es) and determines the opportunities for\n merging them into a reference.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_base": { + "type": "function", + "file": "git2/merge.h", + "line": 448, + "lineto": 452, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "the OID of a merge base between 'one' and 'two'" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "one", + "type": "const git_oid *", + "comment": "one of the commits" + }, + { + "name": "two", + "type": "const git_oid *", + "comment": "the other commit" + } + ], + "argline": "git_oid *out, git_repository *repo, const git_oid *one, const git_oid *two", + "sig": "git_oid *::git_repository *::const git_oid *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" + }, + "description": "

Find a merge base between two commits

\n", + "comments": "", + "group": "merge", + "examples": { + "log.c": ["ex/v1.9.1/log.html#git_merge_base-31"], + "rev-parse.c": ["ex/v1.9.1/rev-parse.html#git_merge_base-1"] + } + }, + "git_merge_bases": { + "type": "function", + "file": "git2/merge.h", + "line": 463, + "lineto": 467, + "args": [ + { + "name": "out", + "type": "git_oidarray *", + "comment": "array in which to store the resulting ids" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "one", + "type": "const git_oid *", + "comment": "one of the commits" + }, + { + "name": "two", + "type": "const git_oid *", + "comment": "the other commit" + } + ], + "argline": "git_oidarray *out, git_repository *repo, const git_oid *one, const git_oid *two", + "sig": "git_oidarray *::git_repository *::const git_oid *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" + }, + "description": "

Find merge bases between two commits

\n", + "comments": "", + "group": "merge" + }, + "git_merge_base_many": { + "type": "function", + "file": "git2/merge.h", + "line": 478, + "lineto": 482, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "the OID of a merge base considering all the commits" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "length", + "type": "size_t", + "comment": "The number of commits in the provided `input_array`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" + } + ], + "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oid *::git_repository *::size_t::const git_oid []", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." + }, + "description": "

Find a merge base given a list of commits

\n", + "comments": "", + "group": "merge" + }, + "git_merge_bases_many": { + "type": "function", + "file": "git2/merge.h", + "line": 524, + "lineto": 528, + "args": [ + { + "name": "out", + "type": "git_oidarray *", + "comment": "array in which to store the resulting ids" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "length", + "type": "size_t", + "comment": "The number of commits in the provided `input_array`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" + } + ], + "argline": "git_oidarray *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oidarray *::git_repository *::size_t::const git_oid []", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." + }, + "description": "

Find all merge bases given a list of commits

\n", + "comments": "

This behaves similar to git merge-base.

\n\n

Given three commits a, b, and c, merge_base_many will compute a hypothetical commit m, which is a merge between b and c.

\n\n

For example, with the following topology: text o---o---o---o---C / / o---o---o---B / / ---2---1---o---o---o---A

\n\n

the result of merge_base_many given a, b, and c is 1. This is because the equivalent topology with the imaginary merge commit m between b and c is: text o---o---o---o---o / \\ / o---o---o---o---M / / ---2---1---o---o---o---A

\n\n

and the result of merge_base_many given a and m is 1.

\n\n

If you're looking to recieve the common ancestor between all the given commits, use merge_base_octopus.

\n", + "group": "merge" + }, + "git_merge_base_octopus": { + "type": "function", + "file": "git2/merge.h", + "line": 539, + "lineto": 543, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "the OID of a merge base considering all the commits" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "length", + "type": "size_t", + "comment": "The number of commits in the provided `input_array`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" + } + ], + "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oid *::git_repository *::size_t::const git_oid []", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." + }, + "description": "

Find a merge base in preparation for an octopus merge

\n", + "comments": "", + "group": "merge" + }, + "git_merge_file": { + "type": "function", + "file": "git2/merge.h", + "line": 561, + "lineto": 566, + "args": [ + { + "name": "out", + "type": "git_merge_file_result *", + "comment": "The git_merge_file_result to be filled in" + }, + { + "name": "ancestor", + "type": "const git_merge_file_input *", + "comment": "The contents of the ancestor file" + }, + { + "name": "ours", + "type": "const git_merge_file_input *", + "comment": "The contents of the file in \"our\" side" + }, + { + "name": "theirs", + "type": "const git_merge_file_input *", + "comment": "The contents of the file in \"their\" side" + }, + { + "name": "opts", + "type": "const git_merge_file_options *", + "comment": "The merge file options or `NULL` for defaults" + } + ], + "argline": "git_merge_file_result *out, const git_merge_file_input *ancestor, const git_merge_file_input *ours, const git_merge_file_input *theirs, const git_merge_file_options *opts", + "sig": "git_merge_file_result *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two files as they exist in the in-memory data structures, using\n the given common ancestor as the baseline, producing a\n git_merge_file_result that reflects the merge result. The\n git_merge_file_result must be freed with git_merge_file_result_free.

\n", + "comments": "

Note that this function does not reference a repository and any configuration must be passed as git_merge_file_options.

\n", + "group": "merge" + }, + "git_merge_file_from_index": { + "type": "function", + "file": "git2/merge.h", + "line": 582, + "lineto": 588, + "args": [ + { + "name": "out", + "type": "git_merge_file_result *", + "comment": "The git_merge_file_result to be filled in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + }, + { + "name": "ancestor", + "type": "const git_index_entry *", + "comment": "The index entry for the ancestor file (stage level 1)" + }, + { + "name": "ours", + "type": "const git_index_entry *", + "comment": "The index entry for our file (stage level 2)" + }, + { + "name": "theirs", + "type": "const git_index_entry *", + "comment": "The index entry for their file (stage level 3)" + }, + { + "name": "opts", + "type": "const git_merge_file_options *", + "comment": "The merge file options or NULL" + } + ], + "argline": "git_merge_file_result *out, git_repository *repo, const git_index_entry *ancestor, const git_index_entry *ours, const git_index_entry *theirs, const git_merge_file_options *opts", + "sig": "git_merge_file_result *::git_repository *::const git_index_entry *::const git_index_entry *::const git_index_entry *::const git_merge_file_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two files as they exist in the index, using the given common\n ancestor as the baseline, producing a git_merge_file_result that\n reflects the merge result. The git_merge_file_result must be freed with\n git_merge_file_result_free.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_file_result_free": { + "type": "function", + "file": "git2/merge.h", + "line": 595, + "lineto": 595, + "args": [ + { + "name": "result", + "type": "git_merge_file_result *", + "comment": "The result to free or `NULL`" + } + ], + "argline": "git_merge_file_result *result", + "sig": "git_merge_file_result *", + "return": { "type": "void", "comment": null }, + "description": "

Frees a git_merge_file_result.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_trees": { + "type": "function", + "file": "git2/merge.h", + "line": 613, + "lineto": 619, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given trees" + }, + { + "name": "ancestor_tree", + "type": "const git_tree *", + "comment": "the common ancestor between the trees (or null if none)" + }, + { + "name": "our_tree", + "type": "const git_tree *", + "comment": "the tree that reflects the destination tree" + }, + { + "name": "their_tree", + "type": "const git_tree *", + "comment": "the tree to merge in to `our_tree`" + }, + { + "name": "opts", + "type": "const git_merge_options *", + "comment": "the merge tree options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, const git_tree *ancestor_tree, const git_tree *our_tree, const git_tree *their_tree, const git_merge_options *opts", + "sig": "git_index **::git_repository *::const git_tree *::const git_tree *::const git_tree *::const git_merge_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two trees, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "merge" + }, + "git_merge_commits": { + "type": "function", + "file": "git2/merge.h", + "line": 636, + "lineto": 641, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given trees" + }, + { + "name": "our_commit", + "type": "const git_commit *", + "comment": "the commit that reflects the destination tree" + }, + { + "name": "their_commit", + "type": "const git_commit *", + "comment": "the commit to merge in to `our_commit`" + }, + { + "name": "opts", + "type": "const git_merge_options *", + "comment": "the merge tree options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, const git_commit *our_commit, const git_commit *their_commit, const git_merge_options *opts", + "sig": "git_index **::git_repository *::const git_commit *::const git_commit *::const git_merge_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merge two commits, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "merge" + }, + "git_merge": { + "type": "function", + "file": "git2/merge.h", + "line": 661, + "lineto": 666, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to merge" + }, + { + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, + { + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" + }, + { + "name": "merge_opts", + "type": "const git_merge_options *", + "comment": "merge options" + }, + { + "name": "checkout_opts", + "type": "const git_checkout_options *", + "comment": "checkout options" + } + ], + "argline": "git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len, const git_merge_options *merge_opts, const git_checkout_options *checkout_opts", + "sig": "git_repository *::const git_annotated_commit **::size_t::const git_merge_options *::const git_checkout_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Merges the given commit(s) into HEAD, writing the results into the working\n directory. Any changes are staged for commit and any conflicts are written\n to the index. Callers should inspect the repository's index after this\n completes, resolve any conflicts and prepare a commit.

\n", + "comments": "

For compatibility with git, the repository is put into a merging state. Once the commit is done (or if the user wishes to abort), you should clear this state by calling git_repository_state_cleanup().

\n", + "group": "merge", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_merge-16"] } + }, + "git_message_prettify": { + "type": "function", + "file": "git2/message.h", + "line": 38, + "lineto": 38, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The user-allocated git_buf which will be filled with the\n cleaned up message." + }, + { + "name": "message", + "type": "const char *", + "comment": "The message to be prettified." + }, + { + "name": "strip_comments", + "type": "int", + "comment": "Non-zero to remove comment lines, 0 to leave them in." + }, + { + "name": "comment_char", + "type": "char", + "comment": "Comment character. Lines starting with this character\n are considered to be comments and removed if `strip_comments` is non-zero." + } + ], + "argline": "git_buf *out, const char *message, int strip_comments, char comment_char", + "sig": "git_buf *::const char *::int::char", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Clean up excess whitespace and make sure there is a trailing newline in the message.

\n", + "comments": "

Optionally, it can remove lines which start with the comment character.

\n", + "group": "message" + }, + "git_message_trailers": { + "type": "function", + "file": "git2/message.h", + "line": 73, + "lineto": 73, + "args": [ + { + "name": "arr", + "type": "git_message_trailer_array *", + "comment": "A pre-allocated git_message_trailer_array struct to be filled in\n with any trailers found during parsing." + }, + { + "name": "message", + "type": "const char *", + "comment": "The message to be parsed" + } + ], + "argline": "git_message_trailer_array *arr, const char *message", + "sig": "git_message_trailer_array *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or non-zero on error." + }, + "description": "

Parse trailers out of a message, filling the array pointed to by +arr+.

\n", + "comments": "

Trailers are key/value pairs in the last paragraph of a message, not including any patches or conflicts that may be present.

\n", + "group": "message" + }, + "git_message_trailer_array_free": { + "type": "function", + "file": "git2/message.h", + "line": 81, + "lineto": 81, + "args": [ + { + "name": "arr", + "type": "git_message_trailer_array *", + "comment": "The trailer to free." + } + ], + "argline": "git_message_trailer_array *arr", + "sig": "git_message_trailer_array *", + "return": { "type": "void", "comment": null }, + "description": "

Clean's up any allocated memory in the git_message_trailer_array filled by\n a call to git_message_trailers.

\n", + "comments": "", + "group": "message" + }, + "git_note_iterator_free": { + "type": "function", + "file": "git2/notes.h", + "line": 75, + "lineto": 75, + "args": [ + { + "name": "it", + "type": "git_note_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_note_iterator *it", + "sig": "git_note_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Frees an git_note_iterator

\n", + "comments": "", + "group": "note" + }, + "git_note_next": { + "type": "function", + "file": "git2/notes.h", + "line": 88, + "lineto": 91, + "args": [ + { + "name": "note_id", + "type": "git_oid *", + "comment": "id of blob containing the message" + }, + { + "name": "annotated_id", + "type": "git_oid *", + "comment": "id of the git object being annotated" + }, + { + "name": "it", + "type": "git_note_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_oid *note_id, git_oid *annotated_id, git_note_iterator *it", + "sig": "git_oid *::git_oid *::git_note_iterator *", + "return": { + "type": "int", + "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" + }, + "description": "

Return the current item (note_id and annotated_id) and advance the iterator\n internally to the next value

\n", + "comments": "", + "group": "note" + }, + "git_object_lookup": { + "type": "function", + "file": "git2/object.h", + "line": 45, + "lineto": 49, + "args": [ + { + "name": "object", + "type": "git_object **", + "comment": "pointer to the looked-up object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to look up the object" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the unique identifier for the object" + }, + { + "name": "type", + "type": "git_object_t", + "comment": "the type of the object" + } + ], + "argline": "git_object **object, git_repository *repo, const git_oid *id, git_object_t type", + "sig": "git_object **::git_repository *::const git_oid *::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a reference to one of the objects in a repository.

\n", + "comments": "

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJECT_ANY' may be passed to let the method guess the object's type.

\n", + "group": "object", + "examples": { + "log.c": ["ex/v1.9.1/log.html#git_object_lookup-32"], + "merge.c": ["ex/v1.9.1/merge.html#git_object_lookup-17"] + } + }, + "git_object_lookup_prefix": { + "type": "function", + "file": "git2/object.h", + "line": 78, + "lineto": 83, + "args": [ + { + "name": "object_out", + "type": "git_object **", + "comment": "pointer where to store the looked-up object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to look up the object" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "a short identifier for the object" + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the short identifier" + }, + { + "name": "type", + "type": "git_object_t", + "comment": "the type of the object" + } + ], + "argline": "git_object **object_out, git_repository *repo, const git_oid *id, size_t len, git_object_t type", + "sig": "git_object **::git_repository *::const git_oid *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a reference to one of the objects in a repository,\n given a prefix of its identifier (short id).

\n", + "comments": "

The object obtained will be so that its identifier matches the first 'len' hexadecimal characters (packets of 4 bits) of the given id. len must be at least GIT_OID_MINPREFIXLEN, and long enough to identify a unique object matching the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The type parameter must match the type of the object in the odb; the method will fail otherwise. The special value GIT_OBJECT_ANY may be passed to let the method guess the object's type.

\n", + "group": "object" + }, + "git_object_lookup_bypath": { + "type": "function", + "file": "git2/object.h", + "line": 96, + "lineto": 100, + "args": [ + { + "name": "out", + "type": "git_object **", + "comment": "buffer that receives a pointer to the object (which must be freed\n by the caller)" + }, + { + "name": "treeish", + "type": "const git_object *", + "comment": "root object that can be peeled to a tree" + }, + { + "name": "path", + "type": "const char *", + "comment": "relative path from the root object to the desired object" + }, + { + "name": "type", + "type": "git_object_t", + "comment": "type of object desired" + } + ], + "argline": "git_object **out, const git_object *treeish, const char *path, git_object_t type", + "sig": "git_object **::const git_object *::const char *::git_object_t", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Lookup an object that represents a tree entry.

\n", + "comments": "", + "group": "object" + }, + "git_object_id": { + "type": "function", + "file": "git2/object.h", + "line": 108, + "lineto": 108, + "args": [ + { + "name": "obj", + "type": "const git_object *", + "comment": "the repository object" + } + ], + "argline": "const git_object *obj", + "sig": "const git_object *", + "return": { "type": "const git_oid *", "comment": " the SHA1 id" }, + "description": "

Get the id (SHA1) of a repository object

\n", + "comments": "", + "group": "object", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_object_id-7", + "ex/v1.9.1/blame.html#git_object_id-8", + "ex/v1.9.1/blame.html#git_object_id-9", + "ex/v1.9.1/blame.html#git_object_id-10" + ], + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_object_id-10", + "ex/v1.9.1/cat-file.html#git_object_id-11" + ], + "log.c": [ + "ex/v1.9.1/log.html#git_object_id-33", + "ex/v1.9.1/log.html#git_object_id-34", + "ex/v1.9.1/log.html#git_object_id-35", + "ex/v1.9.1/log.html#git_object_id-36" + ], + "rev-parse.c": [ + "ex/v1.9.1/rev-parse.html#git_object_id-2", + "ex/v1.9.1/rev-parse.html#git_object_id-3", + "ex/v1.9.1/rev-parse.html#git_object_id-4", + "ex/v1.9.1/rev-parse.html#git_object_id-5", + "ex/v1.9.1/rev-parse.html#git_object_id-6" + ] + } + }, + "git_object_short_id": { + "type": "function", + "file": "git2/object.h", + "line": 122, + "lineto": 122, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Buffer to write string into" + }, + { + "name": "obj", + "type": "const git_object *", + "comment": "The object to get an ID for" + } + ], + "argline": "git_buf *out, const git_object *obj", + "sig": "git_buf *::const git_object *", + "return": { "type": "int", "comment": " 0 on success, \n<\n0 for error" }, + "description": "

Get a short abbreviated OID string for the object

\n", + "comments": "

This starts at the "core.abbrev" length (default 7 characters) and iteratively extends to a longer string if that length is ambiguous. The result will be unambiguous (at least until new objects are added to the repository).

\n", + "group": "object", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_object_short_id-3"] } + }, + "git_object_type": { + "type": "function", + "file": "git2/object.h", + "line": 130, + "lineto": 130, + "args": [ + { + "name": "obj", + "type": "const git_object *", + "comment": "the repository object" + } + ], + "argline": "const git_object *obj", + "sig": "const git_object *", + "return": { "type": "git_object_t", "comment": " the object's type" }, + "description": "

Get the object type of an object

\n", + "comments": "", + "group": "object", + "examples": { + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_object_type-12", + "ex/v1.9.1/cat-file.html#git_object_type-13", + "ex/v1.9.1/cat-file.html#git_object_type-14" + ], + "tag.c": ["ex/v1.9.1/tag.html#git_object_type-4"] + } + }, + "git_object_owner": { + "type": "function", + "file": "git2/object.h", + "line": 144, + "lineto": 144, + "args": [ + { "name": "obj", "type": "const git_object *", "comment": "the object" } + ], + "argline": "const git_object *obj", + "sig": "const git_object *", + "return": { + "type": "git_repository *", + "comment": " the repository who owns this object" + }, + "description": "

Get the repository that owns this object

\n", + "comments": "

Freeing or calling git_repository_close on the returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without affecting the object.

\n", + "group": "object" + }, + "git_object_free": { + "type": "function", + "file": "git2/object.h", + "line": 161, + "lineto": 161, + "args": [ + { + "name": "object", + "type": "git_object *", + "comment": "the object to close" + } + ], + "argline": "git_object *object", + "sig": "git_object *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open object

\n", + "comments": "

This method instructs the library to close an existing object; note that git_objects are owned and cached by the repository so the object may or may not be freed after this library call, depending on how aggressive is the caching mechanism used by the repository.

\n\n

IMPORTANT: It is necessary to call this method when you stop using an object. Failure to do so will cause a memory leak.

\n", + "group": "object", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_object_free-11", + "ex/v1.9.1/blame.html#git_object_free-12", + "ex/v1.9.1/blame.html#git_object_free-13", + "ex/v1.9.1/blame.html#git_object_free-14" + ], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_object_free-15"], + "commit.c": ["ex/v1.9.1/commit.html#git_object_free-6"], + "general.c": ["ex/v1.9.1/general.html#git_object_free-38"], + "log.c": ["ex/v1.9.1/log.html#git_object_free-37"], + "merge.c": ["ex/v1.9.1/merge.html#git_object_free-18"], + "rev-parse.c": [ + "ex/v1.9.1/rev-parse.html#git_object_free-7", + "ex/v1.9.1/rev-parse.html#git_object_free-8", + "ex/v1.9.1/rev-parse.html#git_object_free-9" + ], + "tag.c": [ + "ex/v1.9.1/tag.html#git_object_free-5", + "ex/v1.9.1/tag.html#git_object_free-6", + "ex/v1.9.1/tag.html#git_object_free-7", + "ex/v1.9.1/tag.html#git_object_free-8" + ] + } + }, + "git_object_type2string": { + "type": "function", + "file": "git2/object.h", + "line": 172, + "lineto": 172, + "args": [ + { + "name": "type", + "type": "git_object_t", + "comment": "object type to convert." + } + ], + "argline": "git_object_t type", + "sig": "git_object_t", + "return": { + "type": "const char *", + "comment": " the corresponding string representation." + }, + "description": "

Convert an object type to its string representation.

\n", + "comments": "

The result is a pointer to a string in static memory and should not be free()'ed.

\n", + "group": "object", + "examples": { + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_object_type2string-16", + "ex/v1.9.1/cat-file.html#git_object_type2string-17", + "ex/v1.9.1/cat-file.html#git_object_type2string-18", + "ex/v1.9.1/cat-file.html#git_object_type2string-19" + ], + "general.c": [ + "ex/v1.9.1/general.html#git_object_type2string-39", + "ex/v1.9.1/general.html#git_object_type2string-40" + ] + } + }, + "git_object_string2type": { + "type": "function", + "file": "git2/object.h", + "line": 180, + "lineto": 180, + "args": [ + { + "name": "str", + "type": "const char *", + "comment": "the string to convert." + } + ], + "argline": "const char *str", + "sig": "const char *", + "return": { + "type": "git_object_t", + "comment": " the corresponding git_object_t." + }, + "description": "

Convert a string object type representation to it's git_object_t.

\n", + "comments": "", + "group": "object" + }, + "git_object_typeisloose": { + "type": "function", + "file": "git2/object.h", + "line": 189, + "lineto": 189, + "args": [ + { + "name": "type", + "type": "git_object_t", + "comment": "object type to test." + } + ], + "argline": "git_object_t type", + "sig": "git_object_t", + "return": { + "type": "int", + "comment": " true if the type represents a valid loose object type,\n false otherwise." + }, + "description": "

Determine if the given git_object_t is a valid loose object type.

\n", + "comments": "", + "group": "object" + }, + "git_object_peel": { + "type": "function", + "file": "git2/object.h", + "line": 214, + "lineto": 217, + "args": [ + { + "name": "peeled", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" + }, + { + "name": "object", + "type": "const git_object *", + "comment": "The object to be processed" + }, + { + "name": "target_type", + "type": "git_object_t", + "comment": "The type of the requested object (a GIT_OBJECT_ value)" + } + ], + "argline": "git_object **peeled, const git_object *object, git_object_t target_type", + "sig": "git_object **::const git_object *::git_object_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code" + }, + "description": "

Recursively peel an object until an object of the specified type is met.

\n", + "comments": "

If the query cannot be satisfied due to the object model, GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a tree).

\n\n

If you pass GIT_OBJECT_ANY as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to the target type due to the object model, GIT_EPEEL will be returned.

\n\n

You must free the returned object.

\n", + "group": "object" + }, + "git_object_dup": { + "type": "function", + "file": "git2/object.h", + "line": 227, + "lineto": 227, + "args": [ + { + "name": "dest", + "type": "git_object **", + "comment": "Pointer to store the copy of the object" + }, + { + "name": "source", + "type": "git_object *", + "comment": "Original object to copy" + } + ], + "argline": "git_object **dest, git_object *source", + "sig": "git_object **::git_object *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an in-memory copy of a Git object. The copy must be\n explicitly free'd or it will leak.

\n", + "comments": "", + "group": "object" + }, + "git_object_rawcontent_is_valid": { + "type": "function", + "file": "git2/object.h", + "line": 270, + "lineto": 274, + "args": [ + { + "name": "valid", + "type": "int *", + "comment": "Output pointer to set with validity of the object content" + }, + { + "name": "buf", + "type": "const char *", + "comment": "The contents to validate" + }, + { + "name": "len", + "type": "size_t", + "comment": "The length of the buffer" + }, + { + "name": "object_type", + "type": "git_object_t", + "comment": "The type of the object in the buffer" + } + ], + "argline": "int *valid, const char *buf, size_t len, git_object_t object_type", + "sig": "int *::const char *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Analyzes a buffer of raw object content and determines its validity.\n Tree, commit, and tag objects will be parsed and ensured that they\n are valid, parseable content. (Blobs are always valid by definition.)\n An error message will be set with an informative message if the object\n is not valid.

\n", + "comments": "", + "group": "object" + }, + "git_odb_new": { + "type": "function", + "file": "git2/odb.h", + "line": 102, + "lineto": 102, + "args": [ + { + "name": "odb", + "type": "git_odb **", + "comment": "location to store the database pointer, if opened." + } + ], + "argline": "git_odb **odb", + "sig": "git_odb **", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new object database with no backends.

\n", + "comments": "

Before the ODB can be used for read/writing, a custom database backend must be manually added using git_odb_add_backend()

\n", + "group": "odb" + }, + "git_odb_open": { + "type": "function", + "file": "git2/odb.h", + "line": 120, + "lineto": 120, + "args": [ + { + "name": "odb_out", + "type": "git_odb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + }, + { + "name": "objects_dir", + "type": "const char *", + "comment": "path of the backends' \"objects\" directory." + } + ], + "argline": "git_odb **odb_out, const char *objects_dir", + "sig": "git_odb **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new object database and automatically add\n the two default backends:

\n", + "comments": "
- git_odb_backend_loose: read and write loose object files      from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,        assuming `objects_dir` as the Objects folder which      contains a 'pack/' folder with the corresponding data\n
\n", + "group": "odb" + }, + "git_odb_add_disk_alternate": { + "type": "function", + "file": "git2/odb.h", + "line": 138, + "lineto": 138, + "args": [ + { + "name": "odb", + "type": "git_odb *", + "comment": "database to add the backend to" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to the objects folder for the alternate" + } + ], + "argline": "git_odb *odb, const char *path", + "sig": "git_odb *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, error code otherwise" + }, + "description": "

Add an on-disk alternate to an existing Object DB.

\n", + "comments": "

Note that the added path must point to an objects, not to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n", + "group": "odb" + }, + "git_odb_free": { + "type": "function", + "file": "git2/odb.h", + "line": 145, + "lineto": 145, + "args": [ + { + "name": "db", + "type": "git_odb *", + "comment": "database pointer to close. If NULL no action is taken." + } + ], + "argline": "git_odb *db", + "sig": "git_odb *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open object database.

\n", + "comments": "", + "group": "odb", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_free-20"], + "general.c": ["ex/v1.9.1/general.html#git_odb_free-41"] + } + }, + "git_odb_read": { + "type": "function", + "file": "git2/odb.h", + "line": 163, + "lineto": 163, + "args": [ + { + "name": "obj", + "type": "git_odb_object **", + "comment": "pointer where to store the read object" + }, + { + "name": "db", + "type": "git_odb *", + "comment": "database to search for the object in." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the object to read." + } + ], + "argline": "git_odb_object **obj, git_odb *db, const git_oid *id", + "sig": "git_odb_object **::git_odb *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 if the object was read, GIT_ENOTFOUND if the object is\n not in the database." + }, + "description": "

Read an object from the database.

\n", + "comments": "

This method queries all available ODB backends trying to read the given OID.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", + "group": "odb", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_read-21"], + "general.c": ["ex/v1.9.1/general.html#git_odb_read-42"] + } + }, + "git_odb_read_prefix": { + "type": "function", + "file": "git2/odb.h", + "line": 191, + "lineto": 191, + "args": [ + { + "name": "obj", + "type": "git_odb_object **", + "comment": "pointer where to store the read object" + }, + { + "name": "db", + "type": "git_odb *", + "comment": "database to search for the object in." + }, + { + "name": "short_id", + "type": "const git_oid *", + "comment": "a prefix of the id of the object to read." + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the prefix" + } + ], + "argline": "git_odb_object **obj, git_odb *db, const git_oid *short_id, size_t len", + "sig": "git_odb_object **::git_odb *::const git_oid *::size_t", + "return": { + "type": "int", + "comment": " 0 if the object was read, GIT_ENOTFOUND if the object is not in the\n database. GIT_EAMBIGUOUS if the prefix is ambiguous\n (several objects match the prefix)" + }, + "description": "

Read an object from the database, given a prefix\n of its identifier.

\n", + "comments": "

This method queries all available ODB backends trying to match the 'len' first hexadecimal characters of the 'short_id'. The remaining (GIT_OID_SHA1_HEXSIZE-len)*4 bits of 'short_id' must be 0s. 'len' must be at least GIT_OID_MINPREFIXLEN, and the prefix must be long enough to identify a unique object in all the backends; the method will fail otherwise.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", + "group": "odb" + }, + "git_odb_read_header": { + "type": "function", + "file": "git2/odb.h", + "line": 210, + "lineto": 210, + "args": [ + { + "name": "len_out", + "type": "size_t *", + "comment": "pointer where to store the length" + }, + { + "name": "type_out", + "type": "git_object_t *", + "comment": "pointer where to store the type" + }, + { + "name": "db", + "type": "git_odb *", + "comment": "database to search for the object in." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the object to read." + } + ], + "argline": "size_t *len_out, git_object_t *type_out, git_odb *db, const git_oid *id", + "sig": "size_t *::git_object_t *::git_odb *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 if the object was read, GIT_ENOTFOUND if the object is not\n in the database." + }, + "description": "

Read the header of an object from the database, without\n reading its full contents.

\n", + "comments": "

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header of an object, so the whole object will be read and then the header will be returned.

\n", + "group": "odb" + }, + "git_odb_exists": { + "type": "function", + "file": "git2/odb.h", + "line": 219, + "lineto": 219, + "args": [ + { + "name": "db", + "type": "git_odb *", + "comment": "database to be searched for the given object." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the object to search for." + } + ], + "argline": "git_odb *db, const git_oid *id", + "sig": "git_odb *::const git_oid *", + "return": { + "type": "int", + "comment": " 1 if the object was found, 0 otherwise" + }, + "description": "

Determine if the given object can be found in the object database.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_exists_ext": { + "type": "function", + "file": "git2/odb.h", + "line": 230, + "lineto": 230, + "args": [ + { + "name": "db", + "type": "git_odb *", + "comment": "database to be searched for the given object." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the object to search for." + }, + { + "name": "flags", + "type": "unsigned int", + "comment": "flags affecting the lookup (see `git_odb_lookup_flags_t`)" + } + ], + "argline": "git_odb *db, const git_oid *id, unsigned int flags", + "sig": "git_odb *::const git_oid *::unsigned int", + "return": { + "type": "int", + "comment": " 1 if the object was found, 0 otherwise" + }, + "description": "

Determine if the given object can be found in the object database, with\n extended options.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_exists_prefix": { + "type": "function", + "file": "git2/odb.h", + "line": 243, + "lineto": 244, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "The full OID of the found object if just one is found." + }, + { + "name": "db", + "type": "git_odb *", + "comment": "The database to be searched for the given object." + }, + { + "name": "short_id", + "type": "const git_oid *", + "comment": "A prefix of the id of the object to read." + }, + { + "name": "len", + "type": "size_t", + "comment": "The length of the prefix." + } + ], + "argline": "git_oid *out, git_odb *db, const git_oid *short_id, size_t len", + "sig": "git_oid *::git_odb *::const git_oid *::size_t", + "return": { + "type": "int", + "comment": " 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple\n matches were found, other value \n<\n 0 if there was a read error." + }, + "description": "

Determine if an object can be found in the object database by an\n abbreviated object ID.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_expand_ids": { + "type": "function", + "file": "git2/odb.h", + "line": 286, + "lineto": 289, + "args": [ + { + "name": "db", + "type": "git_odb *", + "comment": "The database to be searched for the given objects." + }, + { + "name": "ids", + "type": "git_odb_expand_id *", + "comment": "An array of short object IDs to search for" + }, + { + "name": "count", + "type": "size_t", + "comment": "The length of the `ids` array" + } + ], + "argline": "git_odb *db, git_odb_expand_id *ids, size_t count", + "sig": "git_odb *::git_odb_expand_id *::size_t", + "return": { + "type": "int", + "comment": " 0 on success or an error code on failure" + }, + "description": "

Determine if one or more objects can be found in the object database\n by their abbreviated object ID and type.

\n", + "comments": "

The given array will be updated in place: for each abbreviated ID that is unique in the database, and of the given type (if specified), the full object ID, object ID length (GIT_OID_SHA1_HEXSIZE) and type will be written back to the array. For IDs that are not found (or are ambiguous), the array entry will be zeroed.

\n\n

Note that since this function operates on multiple objects, the underlying database will not be asked to be reloaded if an object is not found (which is unlike other object database operations.)

\n", + "group": "odb" + }, + "git_odb_refresh": { + "type": "function", + "file": "git2/odb.h", + "line": 309, + "lineto": 309, + "args": [ + { "name": "db", "type": "git_odb *", "comment": "database to refresh" } + ], + "argline": "git_odb *db", + "sig": "git_odb *", + "return": { + "type": "int", + "comment": " 0 on success, error code otherwise" + }, + "description": "

Refresh the object database to load newly added files.

\n", + "comments": "

If the object databases have changed on disk while the library is running, this function will force a reload of the underlying indexes.

\n\n

Use this function when you're confident that an external application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The library will automatically attempt to refresh the ODB when a lookup fails, to see if the looked up object exists on disk but hasn't been loaded yet.

\n", + "group": "odb" + }, + "git_odb_foreach": { + "type": "function", + "file": "git2/odb.h", + "line": 324, + "lineto": 327, + "args": [ + { "name": "db", "type": "git_odb *", "comment": "database to use" }, + { + "name": "cb", + "type": "git_odb_foreach_cb", + "comment": "the callback to call for each object" + }, + { + "name": "payload", + "type": "void *", + "comment": "data to pass to the callback" + } + ], + "argline": "git_odb *db, git_odb_foreach_cb cb, void *payload", + "sig": "git_odb *::git_odb_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

List all objects available in the database

\n", + "comments": "

The callback will be called for each object available in the database. Note that the objects are likely to be returned in the index order, which would make accessing the objects in that order inefficient. Return a non-zero value from the callback to stop looping.

\n", + "group": "odb" + }, + "git_odb_write": { + "type": "function", + "file": "git2/odb.h", + "line": 347, + "lineto": 347, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "pointer to store the OID result of the write" + }, + { + "name": "odb", + "type": "git_odb *", + "comment": "object database where to store the object" + }, + { + "name": "data", + "type": "const void *", + "comment": "`const unsigned char *` buffer with the data to store" + }, + { "name": "len", "type": "size_t", "comment": "size of the buffer" }, + { + "name": "type", + "type": "git_object_t", + "comment": "type of the data to store" + } + ], + "argline": "git_oid *out, git_odb *odb, const void *data, size_t len, git_object_t type", + "sig": "git_oid *::git_odb *::const void *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an object directly into the ODB

\n", + "comments": "

This method writes a full object straight into the ODB. For most cases, it is preferred to write objects through a write stream, which is both faster and less memory intensive, specially for big objects.

\n\n

This method is provided for compatibility with custom backends which are not able to support streaming writes

\n", + "group": "odb", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_odb_write-43"] } + }, + "git_odb_open_wstream": { + "type": "function", + "file": "git2/odb.h", + "line": 370, + "lineto": 370, + "args": [ + { + "name": "out", + "type": "git_odb_stream **", + "comment": "pointer where to store the stream" + }, + { + "name": "db", + "type": "git_odb *", + "comment": "object database where the stream will write" + }, + { + "name": "size", + "type": "git_object_size_t", + "comment": "final size of the object that will be written" + }, + { + "name": "type", + "type": "git_object_t", + "comment": "type of the object that will be written" + } + ], + "argline": "git_odb_stream **out, git_odb *db, git_object_size_t size, git_object_t type", + "sig": "git_odb_stream **::git_odb *::git_object_size_t::git_object_t", + "return": { + "type": "int", + "comment": " 0 if the stream was created; error code otherwise" + }, + "description": "

Open a stream to write an object into the ODB

\n", + "comments": "

The type and final length of the object must be specified when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it won't be effective until git_odb_stream_finalize_write is called and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or will leak memory.

\n", + "group": "odb" + }, + "git_odb_stream_write": { + "type": "function", + "file": "git2/odb.h", + "line": 383, + "lineto": 383, + "args": [ + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "the data to write" + }, + { "name": "len", "type": "size_t", "comment": "the buffer's length" } + ], + "argline": "git_odb_stream *stream, const char *buffer, size_t len", + "sig": "git_odb_stream *::const char *::size_t", + "return": { + "type": "int", + "comment": " 0 if the write succeeded, error code otherwise" + }, + "description": "

Write to an odb stream

\n", + "comments": "

This method will fail if the total number of received bytes exceeds the size declared with git_odb_open_wstream()

\n", + "group": "odb" + }, + "git_odb_stream_finalize_write": { + "type": "function", + "file": "git2/odb.h", + "line": 398, + "lineto": 398, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "pointer to store the resulting object's id" + }, + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" + } + ], + "argline": "git_oid *out, git_odb_stream *stream", + "sig": "git_oid *::git_odb_stream *", + "return": { + "type": "int", + "comment": " 0 on success, an error code otherwise" + }, + "description": "

Finish writing to an odb stream

\n", + "comments": "

The object will take its final name and will be available to the odb.

\n\n

This method will fail if the total number of received bytes differs from the size declared with git_odb_open_wstream()

\n", + "group": "odb" + }, + "git_odb_stream_read": { + "type": "function", + "file": "git2/odb.h", + "line": 410, + "lineto": 410, + "args": [ + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" + }, + { + "name": "buffer", + "type": "char *", + "comment": "a user-allocated buffer to store the data in." + }, + { "name": "len", "type": "size_t", "comment": "the buffer's length" } + ], + "argline": "git_odb_stream *stream, char *buffer, size_t len", + "sig": "git_odb_stream *::char *::size_t", + "return": { + "type": "int", + "comment": " the number of bytes read if succeeded, error code otherwise" + }, + "description": "

Read from an odb stream

\n", + "comments": "

Most backends don't implement streaming reads

\n", + "group": "odb" + }, + "git_odb_stream_free": { + "type": "function", + "file": "git2/odb.h", + "line": 417, + "lineto": 417, + "args": [ + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream to free" + } + ], + "argline": "git_odb_stream *stream", + "sig": "git_odb_stream *", + "return": { "type": "void", "comment": null }, + "description": "

Free an odb stream

\n", + "comments": "", + "group": "odb" + }, + "git_odb_open_rstream": { + "type": "function", + "file": "git2/odb.h", + "line": 445, + "lineto": 450, + "args": [ + { + "name": "out", + "type": "git_odb_stream **", + "comment": "pointer where to store the stream" + }, + { + "name": "len", + "type": "size_t *", + "comment": "pointer where to store the length of the object" + }, + { + "name": "type", + "type": "git_object_t *", + "comment": "pointer where to store the type of the object" + }, + { + "name": "db", + "type": "git_odb *", + "comment": "object database where the stream will read from" + }, + { + "name": "oid", + "type": "const git_oid *", + "comment": "oid of the object the stream will read from" + } + ], + "argline": "git_odb_stream **out, size_t *len, git_object_t *type, git_odb *db, const git_oid *oid", + "sig": "git_odb_stream **::size_t *::git_object_t *::git_odb *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 if the stream was created, error code otherwise" + }, + "description": "

Open a stream to read an object from the ODB

\n", + "comments": "

Note that most backends do not support streaming reads because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream      - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n", + "group": "odb" + }, + "git_odb_write_pack": { + "type": "function", + "file": "git2/odb.h", + "line": 471, + "lineto": 475, + "args": [ + { + "name": "out", + "type": "git_odb_writepack **", + "comment": "pointer to the writepack functions" + }, + { + "name": "db", + "type": "git_odb *", + "comment": "object database where the stream will read from" + }, + { + "name": "progress_cb", + "type": "git_indexer_progress_cb", + "comment": "function to call with progress information.\n Be aware that this is called inline with network and indexing operations,\n so performance may be affected." + }, + { + "name": "progress_payload", + "type": "void *", + "comment": "payload for the progress callback" + } + ], + "argline": "git_odb_writepack **out, git_odb *db, git_indexer_progress_cb progress_cb, void *progress_payload", + "sig": "git_odb_writepack **::git_odb *::git_indexer_progress_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Open a stream for writing a pack file to the ODB.

\n", + "comments": "

If the ODB layer understands pack files, then the given packfile will likely be streamed directly to disk (and a corresponding index created). If the ODB layer does not understand pack files, the objects will be stored in whatever format the ODB layer uses.

\n", + "group": "odb" + }, + "git_odb_write_multi_pack_index": { + "type": "function", + "file": "git2/odb.h", + "line": 489, + "lineto": 490, + "args": [ + { + "name": "db", + "type": "git_odb *", + "comment": "object database where the `multi-pack-index` file will be written." + } + ], + "argline": "git_odb *db", + "sig": "git_odb *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Write a multi-pack-index file from all the .pack files in the ODB.

\n", + "comments": "

If the ODB layer understands pack files, then this will create a file called multi-pack-index next to the .pack and .idx files, which will contain an index of all objects stored in .pack files. This will allow for O(log n) lookup for n objects (regardless of how many packfiles there exist).

\n", + "group": "odb" + }, + "git_odb_hash": { + "type": "function", + "file": "git2/odb.h", + "line": 539, + "lineto": 539, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "the resulting object-ID." + }, + { "name": "data", "type": "const void *", "comment": "data to hash" }, + { "name": "len", "type": "size_t", "comment": "size of the data" }, + { + "name": "object_type", + "type": "git_object_t", + "comment": "of the data to hash" + } + ], + "argline": "git_oid *oid, const void *data, size_t len, git_object_t object_type", + "sig": "git_oid *::const void *::size_t::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Determine the object-ID (sha1 or sha256 hash) of a data buffer

\n", + "comments": "

The resulting OID will be the identifier for the data buffer as if the data buffer it were to written to the ODB.

\n", + "group": "odb" + }, + "git_odb_hashfile": { + "type": "function", + "file": "git2/odb.h", + "line": 554, + "lineto": 554, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "path", + "type": "const char *", + "comment": "file to read and determine object id for" + }, + { + "name": "object_type", + "type": "git_object_t", + "comment": "of the data to hash" + } + ], + "argline": "git_oid *oid, const char *path, git_object_t object_type", + "sig": "git_oid *::const char *::git_object_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read a file from disk and fill a git_oid with the object id\n that the file would have if it were written to the Object\n Database as an object of the given type (w/o applying filters).\n Similar functionality to git.git's git hash-object without\n the -w flag, however, with the --no-filters flag.\n If you need filters, see git_repository_hashfile.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_object_dup": { + "type": "function", + "file": "git2/odb.h", + "line": 570, + "lineto": 570, + "args": [ + { + "name": "dest", + "type": "git_odb_object **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "git_odb_object *", + "comment": "object to copy" + } + ], + "argline": "git_odb_object **dest, git_odb_object *source", + "sig": "git_odb_object **::git_odb_object *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a copy of an odb_object

\n", + "comments": "

The returned copy must be manually freed with git_odb_object_free. Note that because of an implementation detail, the returned copy will be the same pointer as source: the object is internally refcounted, so the copy still needs to be freed twice.

\n", + "group": "odb" + }, + "git_odb_object_free": { + "type": "function", + "file": "git2/odb.h", + "line": 580, + "lineto": 580, + "args": [ + { + "name": "object", + "type": "git_odb_object *", + "comment": "object to close" + } + ], + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { "type": "void", "comment": null }, + "description": "

Close an ODB object

\n", + "comments": "

This method must always be called once a git_odb_object is no longer needed, otherwise memory will leak.

\n", + "group": "odb", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_object_free-22"], + "general.c": ["ex/v1.9.1/general.html#git_odb_object_free-44"] + } + }, + "git_odb_object_id": { + "type": "function", + "file": "git2/odb.h", + "line": 590, + "lineto": 590, + "args": [ + { + "name": "object", + "type": "git_odb_object *", + "comment": "the object" + } + ], + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { + "type": "const git_oid *", + "comment": " a pointer to the OID" + }, + "description": "

Return the OID of an ODB object

\n", + "comments": "

This is the OID from which the object was read from

\n", + "group": "odb" + }, + "git_odb_object_data": { + "type": "function", + "file": "git2/odb.h", + "line": 603, + "lineto": 603, + "args": [ + { + "name": "object", + "type": "git_odb_object *", + "comment": "the object" + } + ], + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { + "type": "const void *", + "comment": " \n\n `const unsigned char *` a pointer to the data" + }, + "description": "

Return the data of an ODB object

\n", + "comments": "

This is the uncompressed, raw data as read from the ODB, without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n", + "group": "odb", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_odb_object_data-45"] + } + }, + "git_odb_object_size": { + "type": "function", + "file": "git2/odb.h", + "line": 614, + "lineto": 614, + "args": [ + { + "name": "object", + "type": "git_odb_object *", + "comment": "the object" + } + ], + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { "type": "size_t", "comment": " the size" }, + "description": "

Return the size of an ODB object

\n", + "comments": "

This is the real size of the data buffer, not the actual size of the object.

\n", + "group": "odb", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_odb_object_size-23"], + "general.c": ["ex/v1.9.1/general.html#git_odb_object_size-46"] + } + }, + "git_odb_object_type": { + "type": "function", + "file": "git2/odb.h", + "line": 622, + "lineto": 622, + "args": [ + { + "name": "object", + "type": "git_odb_object *", + "comment": "the object" + } + ], + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { "type": "git_object_t", "comment": " the type" }, + "description": "

Return the type of an ODB object

\n", + "comments": "", + "group": "odb", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_odb_object_type-47"] + } + }, + "git_odb_add_backend": { + "type": "function", + "file": "git2/odb.h", + "line": 637, + "lineto": 637, + "args": [ + { + "name": "odb", + "type": "git_odb *", + "comment": "database to add the backend to" + }, + { + "name": "backend", + "type": "git_odb_backend *", + "comment": "pointer to a git_odb_backend instance" + }, + { + "name": "priority", + "type": "int", + "comment": "Value for ordering the backends queue" + } + ], + "argline": "git_odb *odb, git_odb_backend *backend, int priority", + "sig": "git_odb *::git_odb_backend *::int", + "return": { + "type": "int", + "comment": " 0 on success, error code otherwise" + }, + "description": "

Add a custom backend to an existing Object DB

\n", + "comments": "

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Read for more information.

\n", + "group": "odb" + }, + "git_odb_add_alternate": { + "type": "function", + "file": "git2/odb.h", + "line": 658, + "lineto": 658, + "args": [ + { + "name": "odb", + "type": "git_odb *", + "comment": "database to add the backend to" + }, + { + "name": "backend", + "type": "git_odb_backend *", + "comment": "pointer to a git_odb_backend instance" + }, + { + "name": "priority", + "type": "int", + "comment": "Value for ordering the backends queue" + } + ], + "argline": "git_odb *odb, git_odb_backend *backend, int priority", + "sig": "git_odb *::git_odb_backend *::int", + "return": { + "type": "int", + "comment": " 0 on success, error code otherwise" + }, + "description": "

Add a custom backend to an existing Object DB; this\n backend will work as an alternate.

\n", + "comments": "

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read for more information.

\n", + "group": "odb" + }, + "git_odb_num_backends": { + "type": "function", + "file": "git2/odb.h", + "line": 666, + "lineto": 666, + "args": [ + { "name": "odb", "type": "git_odb *", "comment": "object database" } + ], + "argline": "git_odb *odb", + "sig": "git_odb *", + "return": { + "type": "size_t", + "comment": " number of backends in the ODB" + }, + "description": "

Get the number of ODB backend objects

\n", + "comments": "", + "group": "odb" + }, + "git_odb_get_backend": { + "type": "function", + "file": "git2/odb.h", + "line": 676, + "lineto": 676, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "output pointer to ODB backend at pos" + }, + { "name": "odb", "type": "git_odb *", "comment": "object database" }, + { + "name": "pos", + "type": "size_t", + "comment": "index into object database backend list" + } + ], + "argline": "git_odb_backend **out, git_odb *odb, size_t pos", + "sig": "git_odb_backend **::git_odb *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if pos is invalid, other errors \n<\n 0" + }, + "description": "

Lookup an ODB backend object by index

\n", + "comments": "", + "group": "odb" + }, + "git_odb_set_commit_graph": { + "type": "function", + "file": "git2/odb.h", + "line": 691, + "lineto": 691, + "args": [ + { "name": "odb", "type": "git_odb *", "comment": "object database" }, + { + "name": "cgraph", + "type": "git_commit_graph *", + "comment": "the git commit-graph" + } + ], + "argline": "git_odb *odb, git_commit_graph *cgraph", + "sig": "git_odb *::git_commit_graph *", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "

Set the git commit-graph for the ODB.

\n", + "comments": "

After a successful call, the ownership of the cgraph parameter will be transferred to libgit2, and the caller should not free it.

\n\n

The commit-graph can also be unset by explicitly passing NULL as the cgraph parameter.

\n", + "group": "odb" + }, + "git_odb_backend_pack": { + "type": "function", + "file": "git2/odb_backend.h", + "line": 142, + "lineto": 144, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "objects_dir", + "type": "const char *", + "comment": "the Git repository's objects directory" + } + ], + "argline": "git_odb_backend **out, const char *objects_dir", + "sig": "git_odb_backend **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a backend for a directory containing packfiles.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_backend_one_pack": { + "type": "function", + "file": "git2/odb_backend.h", + "line": 156, + "lineto": 158, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "index_file", + "type": "const char *", + "comment": "path to the packfile's .idx file" + } + ], + "argline": "git_odb_backend **out, const char *index_file", + "sig": "git_odb_backend **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a backend out of a single packfile

\n", + "comments": "

This can be useful for inspecting the contents of a single packfile.

\n", + "group": "odb" + }, + "git_odb_backend_loose": { + "type": "function", + "file": "git2/odb_backend.h", + "line": 171, + "lineto": 177, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "objects_dir", + "type": "const char *", + "comment": "the Git repository's objects directory" + }, + { + "name": "compression_level", + "type": "int", + "comment": "zlib compression level (0-9), or -1 for the default" + }, + { + "name": "do_fsync", + "type": "int", + "comment": "if non-zero, perform an fsync on write" + }, + { + "name": "dir_mode", + "type": "unsigned int", + "comment": "permission to use when creating directories, or 0 for default" + }, + { + "name": "file_mode", + "type": "unsigned int", + "comment": "permission to use when creating directories, or 0 for default" + } + ], + "argline": "git_odb_backend **out, const char *objects_dir, int compression_level, int do_fsync, unsigned int dir_mode, unsigned int file_mode", + "sig": "git_odb_backend **::const char *::int::int::unsigned int::unsigned int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a backend for loose objects

\n", + "comments": "", + "group": "odb" + }, + "git_oid_fromstr": { + "type": "function", + "file": "git2/oid.h", + "line": 137, + "lineto": 137, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes for sha1,\n\t\t256 bytes for sha256)." + } + ], + "argline": "git_oid *out, const char *str", + "sig": "git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Parse a hex formatted object id into a git_oid.

\n", + "comments": "

The appropriate number of bytes for the given object ID type will be read from the string - 40 bytes for SHA1, 64 bytes for SHA256. The given string need not be NUL terminated.

\n", + "group": "oid", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_oid_fromstr-48", + "ex/v1.9.1/general.html#git_oid_fromstr-49", + "ex/v1.9.1/general.html#git_oid_fromstr-50", + "ex/v1.9.1/general.html#git_oid_fromstr-51", + "ex/v1.9.1/general.html#git_oid_fromstr-52", + "ex/v1.9.1/general.html#git_oid_fromstr-53", + "ex/v1.9.1/general.html#git_oid_fromstr-54", + "ex/v1.9.1/general.html#git_oid_fromstr-55", + "ex/v1.9.1/general.html#git_oid_fromstr-56", + "ex/v1.9.1/general.html#git_oid_fromstr-57", + "ex/v1.9.1/general.html#git_oid_fromstr-58", + "ex/v1.9.1/general.html#git_oid_fromstr-59", + "ex/v1.9.1/general.html#git_oid_fromstr-60", + "ex/v1.9.1/general.html#git_oid_fromstr-61", + "ex/v1.9.1/general.html#git_oid_fromstr-62", + "ex/v1.9.1/general.html#git_oid_fromstr-63" + ] + } + }, + "git_oid_fromstrp": { + "type": "function", + "file": "git2/oid.h", + "line": 146, + "lineto": 146, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string; must be null-terminated." + } + ], + "argline": "git_oid *out, const char *str", + "sig": "git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Parse a hex formatted NUL-terminated string into a git_oid.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_fromstrn": { + "type": "function", + "file": "git2/oid.h", + "line": 159, + "lineto": 159, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string of at least size `length`" + }, + { + "name": "length", + "type": "size_t", + "comment": "length of the input string" + } + ], + "argline": "git_oid *out, const char *str, size_t length", + "sig": "git_oid *::const char *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Parse N characters of a hex formatted object id into a git_oid.

\n", + "comments": "

If N is odd, the last byte's high nibble will be read in and the low nibble set to zero.

\n", + "group": "oid" + }, + "git_oid_fromraw": { + "type": "function", + "file": "git2/oid.h", + "line": 168, + "lineto": 168, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "raw", + "type": "const unsigned char *", + "comment": "the raw input bytes to be copied." + } + ], + "argline": "git_oid *out, const unsigned char *raw", + "sig": "git_oid *::const unsigned char *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Copy an already raw oid into a git_oid structure.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_fmt": { + "type": "function", + "file": "git2/oid.h", + "line": 184, + "lineto": 184, + "args": [ + { + "name": "out", + "type": "char *", + "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes for SHA1,\n\t\t64 bytes for SHA256). Only the oid digits are written;\n\t\ta '\n\\\n0' terminator must be added by the caller if it is\n\t\trequired." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." + } + ], + "argline": "char *out, const git_oid *id", + "sig": "char *::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Format a git_oid into a hex string.

\n", + "comments": "", + "group": "oid", + "examples": { + "fetch.c": [ + "ex/v1.9.1/fetch.html#git_oid_fmt-1", + "ex/v1.9.1/fetch.html#git_oid_fmt-2" + ], + "general.c": [ + "ex/v1.9.1/general.html#git_oid_fmt-64", + "ex/v1.9.1/general.html#git_oid_fmt-65", + "ex/v1.9.1/general.html#git_oid_fmt-66", + "ex/v1.9.1/general.html#git_oid_fmt-67", + "ex/v1.9.1/general.html#git_oid_fmt-68" + ], + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_oid_fmt-1"] + } + }, + "git_oid_nfmt": { + "type": "function", + "file": "git2/oid.h", + "line": 196, + "lineto": 196, + "args": [ + { + "name": "out", + "type": "char *", + "comment": "output hex string; you say how many bytes to write.\n\t\tIf the number of bytes is > GIT_OID_SHA1_HEXSIZE, extra bytes\n\t\twill be zeroed; if not, a '\n\\\n0' terminator is NOT added." + }, + { + "name": "n", + "type": "size_t", + "comment": "number of characters to write into out string" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." + } + ], + "argline": "char *out, size_t n, const git_oid *id", + "sig": "char *::size_t::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Format a git_oid into a partial hex string.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_pathfmt": { + "type": "function", + "file": "git2/oid.h", + "line": 213, + "lineto": 213, + "args": [ + { + "name": "out", + "type": "char *", + "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (41 bytes for SHA1,\n\t\t65 bytes for SHA256). Only the oid digits are written;\n\t\ta '\n\\\n0' terminator must be added by the caller if it\n\t\tis required." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." + } + ], + "argline": "char *out, const git_oid *id", + "sig": "char *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Format a git_oid into a loose-object path string.

\n", + "comments": "

The resulting string is "aa/...", where "aa" is the first two hex digits of the oid and "..." is the remaining 38 digits.

\n", + "group": "oid" + }, + "git_oid_tostr_s": { + "type": "function", + "file": "git2/oid.h", + "line": 226, + "lineto": 226, + "args": [ + { + "name": "oid", + "type": "const git_oid *", + "comment": "The oid structure to format" + } + ], + "argline": "const git_oid *oid", + "sig": "const git_oid *", + "return": { + "type": "char *", + "comment": " the c-string or NULL on failure" + }, + "description": "

Format a git_oid into a statically allocated c-string.

\n", + "comments": "

The c-string is owned by the library and should not be freed by the user. If libgit2 is built with thread support, the string will be stored in TLS (i.e. one buffer per thread) to allow for concurrent calls of the function.

\n", + "group": "oid", + "examples": { + "merge.c": [ + "ex/v1.9.1/merge.html#git_oid_tostr_s-19", + "ex/v1.9.1/merge.html#git_oid_tostr_s-20" + ] + } + }, + "git_oid_tostr": { + "type": "function", + "file": "git2/oid.h", + "line": 247, + "lineto": 247, + "args": [ + { + "name": "out", + "type": "char *", + "comment": "the buffer into which the oid string is output." + }, + { + "name": "n", + "type": "size_t", + "comment": "the size of the out buffer." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the oid structure to format." + } + ], + "argline": "char *out, size_t n, const git_oid *id", + "sig": "char *::size_t::const git_oid *", + "return": { + "type": "char *", + "comment": " the out buffer pointer, assuming no input parameter\n\t\t\terrors, otherwise a pointer to an empty string." + }, + "description": "

Format a git_oid into a buffer as a hex format c-string.

\n", + "comments": "

If the buffer is smaller than the size of a hex-formatted oid string plus an additional byte (GIT_OID_SHA_HEXSIZE + 1 for SHA1 or GIT_OID_SHA256_HEXSIZE + 1 for SHA256), then the resulting oid c-string will be truncated to n-1 characters (but will still be NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid == NULL), then a pointer to an empty string is returned, so that the return value can always be printed.

\n", + "group": "oid", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_oid_tostr-15", + "ex/v1.9.1/blame.html#git_oid_tostr-16" + ], + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_oid_tostr-24", + "ex/v1.9.1/cat-file.html#git_oid_tostr-25", + "ex/v1.9.1/cat-file.html#git_oid_tostr-26", + "ex/v1.9.1/cat-file.html#git_oid_tostr-27", + "ex/v1.9.1/cat-file.html#git_oid_tostr-28" + ], + "log.c": [ + "ex/v1.9.1/log.html#git_oid_tostr-38", + "ex/v1.9.1/log.html#git_oid_tostr-39" + ], + "rev-parse.c": [ + "ex/v1.9.1/rev-parse.html#git_oid_tostr-10", + "ex/v1.9.1/rev-parse.html#git_oid_tostr-11", + "ex/v1.9.1/rev-parse.html#git_oid_tostr-12", + "ex/v1.9.1/rev-parse.html#git_oid_tostr-13" + ] + } + }, + "git_oid_cpy": { + "type": "function", + "file": "git2/oid.h", + "line": 256, + "lineto": 256, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "oid structure the result is written into." + }, + { + "name": "src", + "type": "const git_oid *", + "comment": "oid structure to copy from." + } + ], + "argline": "git_oid *out, const git_oid *src", + "sig": "git_oid *::const git_oid *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Copy an oid from one structure to another.

\n", + "comments": "", + "group": "oid", + "examples": { + "blame.c": [ + "ex/v1.9.1/blame.html#git_oid_cpy-17", + "ex/v1.9.1/blame.html#git_oid_cpy-18", + "ex/v1.9.1/blame.html#git_oid_cpy-19" + ] + } + }, + "git_oid_cmp": { + "type": "function", + "file": "git2/oid.h", + "line": 265, + "lineto": 265, + "args": [ + { + "name": "a", + "type": "const git_oid *", + "comment": "first oid structure." + }, + { + "name": "b", + "type": "const git_oid *", + "comment": "second oid structure." + } + ], + "argline": "const git_oid *a, const git_oid *b", + "sig": "const git_oid *::const git_oid *", + "return": { + "type": "int", + "comment": " \n<\n0, 0, >0 if a \n<\n b, a == b, a > b." + }, + "description": "

Compare two oid structures.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_equal": { + "type": "function", + "file": "git2/oid.h", + "line": 274, + "lineto": 274, + "args": [ + { + "name": "a", + "type": "const git_oid *", + "comment": "first oid structure." + }, + { + "name": "b", + "type": "const git_oid *", + "comment": "second oid structure." + } + ], + "argline": "const git_oid *a, const git_oid *b", + "sig": "const git_oid *::const git_oid *", + "return": { "type": "int", "comment": " true if equal, false otherwise" }, + "description": "

Compare two oid structures for equality

\n", + "comments": "", + "group": "oid" + }, + "git_oid_ncmp": { + "type": "function", + "file": "git2/oid.h", + "line": 285, + "lineto": 285, + "args": [ + { + "name": "a", + "type": "const git_oid *", + "comment": "first oid structure." + }, + { + "name": "b", + "type": "const git_oid *", + "comment": "second oid structure." + }, + { + "name": "len", + "type": "size_t", + "comment": "the number of hex chars to compare" + } + ], + "argline": "const git_oid *a, const git_oid *b, size_t len", + "sig": "const git_oid *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 in case of a match" }, + "description": "

Compare the first 'len' hexadecimal characters (packets of 4 bits)\n of two oid structures.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_streq": { + "type": "function", + "file": "git2/oid.h", + "line": 294, + "lineto": 294, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string of an object id." + } + ], + "argline": "const git_oid *id, const char *str", + "sig": "const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 in case of a match, -1 otherwise." + }, + "description": "

Check if an oid equals an hex formatted object id.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_strcmp": { + "type": "function", + "file": "git2/oid.h", + "line": 304, + "lineto": 304, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string of an object id." + } + ], + "argline": "const git_oid *id, const char *str", + "sig": "const git_oid *::const char *", + "return": { + "type": "int", + "comment": " -1 if str is not valid, \n<\n0 if id sorts before str,\n 0 if id matches str, >0 if id sorts after str." + }, + "description": "

Compare an oid to an hex formatted object id.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_is_zero": { + "type": "function", + "file": "git2/oid.h", + "line": 312, + "lineto": 312, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": "the object ID to check" + } + ], + "argline": "const git_oid *id", + "sig": "const git_oid *", + "return": { "type": "int", "comment": " 1 if all zeros, 0 otherwise." }, + "description": "

Check is an oid is all zeros.

\n", + "comments": "", + "group": "oid", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_oid_is_zero-20"], + "fetch.c": ["ex/v1.9.1/fetch.html#git_oid_is_zero-3"] + } + }, + "git_oid_shorten_new": { + "type": "function", + "file": "git2/oid.h", + "line": 333, + "lineto": 333, + "args": [ + { + "name": "min_length", + "type": "size_t", + "comment": "The minimal length for all identifiers,\n\t\twhich will be used even if shorter OIDs would still\n\t\tbe unique." + } + ], + "argline": "size_t min_length", + "sig": "size_t", + "return": { + "type": "git_oid_shorten *", + "comment": " a `git_oid_shorten` instance, NULL if OOM" + }, + "description": "

Create a new OID shortener.

\n", + "comments": "

The OID shortener is used to process a list of OIDs in text form and return the shortest length that would uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n", + "group": "oid" + }, + "git_oid_shorten_add": { + "type": "function", + "file": "git2/oid.h", + "line": 359, + "lineto": 359, + "args": [ + { + "name": "os", + "type": "git_oid_shorten *", + "comment": "a `git_oid_shorten` instance" + }, + { + "name": "text_id", + "type": "const char *", + "comment": "an OID in text form" + } + ], + "argline": "git_oid_shorten *os, const char *text_id", + "sig": "git_oid_shorten *::const char *", + "return": { + "type": "int", + "comment": " the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs." + }, + "description": "

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n", + "comments": "

The OID is expected to be a 40-char hexadecimal string. The OID is owned by the user and will not be modified or freed.

\n\n

For performance reasons, there is a hard-limit of how many OIDs can be added to a single set (around ~32000, assuming a mostly randomized distribution), which should be enough for any kind of program, and keeps the algorithm fast and memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a GIT_ERROR_INVALID error

\n", + "group": "oid" + }, + "git_oid_shorten_free": { + "type": "function", + "file": "git2/oid.h", + "line": 366, + "lineto": 366, + "args": [ + { + "name": "os", + "type": "git_oid_shorten *", + "comment": "a `git_oid_shorten` instance" + } + ], + "argline": "git_oid_shorten *os", + "sig": "git_oid_shorten *", + "return": { "type": "void", "comment": null }, + "description": "

Free an OID shortener instance

\n", + "comments": "", + "group": "oid" + }, + "git_oidarray_dispose": { + "type": "function", + "file": "git2/oidarray.h", + "line": 38, + "lineto": 38, + "args": [ + { + "name": "array", + "type": "git_oidarray *", + "comment": "git_oidarray from which to free oid data" + } + ], + "argline": "git_oidarray *array", + "sig": "git_oidarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the object IDs contained in an oid_array. This method should\n be called on git_oidarray objects that were provided by the\n library. Not doing so will result in a memory leak.

\n", + "comments": "

This does not free the git_oidarray itself, since the library will never allocate that object directly itself.

\n", + "group": "oidarray" + }, + "git_packbuilder_new": { + "type": "function", + "file": "git2/pack.h", + "line": 65, + "lineto": 65, + "args": [ + { + "name": "out", + "type": "git_packbuilder **", + "comment": "The new packbuilder object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + } + ], + "argline": "git_packbuilder **out, git_repository *repo", + "sig": "git_packbuilder **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Initialize a new packbuilder

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_set_threads": { + "type": "function", + "file": "git2/pack.h", + "line": 78, + "lineto": 78, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "n", + "type": "unsigned int", + "comment": "Number of threads to spawn" + } + ], + "argline": "git_packbuilder *pb, unsigned int n", + "sig": "git_packbuilder *::unsigned int", + "return": { + "type": "unsigned int", + "comment": " number of actual threads to be used" + }, + "description": "

Set number of threads to spawn

\n", + "comments": "

By default, libgit2 won't spawn any threads at all; when set to 0, libgit2 will autodetect the number of CPUs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert": { + "type": "function", + "file": "git2/pack.h", + "line": 92, + "lineto": 92, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the commit" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name; might be NULL" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id, const char *name", + "sig": "git_packbuilder *::const git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert a single object

\n", + "comments": "

For an optimal pack it's mandatory to insert objects in recency order, commits followed by trees and blobs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_tree": { + "type": "function", + "file": "git2/pack.h", + "line": 104, + "lineto": 104, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the root tree" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id", + "sig": "git_packbuilder *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert a root tree object

\n", + "comments": "

This will add the tree as well as all referenced trees and blobs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_commit": { + "type": "function", + "file": "git2/pack.h", + "line": 116, + "lineto": 116, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the commit" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id", + "sig": "git_packbuilder *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert a commit object

\n", + "comments": "

This will add a commit as well as the completed referenced tree.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_walk": { + "type": "function", + "file": "git2/pack.h", + "line": 129, + "lineto": 129, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the revwalk to use to fill the packbuilder" + } + ], + "argline": "git_packbuilder *pb, git_revwalk *walk", + "sig": "git_packbuilder *::git_revwalk *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Insert objects as given by the walk

\n", + "comments": "

Those commits and all objects they reference will be inserted into the packbuilder.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_recur": { + "type": "function", + "file": "git2/pack.h", + "line": 141, + "lineto": 141, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the id of the root object to insert" + }, + { + "name": "name", + "type": "const char *", + "comment": "optional name for the object" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id, const char *name", + "sig": "git_packbuilder *::const git_oid *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Recursively insert an object and its referenced objects

\n", + "comments": "

Insert the object as well as any object it references.

\n", + "group": "packbuilder" + }, + "git_packbuilder_write_buf": { + "type": "function", + "file": "git2/pack.h", + "line": 153, + "lineto": 153, + "args": [ + { + "name": "buf", + "type": "git_buf *", + "comment": "Buffer where to write the packfile" + }, + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + } + ], + "argline": "git_buf *buf, git_packbuilder *pb", + "sig": "git_buf *::git_packbuilder *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write the contents of the packfile to an in-memory buffer

\n", + "comments": "

The contents of the buffer will become a valid packfile, even though there will be no attached index

\n", + "group": "packbuilder" + }, + "git_packbuilder_write": { + "type": "function", + "file": "git2/pack.h", + "line": 166, + "lineto": 171, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to the directory where the packfile and index should be stored, or NULL for default location" + }, + { + "name": "mode", + "type": "unsigned int", + "comment": "permissions to use creating a packfile or 0 for defaults" + }, + { + "name": "progress_cb", + "type": "git_indexer_progress_cb", + "comment": "function to call with progress information from the indexer (optional)" + }, + { + "name": "progress_cb_payload", + "type": "void *", + "comment": "payload for the progress callback (optional)" + } + ], + "argline": "git_packbuilder *pb, const char *path, unsigned int mode, git_indexer_progress_cb progress_cb, void *progress_cb_payload", + "sig": "git_packbuilder *::const char *::unsigned int::git_indexer_progress_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write the new pack and corresponding index file to path.

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_hash": { + "type": "function", + "file": "git2/pack.h", + "line": 184, + "lineto": 184, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder object" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { "type": "const git_oid *", "comment": " 0 or an error code" }, + "description": "

Get the packfile's hash

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the packfile has been written.

\n", + "group": "packbuilder" + }, + "git_packbuilder_name": { + "type": "function", + "file": "git2/pack.h", + "line": 196, + "lineto": 196, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder instance" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { + "type": "const char *", + "comment": " a NUL terminated string for the packfile name" + }, + "description": "

Get the unique name for the resulting packfile.

\n", + "comments": "

The packfile's name is derived from the packfile's content. This is only correct after the packfile has been written.

\n", + "group": "packbuilder" + }, + "git_packbuilder_foreach": { + "type": "function", + "file": "git2/pack.h", + "line": 218, + "lineto": 218, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "cb", + "type": "git_packbuilder_foreach_cb", + "comment": "the callback to call with each packed object's buffer" + }, + { + "name": "payload", + "type": "void *", + "comment": "the callback's data" + } + ], + "argline": "git_packbuilder *pb, git_packbuilder_foreach_cb cb, void *payload", + "sig": "git_packbuilder *::git_packbuilder_foreach_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create the new pack and pass each object to the callback

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_object_count": { + "type": "function", + "file": "git2/pack.h", + "line": 226, + "lineto": 226, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { + "type": "size_t", + "comment": " the number of objects in the packfile" + }, + "description": "

Get the total number of objects the packbuilder will write out

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_written": { + "type": "function", + "file": "git2/pack.h", + "line": 234, + "lineto": 234, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { + "type": "size_t", + "comment": " the number of objects which have already been written" + }, + "description": "

Get the number of objects the packbuilder has already written out

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_set_callbacks": { + "type": "function", + "file": "git2/pack.h", + "line": 264, + "lineto": 267, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder object" + }, + { + "name": "progress_cb", + "type": "git_packbuilder_progress", + "comment": "Function to call with progress information during\n pack building. Be aware that this is called inline with pack building\n operations, so performance may be affected.\n When progress_cb returns an error, the pack building process will be\n aborted and the error will be returned from the invoked function.\n `pb` must then be freed." + }, + { + "name": "progress_cb_payload", + "type": "void *", + "comment": "Payload for progress callback." + } + ], + "argline": "git_packbuilder *pb, git_packbuilder_progress progress_cb, void *progress_cb_payload", + "sig": "git_packbuilder *::git_packbuilder_progress::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the callbacks for a packbuilder

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_free": { + "type": "function", + "file": "git2/pack.h", + "line": 274, + "lineto": 274, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { "type": "void", "comment": null }, + "description": "

Free the packbuilder and all associated data

\n", + "comments": "", + "group": "packbuilder" + }, + "git_patch_owner": { + "type": "function", + "file": "git2/patch.h", + "line": 37, + "lineto": 37, + "args": [ + { "name": "patch", "type": "const git_patch *", "comment": "the patch" } + ], + "argline": "const git_patch *patch", + "sig": "const git_patch *", + "return": { + "type": "git_repository *", + "comment": " a pointer to the repository" + }, + "description": "

Get the repository associated with this patch. May be NULL.

\n", + "comments": "", + "group": "patch" + }, + "git_patch_from_diff": { + "type": "function", + "file": "git2/patch.h", + "line": 59, + "lineto": 60, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "Output parameter for the delta patch object" + }, + { "name": "diff", "type": "git_diff *", "comment": "Diff list object" }, + { "name": "idx", "type": "size_t", "comment": "Index into diff list" } + ], + "argline": "git_patch **out, git_diff *diff, size_t idx", + "sig": "git_patch **::git_diff *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, other value \n<\n 0 on error" + }, + "description": "

Return a patch for an entry in the diff list.

\n", + "comments": "

The git_patch is a newly created object contains the text diffs for the delta. You have to call git_patch_free() when you are done with it. You can use the patch object to loop over all the hunks and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be created, the output will be set to NULL, and the binary flag will be set true in the git_diff_delta structure.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass NULL for the git_patch, then the text diff will not be calculated.

\n", + "group": "patch" + }, + "git_patch_from_blobs": { + "type": "function", + "file": "git2/patch.h", + "line": 78, + "lineto": 84, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "The generated patch; NULL on error" + }, + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "new_blob", + "type": "const git_blob *", + "comment": "Blob for new side of diff, or NULL for empty blob" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat new blob as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + } + ], + "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *opts", + "sig": "git_patch **::const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code \n<\n 0" + }, + "description": "

Directly generate a patch from the difference between two blobs.

\n", + "comments": "

This is just like git_diff_blobs() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch" + }, + "git_patch_from_blob_and_buffer": { + "type": "function", + "file": "git2/patch.h", + "line": 103, + "lineto": 110, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "The generated patch; NULL on error" + }, + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "buffer", + "type": "const void *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "buffer_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "buffer_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + } + ], + "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const void *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *opts", + "sig": "git_patch **::const git_blob *::const char *::const void *::size_t::const char *::const git_diff_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code \n<\n 0" + }, + "description": "

Directly generate a patch from the difference between a blob and a buffer.

\n", + "comments": "

This is just like git_diff_blob_to_buffer() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch" + }, + "git_patch_from_buffers": { + "type": "function", + "file": "git2/patch.h", + "line": 130, + "lineto": 138, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "The generated patch; NULL on error" + }, + { + "name": "old_buffer", + "type": "const void *", + "comment": "Raw data for old side of diff, or NULL for empty" + }, + { + "name": "old_len", + "type": "size_t", + "comment": "Length of the raw data for old side of the diff" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old buffer as if it had this filename; can be NULL" + }, + { + "name": "new_buffer", + "type": "const void *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "new_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + } + ], + "argline": "git_patch **out, const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *opts", + "sig": "git_patch **::const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code \n<\n 0" + }, + "description": "

Directly generate a patch from the difference between two buffers.

\n", + "comments": "

This is just like git_diff_buffers() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch", + "examples": { + "diff.c": ["ex/v1.9.1/diff.html#git_patch_from_buffers-16"] + } + }, + "git_patch_free": { + "type": "function", + "file": "git2/patch.h", + "line": 145, + "lineto": 145, + "args": [ + { + "name": "patch", + "type": "git_patch *", + "comment": "The patch to free." + } + ], + "argline": "git_patch *patch", + "sig": "git_patch *", + "return": { "type": "void", "comment": null }, + "description": "

Free a git_patch object.

\n", + "comments": "", + "group": "patch", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_patch_free-17"] } + }, + "git_patch_get_delta": { + "type": "function", + "file": "git2/patch.h", + "line": 154, + "lineto": 154, + "args": [ + { + "name": "patch", + "type": "const git_patch *", + "comment": "The patch in which to get the delta." + } + ], + "argline": "const git_patch *patch", + "sig": "const git_patch *", + "return": { + "type": "const git_diff_delta *", + "comment": " The delta associated with the patch." + }, + "description": "

Get the delta associated with a patch. This delta points to internal\n data and you do not have to release it when you are done with it.

\n", + "comments": "", + "group": "patch" + }, + "git_patch_num_hunks": { + "type": "function", + "file": "git2/patch.h", + "line": 162, + "lineto": 162, + "args": [ + { + "name": "patch", + "type": "const git_patch *", + "comment": "The patch in which to get the number of hunks." + } + ], + "argline": "const git_patch *patch", + "sig": "const git_patch *", + "return": { + "type": "size_t", + "comment": " The number of hunks of the patch." + }, + "description": "

Get the number of hunks in a patch

\n", + "comments": "", + "group": "patch" + }, + "git_patch_line_stats": { + "type": "function", + "file": "git2/patch.h", + "line": 180, + "lineto": 184, + "args": [ + { + "name": "total_context", + "type": "size_t *", + "comment": "Count of context lines in output, can be NULL." + }, + { + "name": "total_additions", + "type": "size_t *", + "comment": "Count of addition lines in output, can be NULL." + }, + { + "name": "total_deletions", + "type": "size_t *", + "comment": "Count of deletion lines in output, can be NULL." + }, + { + "name": "patch", + "type": "const git_patch *", + "comment": "The git_patch object" + } + ], + "argline": "size_t *total_context, size_t *total_additions, size_t *total_deletions, const git_patch *patch", + "sig": "size_t *::size_t *::size_t *::const git_patch *", + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, + "description": "

Get line counts of each type in a patch.

\n", + "comments": "

This helps imitate a diff --numstat type of output. For that purpose, you only need the total_additions and total_deletions values, but we include the total_context line count in case you want the total number of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n", + "group": "patch" + }, + "git_patch_get_hunk": { + "type": "function", + "file": "git2/patch.h", + "line": 199, + "lineto": 203, + "args": [ + { + "name": "out", + "type": "const git_diff_hunk **", + "comment": "Output pointer to git_diff_hunk of hunk" + }, + { + "name": "lines_in_hunk", + "type": "size_t *", + "comment": "Output count of total lines in this hunk" + }, + { + "name": "patch", + "type": "git_patch *", + "comment": "Input pointer to patch object" + }, + { + "name": "hunk_idx", + "type": "size_t", + "comment": "Input index of hunk to get information about" + } + ], + "argline": "const git_diff_hunk **out, size_t *lines_in_hunk, git_patch *patch, size_t hunk_idx", + "sig": "const git_diff_hunk **::size_t *::git_patch *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if hunk_idx out of range, \n<\n0 on error" + }, + "description": "

Get the information about a hunk in a patch

\n", + "comments": "

Given a patch and a hunk index into the patch, this returns detailed information about that hunk. Any of the output pointers can be passed as NULL if you don't care about that particular piece of information.

\n", + "group": "patch" + }, + "git_patch_num_lines_in_hunk": { + "type": "function", + "file": "git2/patch.h", + "line": 212, + "lineto": 214, + "args": [ + { + "name": "patch", + "type": "const git_patch *", + "comment": "The git_patch object" + }, + { "name": "hunk_idx", "type": "size_t", "comment": "Index of the hunk" } + ], + "argline": "const git_patch *patch, size_t hunk_idx", + "sig": "const git_patch *::size_t", + "return": { + "type": "int", + "comment": " Number of lines in hunk or GIT_ENOTFOUND if invalid hunk index" + }, + "description": "

Get the number of lines in a hunk.

\n", + "comments": "", + "group": "patch" + }, + "git_patch_get_line_in_hunk": { + "type": "function", + "file": "git2/patch.h", + "line": 230, + "lineto": 234, + "args": [ + { + "name": "out", + "type": "const git_diff_line **", + "comment": "The git_diff_line data for this line" + }, + { + "name": "patch", + "type": "git_patch *", + "comment": "The patch to look in" + }, + { + "name": "hunk_idx", + "type": "size_t", + "comment": "The index of the hunk" + }, + { + "name": "line_of_hunk", + "type": "size_t", + "comment": "The index of the line in the hunk" + } + ], + "argline": "const git_diff_line **out, git_patch *patch, size_t hunk_idx, size_t line_of_hunk", + "sig": "const git_diff_line **::git_patch *::size_t::size_t", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Get data about a line in a hunk of a patch.

\n", + "comments": "

Given a patch, a hunk index, and a line index in the hunk, this will return a lot of details about that line. If you pass a hunk index larger than the number of hunks or a line index larger than the number of lines in the hunk, this will return -1.

\n", + "group": "patch" + }, + "git_patch_size": { + "type": "function", + "file": "git2/patch.h", + "line": 252, + "lineto": 256, + "args": [ + { + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" + }, + { + "name": "include_context", + "type": "int", + "comment": "Include context lines in size if non-zero" + }, + { + "name": "include_hunk_headers", + "type": "int", + "comment": "Include hunk header lines if non-zero" + }, + { + "name": "include_file_headers", + "type": "int", + "comment": "Include file header lines if non-zero" + } + ], + "argline": "git_patch *patch, int include_context, int include_hunk_headers, int include_file_headers", + "sig": "git_patch *::int::int::int", + "return": { "type": "size_t", "comment": " The number of bytes of data" }, + "description": "

Look up size of patch diff data in bytes

\n", + "comments": "

This returns the raw size of the patch data. This only includes the actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size of all of the diff output; if you pass it as false (zero), this will only include the actual changed lines (as if context_lines was 0).

\n", + "group": "patch" + }, + "git_patch_print": { + "type": "function", + "file": "git2/patch.h", + "line": 270, + "lineto": 273, + "args": [ + { + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" + }, + { + "name": "print_cb", + "type": "git_diff_line_cb", + "comment": "Callback function to output lines of the patch. Will be\n called for file headers, hunk headers, and diff lines." + }, + { + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callbacks." + } + ], + "argline": "git_patch *patch, git_diff_line_cb print_cb, void *payload", + "sig": "git_patch *::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Serialize the patch to text via callback.

\n", + "comments": "

Returning a non-zero value from the callback will terminate the iteration and return that value to the caller.

\n", + "group": "patch" + }, + "git_patch_to_buf": { + "type": "function", + "file": "git2/patch.h", + "line": 282, + "lineto": 284, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The git_buf to be filled in" + }, + { + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" + } + ], + "argline": "git_buf *out, git_patch *patch", + "sig": "git_buf *::git_patch *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure." + }, + "description": "

Get the content of a patch as a single diff text.

\n", + "comments": "", + "group": "patch", + "examples": { "diff.c": ["ex/v1.9.1/diff.html#git_patch_to_buf-18"] } + }, + "git_pathspec_new": { + "type": "function", + "file": "git2/pathspec.h", + "line": 89, + "lineto": 90, + "args": [ + { + "name": "out", + "type": "git_pathspec **", + "comment": "Output of the compiled pathspec" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "A git_strarray of the paths to match" + } + ], + "argline": "git_pathspec **out, const git_strarray *pathspec", + "sig": "git_pathspec **::const git_strarray *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Compile a pathspec

\n", + "comments": "", + "group": "pathspec", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_pathspec_new-40"] } + }, + "git_pathspec_free": { + "type": "function", + "file": "git2/pathspec.h", + "line": 97, + "lineto": 97, + "args": [ + { + "name": "ps", + "type": "git_pathspec *", + "comment": "The compiled pathspec" + } + ], + "argline": "git_pathspec *ps", + "sig": "git_pathspec *", + "return": { "type": "void", "comment": null }, + "description": "

Free a pathspec

\n", + "comments": "", + "group": "pathspec", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_pathspec_free-41"] } + }, + "git_pathspec_matches_path": { + "type": "function", + "file": "git2/pathspec.h", + "line": 112, + "lineto": 113, + "args": [ + { + "name": "ps", + "type": "const git_pathspec *", + "comment": "The compiled pathspec" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "path", + "type": "const char *", + "comment": "The pathname to attempt to match" + } + ], + "argline": "const git_pathspec *ps, uint32_t flags, const char *path", + "sig": "const git_pathspec *::uint32_t::const char *", + "return": { + "type": "int", + "comment": " 1 is path matches spec, 0 if it does not" + }, + "description": "

Try to match a path against a pathspec

\n", + "comments": "

Unlike most of the other pathspec matching functions, this will not fall back on the native case-sensitivity for your platform. You must explicitly pass flags to control case sensitivity or else this will fall back on being case sensitive.

\n", + "group": "pathspec" + }, + "git_pathspec_match_workdir": { + "type": "function", + "file": "git2/pathspec.h", + "line": 137, + "lineto": 141, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository in which to match; bare repo is an error" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_repository *repo, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_repository *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag was given" + }, + "description": "

Match a pathspec against the working directory of a repository.

\n", + "comments": "

This matches the pathspec against the current files in the working directory of the repository. It is an error to invoke this on a bare repo. This handles git ignores (i.e. ignored files will not be considered to match the pathspec unless the file is tracked in the index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" + }, + "git_pathspec_match_index": { + "type": "function", + "file": "git2/pathspec.h", + "line": 166, + "lineto": 170, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to match against" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_index *index, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_index *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" + }, + "description": "

Match a pathspec against entries in an index.

\n", + "comments": "

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled by the current case-sensitivity of the index object itself and the USE_CASE and IGNORE_CASE flags will have no effect. This behavior will be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" + }, + "git_pathspec_match_tree": { + "type": "function", + "file": "git2/pathspec.h", + "line": 190, + "lineto": 194, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "tree", + "type": "git_tree *", + "comment": "The root-level tree to match against" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_tree *tree, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_tree *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" + }, + "description": "

Match a pathspec against files in a tree.

\n", + "comments": "

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_pathspec_match_tree-42"] } + }, + "git_pathspec_match_diff": { + "type": "function", + "file": "git2/pathspec.h", + "line": 214, + "lineto": 218, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "A generated diff list" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_diff *diff, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_diff *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" + }, + "description": "

Match a pathspec against files in a diff list.

\n", + "comments": "

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_free": { + "type": "function", + "file": "git2/pathspec.h", + "line": 225, + "lineto": 225, + "args": [ + { + "name": "m", + "type": "git_pathspec_match_list *", + "comment": "The git_pathspec_match_list to be freed" + } + ], + "argline": "git_pathspec_match_list *m", + "sig": "git_pathspec_match_list *", + "return": { "type": "void", "comment": null }, + "description": "

Free memory associates with a git_pathspec_match_list

\n", + "comments": "", + "group": "pathspec" + }, + "git_pathspec_match_list_entrycount": { + "type": "function", + "file": "git2/pathspec.h", + "line": 233, + "lineto": 234, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + } + ], + "argline": "const git_pathspec_match_list *m", + "sig": "const git_pathspec_match_list *", + "return": { + "type": "size_t", + "comment": " Number of items in match list" + }, + "description": "

Get the number of items in a match list.

\n", + "comments": "", + "group": "pathspec" + }, + "git_pathspec_match_list_entry": { + "type": "function", + "file": "git2/pathspec.h", + "line": 246, + "lineto": 247, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + }, + { + "name": "pos", + "type": "size_t", + "comment": "The index into the list" + } + ], + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", + "return": { + "type": "const char *", + "comment": " The filename of the match" + }, + "description": "

Get a matching filename by position.

\n", + "comments": "

This routine cannot be used if the match list was generated by git_pathspec_match_diff. If so, it will always return NULL.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_diff_entry": { + "type": "function", + "file": "git2/pathspec.h", + "line": 259, + "lineto": 260, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + }, + { + "name": "pos", + "type": "size_t", + "comment": "The index into the list" + } + ], + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", + "return": { + "type": "const git_diff_delta *", + "comment": " The filename of the match" + }, + "description": "

Get a matching diff delta by position.

\n", + "comments": "

This routine can only be used if the match list was generated by git_pathspec_match_diff. Otherwise it will always return NULL.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_failed_entrycount": { + "type": "function", + "file": "git2/pathspec.h", + "line": 271, + "lineto": 272, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + } + ], + "argline": "const git_pathspec_match_list *m", + "sig": "const git_pathspec_match_list *", + "return": { + "type": "size_t", + "comment": " Number of items in original pathspec that had no matches" + }, + "description": "

Get the number of pathspec items that did not match.

\n", + "comments": "

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when generating the git_pathspec_match_list.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_failed_entry": { + "type": "function", + "file": "git2/pathspec.h", + "line": 283, + "lineto": 284, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + }, + { + "name": "pos", + "type": "size_t", + "comment": "The index into the failed items" + } + ], + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", + "return": { + "type": "const char *", + "comment": " The pathspec pattern that didn't match anything" + }, + "description": "

Get an original pathspec string that had no matches.

\n", + "comments": "

This will be return NULL for positions out of range.

\n", + "group": "pathspec" + }, + "git_proxy_options_init": { + "type": "function", + "file": "git2/proxy.h", + "line": 103, + "lineto": 103, + "args": [ + { + "name": "opts", + "type": "git_proxy_options *", + "comment": "The `git_proxy_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_PROXY_OPTIONS_VERSION`." + } + ], + "argline": "git_proxy_options *opts, unsigned int version", + "sig": "git_proxy_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_proxy_options structure

\n", + "comments": "

Initializes a git_proxy_options with default values. Equivalent to creating an instance with GIT_PROXY_OPTIONS_INIT.

\n", + "group": "proxy" + }, + "git_rebase_options_init": { + "type": "function", + "file": "git2/rebase.h", + "line": 201, + "lineto": 203, + "args": [ + { + "name": "opts", + "type": "git_rebase_options *", + "comment": "The `git_rebase_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REBASE_OPTIONS_VERSION`." + } + ], + "argline": "git_rebase_options *opts, unsigned int version", + "sig": "git_rebase_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_rebase_options structure

\n", + "comments": "

Initializes a git_rebase_options with default values. Equivalent to creating an instance with GIT_REBASE_OPTIONS_INIT.

\n", + "group": "rebase" + }, + "git_rebase_init": { + "type": "function", + "file": "git2/rebase.h", + "line": 222, + "lineto": 228, + "args": [ + { + "name": "out", + "type": "git_rebase **", + "comment": "Pointer to store the rebase object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository to perform the rebase" + }, + { + "name": "branch", + "type": "const git_annotated_commit *", + "comment": "The terminal commit to rebase, or NULL to rebase the\n current branch" + }, + { + "name": "upstream", + "type": "const git_annotated_commit *", + "comment": "The commit to begin rebasing from, or NULL to rebase all\n reachable commits" + }, + { + "name": "onto", + "type": "const git_annotated_commit *", + "comment": "The branch to rebase onto, or NULL to rebase onto the given\n upstream" + }, + { + "name": "opts", + "type": "const git_rebase_options *", + "comment": "Options to specify how rebase is performed, or NULL" + } + ], + "argline": "git_rebase **out, git_repository *repo, const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, const git_rebase_options *opts", + "sig": "git_rebase **::git_repository *::const git_annotated_commit *::const git_annotated_commit *::const git_annotated_commit *::const git_rebase_options *", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a rebase operation to rebase the changes in branch\n relative to upstream onto another branch. To begin the rebase\n process, call git_rebase_next. When you have finished with this\n object, call git_rebase_free.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_open": { + "type": "function", + "file": "git2/rebase.h", + "line": 239, + "lineto": 242, + "args": [ + { + "name": "out", + "type": "git_rebase **", + "comment": "Pointer to store the rebase object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository that has a rebase in-progress" + }, + { + "name": "opts", + "type": "const git_rebase_options *", + "comment": "Options to specify how rebase is performed" + } + ], + "argline": "git_rebase **out, git_repository *repo, const git_rebase_options *opts", + "sig": "git_rebase **::git_repository *::const git_rebase_options *", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Opens an existing rebase that was previously started by either an\n invocation of git_rebase_init or by another client.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_orig_head_name": { + "type": "function", + "file": "git2/rebase.h", + "line": 250, + "lineto": 250, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "const char *", + "comment": " The original `HEAD` ref name" + }, + "description": "

Gets the original HEAD ref name for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_orig_head_id": { + "type": "function", + "file": "git2/rebase.h", + "line": 258, + "lineto": 258, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "const git_oid *", + "comment": " The original `HEAD` id" + }, + "description": "

Gets the original HEAD id for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_onto_name": { + "type": "function", + "file": "git2/rebase.h", + "line": 266, + "lineto": 266, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { "type": "const char *", "comment": " The `onto` ref name" }, + "description": "

Gets the onto ref name for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_onto_id": { + "type": "function", + "file": "git2/rebase.h", + "line": 274, + "lineto": 274, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { "type": "const git_oid *", "comment": " The `onto` id" }, + "description": "

Gets the onto id for merge rebases.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_operation_entrycount": { + "type": "function", + "file": "git2/rebase.h", + "line": 282, + "lineto": 282, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "size_t", + "comment": " The number of rebase operations in total" + }, + "description": "

Gets the count of rebase operations that are to be applied.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_operation_current": { + "type": "function", + "file": "git2/rebase.h", + "line": 293, + "lineto": 293, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "size_t", + "comment": " The index of the rebase operation currently being applied." + }, + "description": "

Gets the index of the rebase operation that is currently being applied.\n If the first operation has not yet been applied (because you have\n called init but not yet next) then this returns\n GIT_REBASE_NO_OPERATION.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_operation_byindex": { + "type": "function", + "file": "git2/rebase.h", + "line": 302, + "lineto": 304, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" + }, + { + "name": "idx", + "type": "size_t", + "comment": "The index of the rebase operation to retrieve" + } + ], + "argline": "git_rebase *rebase, size_t idx", + "sig": "git_rebase *::size_t", + "return": { + "type": "git_rebase_operation *", + "comment": " The rebase operation or NULL if `idx` was out of bounds" + }, + "description": "

Gets the rebase operation specified by the given index.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_next": { + "type": "function", + "file": "git2/rebase.h", + "line": 317, + "lineto": 319, + "args": [ + { + "name": "operation", + "type": "git_rebase_operation **", + "comment": "Pointer to store the rebase operation that is to be performed next" + }, + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase in progress" + } + ], + "argline": "git_rebase_operation **operation, git_rebase *rebase", + "sig": "git_rebase_operation **::git_rebase *", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Performs the next rebase operation and returns the information about it.\n If the operation is one that applies a patch (which is any operation except\n GIT_REBASE_OPERATION_EXEC) then the patch will be applied and the index and\n working directory will be updated with the changes. If there are conflicts,\n you will need to address those before committing the changes.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_inmemory_index": { + "type": "function", + "file": "git2/rebase.h", + "line": 336, + "lineto": 338, + "args": [ + { + "name": "index", + "type": "git_index **", + "comment": "The result index of the last operation." + }, + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase." + } + ], + "argline": "git_index **index, git_rebase *rebase", + "sig": "git_index **::git_rebase *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Gets the index produced by the last operation, which is the result\n of git_rebase_next and which will be committed by the next\n invocation of git_rebase_commit. This is useful for resolving\n conflicts in an in-memory rebase before committing them. You must\n call git_index_free when you are finished with this.

\n", + "comments": "

This is only applicable for in-memory rebases; for rebases within a working directory, the changes were applied to the repository's index.

\n", + "group": "rebase" + }, + "git_rebase_commit": { + "type": "function", + "file": "git2/rebase.h", + "line": 362, + "lineto": 368, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer in which to store the OID of the newly created commit" + }, + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "The author of the updated commit, or NULL to keep the\n author from the original commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "The committer of the rebase" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "The encoding for the message in the commit,\n represented with a standard encoding name. If message is NULL,\n this should also be NULL, and the encoding from the original\n commit will be maintained. If message is specified, this may be\n NULL to indicate that \"UTF-8\" is to be used." + }, + { + "name": "message", + "type": "const char *", + "comment": "The message for this commit, or NULL to use the message\n from the original commit." + } + ], + "argline": "git_oid *id, git_rebase *rebase, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message", + "sig": "git_oid *::git_rebase *::const git_signature *::const git_signature *::const char *::const char *", + "return": { + "type": "int", + "comment": " Zero on success, GIT_EUNMERGED if there are unmerged changes in\n the index, GIT_EAPPLIED if the current commit has already\n been applied to the upstream and there is nothing to commit,\n -1 on failure." + }, + "description": "

Commits the current patch. You must have resolved any conflicts that\n were introduced during the patch application from the git_rebase_next\n invocation.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_abort": { + "type": "function", + "file": "git2/rebase.h", + "line": 378, + "lineto": 378, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND if a rebase is not in progress,\n -1 on other errors." + }, + "description": "

Aborts a rebase that is currently in progress, resetting the repository\n and working directory to their state before rebase began.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_finish": { + "type": "function", + "file": "git2/rebase.h", + "line": 388, + "lineto": 390, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" + }, + { + "name": "signature", + "type": "const git_signature *", + "comment": "The identity that is finishing the rebase (optional)" + } + ], + "argline": "git_rebase *rebase, const git_signature *signature", + "sig": "git_rebase *::const git_signature *", + "return": { "type": "int", "comment": " Zero on success; -1 on error" }, + "description": "

Finishes a rebase that is currently in progress once all patches have\n been applied.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_free": { + "type": "function", + "file": "git2/rebase.h", + "line": 397, + "lineto": 397, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase object" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { "type": "void", "comment": null }, + "description": "

Frees the git_rebase object.

\n", + "comments": "", + "group": "rebase" + }, + "git_refdb_new": { + "type": "function", + "file": "git2/refdb.h", + "line": 35, + "lineto": 35, + "args": [ + { + "name": "out", + "type": "git_refdb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new reference database with no backends.

\n", + "comments": "

Before the Ref DB can be used for read/writing, a custom database backend must be manually set using git_refdb_set_backend()

\n", + "group": "refdb" + }, + "git_refdb_open": { + "type": "function", + "file": "git2/refdb.h", + "line": 49, + "lineto": 49, + "args": [ + { + "name": "out", + "type": "git_refdb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new reference database and automatically add\n the default backends:

\n", + "comments": "\n", + "group": "refdb" + }, + "git_refdb_compress": { + "type": "function", + "file": "git2/refdb.h", + "line": 59, + "lineto": 59, + "args": [ + { + "name": "refdb", + "type": "git_refdb *", + "comment": "The reference database to optimize." + } + ], + "argline": "git_refdb *refdb", + "sig": "git_refdb *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. For on-disk reference\n databases, for example, this may pack all loose references.

\n", + "comments": "", + "group": "refdb" + }, + "git_refdb_free": { + "type": "function", + "file": "git2/refdb.h", + "line": 66, + "lineto": 66, + "args": [ + { + "name": "refdb", + "type": "git_refdb *", + "comment": "reference database pointer or NULL" + } + ], + "argline": "git_refdb *refdb", + "sig": "git_refdb *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open reference database.

\n", + "comments": "", + "group": "refdb" + }, + "git_reflog_read": { + "type": "function", + "file": "git2/reflog.h", + "line": 38, + "lineto": 38, + "args": [ + { + "name": "out", + "type": "git_reflog **", + "comment": "pointer to reflog" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "name", + "type": "const char *", + "comment": "reference to look up" + } + ], + "argline": "git_reflog **out, git_repository *repo, const char *name", + "sig": "git_reflog **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Read the reflog for the given reference

\n", + "comments": "

If there is no reflog file for the given reference yet, an empty reflog object will be returned.

\n\n

The reflog must be freed manually by using git_reflog_free().

\n", + "group": "reflog" + }, + "git_reflog_write": { + "type": "function", + "file": "git2/reflog.h", + "line": 47, + "lineto": 47, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "an existing reflog object" + } + ], + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write an existing in-memory reflog object back to disk\n using an atomic file lock.

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_append": { + "type": "function", + "file": "git2/reflog.h", + "line": 60, + "lineto": 60, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "an existing reflog object" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the OID the reference is now pointing to" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "the signature of the committer" + }, + { + "name": "msg", + "type": "const char *", + "comment": "the reflog message" + } + ], + "argline": "git_reflog *reflog, const git_oid *id, const git_signature *committer, const char *msg", + "sig": "git_reflog *::const git_oid *::const git_signature *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add a new entry to the in-memory reflog.

\n", + "comments": "

msg is optional and can be NULL.

\n", + "group": "reflog" + }, + "git_reflog_rename": { + "type": "function", + "file": "git2/reflog.h", + "line": 75, + "lineto": 75, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "old_name", + "type": "const char *", + "comment": "the old name of the reference" + }, + { + "name": "name", + "type": "const char *", + "comment": "the new name of the reference" + } + ], + "argline": "git_repository *repo, const char *old_name, const char *name", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Rename a reflog

\n", + "comments": "

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity. See git_reference_create_symbolic() for rules about valid names.

\n", + "group": "reflog" + }, + "git_reflog_delete": { + "type": "function", + "file": "git2/reflog.h", + "line": 84, + "lineto": 84, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "name", + "type": "const char *", + "comment": "the reflog to delete" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Delete the reflog for the given reference

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entrycount": { + "type": "function", + "file": "git2/reflog.h", + "line": 92, + "lineto": 92, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "the previously loaded reflog" + } + ], + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { "type": "size_t", "comment": " the number of log entries" }, + "description": "

Get the number of log entries in a reflog

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_byindex": { + "type": "function", + "file": "git2/reflog.h", + "line": 105, + "lineto": 105, + "args": [ + { + "name": "reflog", + "type": "const git_reflog *", + "comment": "a previously loaded reflog" + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position of the entry to lookup. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." + } + ], + "argline": "const git_reflog *reflog, size_t idx", + "sig": "const git_reflog *::size_t", + "return": { + "type": "const git_reflog_entry *", + "comment": " the entry; NULL if not found" + }, + "description": "

Lookup an entry by its index

\n", + "comments": "

Requesting the reflog entry with an index of 0 (zero) will return the most recently created entry.

\n", + "group": "reflog" + }, + "git_reflog_drop": { + "type": "function", + "file": "git2/reflog.h", + "line": 124, + "lineto": 127, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "a previously loaded reflog." + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position of the entry to remove. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." + }, + { + "name": "rewrite_previous_entry", + "type": "int", + "comment": "1 to rewrite the history; 0 otherwise." + } + ], + "argline": "git_reflog *reflog, size_t idx, int rewrite_previous_entry", + "sig": "git_reflog *::size_t::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if the entry doesn't exist\n or an error code." + }, + "description": "

Remove an entry from the reflog by its index

\n", + "comments": "

To ensure there's no gap in the log history, set rewrite_previous_entry param value to 1. When deleting entry n, member old_oid of entry n-1 (if any) will be updated with the value of member new_oid of entry n+1.

\n", + "group": "reflog" + }, + "git_reflog_entry_id_old": { + "type": "function", + "file": "git2/reflog.h", + "line": 135, + "lineto": 135, + "args": [ + { + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" + } + ], + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", + "return": { "type": "const git_oid *", "comment": " the old oid" }, + "description": "

Get the old oid

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_id_new": { + "type": "function", + "file": "git2/reflog.h", + "line": 143, + "lineto": 143, + "args": [ + { + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" + } + ], + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", + "return": { + "type": "const git_oid *", + "comment": " the new oid at this time" + }, + "description": "

Get the new oid

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_committer": { + "type": "function", + "file": "git2/reflog.h", + "line": 151, + "lineto": 151, + "args": [ + { + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" + } + ], + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", + "return": { + "type": "const git_signature *", + "comment": " the committer" + }, + "description": "

Get the committer of this entry

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_message": { + "type": "function", + "file": "git2/reflog.h", + "line": 159, + "lineto": 159, + "args": [ + { + "name": "entry", + "type": "const git_reflog_entry *", + "comment": "a reflog entry" + } + ], + "argline": "const git_reflog_entry *entry", + "sig": "const git_reflog_entry *", + "return": { "type": "const char *", "comment": " the log msg" }, + "description": "

Get the log message

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_free": { + "type": "function", + "file": "git2/reflog.h", + "line": 166, + "lineto": 166, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "reflog to free" + } + ], + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { "type": "void", "comment": null }, + "description": "

Free the reflog

\n", + "comments": "", + "group": "reflog" + }, + "git_reference_lookup": { + "type": "function", + "file": "git2/refs.h", + "line": 37, + "lineto": 37, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer to the looked-up reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to look up the reference" + }, + { + "name": "name", + "type": "const char *", + "comment": "the long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name", + "sig": "git_reference **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." + }, + "description": "

Lookup a reference by name in a repository.

\n", + "comments": "

The returned reference must be freed by the user.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_reference_lookup-15", + "ex/v1.9.1/checkout.html#git_reference_lookup-16" + ], + "general.c": ["ex/v1.9.1/general.html#git_reference_lookup-69"], + "merge.c": ["ex/v1.9.1/merge.html#git_reference_lookup-21"] + } + }, + "git_reference_name_to_id": { + "type": "function", + "file": "git2/refs.h", + "line": 54, + "lineto": 55, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Pointer to oid to be filled in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository in which to look up the reference" + }, + { + "name": "name", + "type": "const char *", + "comment": "The long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)" + } + ], + "argline": "git_oid *out, git_repository *repo, const char *name", + "sig": "git_oid *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." + }, + "description": "

Lookup a reference by name and resolve immediately to OID.

\n", + "comments": "

This function provides a quick way to resolve a reference name straight through to the object id that it refers to. This avoids having to allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference" + }, + "git_reference_dwim": { + "type": "function", + "file": "git2/refs.h", + "line": 68, + "lineto": 68, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer in which to store the reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "shorthand", + "type": "const char *", + "comment": "the short name for the reference" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *shorthand", + "sig": "git_reference **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a reference by DWIMing its short name

\n", + "comments": "

Apply the git precedence rules to the given shorthand to determine which reference the user is referring to.

\n", + "group": "reference", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_reference_dwim-22"] } + }, + "git_reference_symbolic_create_matching": { + "type": "function", + "file": "git2/refs.h", + "line": 112, + "lineto": 112, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where that reference will live" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the reference" + }, + { + "name": "target", + "type": "const char *", + "comment": "The target of the reference" + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + }, + { + "name": "current_value", + "type": "const char *", + "comment": "The expected value of the reference when updating" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code" + }, + "description": "

Conditionally create a new symbolic reference.

\n", + "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_value (i.e. if the ref has changed since the user read it).

\n\n

If current_value is all zeros, this function will return GIT_EMODIFIED if the ref already exists.

\n", + "group": "reference" + }, + "git_reference_symbolic_create": { + "type": "function", + "file": "git2/refs.h", + "line": 148, + "lineto": 148, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where that reference will live" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the reference" + }, + { + "name": "target", + "type": "const char *", + "comment": "The target of the reference" + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Create a new symbolic reference.

\n", + "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", + "group": "reference" + }, + "git_reference_create": { + "type": "function", + "file": "git2/refs.h", + "line": 185, + "lineto": 185, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where that reference will live" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the reference" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The object id pointed to by the reference." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Create a new direct reference.

\n", + "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", + "group": "reference", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_reference_create-23"] + } + }, + "git_reference_create_matching": { + "type": "function", + "file": "git2/refs.h", + "line": 228, + "lineto": 228, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where that reference will live" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the reference" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The object id pointed to by the reference." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + }, + { + "name": "current_id", + "type": "const git_oid *", + "comment": "The expected value of the reference at the time of update" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Conditionally create new direct reference

\n", + "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_id (i.e. if the ref has changed since the user read it).

\n", + "group": "reference" + }, + "git_reference_target": { + "type": "function", + "file": "git2/refs.h", + "line": 243, + "lineto": 243, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const git_oid *", + "comment": " a pointer to the oid if available, NULL otherwise" + }, + "description": "

Get the OID pointed to by a direct reference.

\n", + "comments": "

Only available if the reference is direct (i.e. an object id reference, not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and then this function (or maybe use git_reference_name_to_id() to directly resolve a reference name all the way through to an OID).

\n", + "group": "reference", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_reference_target-70"] + } + }, + "git_reference_target_peel": { + "type": "function", + "file": "git2/refs.h", + "line": 254, + "lineto": 254, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const git_oid *", + "comment": " a pointer to the oid if available, NULL otherwise" + }, + "description": "

Return the peeled OID target of this reference.

\n", + "comments": "

This peeled OID only applies to direct references that point to a hard Tag object: it is the result of peeling such Tag.

\n", + "group": "reference" + }, + "git_reference_symbolic_target": { + "type": "function", + "file": "git2/refs.h", + "line": 264, + "lineto": 264, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const char *", + "comment": " a pointer to the name if available, NULL otherwise" + }, + "description": "

Get full name to the reference pointed to by a symbolic reference.

\n", + "comments": "

Only available if the reference is symbolic.

\n", + "group": "reference", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_reference_symbolic_target-71" + ], + "merge.c": ["ex/v1.9.1/merge.html#git_reference_symbolic_target-24"] + } + }, + "git_reference_type": { + "type": "function", + "file": "git2/refs.h", + "line": 274, + "lineto": 274, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { "type": "git_reference_t", "comment": " the type" }, + "description": "

Get the type of a reference.

\n", + "comments": "

Either direct (GIT_REFERENCE_DIRECT) or symbolic (GIT_REFERENCE_SYMBOLIC)

\n", + "group": "reference", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_reference_type-72"] + } + }, + "git_reference_name": { + "type": "function", + "file": "git2/refs.h", + "line": 284, + "lineto": 284, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const char *", + "comment": " the full name for the ref" + }, + "description": "

Get the full name of a reference.

\n", + "comments": "

See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_reference_name-17"], + "merge.c": ["ex/v1.9.1/merge.html#git_reference_name-25"] + } + }, + "git_reference_resolve": { + "type": "function", + "file": "git2/refs.h", + "line": 302, + "lineto": 302, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the peeled reference" + }, + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "git_reference **out, const git_reference *ref", + "sig": "git_reference **::const git_reference *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Resolve a symbolic reference to a direct reference.

\n", + "comments": "

This method iteratively peels a symbolic reference until it resolves to a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that reference is returned. This copy must be manually freed too.

\n", + "group": "reference" + }, + "git_reference_owner": { + "type": "function", + "file": "git2/refs.h", + "line": 310, + "lineto": 310, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "git_repository *", + "comment": " a pointer to the repo" + }, + "description": "

Get the repository where a reference resides.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_symbolic_set_target": { + "type": "function", + "file": "git2/refs.h", + "line": 332, + "lineto": 336, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference" + }, + { + "name": "target", + "type": "const char *", + "comment": "The new target for the reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_reference *ref, const char *target, const char *log_message", + "sig": "git_reference **::git_reference *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Create a new reference with the same name as the given reference but a\n different symbolic target. The reference must be a symbolic reference,\n otherwise this will fail.

\n", + "comments": "

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", + "group": "reference" + }, + "git_reference_set_target": { + "type": "function", + "file": "git2/refs.h", + "line": 352, + "lineto": 356, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The new target OID for the reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_reference *ref, const git_oid *id, const char *log_message", + "sig": "git_reference **::git_reference *::const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed since it was read, or an error code" + }, + "description": "

Conditionally create a new reference with the same name as the given reference but a\n different OID target. The reference must be a direct reference, otherwise\n this will fail.

\n", + "comments": "

The new reference will be written to disk, overwriting the given reference.

\n", + "group": "reference", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_reference_set_target-26"] + } + }, + "git_reference_rename": { + "type": "function", + "file": "git2/refs.h", + "line": 382, + "lineto": 387, + "args": [ + { + "name": "new_ref", + "type": "git_reference **", + "comment": "The new reference" + }, + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference to rename" + }, + { + "name": "new_name", + "type": "const char *", + "comment": "The new name for the reference" + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite an existing reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **new_ref, git_reference *ref, const char *new_name, int force, const char *log_message", + "sig": "git_reference **::git_reference *::const char *::int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Rename an existing reference.

\n", + "comments": "

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already a reference with the given name, the renaming will fail.

\n\n

IMPORTANT: The user needs to write a proper reflog entry if the reflog is enabled for the repository. We only rename the reflog if it exists.

\n", + "group": "reference" + }, + "git_reference_delete": { + "type": "function", + "file": "git2/refs.h", + "line": 402, + "lineto": 402, + "args": [ + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference to remove" + } + ], + "argline": "git_reference *ref", + "sig": "git_reference *", + "return": { + "type": "int", + "comment": " 0, GIT_EMODIFIED or an error code" + }, + "description": "

Delete an existing reference.

\n", + "comments": "

This method works for both direct and symbolic references. The reference will be immediately removed on disk but the memory will not be freed. Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed from the time it was looked up.

\n", + "group": "reference" + }, + "git_reference_remove": { + "type": "function", + "file": "git2/refs.h", + "line": 414, + "lineto": 414, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository to remove the reference from" + }, + { + "name": "name", + "type": "const char *", + "comment": "The reference to remove" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Delete an existing reference by name

\n", + "comments": "

This method removes the named reference from the repository without looking at its old value.

\n", + "group": "reference" + }, + "git_reference_list": { + "type": "function", + "file": "git2/refs.h", + "line": 428, + "lineto": 428, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe reference names will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + } + ], + "argline": "git_strarray *array, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Fill a list with all the references that can be found in a repository.

\n", + "comments": "

The string array will be filled with the names of all references; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free().

\n", + "group": "reference", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_reference_list-73"] + } + }, + "git_reference_foreach": { + "type": "function", + "file": "git2/refs.h", + "line": 468, + "lineto": 471, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + }, + { + "name": "callback", + "type": "git_reference_foreach_cb", + "comment": "Function which will be called for every listed ref" + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback" + } + ], + "argline": "git_repository *repo, git_reference_foreach_cb callback, void *payload", + "sig": "git_repository *::git_reference_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Perform a callback on each reference in the repository.

\n", + "comments": "

The callback function will be called for each reference in the repository, receiving the reference object and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n\n

Note that the callback function is responsible to call git_reference_free on each reference passed to it.

\n", + "group": "reference" + }, + "git_reference_foreach_name": { + "type": "function", + "file": "git2/refs.h", + "line": 486, + "lineto": 489, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + }, + { + "name": "callback", + "type": "git_reference_foreach_name_cb", + "comment": "Function which will be called for every listed ref name" + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback" + } + ], + "argline": "git_repository *repo, git_reference_foreach_name_cb callback, void *payload", + "sig": "git_repository *::git_reference_foreach_name_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Perform a callback on the fully-qualified name of each reference.

\n", + "comments": "

The callback function will be called for each reference in the repository, receiving the name of the reference and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n", + "group": "reference" + }, + "git_reference_dup": { + "type": "function", + "file": "git2/refs.h", + "line": 500, + "lineto": 500, + "args": [ + { + "name": "dest", + "type": "git_reference **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "git_reference *", + "comment": "object to copy" + } + ], + "argline": "git_reference **dest, git_reference *source", + "sig": "git_reference **::git_reference *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a copy of an existing reference.

\n", + "comments": "

Call git_reference_free to free the data.

\n", + "group": "reference" + }, + "git_reference_free": { + "type": "function", + "file": "git2/refs.h", + "line": 507, + "lineto": 507, + "args": [ + { "name": "ref", "type": "git_reference *", "comment": "git_reference" } + ], + "argline": "git_reference *ref", + "sig": "git_reference *", + "return": { "type": "void", "comment": null }, + "description": "

Free the given reference.

\n", + "comments": "", + "group": "reference", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_reference_free-18", + "ex/v1.9.1/checkout.html#git_reference_free-19", + "ex/v1.9.1/checkout.html#git_reference_free-20" + ], + "commit.c": ["ex/v1.9.1/commit.html#git_reference_free-7"], + "general.c": ["ex/v1.9.1/general.html#git_reference_free-74"], + "merge.c": [ + "ex/v1.9.1/merge.html#git_reference_free-27", + "ex/v1.9.1/merge.html#git_reference_free-28", + "ex/v1.9.1/merge.html#git_reference_free-29" + ], + "status.c": ["ex/v1.9.1/status.html#git_reference_free-1"] + } + }, + "git_reference_cmp": { + "type": "function", + "file": "git2/refs.h", + "line": 516, + "lineto": 518, + "args": [ + { + "name": "ref1", + "type": "const git_reference *", + "comment": "The first git_reference" + }, + { + "name": "ref2", + "type": "const git_reference *", + "comment": "The second git_reference" + } + ], + "argline": "const git_reference *ref1, const git_reference *ref2", + "sig": "const git_reference *::const git_reference *", + "return": { + "type": "int", + "comment": " 0 if the same, else a stable but meaningless ordering." + }, + "description": "

Compare two references.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_iterator_new": { + "type": "function", + "file": "git2/refs.h", + "line": 527, + "lineto": 529, + "args": [ + { + "name": "out", + "type": "git_reference_iterator **", + "comment": "pointer in which to store the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_reference_iterator **out, git_repository *repo", + "sig": "git_reference_iterator **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an iterator for the repo's references

\n", + "comments": "", + "group": "reference" + }, + "git_reference_iterator_glob_new": { + "type": "function", + "file": "git2/refs.h", + "line": 540, + "lineto": 543, + "args": [ + { + "name": "out", + "type": "git_reference_iterator **", + "comment": "pointer in which to store the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "glob", + "type": "const char *", + "comment": "the glob to match against the reference names" + } + ], + "argline": "git_reference_iterator **out, git_repository *repo, const char *glob", + "sig": "git_reference_iterator **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an iterator for the repo's references that match the\n specified glob

\n", + "comments": "", + "group": "reference" + }, + "git_reference_next": { + "type": "function", + "file": "git2/refs.h", + "line": 552, + "lineto": 552, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer in which to store the reference" + }, + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator" + } + ], + "argline": "git_reference **out, git_reference_iterator *iter", + "sig": "git_reference **::git_reference_iterator *", + "return": { + "type": "int", + "comment": " 0, GIT_ITEROVER if there are no more; or an error code" + }, + "description": "

Get the next reference

\n", + "comments": "", + "group": "reference" + }, + "git_reference_next_name": { + "type": "function", + "file": "git2/refs.h", + "line": 565, + "lineto": 565, + "args": [ + { + "name": "out", + "type": "const char **", + "comment": "pointer in which to store the string" + }, + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator" + } + ], + "argline": "const char **out, git_reference_iterator *iter", + "sig": "const char **::git_reference_iterator *", + "return": { + "type": "int", + "comment": " 0, GIT_ITEROVER if there are no more; or an error code" + }, + "description": "

Get the next reference's name

\n", + "comments": "

This function is provided for convenience in case only the names are interesting as it avoids the allocation of the git_reference object which git_reference_next() needs.

\n", + "group": "reference" + }, + "git_reference_iterator_free": { + "type": "function", + "file": "git2/refs.h", + "line": 572, + "lineto": 572, + "args": [ + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator to free" + } + ], + "argline": "git_reference_iterator *iter", + "sig": "git_reference_iterator *", + "return": { "type": "void", "comment": null }, + "description": "

Free the iterator and its associated resources

\n", + "comments": "", + "group": "reference" + }, + "git_reference_foreach_glob": { + "type": "function", + "file": "git2/refs.h", + "line": 592, + "lineto": 596, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + }, + { + "name": "glob", + "type": "const char *", + "comment": "Pattern to match (fnmatch-style) against reference name." + }, + { + "name": "callback", + "type": "git_reference_foreach_name_cb", + "comment": "Function which will be called for every listed ref" + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback" + } + ], + "argline": "git_repository *repo, const char *glob, git_reference_foreach_name_cb callback, void *payload", + "sig": "git_repository *::const char *::git_reference_foreach_name_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUSER on non-zero callback, or error code" + }, + "description": "

Perform a callback on each reference in the repository whose name\n matches the given pattern.

\n", + "comments": "

This function acts like git_reference_foreach() with an additional pattern match being applied to the reference name before issuing the callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches any sequence of letters, a '?' matches any letter, and square brackets can be used to define character ranges (such as "[0-9]" for digits).

\n", + "group": "reference" + }, + "git_reference_has_log": { + "type": "function", + "file": "git2/refs.h", + "line": 606, + "lineto": 606, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference's name" + } + ], + "argline": "git_repository *repo, const char *refname", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 when no reflog can be found, 1 when it exists;\n otherwise an error code." + }, + "description": "

Check if a reflog exists for the specified reference.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_ensure_log": { + "type": "function", + "file": "git2/refs.h", + "line": 618, + "lineto": 618, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference's name" + } + ], + "argline": "git_repository *repo, const char *refname", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Ensure there is a reflog for a particular reference.

\n", + "comments": "

Make sure that successive updates to the reference will append to its log.

\n", + "group": "reference" + }, + "git_reference_is_branch": { + "type": "function", + "file": "git2/refs.h", + "line": 628, + "lineto": 628, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/heads\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a local branch.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_is_remote": { + "type": "function", + "file": "git2/refs.h", + "line": 638, + "lineto": 638, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/remotes\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a remote tracking branch

\n", + "comments": "", + "group": "reference", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_reference_is_remote-21"] + } + }, + "git_reference_is_tag": { + "type": "function", + "file": "git2/refs.h", + "line": 648, + "lineto": 648, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/tags\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a tag

\n", + "comments": "", + "group": "reference" + }, + "git_reference_is_note": { + "type": "function", + "file": "git2/refs.h", + "line": 658, + "lineto": 658, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/notes\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a note

\n", + "comments": "", + "group": "reference" + }, + "git_reference_normalize_name": { + "type": "function", + "file": "git2/refs.h", + "line": 714, + "lineto": 718, + "args": [ + { + "name": "buffer_out", + "type": "char *", + "comment": "User allocated buffer to store normalized name" + }, + { + "name": "buffer_size", + "type": "size_t", + "comment": "Size of buffer_out" + }, + { + "name": "name", + "type": "const char *", + "comment": "Reference name to be checked." + }, + { + "name": "flags", + "type": "unsigned int", + "comment": "Flags to constrain name validation rules - see the\n GIT_REFERENCE_FORMAT constants above." + } + ], + "argline": "char *buffer_out, size_t buffer_size, const char *name, unsigned int flags", + "sig": "char *::size_t::const char *::unsigned int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC\n or an error code." + }, + "description": "

Normalize reference name and check validity.

\n", + "comments": "

This will normalize the reference name by removing any leading slash '/' characters and collapsing runs of adjacent slashes between name components into a single slash.

\n\n

Once normalized, if the reference name is valid, it will be returned in the user allocated buffer.

\n\n

See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference" + }, + "git_reference_peel": { + "type": "function", + "file": "git2/refs.h", + "line": 735, + "lineto": 738, + "args": [ + { + "name": "out", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" + }, + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference to be processed" + }, + { + "name": "type", + "type": "git_object_t", + "comment": "The type of the requested object (GIT_OBJECT_COMMIT,\n GIT_OBJECT_TAG, GIT_OBJECT_TREE, GIT_OBJECT_BLOB or GIT_OBJECT_ANY)." + } + ], + "argline": "git_object **out, const git_reference *ref, git_object_t type", + "sig": "git_object **::const git_reference *::git_object_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code" + }, + "description": "

Recursively peel reference until object of the specified type is found.

\n", + "comments": "

The retrieved peeled object is owned by the repository and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJECT_ANY as the target type, then the object will be peeled until a non-tag object is met.

\n", + "group": "reference", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_reference_peel-30"] } + }, + "git_reference_name_is_valid": { + "type": "function", + "file": "git2/refs.h", + "line": 755, + "lineto": 755, + "args": [ + { + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given reference name" + }, + { + "name": "refname", + "type": "const char *", + "comment": "name to be checked." + } + ], + "argline": "int *valid, const char *refname", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Ensure the reference name is well-formed.

\n", + "comments": "

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n", + "group": "reference" + }, + "git_reference_shorthand": { + "type": "function", + "file": "git2/refs.h", + "line": 769, + "lineto": 769, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "a reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const char *", + "comment": " the human-readable version of the name" + }, + "description": "

Get the reference's short name

\n", + "comments": "

This will transform the reference name into a name "human-readable" version. If no shortname is appropriate, it will return the full name.

\n\n

The memory is owned by the reference and must not be freed.

\n", + "group": "reference", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_reference_shorthand-2"] + } + }, + "git_refspec_parse": { + "type": "function", + "file": "git2/refspec.h", + "line": 32, + "lineto": 32, + "args": [ + { + "name": "refspec", + "type": "git_refspec **", + "comment": "a pointer to hold the refspec handle" + }, + { + "name": "input", + "type": "const char *", + "comment": "the refspec string" + }, + { + "name": "is_fetch", + "type": "int", + "comment": "is this a refspec for a fetch" + } + ], + "argline": "git_refspec **refspec, const char *input, int is_fetch", + "sig": "git_refspec **::const char *::int", + "return": { + "type": "int", + "comment": " 0 if the refspec string could be parsed, -1 otherwise" + }, + "description": "

Parse a given refspec string

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_free": { + "type": "function", + "file": "git2/refspec.h", + "line": 39, + "lineto": 39, + "args": [ + { + "name": "refspec", + "type": "git_refspec *", + "comment": "the refspec object" + } + ], + "argline": "git_refspec *refspec", + "sig": "git_refspec *", + "return": { "type": "void", "comment": null }, + "description": "

Free a refspec object which has been created by git_refspec_parse

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_src": { + "type": "function", + "file": "git2/refspec.h", + "line": 47, + "lineto": 47, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + } + ], + "argline": "const git_refspec *refspec", + "sig": "const git_refspec *", + "return": { + "type": "const char *", + "comment": " the refspec's source specifier" + }, + "description": "

Get the source specifier

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_dst": { + "type": "function", + "file": "git2/refspec.h", + "line": 55, + "lineto": 55, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + } + ], + "argline": "const git_refspec *refspec", + "sig": "const git_refspec *", + "return": { + "type": "const char *", + "comment": " the refspec's destination specifier" + }, + "description": "

Get the destination specifier

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_string": { + "type": "function", + "file": "git2/refspec.h", + "line": 63, + "lineto": 63, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + } + ], + "argline": "const git_refspec *refspec", + "sig": "const git_refspec *", + "return": { + "type": "const char *", + "comment": " the refspec's original string" + }, + "description": "

Get the refspec's string

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_force": { + "type": "function", + "file": "git2/refspec.h", + "line": 71, + "lineto": 71, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + } + ], + "argline": "const git_refspec *refspec", + "sig": "const git_refspec *", + "return": { + "type": "int", + "comment": " 1 if force update has been set, 0 otherwise" + }, + "description": "

Get the force update setting

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_direction": { + "type": "function", + "file": "git2/refspec.h", + "line": 79, + "lineto": 79, + "args": [ + { "name": "spec", "type": "const git_refspec *", "comment": "refspec" } + ], + "argline": "const git_refspec *spec", + "sig": "const git_refspec *", + "return": { + "type": "git_direction", + "comment": " GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH" + }, + "description": "

Get the refspec's direction.

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_src_matches_negative": { + "type": "function", + "file": "git2/refspec.h", + "line": 88, + "lineto": 88, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the name of the reference to check" + } + ], + "argline": "const git_refspec *refspec, const char *refname", + "sig": "const git_refspec *::const char *", + "return": { + "type": "int", + "comment": " 1 if the refspec matches, 0 otherwise" + }, + "description": "

Check if a refspec's source descriptor matches a negative reference

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_src_matches": { + "type": "function", + "file": "git2/refspec.h", + "line": 97, + "lineto": 97, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the name of the reference to check" + } + ], + "argline": "const git_refspec *refspec, const char *refname", + "sig": "const git_refspec *::const char *", + "return": { + "type": "int", + "comment": " 1 if the refspec matches, 0 otherwise" + }, + "description": "

Check if a refspec's source descriptor matches a reference

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_dst_matches": { + "type": "function", + "file": "git2/refspec.h", + "line": 106, + "lineto": 106, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the name of the reference to check" + } + ], + "argline": "const git_refspec *refspec, const char *refname", + "sig": "const git_refspec *::const char *", + "return": { + "type": "int", + "comment": " 1 if the refspec matches, 0 otherwise" + }, + "description": "

Check if a refspec's destination descriptor matches a reference

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_transform": { + "type": "function", + "file": "git2/refspec.h", + "line": 116, + "lineto": 116, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "where to store the target name" + }, + { + "name": "spec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the reference to transform" + } + ], + "argline": "git_buf *out, const git_refspec *spec, const char *name", + "sig": "git_buf *::const git_refspec *::const char *", + "return": { "type": "int", "comment": " 0, GIT_EBUFS or another error" }, + "description": "

Transform a reference to its target following the refspec's rules

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_rtransform": { + "type": "function", + "file": "git2/refspec.h", + "line": 126, + "lineto": 126, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "where to store the source reference name" + }, + { + "name": "spec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the reference to transform" + } + ], + "argline": "git_buf *out, const git_refspec *spec, const char *name", + "sig": "git_buf *::const git_refspec *::const char *", + "return": { "type": "int", "comment": " 0, GIT_EBUFS or another error" }, + "description": "

Transform a target reference to its source reference following the refspec's rules

\n", + "comments": "", + "group": "refspec", + "examples": { + "fetch.c": ["ex/v1.9.1/fetch.html#git_refspec_rtransform-4"] + } + }, + "git_remote_create": { + "type": "function", + "file": "git2/remote.h", + "line": 38, + "lineto": 42, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "the resulting remote" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to create the remote" + }, + { + "name": "name", + "type": "const char *", + "comment": "the remote's name" + }, + { "name": "url", "type": "const char *", "comment": "the remote's url" } + ], + "argline": "git_remote **out, git_repository *repo, const char *name, const char *url", + "sig": "git_remote **::git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Add a remote with the default fetch refspec to the repository's configuration.

\n", + "comments": "", + "group": "remote", + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_create-1"] } + }, + "git_remote_create_options_init": { + "type": "function", + "file": "git2/remote.h", + "line": 135, + "lineto": 137, + "args": [ + { + "name": "opts", + "type": "git_remote_create_options *", + "comment": "The `git_remote_create_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REMOTE_CREATE_OPTIONS_VERSION`." + } + ], + "argline": "git_remote_create_options *opts, unsigned int version", + "sig": "git_remote_create_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_remote_create_options structure

\n", + "comments": "

Initializes a git_remote_create_options with default values. Equivalent to creating an instance with GIT_REMOTE_CREATE_OPTIONS_INIT.

\n", + "group": "remote" + }, + "git_remote_create_with_opts": { + "type": "function", + "file": "git2/remote.h", + "line": 151, + "lineto": 154, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "the resulting remote" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote's url" + }, + { + "name": "opts", + "type": "const git_remote_create_options *", + "comment": "the remote creation options" + } + ], + "argline": "git_remote **out, const char *url, const git_remote_create_options *opts", + "sig": "git_remote **::const char *::const git_remote_create_options *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Create a remote, with options.

\n", + "comments": "

This function allows more fine-grained control over the remote creation.

\n\n

Passing NULL as the opts argument will result in a detached remote.

\n", + "group": "remote" + }, + "git_remote_create_with_fetchspec": { + "type": "function", + "file": "git2/remote.h", + "line": 167, + "lineto": 172, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "the resulting remote" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to create the remote" + }, + { + "name": "name", + "type": "const char *", + "comment": "the remote's name" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote's url" + }, + { + "name": "fetch", + "type": "const char *", + "comment": "the remote fetch value" + } + ], + "argline": "git_remote **out, git_repository *repo, const char *name, const char *url, const char *fetch", + "sig": "git_remote **::git_repository *::const char *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Add a remote with the provided fetch refspec (or default if NULL) to the repository's\n configuration.

\n", + "comments": "", + "group": "remote" + }, + "git_remote_create_anonymous": { + "type": "function", + "file": "git2/remote.h", + "line": 185, + "lineto": 188, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "pointer to the new remote objects" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the associated repository" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote repository's URL" + } + ], + "argline": "git_remote **out, git_repository *repo, const char *url", + "sig": "git_remote **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create an anonymous remote

\n", + "comments": "

Create a remote with the given url in-memory. You can use this when you have a URL instead of a remote's name.

\n", + "group": "remote", + "examples": { + "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_create_anonymous-5"], + "ls-remote.c": [ + "ex/v1.9.1/ls-remote.html#git_remote_create_anonymous-2" + ] + } + }, + "git_remote_create_detached": { + "type": "function", + "file": "git2/remote.h", + "line": 204, + "lineto": 206, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "pointer to the new remote objects" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote repository's URL" + } + ], + "argline": "git_remote **out, const char *url", + "sig": "git_remote **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a remote without a connected local repo

\n", + "comments": "

Create a remote with the given url in-memory. You can use this when you have a URL instead of a remote's name.

\n\n

Contrasted with git_remote_create_anonymous, a detached remote will not consider any repo configuration values (such as insteadof url substitutions).

\n", + "group": "remote" + }, + "git_remote_lookup": { + "type": "function", + "file": "git2/remote.h", + "line": 219, + "lineto": 219, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "pointer to the new remote object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the associated repository" + }, + { + "name": "name", + "type": "const char *", + "comment": "the remote's name" + } + ], + "argline": "git_remote **out, git_repository *repo, const char *name", + "sig": "git_remote **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Get the information for a particular remote

\n", + "comments": "

The name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "group": "remote", + "examples": { + "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_lookup-6"], + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_lookup-3"], + "push.c": ["ex/v1.9.1/push.html#git_remote_lookup-1"], + "remote.c": ["ex/v1.9.1/remote.html#git_remote_lookup-2"] + } + }, + "git_remote_dup": { + "type": "function", + "file": "git2/remote.h", + "line": 231, + "lineto": 231, + "args": [ + { + "name": "dest", + "type": "git_remote **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "git_remote *", + "comment": "object to copy" + } + ], + "argline": "git_remote **dest, git_remote *source", + "sig": "git_remote **::git_remote *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a copy of an existing remote. All internal strings are also\n duplicated. Callbacks are not duplicated.

\n", + "comments": "

Call git_remote_free to free the data.

\n", + "group": "remote" + }, + "git_remote_owner": { + "type": "function", + "file": "git2/remote.h", + "line": 239, + "lineto": 239, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "git_repository *", + "comment": " a pointer to the repository" + }, + "description": "

Get the remote's repository

\n", + "comments": "", + "group": "remote" + }, + "git_remote_name": { + "type": "function", + "file": "git2/remote.h", + "line": 247, + "lineto": 247, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "const char *", + "comment": " a pointer to the name or NULL for in-memory remotes" + }, + "description": "

Get the remote's name

\n", + "comments": "", + "group": "remote" + }, + "git_remote_url": { + "type": "function", + "file": "git2/remote.h", + "line": 259, + "lineto": 259, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { "type": "const char *", "comment": " a pointer to the url" }, + "description": "

Get the remote's url

\n", + "comments": "

If url.*.insteadOf has been configured for this URL, it will return the modified URL. This function does not consider if a push url has been configured for this remote (use git_remote_pushurl if needed).

\n", + "group": "remote", + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_url-3"] } + }, + "git_remote_pushurl": { + "type": "function", + "file": "git2/remote.h", + "line": 271, + "lineto": 271, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "const char *", + "comment": " a pointer to the url or NULL if no special url for pushing is set" + }, + "description": "

Get the remote's url for pushing.

\n", + "comments": "

If url.*.pushInsteadOf has been configured for this URL, it will return the modified URL. If git_remote_set_instance_pushurl has been called for this remote, then that URL will be returned.

\n", + "group": "remote", + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_pushurl-4"] } + }, + "git_remote_set_url": { + "type": "function", + "file": "git2/remote.h", + "line": 284, + "lineto": 284, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the change" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the remote's name" + }, + { "name": "url", "type": "const char *", "comment": "the url to set" } + ], + "argline": "git_repository *repo, const char *remote, const char *url", + "sig": "git_repository *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error value" }, + "description": "

Set the remote's url in the configuration

\n", + "comments": "

Remote objects already in memory will not be affected. This assumes the common case of a single-url remote and will otherwise return an error.

\n", + "group": "remote", + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_set_url-5"] } + }, + "git_remote_set_pushurl": { + "type": "function", + "file": "git2/remote.h", + "line": 298, + "lineto": 298, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the change" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the remote's name" + }, + { "name": "url", "type": "const char *", "comment": "the url to set" } + ], + "argline": "git_repository *repo, const char *remote, const char *url", + "sig": "git_repository *::const char *::const char *", + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Set the remote's url for pushing in the configuration.

\n", + "comments": "

Remote objects already in memory will not be affected. This assumes the common case of a single-url remote and will otherwise return an error.

\n", + "group": "remote", + "examples": { + "remote.c": ["ex/v1.9.1/remote.html#git_remote_set_pushurl-6"] + } + }, + "git_remote_set_instance_url": { + "type": "function", + "file": "git2/remote.h", + "line": 308, + "lineto": 308, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote's name" + }, + { "name": "url", "type": "const char *", "comment": "the url to set" } + ], + "argline": "git_remote *remote, const char *url", + "sig": "git_remote *::const char *", + "return": { "type": "int", "comment": " 0 or an error value" }, + "description": "

Set the url for this particular url instance. The URL in the\n configuration will be ignored, and will not be changed.

\n", + "comments": "", + "group": "remote" + }, + "git_remote_set_instance_pushurl": { + "type": "function", + "file": "git2/remote.h", + "line": 318, + "lineto": 318, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote's name" + }, + { "name": "url", "type": "const char *", "comment": "the url to set" } + ], + "argline": "git_remote *remote, const char *url", + "sig": "git_remote *::const char *", + "return": { "type": "int", "comment": " 0 or an error value" }, + "description": "

Set the push url for this particular url instance. The URL in the\n configuration will be ignored, and will not be changed.

\n", + "comments": "", + "group": "remote" + }, + "git_remote_add_fetch": { + "type": "function", + "file": "git2/remote.h", + "line": 331, + "lineto": 331, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to change the configuration" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the name of the remote to change" + }, + { + "name": "refspec", + "type": "const char *", + "comment": "the new fetch refspec" + } + ], + "argline": "git_repository *repo, const char *remote, const char *refspec", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC if refspec is invalid or an error value" + }, + "description": "

Add a fetch refspec to the remote's configuration

\n", + "comments": "

Add the given refspec to the fetch list in the configuration. No loaded remote instances will be affected.

\n", + "group": "remote" + }, + "git_remote_get_fetch_refspecs": { + "type": "function", + "file": "git2/remote.h", + "line": 343, + "lineto": 343, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "pointer to the array in which to store the strings" + }, + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "git_strarray *array, const git_remote *remote", + "sig": "git_strarray *::const git_remote *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Get the remote's list of fetch refspecs

\n", + "comments": "

The memory is owned by the user and should be freed with git_strarray_free.

\n", + "group": "remote" + }, + "git_remote_add_push": { + "type": "function", + "file": "git2/remote.h", + "line": 356, + "lineto": 356, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to change the configuration" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the name of the remote to change" + }, + { + "name": "refspec", + "type": "const char *", + "comment": "the new push refspec" + } + ], + "argline": "git_repository *repo, const char *remote, const char *refspec", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC if refspec is invalid or an error value" + }, + "description": "

Add a push refspec to the remote's configuration

\n", + "comments": "

Add the given refspec to the push list in the configuration. No loaded remote instances will be affected.

\n", + "group": "remote" + }, + "git_remote_get_push_refspecs": { + "type": "function", + "file": "git2/remote.h", + "line": 368, + "lineto": 368, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "pointer to the array in which to store the strings" + }, + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "git_strarray *array, const git_remote *remote", + "sig": "git_strarray *::const git_remote *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Get the remote's list of push refspecs

\n", + "comments": "

The memory is owned by the user and should be freed with git_strarray_free.

\n", + "group": "remote" + }, + "git_remote_refspec_count": { + "type": "function", + "file": "git2/remote.h", + "line": 376, + "lineto": 376, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "size_t", + "comment": " the amount of refspecs configured in this remote" + }, + "description": "

Get the number of refspecs for a remote

\n", + "comments": "", + "group": "remote" + }, + "git_remote_get_refspec": { + "type": "function", + "file": "git2/remote.h", + "line": 385, + "lineto": 385, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + }, + { "name": "n", "type": "size_t", "comment": "the refspec to get" } + ], + "argline": "const git_remote *remote, size_t n", + "sig": "const git_remote *::size_t", + "return": { + "type": "const git_refspec *", + "comment": " the nth refspec" + }, + "description": "

Get a refspec from the remote

\n", + "comments": "", + "group": "remote" + }, + "git_remote_ls": { + "type": "function", + "file": "git2/remote.h", + "line": 407, + "lineto": 407, + "args": [ + { + "name": "out", + "type": "const git_remote_head ***", + "comment": "pointer to the array" + }, + { + "name": "size", + "type": "size_t *", + "comment": "the number of remote heads" + }, + { "name": "remote", "type": "git_remote *", "comment": "the remote" } + ], + "argline": "const git_remote_head ***out, size_t *size, git_remote *remote", + "sig": "const git_remote_head ***::size_t *::git_remote *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Get the remote repository's reference advertisement list

\n", + "comments": "

Get the list of references with which the server responds to a new connection.

\n\n

The remote (or more exactly its transport) must have connected to the remote repository. This list is available as soon as the connection to the remote is initiated and it remains available after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long as a new connection is not initiated, but it is recommended that you make a copy in order to make use of the data.

\n", + "group": "remote", + "examples": { + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_ls-4"] + } + }, + "git_remote_connected": { + "type": "function", + "file": "git2/remote.h", + "line": 418, + "lineto": 418, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "int", + "comment": " 1 if it's connected, 0 otherwise." + }, + "description": "

Check whether the remote is connected

\n", + "comments": "

Check whether the remote's underlying transport is connected to the remote host.

\n", + "group": "remote" + }, + "git_remote_stop": { + "type": "function", + "file": "git2/remote.h", + "line": 429, + "lineto": 429, + "args": [ + { "name": "remote", "type": "git_remote *", "comment": "the remote" } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Cancel the operation

\n", + "comments": "

At certain points in its operation, the network code checks whether the operation has been cancelled and if so stops the operation.

\n", + "group": "remote" + }, + "git_remote_disconnect": { + "type": "function", + "file": "git2/remote.h", + "line": 439, + "lineto": 439, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to disconnect from" + } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Disconnect from the remote

\n", + "comments": "

Close the connection to the remote.

\n", + "group": "remote" + }, + "git_remote_free": { + "type": "function", + "file": "git2/remote.h", + "line": 449, + "lineto": 449, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to free" + } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { "type": "void", "comment": null }, + "description": "

Free the memory associated with a remote

\n", + "comments": "

This also disconnects from the remote, if the connection has not been closed yet (using git_remote_disconnect).

\n", + "group": "remote", + "examples": { + "fetch.c": [ + "ex/v1.9.1/fetch.html#git_remote_free-7", + "ex/v1.9.1/fetch.html#git_remote_free-8" + ], + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_free-5"], + "remote.c": ["ex/v1.9.1/remote.html#git_remote_free-7"] + } + }, + "git_remote_list": { + "type": "function", + "file": "git2/remote.h", + "line": 460, + "lineto": 460, + "args": [ + { + "name": "out", + "type": "git_strarray *", + "comment": "a string array which receives the names of the remotes" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to query" + } + ], + "argline": "git_strarray *out, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get a list of the configured remotes for a repo

\n", + "comments": "

The string array must be freed by the user.

\n", + "group": "remote", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_remote_list-22"], + "remote.c": ["ex/v1.9.1/remote.html#git_remote_list-8"] + } + }, + "git_remote_init_callbacks": { + "type": "function", + "file": "git2/remote.h", + "line": 714, + "lineto": 716, + "args": [ + { + "name": "opts", + "type": "git_remote_callbacks *", + "comment": "the `git_remote_callbacks` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_REMOTE_CALLBACKS_VERSION`" + } + ], + "argline": "git_remote_callbacks *opts, unsigned int version", + "sig": "git_remote_callbacks *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_remote_callbacks with default values. Equivalent to\n creating an instance with GIT_REMOTE_CALLBACKS_INIT.

\n", + "comments": "", + "group": "remote", + "examples": { + "push.c": ["ex/v1.9.1/push.html#git_remote_init_callbacks-2"] + } + }, + "git_fetch_options_init": { + "type": "function", + "file": "git2/remote.h", + "line": 852, + "lineto": 854, + "args": [ + { + "name": "opts", + "type": "git_fetch_options *", + "comment": "The `git_fetch_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_FETCH_OPTIONS_VERSION`." + } + ], + "argline": "git_fetch_options *opts, unsigned int version", + "sig": "git_fetch_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_fetch_options structure

\n", + "comments": "

Initializes a git_fetch_options with default values. Equivalent to creating an instance with GIT_FETCH_OPTIONS_INIT.

\n", + "group": "fetch" + }, + "git_push_options_init": { + "type": "function", + "file": "git2/remote.h", + "line": 917, + "lineto": 919, + "args": [ + { + "name": "opts", + "type": "git_push_options *", + "comment": "The `git_push_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_PUSH_OPTIONS_VERSION`." + } + ], + "argline": "git_push_options *opts, unsigned int version", + "sig": "git_push_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_push_options structure

\n", + "comments": "

Initializes a git_push_options with default values. Equivalent to creating an instance with GIT_PUSH_OPTIONS_INIT.

\n", + "group": "push", + "examples": { "push.c": ["ex/v1.9.1/push.html#git_push_options_init-3"] } + }, + "git_remote_connect_options_init": { + "type": "function", + "file": "git2/remote.h", + "line": 968, + "lineto": 970, + "args": [ + { + "name": "opts", + "type": "git_remote_connect_options *", + "comment": "The `git_remote_connect_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REMOTE_CONNECT_OPTIONS_VERSION`." + } + ], + "argline": "git_remote_connect_options *opts, unsigned int version", + "sig": "git_remote_connect_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_remote_connect_options structure.

\n", + "comments": "

Initializes a git_remote_connect_options with default values. Equivalent to creating an instance with GIT_REMOTE_CONNECT_OPTIONS_INIT.

\n", + "group": "remote" + }, + "git_remote_connect": { + "type": "function", + "file": "git2/remote.h", + "line": 987, + "lineto": 992, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to connect to" + }, + { + "name": "direction", + "type": "git_direction", + "comment": "GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push" + }, + { + "name": "callbacks", + "type": "const git_remote_callbacks *", + "comment": "the callbacks to use for this connection" + }, + { + "name": "proxy_opts", + "type": "const git_proxy_options *", + "comment": "proxy settings" + }, + { + "name": "custom_headers", + "type": "const git_strarray *", + "comment": "extra HTTP headers to use in this connection" + } + ], + "argline": "git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_proxy_options *proxy_opts, const git_strarray *custom_headers", + "sig": "git_remote *::git_direction::const git_remote_callbacks *::const git_proxy_options *::const git_strarray *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open a connection to a remote.

\n", + "comments": "

The transport is selected based on the URL; the direction argument is due to a limitation of the git protocol which starts up a specific binary which can only do the one or the other.

\n", + "group": "remote", + "examples": { + "ls-remote.c": ["ex/v1.9.1/ls-remote.html#git_remote_connect-6"] + } + }, + "git_remote_connect_ext": { + "type": "function", + "file": "git2/remote.h", + "line": 1012, + "lineto": 1015, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to connect to" + }, + { + "name": "direction", + "type": "git_direction", + "comment": "GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push" + }, + { + "name": "opts", + "type": "const git_remote_connect_options *", + "comment": "the remote connection options" + } + ], + "argline": "git_remote *remote, git_direction direction, const git_remote_connect_options *opts", + "sig": "git_remote *::git_direction::const git_remote_connect_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open a connection to a remote with extended options.

\n", + "comments": "

The transport is selected based on the URL; the direction argument is due to a limitation of the git protocol which starts up a specific binary which can only do the one or the other.

\n\n

The given options structure will form the defaults for connection options and callback setup. Callers may override these defaults by specifying git_fetch_options or git_push_options in subsequent calls.

\n", + "group": "remote" + }, + "git_remote_download": { + "type": "function", + "file": "git2/remote.h", + "line": 1037, + "lineto": 1040, + "args": [ + { "name": "remote", "type": "git_remote *", "comment": "the remote" }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for this negotiation and\n download. Use NULL or an empty array to use the base refspecs" + }, + { + "name": "opts", + "type": "const git_fetch_options *", + "comment": "the options to use for this fetch or NULL" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts", + "sig": "git_remote *::const git_strarray *::const git_fetch_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Download and index the packfile.

\n", + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, download and index the packfile.

\n\n

The .idx file will be created and both it and the packfile with be renamed to their final name.

\n\n

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", + "group": "remote" + }, + "git_remote_upload": { + "type": "function", + "file": "git2/remote.h", + "line": 1059, + "lineto": 1062, + "args": [ + { "name": "remote", "type": "git_remote *", "comment": "the remote" }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for this negotiation and\n upload. Use NULL or an empty array to use the base refspecs" + }, + { + "name": "opts", + "type": "const git_push_options *", + "comment": "the options to use for this push" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_push_options *opts", + "sig": "git_remote *::const git_strarray *::const git_push_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a packfile and send it to the server

\n", + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, create a packfile with the missing objects and send it.

\n\n

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", + "group": "remote" + }, + "git_remote_update_tips": { + "type": "function", + "file": "git2/remote.h", + "line": 1081, + "lineto": 1086, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to update" + }, + { + "name": "callbacks", + "type": "const git_remote_callbacks *", + "comment": "pointer to the callback structure to use or NULL" + }, + { + "name": "update_flags", + "type": "unsigned int", + "comment": "the git_remote_update_flags for these tips." + }, + { + "name": "download_tags", + "type": "git_remote_autotag_option_t", + "comment": "what the behaviour for downloading tags is for this fetch. This is\n ignored for push. This must be the same value passed to `git_remote_download()`." + }, + { + "name": "reflog_message", + "type": "const char *", + "comment": "The message to insert into the reflogs. If\n NULL and fetching, the default is \"fetch \n\", where \n is\n the name of the remote (or its url, for in-memory remotes). This\n parameter is ignored when pushing." + } + ], + "argline": "git_remote *remote, const git_remote_callbacks *callbacks, unsigned int update_flags, git_remote_autotag_option_t download_tags, const char *reflog_message", + "sig": "git_remote *::const git_remote_callbacks *::unsigned int::git_remote_autotag_option_t::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Update the tips to the new state.

\n", + "comments": "

If callbacks are not specified then the callbacks specified to git_remote_connect will be used (if it was called).

\n", + "group": "remote" + }, + "git_remote_fetch": { + "type": "function", + "file": "git2/remote.h", + "line": 1106, + "lineto": 1110, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to fetch from" + }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for this fetch. Pass NULL or an\n empty array to use the base refspecs." + }, + { + "name": "opts", + "type": "const git_fetch_options *", + "comment": "options to use for this fetch or NULL" + }, + { + "name": "reflog_message", + "type": "const char *", + "comment": "The message to insert into the reflogs. If NULL, the\n\t\t\t\t\t\t\t\t default is \"fetch\"" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts, const char *reflog_message", + "sig": "git_remote *::const git_strarray *::const git_fetch_options *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Download new data and update tips.

\n", + "comments": "

Convenience function to connect to a remote, download the data, disconnect and update the remote-tracking branches.

\n\n

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", + "group": "remote", + "examples": { "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_fetch-9"] } + }, + "git_remote_prune": { + "type": "function", + "file": "git2/remote.h", + "line": 1122, + "lineto": 1124, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to prune" + }, + { + "name": "callbacks", + "type": "const git_remote_callbacks *", + "comment": "callbacks to use for this prune" + } + ], + "argline": "git_remote *remote, const git_remote_callbacks *callbacks", + "sig": "git_remote *::const git_remote_callbacks *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Prune tracking refs that are no longer present on remote.

\n", + "comments": "

If callbacks are not specified then the callbacks specified to git_remote_connect will be used (if it was called).

\n", + "group": "remote" + }, + "git_remote_push": { + "type": "function", + "file": "git2/remote.h", + "line": 1139, + "lineto": 1142, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to push to" + }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for pushing. If NULL or an empty\n array, the configured refspecs will be used" + }, + { + "name": "opts", + "type": "const git_push_options *", + "comment": "options to use for this push" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_push_options *opts", + "sig": "git_remote *::const git_strarray *::const git_push_options *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Perform a push.

\n", + "comments": "

If options are specified and this remote is already connected then the existing remote connection options will be discarded and the remote will now use the new options.

\n", + "group": "remote", + "examples": { "push.c": ["ex/v1.9.1/push.html#git_remote_push-4"] } + }, + "git_remote_stats": { + "type": "function", + "file": "git2/remote.h", + "line": 1150, + "lineto": 1150, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to get statistics for" + } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { + "type": "const git_indexer_progress *", + "comment": " the git_indexer_progress for the remote" + }, + "description": "

Get the statistics structure that is filled in by the fetch operation.

\n", + "comments": "", + "group": "remote", + "examples": { "fetch.c": ["ex/v1.9.1/fetch.html#git_remote_stats-10"] } + }, + "git_remote_autotag": { + "type": "function", + "file": "git2/remote.h", + "line": 1158, + "lineto": 1158, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "git_remote_autotag_option_t", + "comment": " the auto-follow setting" + }, + "description": "

Retrieve the tag auto-follow setting

\n", + "comments": "", + "group": "remote" + }, + "git_remote_set_autotag": { + "type": "function", + "file": "git2/remote.h", + "line": 1171, + "lineto": 1171, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to make the change" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the name of the remote" + }, + { + "name": "value", + "type": "git_remote_autotag_option_t", + "comment": "the new value to take." + } + ], + "argline": "git_repository *repo, const char *remote, git_remote_autotag_option_t value", + "sig": "git_repository *::const char *::git_remote_autotag_option_t", + "return": { "type": "int", "comment": " 0, or an error code." }, + "description": "

Set the remote's tag following setting.

\n", + "comments": "

The change will be made in the configuration. No loaded remotes will be affected.

\n", + "group": "remote" + }, + "git_remote_prune_refs": { + "type": "function", + "file": "git2/remote.h", + "line": 1179, + "lineto": 1179, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { "type": "int", "comment": " the ref-prune setting" }, + "description": "

Retrieve the ref-prune setting

\n", + "comments": "", + "group": "remote" + }, + "git_remote_rename": { + "type": "function", + "file": "git2/remote.h", + "line": 1201, + "lineto": 1205, + "args": [ + { + "name": "problems", + "type": "git_strarray *", + "comment": "non-default refspecs cannot be renamed and will be\n stored here for further processing by the caller. Always free this\n strarray on successful return." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to rename" + }, + { + "name": "name", + "type": "const char *", + "comment": "the current name of the remote" + }, + { + "name": "new_name", + "type": "const char *", + "comment": "the new name the remote should bear" + } + ], + "argline": "git_strarray *problems, git_repository *repo, const char *name, const char *new_name", + "sig": "git_strarray *::git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Give the remote a new name

\n", + "comments": "

All remote-tracking branches and configuration settings for the remote are updated.

\n\n

The new name will be checked for validity. See git_tag_create() for rules about valid names.

\n\n

No loaded instances of a the remote with the old name will change their name or their list of refspecs.

\n", + "group": "remote", + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_rename-9"] } + }, + "git_remote_name_is_valid": { + "type": "function", + "file": "git2/remote.h", + "line": 1214, + "lineto": 1214, + "args": [ + { + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given remote name" + }, + { + "name": "remote_name", + "type": "const char *", + "comment": "name to be checked." + } + ], + "argline": "int *valid, const char *remote_name", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Ensure the remote name is well-formed.

\n", + "comments": "", + "group": "remote" + }, + "git_remote_delete": { + "type": "function", + "file": "git2/remote.h", + "line": 1226, + "lineto": 1226, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to act" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the remote to delete" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code." + }, + "description": "

Delete an existing persisted remote.

\n", + "comments": "

All remote-tracking branches and configuration settings for the remote will be removed.

\n", + "group": "remote", + "examples": { "remote.c": ["ex/v1.9.1/remote.html#git_remote_delete-10"] } + }, + "git_remote_default_branch": { + "type": "function", + "file": "git2/remote.h", + "line": 1244, + "lineto": 1244, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer in which to store the reference name" + }, + { "name": "remote", "type": "git_remote *", "comment": "the remote" } + ], + "argline": "git_buf *out, git_remote *remote", + "sig": "git_buf *::git_remote *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the remote does not have any references\n or none of them point to HEAD's commit, or an error message." + }, + "description": "

Retrieve the name of the remote's default branch

\n", + "comments": "

The default branch of a repository is the branch which HEAD points to. If the remote does not support reporting this information directly, it performs the guess as git does; that is, if there are multiple branches which point to the same commit, the first one is chosen. If the master branch is a candidate, it wins.

\n\n

This function must only be called after connecting.

\n", + "group": "remote" + }, + "git_repository_open": { + "type": "function", + "file": "git2/repository.h", + "line": 43, + "lineto": 43, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "pointer to the repo which will be opened" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path to the repository" + } + ], + "argline": "git_repository **out, const char *path", + "sig": "git_repository **::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open a git repository.

\n", + "comments": "

The 'path' argument must point to either a git repository folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal or bare repository or fail is 'path' is neither.

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "repository", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_repository_open-75"] + } + }, + "git_repository_open_from_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 54, + "lineto": 54, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Output pointer containing opened repository" + }, + { + "name": "wt", + "type": "git_worktree *", + "comment": "Working tree to open" + } + ], + "argline": "git_repository **out, git_worktree *wt", + "sig": "git_repository **::git_worktree *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open working tree as a repository

\n", + "comments": "

Open the working directory of the working tree as a normal repository that can then be worked on.

\n", + "group": "repository" + }, + "git_repository_wrap_odb": { + "type": "function", + "file": "git2/repository.h", + "line": 67, + "lineto": 69, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "pointer to the repo" + }, + { + "name": "odb", + "type": "git_odb *", + "comment": "the object database to wrap" + } + ], + "argline": "git_repository **out, git_odb *odb", + "sig": "git_repository **::git_odb *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a "fake" repository to wrap an object database

\n", + "comments": "

Create a repository object to wrap an object database to be used with the API when all you have is an object database. This doesn't have any paths associated with it, so use with care.

\n", + "group": "repository" + }, + "git_repository_discover": { + "type": "function", + "file": "git2/repository.h", + "line": 101, + "lineto": 105, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "A pointer to a user-allocated git_buf which will contain\n the found path." + }, + { + "name": "start_path", + "type": "const char *", + "comment": "The base path where the lookup starts." + }, + { + "name": "across_fs", + "type": "int", + "comment": "If true, then the lookup will not stop when a\n filesystem device change is detected while exploring parent directories." + }, + { + "name": "ceiling_dirs", + "type": "const char *", + "comment": "A GIT_PATH_LIST_SEPARATOR separated list of\n absolute symbolic link free paths. The lookup will stop when any\n of this paths is reached. Note that the lookup always performs on\n start_path no matter start_path appears in ceiling_dirs ceiling_dirs\n might be NULL (which is equivalent to an empty string)" + } + ], + "argline": "git_buf *out, const char *start_path, int across_fs, const char *ceiling_dirs", + "sig": "git_buf *::const char *::int::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Look for a git repository and copy its path in the given buffer.\n The lookup start from base_path and walk across parent directories\n if nothing has been found. The lookup ends when the first repository\n is found, or when reaching a directory referenced in ceiling_dirs\n or when the filesystem changes (in case across_fs is true).

\n", + "comments": "

The method will automatically detect if the repository is bare (if there is a repository).

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "repository" + }, + "git_repository_open_ext": { + "type": "function", + "file": "git2/repository.h", + "line": 181, + "lineto": 185, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Pointer to the repo which will be opened. This can\n actually be NULL if you only want to use the error code to\n see if a repo at this path could be opened." + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to open as git repository. If the flags\n permit \"searching\", then this can be a path to a subdirectory\n inside the working directory of the repository. May be NULL if\n flags is GIT_REPOSITORY_OPEN_FROM_ENV." + }, + { + "name": "flags", + "type": "unsigned int", + "comment": "A combination of the GIT_REPOSITORY_OPEN flags above." + }, + { + "name": "ceiling_dirs", + "type": "const char *", + "comment": "A GIT_PATH_LIST_SEPARATOR delimited list of path\n prefixes at which the search for a containing repository should\n terminate." + } + ], + "argline": "git_repository **out, const char *path, unsigned int flags, const char *ceiling_dirs", + "sig": "git_repository **::const char *::unsigned int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if no repository could be found,\n or -1 if there was a repository but open failed for some reason\n (such as repo corruption or system errors)." + }, + "description": "

Find and open a repository with extended controls.

\n", + "comments": "

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "repository", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_repository_open_ext-43"] } + }, + "git_repository_open_bare": { + "type": "function", + "file": "git2/repository.h", + "line": 202, + "lineto": 202, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Pointer to the repo which will be opened." + }, + { + "name": "bare_path", + "type": "const char *", + "comment": "Direct path to the bare repository" + } + ], + "argline": "git_repository **out, const char *bare_path", + "sig": "git_repository **::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Open a bare repository on the serverside.

\n", + "comments": "

This is a fast open for bare repositories that will come in handy if you're e.g. hosting git repositories and need to access them efficiently

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "repository" + }, + "git_repository_free": { + "type": "function", + "file": "git2/repository.h", + "line": 215, + "lineto": 215, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "repository handle to close. If NULL nothing occurs." + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "void", "comment": null }, + "description": "

Free a previously allocated repository

\n", + "comments": "

Note that after a repository is free'd, all the objects it has spawned will still exist until they are manually closed by the user with git_object_free, but accessing any of the attributes of an object without a backing repository will result in undefined behavior

\n", + "group": "repository", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_repository_free-76"], + "init.c": ["ex/v1.9.1/init.html#git_repository_free-4"] + } + }, + "git_repository_init": { + "type": "function", + "file": "git2/repository.h", + "line": 236, + "lineto": 239, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "pointer to the repo which will be created or reinitialized" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path to the repository" + }, + { + "name": "is_bare", + "type": "unsigned int", + "comment": "if true, a Git repository without a working directory is\n\t\tcreated at the pointed path. If false, provided path will be\n\t\tconsidered as the working directory into which the .git directory\n\t\twill be created." + } + ], + "argline": "git_repository **out, const char *path, unsigned int is_bare", + "sig": "git_repository **::const char *::unsigned int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Creates a new Git repository in the given folder.

\n", + "comments": "

TODO: - Reinit the repository

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "repository", + "examples": { "init.c": ["ex/v1.9.1/init.html#git_repository_init-5"] } + }, + "git_repository_init_options_init": { + "type": "function", + "file": "git2/repository.h", + "line": 405, + "lineto": 407, + "args": [ + { + "name": "opts", + "type": "git_repository_init_options *", + "comment": "The `git_repository_init_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`." + } + ], + "argline": "git_repository_init_options *opts, unsigned int version", + "sig": "git_repository_init_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_repository_init_options structure

\n", + "comments": "

Initializes a git_repository_init_options with default values. Equivalent to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n", + "group": "repository" + }, + "git_repository_init_ext": { + "type": "function", + "file": "git2/repository.h", + "line": 426, + "lineto": 429, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Pointer to the repo which will be created or reinitialized." + }, + { + "name": "repo_path", + "type": "const char *", + "comment": "The path to the repository." + }, + { + "name": "opts", + "type": "git_repository_init_options *", + "comment": "Pointer to git_repository_init_options struct." + } + ], + "argline": "git_repository **out, const char *repo_path, git_repository_init_options *opts", + "sig": "git_repository **::const char *::git_repository_init_options *", + "return": { "type": "int", "comment": " 0 or an error code on failure." }, + "description": "

Create a new Git repository in the given folder with extended controls.

\n", + "comments": "

This will initialize a new git repository (creating the repo_path if requested by flags) and working directory as needed. It will auto-detect the case sensitivity of the file system and if the file system supports file mode bits correctly.

\n\n

Note that the libgit2 library must be initialized using git_libgit2_init before any APIs can be called, including this one.

\n", + "group": "repository", + "examples": { + "init.c": ["ex/v1.9.1/init.html#git_repository_init_ext-6"] + } + }, + "git_repository_head": { + "type": "function", + "file": "git2/repository.h", + "line": 444, + "lineto": 444, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer to the reference which will be retrieved" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + } + ], + "argline": "git_reference **out, git_repository *repo", + "sig": "git_reference **::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch, GIT_ENOTFOUND when HEAD is missing; an error code otherwise" + }, + "description": "

Retrieve and resolve the reference pointed at by HEAD.

\n", + "comments": "

The returned git_reference will be owned by caller and git_reference_free() must be called when done with it to release the allocated memory and prevent a leak.

\n", + "group": "repository", + "examples": { + "merge.c": [ + "ex/v1.9.1/merge.html#git_repository_head-31", + "ex/v1.9.1/merge.html#git_repository_head-32" + ], + "status.c": ["ex/v1.9.1/status.html#git_repository_head-3"] + } + }, + "git_repository_head_for_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 454, + "lineto": 455, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer to the reference which will be retrieved" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the worktree to retrieve HEAD for" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name", + "sig": "git_reference **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 when successful, error-code otherwise" + }, + "description": "

Retrieve the referenced HEAD for the worktree

\n", + "comments": "", + "group": "repository" + }, + "git_repository_head_detached": { + "type": "function", + "file": "git2/repository.h", + "line": 467, + "lineto": 467, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repo to test" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 1 if HEAD is detached, 0 if it's not; error code if there\n was an error." + }, + "description": "

Check if a repository's HEAD is detached

\n", + "comments": "

A repository's HEAD is detached when it points directly to a commit instead of a branch.

\n", + "group": "repository" + }, + "git_repository_head_detached_for_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 480, + "lineto": 481, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "a repository object" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the worktree to retrieve HEAD for" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 1 if HEAD is detached, 0 if its not; error code if\n there was an error" + }, + "description": "

Check if a worktree's HEAD is detached

\n", + "comments": "

A worktree's HEAD is detached when it points directly to a commit instead of a branch.

\n", + "group": "repository" + }, + "git_repository_head_unborn": { + "type": "function", + "file": "git2/repository.h", + "line": 493, + "lineto": 493, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repo to test" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 1 if the current branch is unborn, 0 if it's not; error\n code if there was an error" + }, + "description": "

Check if the current branch is unborn

\n", + "comments": "

An unborn branch is one named from HEAD but which doesn't exist in the refs namespace, because it doesn't have any commit to point to.

\n", + "group": "repository" + }, + "git_repository_is_empty": { + "type": "function", + "file": "git2/repository.h", + "line": 507, + "lineto": 507, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repo to test" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 1 if the repository is empty, 0 if it isn't, error code\n if the repository is corrupted" + }, + "description": "

Check if a repository is empty

\n", + "comments": "

An empty repository has just been initialized and contains no references apart from HEAD, which must be pointing to the unborn master branch, or the branch specified for the repository in the init.defaultBranch configuration variable.

\n", + "group": "repository" + }, + "git_repository_item_path": { + "type": "function", + "file": "git2/repository.h", + "line": 545, + "lineto": 545, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Buffer to store the path at" + }, + { + "name": "repo", + "type": "const git_repository *", + "comment": "Repository to get path for" + }, + { + "name": "item", + "type": "git_repository_item_t", + "comment": "The repository item for which to retrieve the path" + } + ], + "argline": "git_buf *out, const git_repository *repo, git_repository_item_t item", + "sig": "git_buf *::const git_repository *::git_repository_item_t", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the path cannot exist or an error code" + }, + "description": "

Get the location of a specific repository file or directory

\n", + "comments": "

This function will retrieve the path of a specific repository item. It will thereby honor things like the repository's common directory, gitdir, etc. In case a file path cannot exist for a given item (e.g. the working directory of a bare repository), GIT_ENOTFOUND is returned.

\n", + "group": "repository" + }, + "git_repository_path": { + "type": "function", + "file": "git2/repository.h", + "line": 556, + "lineto": 556, + "args": [ + { + "name": "repo", + "type": "const git_repository *", + "comment": "A repository object" + } + ], + "argline": "const git_repository *repo", + "sig": "const git_repository *", + "return": { + "type": "const char *", + "comment": " the path to the repository" + }, + "description": "

Get the path of this repository

\n", + "comments": "

This is the path of the .git folder for normal repositories, or of the repository itself for bare repositories.

\n", + "group": "repository", + "examples": { + "init.c": ["ex/v1.9.1/init.html#git_repository_path-7"], + "status.c": ["ex/v1.9.1/status.html#git_repository_path-4"] + } + }, + "git_repository_workdir": { + "type": "function", + "file": "git2/repository.h", + "line": 567, + "lineto": 567, + "args": [ + { + "name": "repo", + "type": "const git_repository *", + "comment": "A repository object" + } + ], + "argline": "const git_repository *repo", + "sig": "const git_repository *", + "return": { + "type": "const char *", + "comment": " the path to the working dir, if it exists" + }, + "description": "

Get the path of the working directory for this repository

\n", + "comments": "

If the repository is bare, this function will always return NULL.

\n", + "group": "repository", + "examples": { "init.c": ["ex/v1.9.1/init.html#git_repository_workdir-8"] } + }, + "git_repository_commondir": { + "type": "function", + "file": "git2/repository.h", + "line": 579, + "lineto": 579, + "args": [ + { + "name": "repo", + "type": "const git_repository *", + "comment": "A repository object" + } + ], + "argline": "const git_repository *repo", + "sig": "const git_repository *", + "return": { + "type": "const char *", + "comment": " the path to the common dir" + }, + "description": "

Get the path of the shared common directory for this repository.

\n", + "comments": "

If the repository is bare, it is the root directory for the repository. If the repository is a worktree, it is the parent repo's gitdir. Otherwise, it is the gitdir.

\n", + "group": "repository" + }, + "git_repository_set_workdir": { + "type": "function", + "file": "git2/repository.h", + "line": 598, + "lineto": 599, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "workdir", + "type": "const char *", + "comment": "The path to a working directory" + }, + { + "name": "update_gitlink", + "type": "int", + "comment": "Create/update gitlink in workdir and set config\n \"core.worktree\" (if workdir is not the parent of the .git directory)" + } + ], + "argline": "git_repository *repo, const char *workdir, int update_gitlink", + "sig": "git_repository *::const char *::int", + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Set the path to the working directory for this repository

\n", + "comments": "

The working directory doesn't need to be the same one that contains the .git folder for this repository.

\n\n

If this repository is bare, setting its working directory will turn it into a normal repository, capable of performing all the common workdir operations (checkout, status, index manipulation, etc).

\n", + "group": "repository" + }, + "git_repository_is_bare": { + "type": "function", + "file": "git2/repository.h", + "line": 607, + "lineto": 607, + "args": [ + { + "name": "repo", + "type": "const git_repository *", + "comment": "Repo to test" + } + ], + "argline": "const git_repository *repo", + "sig": "const git_repository *", + "return": { + "type": "int", + "comment": " 1 if the repository is bare, 0 otherwise." + }, + "description": "

Check if a repository is bare

\n", + "comments": "", + "group": "repository", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_repository_is_bare-5"] + } + }, + "git_repository_is_worktree": { + "type": "function", + "file": "git2/repository.h", + "line": 615, + "lineto": 615, + "args": [ + { + "name": "repo", + "type": "const git_repository *", + "comment": "Repo to test" + } + ], + "argline": "const git_repository *repo", + "sig": "const git_repository *", + "return": { + "type": "int", + "comment": " 1 if the repository is a linked work tree, 0 otherwise." + }, + "description": "

Check if a repository is a linked work tree

\n", + "comments": "", + "group": "repository" + }, + "git_repository_config": { + "type": "function", + "file": "git2/repository.h", + "line": 631, + "lineto": 631, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "Pointer to store the loaded configuration" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + } + ], + "argline": "git_config **out, git_repository *repo", + "sig": "git_config **::git_repository *", + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Get the configuration file for this repository.

\n", + "comments": "

If a configuration file has not been set, the default config set for the repository will be returned, including global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer being used by the user.

\n", + "group": "repository", + "examples": { + "config.c": ["ex/v1.9.1/config.html#git_repository_config-9"] + } + }, + "git_repository_config_snapshot": { + "type": "function", + "file": "git2/repository.h", + "line": 647, + "lineto": 647, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "Pointer to store the loaded configuration" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_config **out, git_repository *repo", + "sig": "git_config **::git_repository *", + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Get a snapshot of the repository's configuration

\n", + "comments": "

Convenience function to take a snapshot from the repository's configuration. The contents of this snapshot will not change, even if the underlying config files are modified.

\n\n

The configuration file must be freed once it's no longer being used by the user.

\n", + "group": "repository", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_repository_config_snapshot-77", + "ex/v1.9.1/general.html#git_repository_config_snapshot-78" + ] + } + }, + "git_repository_odb": { + "type": "function", + "file": "git2/repository.h", + "line": 663, + "lineto": 663, + "args": [ + { + "name": "out", + "type": "git_odb **", + "comment": "Pointer to store the loaded ODB" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + } + ], + "argline": "git_odb **out, git_repository *repo", + "sig": "git_odb **::git_repository *", + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Get the Object Database for this repository.

\n", + "comments": "

If a custom ODB has not been set, the default database for the repository will be returned (the one located in .git/objects).

\n\n

The ODB must be freed once it's no longer being used by the user.

\n", + "group": "repository", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_repository_odb-29"], + "general.c": ["ex/v1.9.1/general.html#git_repository_odb-79"] + } + }, + "git_repository_refdb": { + "type": "function", + "file": "git2/repository.h", + "line": 679, + "lineto": 679, + "args": [ + { + "name": "out", + "type": "git_refdb **", + "comment": "Pointer to store the loaded refdb" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Get the Reference Database Backend for this repository.

\n", + "comments": "

If a custom refsdb has not been set, the default database for the repository will be returned (the one that manipulates loose and packed references in the .git directory).

\n\n

The refdb must be freed once it's no longer being used by the user.

\n", + "group": "repository" + }, + "git_repository_index": { + "type": "function", + "file": "git2/repository.h", + "line": 695, + "lineto": 695, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "Pointer to store the loaded index" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + } + ], + "argline": "git_index **out, git_repository *repo", + "sig": "git_index **::git_repository *", + "return": { "type": "int", "comment": " 0, or an error code" }, + "description": "

Get the Index file for this repository.

\n", + "comments": "

If a custom index has not been set, the default index for the repository will be returned (the one located in .git/index).

\n\n

The index must be freed once it's no longer being used by the user.

\n", + "group": "repository", + "examples": { + "add.c": ["ex/v1.9.1/add.html#git_repository_index-5"], + "commit.c": ["ex/v1.9.1/commit.html#git_repository_index-8"], + "general.c": ["ex/v1.9.1/general.html#git_repository_index-80"], + "init.c": ["ex/v1.9.1/init.html#git_repository_index-9"], + "ls-files.c": ["ex/v1.9.1/ls-files.html#git_repository_index-5"], + "merge.c": ["ex/v1.9.1/merge.html#git_repository_index-33"] + } + }, + "git_repository_message": { + "type": "function", + "file": "git2/repository.h", + "line": 713, + "lineto": 713, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "git_buf to write data into" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository to read prepared message from" + } + ], + "argline": "git_buf *out, git_repository *repo", + "sig": "git_buf *::git_repository *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if no message exists or an error code" + }, + "description": "

Retrieve git's prepared message

\n", + "comments": "

Operations such as git revert/cherry-pick/merge with the -n option stop just short of creating a commit with the changes and save their prepared message in .git/MERGE_MSG so the next git-commit execution can present it to the user for them to amend if they wish.

\n\n

Use this function to get the contents of this file. Don't forget to remove the file after you create the commit.

\n", + "group": "repository" + }, + "git_repository_message_remove": { + "type": "function", + "file": "git2/repository.h", + "line": 723, + "lineto": 723, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository to remove prepared message from." + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Remove git's prepared message.

\n", + "comments": "

Remove the message that git_repository_message retrieves.

\n", + "group": "repository" + }, + "git_repository_state_cleanup": { + "type": "function", + "file": "git2/repository.h", + "line": 732, + "lineto": 732, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "int", "comment": " 0 on success, or error" }, + "description": "

Remove all the metadata associated with an ongoing command like merge,\n revert, cherry-pick, etc. For example: MERGE_HEAD, MERGE_MSG, etc.

\n", + "comments": "", + "group": "repository", + "examples": { + "merge.c": ["ex/v1.9.1/merge.html#git_repository_state_cleanup-34"] + } + }, + "git_repository_fetchhead_foreach": { + "type": "function", + "file": "git2/repository.h", + "line": 763, + "lineto": 766, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "callback", + "type": "git_repository_fetchhead_foreach_cb", + "comment": "Callback function" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to callback data (optional)" + } + ], + "argline": "git_repository *repo, git_repository_fetchhead_foreach_cb callback, void *payload", + "sig": "git_repository *::git_repository_fetchhead_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no FETCH_HEAD file, or other error code." + }, + "description": "

Invoke 'callback' for each entry in the given FETCH_HEAD file.

\n", + "comments": "

Return a non-zero value from the callback to stop the loop.

\n", + "group": "repository" + }, + "git_repository_mergehead_foreach": { + "type": "function", + "file": "git2/repository.h", + "line": 792, + "lineto": 795, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "callback", + "type": "git_repository_mergehead_foreach_cb", + "comment": "Callback function" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to callback data (optional)" + } + ], + "argline": "git_repository *repo, git_repository_mergehead_foreach_cb callback, void *payload", + "sig": "git_repository *::git_repository_mergehead_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no MERGE_HEAD file, or other error code." + }, + "description": "

If a merge is in progress, invoke 'callback' for each commit ID in the\n MERGE_HEAD file.

\n", + "comments": "

Return a non-zero value from the callback to stop the loop.

\n", + "group": "repository" + }, + "git_repository_hashfile": { + "type": "function", + "file": "git2/repository.h", + "line": 822, + "lineto": 827, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Output value of calculated SHA" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository pointer" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to file on disk whose contents should be hashed. This\n may be an absolute path or a relative path, in which case it\n will be treated as a path within the working directory." + }, + { + "name": "type", + "type": "git_object_t", + "comment": "The object type to hash as (e.g. GIT_OBJECT_BLOB)" + }, + { + "name": "as_path", + "type": "const char *", + "comment": "The path to use to look up filtering rules. If this is\n an empty string then no filters will be applied when\n calculating the hash. If this is `NULL` and the `path`\n parameter is a file within the repository's working\n directory, then the `path` will be used." + } + ], + "argline": "git_oid *out, git_repository *repo, const char *path, git_object_t type, const char *as_path", + "sig": "git_oid *::git_repository *::const char *::git_object_t::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Calculate hash of file using repository filtering rules.

\n", + "comments": "

If you simply want to calculate the hash of a file on disk with no filters, you can just use the git_odb_hashfile() API. However, if you want to hash a file in the repository and you want to apply filtering rules (e.g. crlf filters) before generating the SHA, then use this function.

\n\n

Note: if the repository has core.safecrlf set to fail and the filtering triggers that failure, then this function will return an error and not calculate the hash of the file.

\n", + "group": "repository" + }, + "git_repository_set_head": { + "type": "function", + "file": "git2/repository.h", + "line": 847, + "lineto": 849, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository pointer" + }, + { + "name": "refname", + "type": "const char *", + "comment": "Canonical name of the reference the HEAD should point at" + } + ], + "argline": "git_repository *repo, const char *refname", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Make the repository HEAD point to the specified reference.

\n", + "comments": "

If the provided reference points to a Tree or a Blob, the HEAD is unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point to that branch, staying attached, or become attached if it isn't yet. If the branch doesn't exist yet, no error will be return. The HEAD will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to the Commit.

\n", + "group": "repository", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_repository_set_head-23"] + } + }, + "git_repository_set_head_detached": { + "type": "function", + "file": "git2/repository.h", + "line": 867, + "lineto": 869, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository pointer" + }, + { + "name": "committish", + "type": "const git_oid *", + "comment": "Object id of the Commit the HEAD should point to" + } + ], + "argline": "git_repository *repo, const git_oid *committish", + "sig": "git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Make the repository HEAD directly point to the Commit.

\n", + "comments": "

If the provided committish cannot be found in the repository, the HEAD is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided committish cannot be peeled into a commit, the HEAD is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to the peeled Commit.

\n", + "group": "repository" + }, + "git_repository_set_head_detached_from_annotated": { + "type": "function", + "file": "git2/repository.h", + "line": 885, + "lineto": 887, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository pointer" + }, + { + "name": "committish", + "type": "const git_annotated_commit *", + "comment": "annotated commit to point HEAD to" + } + ], + "argline": "git_repository *repo, const git_annotated_commit *committish", + "sig": "git_repository *::const git_annotated_commit *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Make the repository HEAD directly point to the Commit.

\n", + "comments": "

This behaves like git_repository_set_head_detached() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_repository_set_head_detached().

\n", + "group": "repository", + "examples": { + "checkout.c": [ + "ex/v1.9.1/checkout.html#git_repository_set_head_detached_from_annotated-24" + ] + } + }, + "git_repository_detach_head": { + "type": "function", + "file": "git2/repository.h", + "line": 906, + "lineto": 907, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository pointer" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch or an error code" + }, + "description": "

Detach the HEAD.

\n", + "comments": "

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non committish, the HEAD is unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n", + "group": "repository" + }, + "git_repository_state": { + "type": "function", + "file": "git2/repository.h", + "line": 937, + "lineto": 937, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository pointer" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "int", "comment": " The state of the repository" }, + "description": "

Determines the status of a git repository - ie, whether an operation\n (merge, cherry-pick, etc) is in progress.

\n", + "comments": "", + "group": "repository", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_repository_state-25"], + "merge.c": ["ex/v1.9.1/merge.html#git_repository_state-35"] + } + }, + "git_repository_set_namespace": { + "type": "function", + "file": "git2/repository.h", + "line": 951, + "lineto": 951, + "args": [ + { "name": "repo", "type": "git_repository *", "comment": "The repo" }, + { + "name": "nmspace", + "type": "const char *", + "comment": "The namespace. This should not include the refs\n\tfolder, e.g. to namespace all references under `refs/namespaces/foo/`,\n\tuse `foo` as the namespace." + } + ], + "argline": "git_repository *repo, const char *nmspace", + "sig": "git_repository *::const char *", + "return": { "type": "int", "comment": " 0 on success, -1 on error" }, + "description": "

Sets the active namespace for this Git Repository

\n", + "comments": "

This namespace affects all reference operations for the repo. See man gitnamespaces

\n", + "group": "repository" + }, + "git_repository_get_namespace": { + "type": "function", + "file": "git2/repository.h", + "line": 959, + "lineto": 959, + "args": [ + { "name": "repo", "type": "git_repository *", "comment": "The repo" } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "const char *", + "comment": " the active namespace, or NULL if there isn't one" + }, + "description": "

Get the currently active namespace for this repository

\n", + "comments": "", + "group": "repository" + }, + "git_repository_is_shallow": { + "type": "function", + "file": "git2/repository.h", + "line": 968, + "lineto": 968, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "int", "comment": " 1 if shallow, zero if not" }, + "description": "

Determine if the repository was a shallow clone

\n", + "comments": "", + "group": "repository" + }, + "git_repository_ident": { + "type": "function", + "file": "git2/repository.h", + "line": 981, + "lineto": 981, + "args": [ + { + "name": "name", + "type": "const char **", + "comment": "where to store the pointer to the name" + }, + { + "name": "email", + "type": "const char **", + "comment": "where to store the pointer to the email" + }, + { + "name": "repo", + "type": "const git_repository *", + "comment": "the repository" + } + ], + "argline": "const char **name, const char **email, const git_repository *repo", + "sig": "const char **::const char **::const git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Retrieve the configured identity to use for reflogs

\n", + "comments": "

The memory is owned by the repository and must not be freed by the user.

\n", + "group": "repository" + }, + "git_repository_set_ident": { + "type": "function", + "file": "git2/repository.h", + "line": 995, + "lineto": 995, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to configure" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name to use for the reflog entries" + }, + { + "name": "email", + "type": "const char *", + "comment": "the email to use for the reflog entries" + } + ], + "argline": "git_repository *repo, const char *name, const char *email", + "sig": "git_repository *::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Set the identity to be used for writing reflogs

\n", + "comments": "

If both are set, this name and email will be used to write to the reflog. Pass NULL to unset. When unset, the identity will be taken from the repository's configuration.

\n", + "group": "repository" + }, + "git_repository_oid_type": { + "type": "function", + "file": "git2/repository.h", + "line": 1003, + "lineto": 1003, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { "type": "git_oid_t", "comment": " the object id type" }, + "description": "

Gets the object type used by this repository.

\n", + "comments": "", + "group": "repository" + }, + "git_repository_commit_parents": { + "type": "function", + "file": "git2/repository.h", + "line": 1014, + "lineto": 1014, + "args": [ + { + "name": "commits", + "type": "git_commitarray *", + "comment": "a `git_commitarray` that will contain the commit parents" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_commitarray *commits, git_repository *repo", + "sig": "git_commitarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Gets the parents of the next commit, given the current repository state.\n Generally, this is the HEAD commit, except when performing a merge, in\n which case it is two or more commits.

\n", + "comments": "", + "group": "repository" + }, + "git_reset": { + "type": "function", + "file": "git2/reset.h", + "line": 62, + "lineto": 66, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to perform the reset operation." + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Committish to which the Head should be moved to. This object\n must belong to the given `repo` and can either be a git_commit or a\n git_tag. When a git_tag is being passed, it should be dereferenceable\n to a git_commit which oid will be used as the target of the branch." + }, + { + "name": "reset_type", + "type": "git_reset_t", + "comment": "Kind of reset operation to perform." + }, + { + "name": "checkout_opts", + "type": "const git_checkout_options *", + "comment": "Optional checkout options to be used for a HARD reset.\n The checkout_strategy field will be overridden (based on reset_type).\n This parameter can be used to propagate notify and progress callbacks." + } + ], + "argline": "git_repository *repo, const git_object *target, git_reset_t reset_type, const git_checkout_options *checkout_opts", + "sig": "git_repository *::const git_object *::git_reset_t::const git_checkout_options *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", + "comments": "

SOFT reset means the Head will be moved to the commit.

\n\n

MIXED reset will trigger a SOFT reset, plus the index will be replaced with the content of the commit tree.

\n\n

HARD reset will trigger a MIXED reset and the working directory will be replaced with the content of the index. (Untracked and ignored files will be left alone, however.)

\n\n

TODO: Implement remaining kinds of resets.

\n", + "group": "reset" + }, + "git_reset_from_annotated": { + "type": "function", + "file": "git2/reset.h", + "line": 92, + "lineto": 96, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to perform the reset operation." + }, + { + "name": "target", + "type": "const git_annotated_commit *", + "comment": "Annotated commit to which the Head should be moved to.\n This object must belong to the given `repo`, it will be dereferenced\n to a git_commit which oid will be used as the target of the branch." + }, + { + "name": "reset_type", + "type": "git_reset_t", + "comment": "Kind of reset operation to perform." + }, + { + "name": "checkout_opts", + "type": "const git_checkout_options *", + "comment": "Optional checkout options to be used for a HARD reset.\n The checkout_strategy field will be overridden (based on reset_type).\n This parameter can be used to propagate notify and progress callbacks." + } + ], + "argline": "git_repository *repo, const git_annotated_commit *target, git_reset_t reset_type, const git_checkout_options *checkout_opts", + "sig": "git_repository *::const git_annotated_commit *::git_reset_t::const git_checkout_options *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", + "comments": "

This behaves like git_reset() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_reset().

\n", + "group": "reset" + }, + "git_reset_default": { + "type": "function", + "file": "git2/reset.h", + "line": 116, + "lineto": 119, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to perform the reset operation." + }, + { + "name": "target", + "type": "const git_object *", + "comment": "The committish which content will be used to reset the content\n of the index." + }, + { + "name": "pathspecs", + "type": "const git_strarray *", + "comment": "List of pathspecs to operate on." + } + ], + "argline": "git_repository *repo, const git_object *target, const git_strarray *pathspecs", + "sig": "git_repository *::const git_object *::const git_strarray *", + "return": { + "type": "int", + "comment": " 0 on success or an error code \n<\n 0" + }, + "description": "

Updates some entries in the index from the target commit tree.

\n", + "comments": "

The scope of the updated entries is determined by the paths being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing entries in the index matching the provided pathspecs.

\n", + "group": "reset" + }, + "git_revert_options_init": { + "type": "function", + "file": "git2/revert.h", + "line": 54, + "lineto": 56, + "args": [ + { + "name": "opts", + "type": "git_revert_options *", + "comment": "The `git_revert_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_REVERT_OPTIONS_VERSION`." + } + ], + "argline": "git_revert_options *opts, unsigned int version", + "sig": "git_revert_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_revert_options structure

\n", + "comments": "

Initializes a git_revert_options with default values. Equivalent to creating an instance with GIT_REVERT_OPTIONS_INIT.

\n", + "group": "revert" + }, + "git_revert_commit": { + "type": "function", + "file": "git2/revert.h", + "line": 72, + "lineto": 78, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository that contains the given commits" + }, + { + "name": "revert_commit", + "type": "git_commit *", + "comment": "the commit to revert" + }, + { + "name": "our_commit", + "type": "git_commit *", + "comment": "the commit to revert against (eg, HEAD)" + }, + { + "name": "mainline", + "type": "unsigned int", + "comment": "the parent of the revert commit, if it is a merge" + }, + { + "name": "merge_options", + "type": "const git_merge_options *", + "comment": "the merge options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, git_commit *revert_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options", + "sig": "git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Reverts the given commit against the given "our" commit, producing an\n index that reflects the result of the revert.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "revert" + }, + "git_revert": { + "type": "function", + "file": "git2/revert.h", + "line": 88, + "lineto": 91, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to revert" + }, + { + "name": "commit", + "type": "git_commit *", + "comment": "the commit to revert" + }, + { + "name": "given_opts", + "type": "const git_revert_options *", + "comment": "the revert options (or null for defaults)" + } + ], + "argline": "git_repository *repo, git_commit *commit, const git_revert_options *given_opts", + "sig": "git_repository *::git_commit *::const git_revert_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Reverts the given commit, producing changes in the index and working directory.

\n", + "comments": "", + "group": "revert" + }, + "git_revparse_single": { + "type": "function", + "file": "git2/revparse.h", + "line": 37, + "lineto": 38, + "args": [ + { + "name": "out", + "type": "git_object **", + "comment": "pointer to output object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to search in" + }, + { + "name": "spec", + "type": "const char *", + "comment": "the textual specification for an object" + } + ], + "argline": "git_object **out, git_repository *repo, const char *spec", + "sig": "git_object **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Find a single object, as specified by a revision string.

\n", + "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n\n

The returned object should be released with git_object_free when no longer needed.

\n", + "group": "revparse", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_revparse_single-21"], + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_revparse_single-30"], + "describe.c": ["ex/v1.9.1/describe.html#git_revparse_single-6"], + "log.c": ["ex/v1.9.1/log.html#git_revparse_single-44"], + "tag.c": [ + "ex/v1.9.1/tag.html#git_revparse_single-9", + "ex/v1.9.1/tag.html#git_revparse_single-10", + "ex/v1.9.1/tag.html#git_revparse_single-11", + "ex/v1.9.1/tag.html#git_revparse_single-12" + ] + } + }, + "git_revparse_ext": { + "type": "function", + "file": "git2/revparse.h", + "line": 61, + "lineto": 65, + "args": [ + { + "name": "object_out", + "type": "git_object **", + "comment": "pointer to output object" + }, + { + "name": "reference_out", + "type": "git_reference **", + "comment": "pointer to output reference or NULL" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to search in" + }, + { + "name": "spec", + "type": "const char *", + "comment": "the textual specification for an object" + } + ], + "argline": "git_object **object_out, git_reference **reference_out, git_repository *repo, const char *spec", + "sig": "git_object **::git_reference **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC\n or an error code" + }, + "description": "

Find a single object and intermediate reference by a revision string.

\n", + "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n\n

In some cases (@{<-n>} or <branchname>@{upstream}), the expression may point to an intermediate reference. When such expressions are being passed in, reference_out will be valued as well.

\n\n

The returned object should be released with git_object_free and the returned reference with git_reference_free when no longer needed.

\n", + "group": "revparse", + "examples": { "commit.c": ["ex/v1.9.1/commit.html#git_revparse_ext-9"] } + }, + "git_revparse": { + "type": "function", + "file": "git2/revparse.h", + "line": 105, + "lineto": 108, + "args": [ + { + "name": "revspec", + "type": "git_revspec *", + "comment": "Pointer to an user-allocated git_revspec struct where\n\t the result of the rev-parse will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to search in" + }, + { + "name": "spec", + "type": "const char *", + "comment": "the rev-parse spec to parse" + } + ], + "argline": "git_revspec *revspec, git_repository *repo, const char *spec", + "sig": "git_revspec *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_INVALIDSPEC, GIT_ENOTFOUND, GIT_EAMBIGUOUS or an error code" + }, + "description": "

Parse a revision string for from, to, and intent.

\n", + "comments": "

See man gitrevisions or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n", + "group": "revparse", + "examples": { + "blame.c": ["ex/v1.9.1/blame.html#git_revparse-22"], + "log.c": ["ex/v1.9.1/log.html#git_revparse-45"], + "rev-parse.c": [ + "ex/v1.9.1/rev-parse.html#git_revparse-14", + "ex/v1.9.1/rev-parse.html#git_revparse-15" + ] + } + }, + "git_revwalk_new": { + "type": "function", + "file": "git2/revwalk.h", + "line": 73, + "lineto": 73, + "args": [ + { + "name": "out", + "type": "git_revwalk **", + "comment": "pointer to the new revision walker" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to walk through" + } + ], + "argline": "git_revwalk **out, git_repository *repo", + "sig": "git_revwalk **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Allocate a new revision walker to iterate through a repo.

\n", + "comments": "

This revision walker uses a custom memory pool and an internal commit cache, so it is relatively expensive to allocate.

\n\n

For maximum performance, this revision walker should be reused for different walks.

\n\n

This revision walker is not thread safe: it may only be used to walk a repository on a single thread; however, it is possible to have several revision walkers in several different threads walking the same repository.

\n", + "group": "revwalk", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_revwalk_new-81"], + "log.c": [ + "ex/v1.9.1/log.html#git_revwalk_new-46", + "ex/v1.9.1/log.html#git_revwalk_new-47" + ] + } + }, + "git_revwalk_reset": { + "type": "function", + "file": "git2/revwalk.h", + "line": 89, + "lineto": 89, + "args": [ + { + "name": "walker", + "type": "git_revwalk *", + "comment": "handle to reset." + } + ], + "argline": "git_revwalk *walker", + "sig": "git_revwalk *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Reset the revision walker for reuse.

\n", + "comments": "

This will clear all the pushed and hidden commits, and leave the walker in a blank state (just like at creation) ready to receive new commit pushes and start a new walk.

\n\n

The revision walk is automatically reset when a walk is over.

\n", + "group": "revwalk" + }, + "git_revwalk_push": { + "type": "function", + "file": "git2/revwalk.h", + "line": 108, + "lineto": 108, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the oid of the commit to start from." + } + ], + "argline": "git_revwalk *walk, const git_oid *id", + "sig": "git_revwalk *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add a new root for the traversal

\n", + "comments": "

The pushed commit will be marked as one of the roots from which to start the walk. This commit may not be walked if it or a child is hidden.

\n\n

At least one commit must be pushed onto the walker before a walk can be started.

\n\n

The given id must belong to a committish on the walked repository.

\n", + "group": "revwalk", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_revwalk_push-82"], + "log.c": ["ex/v1.9.1/log.html#git_revwalk_push-48"] + } + }, + "git_revwalk_push_glob": { + "type": "function", + "file": "git2/revwalk.h", + "line": 126, + "lineto": 126, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + }, + { + "name": "glob", + "type": "const char *", + "comment": "the glob pattern references should match" + } + ], + "argline": "git_revwalk *walk, const char *glob", + "sig": "git_revwalk *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Push matching references

\n", + "comments": "

The OIDs pointed to by the references that match the given glob pattern will be pushed to the revision walker.

\n\n

A leading 'refs/' is implied if not present as well as a trailing '/*' if the glob lacks '?', '*' or '['.

\n\n

Any references matching this glob which do not point to a committish will be ignored.

\n", + "group": "revwalk" + }, + "git_revwalk_push_head": { + "type": "function", + "file": "git2/revwalk.h", + "line": 134, + "lineto": 134, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + } + ], + "argline": "git_revwalk *walk", + "sig": "git_revwalk *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Push the repository's HEAD

\n", + "comments": "", + "group": "revwalk", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_revwalk_push_head-49"] } + }, + "git_revwalk_hide": { + "type": "function", + "file": "git2/revwalk.h", + "line": 149, + "lineto": 149, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal." + }, + { + "name": "commit_id", + "type": "const git_oid *", + "comment": "the oid of commit that will be ignored during the traversal" + } + ], + "argline": "git_revwalk *walk, const git_oid *commit_id", + "sig": "git_revwalk *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Mark a commit (and its ancestors) uninteresting for the output.

\n", + "comments": "

The given id must belong to a committish on the walked repository.

\n\n

The resolved commit and all its parents will be hidden from the output on the revision walk.

\n", + "group": "revwalk", + "examples": { "log.c": ["ex/v1.9.1/log.html#git_revwalk_hide-50"] } + }, + "git_revwalk_hide_glob": { + "type": "function", + "file": "git2/revwalk.h", + "line": 168, + "lineto": 168, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + }, + { + "name": "glob", + "type": "const char *", + "comment": "the glob pattern references should match" + } + ], + "argline": "git_revwalk *walk, const char *glob", + "sig": "git_revwalk *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Hide matching references.

\n", + "comments": "

The OIDs pointed to by the references that match the given glob pattern and their ancestors will be hidden from the output on the revision walk.

\n\n

A leading 'refs/' is implied if not present as well as a trailing '/*' if the glob lacks '?', '*' or '['.

\n\n

Any references matching this glob which do not point to a committish will be ignored.

\n", + "group": "revwalk" + }, + "git_revwalk_hide_head": { + "type": "function", + "file": "git2/revwalk.h", + "line": 176, + "lineto": 176, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + } + ], + "argline": "git_revwalk *walk", + "sig": "git_revwalk *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Hide the repository's HEAD

\n", + "comments": "", + "group": "revwalk" + }, + "git_revwalk_push_ref": { + "type": "function", + "file": "git2/revwalk.h", + "line": 187, + "lineto": 187, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference to push" + } + ], + "argline": "git_revwalk *walk, const char *refname", + "sig": "git_revwalk *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Push the OID pointed to by a reference

\n", + "comments": "

The reference must point to a committish.

\n", + "group": "revwalk" + }, + "git_revwalk_hide_ref": { + "type": "function", + "file": "git2/revwalk.h", + "line": 198, + "lineto": 198, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference to hide" + } + ], + "argline": "git_revwalk *walk, const char *refname", + "sig": "git_revwalk *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Hide the OID pointed to by a reference

\n", + "comments": "

The reference must point to a committish.

\n", + "group": "revwalk" + }, + "git_revwalk_next": { + "type": "function", + "file": "git2/revwalk.h", + "line": 218, + "lineto": 218, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Pointer where to store the oid of the next commit" + }, + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker to pop the commit from." + } + ], + "argline": "git_oid *out, git_revwalk *walk", + "sig": "git_oid *::git_revwalk *", + "return": { + "type": "int", + "comment": " 0 if the next commit was found;\n\tGIT_ITEROVER if there are no commits left to iterate" + }, + "description": "

Get the next commit from the revision walk.

\n", + "comments": "

The initial call to this method is not blocking when iterating through a repo with a time-sorting mode.

\n\n

Iterating with Topological or inverted modes makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo).

\n\n

The revision walker is reset when the walk is over.

\n", + "group": "revwalk", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_revwalk_next-83"], + "log.c": ["ex/v1.9.1/log.html#git_revwalk_next-51"] + } + }, + "git_revwalk_sorting": { + "type": "function", + "file": "git2/revwalk.h", + "line": 230, + "lineto": 230, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal." + }, + { + "name": "sort_mode", + "type": "unsigned int", + "comment": "combination of GIT_SORT_XXX flags" + } + ], + "argline": "git_revwalk *walk, unsigned int sort_mode", + "sig": "git_revwalk *::unsigned int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Change the sorting mode when iterating through the\n repository's contents.

\n", + "comments": "

Changing the sorting mode resets the walker.

\n", + "group": "revwalk", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_revwalk_sorting-84"], + "log.c": [ + "ex/v1.9.1/log.html#git_revwalk_sorting-52", + "ex/v1.9.1/log.html#git_revwalk_sorting-53" + ] + } + }, + "git_revwalk_push_range": { + "type": "function", + "file": "git2/revwalk.h", + "line": 245, + "lineto": 245, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + }, + { "name": "range", "type": "const char *", "comment": "the range" } + ], + "argline": "git_revwalk *walk, const char *range", + "sig": "git_revwalk *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Push and hide the respective endpoints of the given range.

\n", + "comments": "

The range should be of the form .. where each is in the form accepted by 'git_revparse_single'. The left-hand commit will be hidden and the right-hand commit pushed.

\n", + "group": "revwalk" + }, + "git_revwalk_simplify_first_parent": { + "type": "function", + "file": "git2/revwalk.h", + "line": 255, + "lineto": 255, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "The revision walker." + } + ], + "argline": "git_revwalk *walk", + "sig": "git_revwalk *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Simplify the history by first-parent

\n", + "comments": "

No parents other than the first for each commit will be enqueued.

\n", + "group": "revwalk" + }, + "git_revwalk_free": { + "type": "function", + "file": "git2/revwalk.h", + "line": 263, + "lineto": 263, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "traversal handle to close. If NULL nothing occurs." + } + ], + "argline": "git_revwalk *walk", + "sig": "git_revwalk *", + "return": { "type": "void", "comment": null }, + "description": "

Free a revision walker previously allocated.

\n", + "comments": "", + "group": "revwalk", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_revwalk_free-85"], + "log.c": ["ex/v1.9.1/log.html#git_revwalk_free-54"] + } + }, + "git_revwalk_repository": { + "type": "function", + "file": "git2/revwalk.h", + "line": 272, + "lineto": 272, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the revision walker" + } + ], + "argline": "git_revwalk *walk", + "sig": "git_revwalk *", + "return": { + "type": "git_repository *", + "comment": " the repository being walked" + }, + "description": "

Return the repository on which this walker\n is operating.

\n", + "comments": "", + "group": "revwalk" + }, + "git_revwalk_add_hide_cb": { + "type": "function", + "file": "git2/revwalk.h", + "line": 295, + "lineto": 298, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the revision walker" + }, + { + "name": "hide_cb", + "type": "git_revwalk_hide_cb", + "comment": "callback function to hide a commit and its parents" + }, + { + "name": "payload", + "type": "void *", + "comment": "data payload to be passed to callback function" + } + ], + "argline": "git_revwalk *walk, git_revwalk_hide_cb hide_cb, void *payload", + "sig": "git_revwalk *::git_revwalk_hide_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Adds, changes or removes a callback function to hide a commit and its parents

\n", + "comments": "", + "group": "revwalk" + }, + "git_signature_new": { + "type": "function", + "file": "git2/signature.h", + "line": 41, + "lineto": 41, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature, in case of error NULL" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the person" + }, + { + "name": "email", + "type": "const char *", + "comment": "email of the person" + }, + { + "name": "time", + "type": "git_time_t", + "comment": "time (in seconds from epoch) when the action happened" + }, + { + "name": "offset", + "type": "int", + "comment": "timezone offset (in minutes) for the time" + } + ], + "argline": "git_signature **out, const char *name, const char *email, git_time_t time, int offset", + "sig": "git_signature **::const char *::const char *::git_time_t::int", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new action signature.

\n", + "comments": "

Call git_signature_free() to free the data.

\n\n

Note: angle brackets ('<' and '>') characters are not allowed to be used in either the name or the email parameter.

\n", + "group": "signature", + "examples": { + "general.c": [ + "ex/v1.9.1/general.html#git_signature_new-86", + "ex/v1.9.1/general.html#git_signature_new-87" + ] + } + }, + "git_signature_now": { + "type": "function", + "file": "git2/signature.h", + "line": 53, + "lineto": 53, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature, in case of error NULL" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the person" + }, + { + "name": "email", + "type": "const char *", + "comment": "email of the person" + } + ], + "argline": "git_signature **out, const char *name, const char *email", + "sig": "git_signature **::const char *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new action signature with a timestamp of 'now'.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "signature", + "examples": { "merge.c": ["ex/v1.9.1/merge.html#git_signature_now-36"] } + }, + "git_signature_default_from_env": { + "type": "function", + "file": "git2/signature.h", + "line": 86, + "lineto": 89, + "args": [ + { + "name": "author_out", + "type": "git_signature **", + "comment": "pointer to set the author signature, or NULL" + }, + { + "name": "committer_out", + "type": "git_signature **", + "comment": "pointer to set the committer signature, or NULL" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository pointer" + } + ], + "argline": "git_signature **author_out, git_signature **committer_out, git_repository *repo", + "sig": "git_signature **::git_signature **::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if config is missing, or error code" + }, + "description": "

Create a new author and/or committer signatures with default\n information based on the configuration and environment variables.

\n", + "comments": "

If author_out is set, it will be populated with the author information. The GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables will be honored, and user.name and user.email configuration options will be honored if the environment variables are unset. For timestamps, GIT_AUTHOR_DATE will be used, otherwise the current time will be used.

\n\n

If committer_out is set, it will be populated with the committer information. The GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL environment variables will be honored, and user.name and user.email configuration options will be honored if the environment variables are unset. For timestamps, GIT_COMMITTER_DATE will be used, otherwise the current time will be used.

\n\n

If neither GIT_AUTHOR_DATE nor GIT_COMMITTER_DATE are set, both timestamps will be set to the same time.

\n\n

It will return GIT_ENOTFOUND if either the user.name or user.email are not set and there is no fallback from an environment variable. One of author_out or committer_out must be set.

\n", + "group": "signature", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_signature_default_from_env-10"], + "init.c": ["ex/v1.9.1/init.html#git_signature_default_from_env-10"], + "tag.c": ["ex/v1.9.1/tag.html#git_signature_default_from_env-13"] + } + }, + "git_signature_default": { + "type": "function", + "file": "git2/signature.h", + "line": 107, + "lineto": 107, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository pointer" + } + ], + "argline": "git_signature **out, git_repository *repo", + "sig": "git_signature **::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if config is missing, or error code" + }, + "description": "

Create a new action signature with default user and now timestamp.

\n", + "comments": "

This looks up the user.name and user.email from the configuration and uses the current time as the timestamp, and creates a new signature based on that information. It will return GIT_ENOTFOUND if either the user.name or user.email are not set.

\n\n

Note that these do not examine environment variables, only the configuration files. Use git_signature_default_from_env to consider the environment variables.

\n", + "group": "signature" + }, + "git_signature_from_buffer": { + "type": "function", + "file": "git2/signature.h", + "line": 120, + "lineto": 120, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature" + }, + { "name": "buf", "type": "const char *", "comment": "signature string" } + ], + "argline": "git_signature **out, const char *buf", + "sig": "git_signature **::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALID if the signature is not parseable, or an error code" + }, + "description": "

Create a new signature by parsing the given buffer, which is\n expected to be in the format "Real Name \n<email

\n\n
\n

timestamp tzoffset",\n where timestamp is the number of seconds since the Unix epoch and\n tzoffset is the timezone offset in hhmm format (note the lack\n of a colon separator).

\n
\n", + "comments": "", + "group": "signature" + }, + "git_signature_dup": { + "type": "function", + "file": "git2/signature.h", + "line": 132, + "lineto": 132, + "args": [ + { + "name": "dest", + "type": "git_signature **", + "comment": "pointer where to store the copy" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to duplicate" + } + ], + "argline": "git_signature **dest, const git_signature *sig", + "sig": "git_signature **::const git_signature *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a copy of an existing signature. All internal strings are also\n duplicated.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "signature" + }, + "git_signature_free": { + "type": "function", + "file": "git2/signature.h", + "line": 143, + "lineto": 143, + "args": [ + { + "name": "sig", + "type": "git_signature *", + "comment": "signature to free" + } + ], + "argline": "git_signature *sig", + "sig": "git_signature *", + "return": { "type": "void", "comment": null }, + "description": "

Free an existing signature.

\n", + "comments": "

Because the signature is not an opaque structure, it is legal to free it manually, but be sure to free the "name" and "email" strings in addition to the structure itself.

\n", + "group": "signature", + "examples": { + "commit.c": [ + "ex/v1.9.1/commit.html#git_signature_free-11", + "ex/v1.9.1/commit.html#git_signature_free-12" + ], + "general.c": [ + "ex/v1.9.1/general.html#git_signature_free-88", + "ex/v1.9.1/general.html#git_signature_free-89" + ], + "init.c": [ + "ex/v1.9.1/init.html#git_signature_free-11", + "ex/v1.9.1/init.html#git_signature_free-12" + ], + "tag.c": ["ex/v1.9.1/tag.html#git_signature_free-14"] + } + }, + "git_stash_save": { + "type": "function", + "file": "git2/stash.h", + "line": 72, + "lineto": 77, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Object id of the commit containing the stashed state.\n This commit is also the target of the direct reference refs/stash." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "stasher", + "type": "const git_signature *", + "comment": "The identity of the person performing the stashing." + }, + { + "name": "message", + "type": "const char *", + "comment": "Optional description along with the stashed state." + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Flags to control the stashing process. (see GIT_STASH_* above)" + } + ], + "argline": "git_oid *out, git_repository *repo, const git_signature *stasher, const char *message, uint32_t flags", + "sig": "git_oid *::git_repository *::const git_signature *::const char *::uint32_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND where there's nothing to stash,\n or error code." + }, + "description": "

Save the local modifications to a new stash.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_save_options_init": { + "type": "function", + "file": "git2/stash.h", + "line": 118, + "lineto": 119, + "args": [ + { + "name": "opts", + "type": "git_stash_save_options *", + "comment": "The `git_stash_save_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_STASH_SAVE_OPTIONS_VERSION`." + } + ], + "argline": "git_stash_save_options *opts, unsigned int version", + "sig": "git_stash_save_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_stash_save_options structure

\n", + "comments": "

Initializes a git_stash_save_options with default values. Equivalent to creating an instance with GIT_STASH_SAVE_OPTIONS_INIT.

\n", + "group": "stash" + }, + "git_stash_save_with_opts": { + "type": "function", + "file": "git2/stash.h", + "line": 131, + "lineto": 134, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Object id of the commit containing the stashed state.\n This commit is also the target of the direct reference refs/stash." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "opts", + "type": "const git_stash_save_options *", + "comment": "The stash options." + } + ], + "argline": "git_oid *out, git_repository *repo, const git_stash_save_options *opts", + "sig": "git_oid *::git_repository *::const git_stash_save_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND where there's nothing to stash,\n or error code." + }, + "description": "

Save the local modifications to a new stash, with options.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_apply_options_init": { + "type": "function", + "file": "git2/stash.h", + "line": 225, + "lineto": 226, + "args": [ + { + "name": "opts", + "type": "git_stash_apply_options *", + "comment": "The `git_stash_apply_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_STASH_APPLY_OPTIONS_VERSION`." + } + ], + "argline": "git_stash_apply_options *opts, unsigned int version", + "sig": "git_stash_apply_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_stash_apply_options structure

\n", + "comments": "

Initializes a git_stash_apply_options with default values. Equivalent to creating an instance with GIT_STASH_APPLY_OPTIONS_INIT.

\n", + "group": "stash" + }, + "git_stash_apply": { + "type": "function", + "file": "git2/stash.h", + "line": 252, + "lineto": 255, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "index", + "type": "size_t", + "comment": "The position within the stash list. 0 points to the\n most recent stashed state." + }, + { + "name": "options", + "type": "const git_stash_apply_options *", + "comment": "Optional options to control how stashes are applied." + } + ], + "argline": "git_repository *repo, size_t index, const git_stash_apply_options *options", + "sig": "git_repository *::size_t::const git_stash_apply_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the\n given index, GIT_EMERGECONFLICT if changes exist in the working\n directory, or an error code" + }, + "description": "

Apply a single stashed state from the stash list.

\n", + "comments": "

If local changes in the working directory conflict with changes in the stash then GIT_EMERGECONFLICT will be returned. In this case, the index will always remain unmodified and all files in the working directory will remain unmodified. However, if you are restoring untracked files or ignored files and there is a conflict when applying the modified files, then those files will remain in the working directory.

\n\n

If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be conflicts when reinstating the index, the function will return GIT_EMERGECONFLICT and both the working directory and index will be left unmodified.

\n", + "group": "stash" + }, + "git_stash_foreach": { + "type": "function", + "file": "git2/stash.h", + "line": 288, + "lineto": 291, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the stash." + }, + { + "name": "callback", + "type": "git_stash_cb", + "comment": "Callback to invoke per found stashed state. The most\n recent stash state will be enumerated first." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra parameter to callback function." + } + ], + "argline": "git_repository *repo, git_stash_cb callback, void *payload", + "sig": "git_repository *::git_stash_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code." + }, + "description": "

Loop over all the stashed states and issue a callback for each one.

\n", + "comments": "

If the callback returns a non-zero value, this will stop looping.

\n", + "group": "stash" + }, + "git_stash_drop": { + "type": "function", + "file": "git2/stash.h", + "line": 304, + "lineto": 306, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "index", + "type": "size_t", + "comment": "The position within the stash list. 0 points to the\n most recent stashed state." + } + ], + "argline": "git_repository *repo, size_t index", + "sig": "git_repository *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the given\n index, or error code." + }, + "description": "

Remove a single stashed state from the stash list.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_pop": { + "type": "function", + "file": "git2/stash.h", + "line": 320, + "lineto": 323, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The owning repository." + }, + { + "name": "index", + "type": "size_t", + "comment": "The position within the stash list. 0 points to the\n most recent stashed state." + }, + { + "name": "options", + "type": "const git_stash_apply_options *", + "comment": "Optional options to control how stashes are applied." + } + ], + "argline": "git_repository *repo, size_t index, const git_stash_apply_options *options", + "sig": "git_repository *::size_t::const git_stash_apply_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the given\n index, or error code. (see git_stash_apply() above for details)" + }, + "description": "

Apply a single stashed state from the stash list and remove it from the list\n if successful.

\n", + "comments": "", + "group": "stash" + }, + "git_status_options_init": { + "type": "function", + "file": "git2/status.h", + "line": 280, + "lineto": 282, + "args": [ + { + "name": "opts", + "type": "git_status_options *", + "comment": "The `git_status_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_STATUS_OPTIONS_VERSION`." + } + ], + "argline": "git_status_options *opts, unsigned int version", + "sig": "git_status_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_status_options structure

\n", + "comments": "

Initializes a git_status_options with default values. Equivalent to creating an instance with GIT_STATUS_OPTIONS_INIT.

\n", + "group": "status" + }, + "git_status_foreach": { + "type": "function", + "file": "git2/status.h", + "line": 320, + "lineto": 323, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "callback", + "type": "git_status_cb", + "comment": "The function to call on each file" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to pass through to callback function" + } + ], + "argline": "git_repository *repo, git_status_cb callback, void *payload", + "sig": "git_repository *::git_status_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Gather file statuses and run a callback for each one.

\n", + "comments": "

The callback is passed the path of the file, the status (a combination of the git_status_t values above) and the payload data pointer passed into this function.

\n\n

If the callback returns a non-zero value, this function will stop looping and return that value to caller.

\n", + "group": "status", + "examples": { "status.c": ["ex/v1.9.1/status.html#git_status_foreach-6"] } + }, + "git_status_foreach_ext": { + "type": "function", + "file": "git2/status.h", + "line": 344, + "lineto": 348, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object" + }, + { + "name": "opts", + "type": "const git_status_options *", + "comment": "Status options structure" + }, + { + "name": "callback", + "type": "git_status_cb", + "comment": "The function to call on each file" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to pass through to callback function" + } + ], + "argline": "git_repository *repo, const git_status_options *opts, git_status_cb callback, void *payload", + "sig": "git_repository *::const git_status_options *::git_status_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Gather file status information and run callbacks as requested.

\n", + "comments": "

This is an extended version of the git_status_foreach() API that allows for more granular control over which paths will be processed and in what order. See the git_status_options structure for details about the additional controls that this makes available.

\n\n

Note that if a pathspec is given in the git_status_options to filter the status, then the results from rename detection (if you enable it) may not be accurate. To do rename detection properly, this must be called with no pathspec so that all files can be considered.

\n", + "group": "status", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_status_foreach_ext-7"] + } + }, + "git_status_file": { + "type": "function", + "file": "git2/status.h", + "line": 376, + "lineto": 379, + "args": [ + { + "name": "status_flags", + "type": "unsigned int *", + "comment": "Output combination of git_status_t values for file" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "path", + "type": "const char *", + "comment": "The exact path to retrieve status for relative to the\n repository working directory" + } + ], + "argline": "unsigned int *status_flags, git_repository *repo, const char *path", + "sig": "unsigned int *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if the file is not found in the HEAD,\n index, and work tree, GIT_EAMBIGUOUS if `path` matches multiple files\n or if it refers to a folder, and -1 on other errors." + }, + "description": "

Get file status for a single file.

\n", + "comments": "

This tries to get status for the filename that you give. If no files match that name (in either the HEAD, index, or working directory), this returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a directory or if running on a case- insensitive filesystem and yet the HEAD has two entries that both match the path), then this returns GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of targets and because of the path filtering, there is not enough information to check renames correctly. To check file status with rename detection, there is no choice but to do a full git_status_list_new and scan through looking for the path that you are interested in.

\n", + "group": "status", + "examples": { "add.c": ["ex/v1.9.1/add.html#git_status_file-6"] } + }, + "git_status_list_new": { + "type": "function", + "file": "git2/status.h", + "line": 394, + "lineto": 397, + "args": [ + { + "name": "out", + "type": "git_status_list **", + "comment": "Pointer to store the status results in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object" + }, + { + "name": "opts", + "type": "const git_status_options *", + "comment": "Status options structure" + } + ], + "argline": "git_status_list **out, git_repository *repo, const git_status_options *opts", + "sig": "git_status_list **::git_repository *::const git_status_options *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Gather file status information and populate the git_status_list.

\n", + "comments": "

Note that if a pathspec is given in the git_status_options to filter the status, then the results from rename detection (if you enable it) may not be accurate. To do rename detection properly, this must be called with no pathspec so that all files can be considered.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v1.9.1/status.html#git_status_list_new-8", + "ex/v1.9.1/status.html#git_status_list_new-9" + ] + } + }, + "git_status_list_entrycount": { + "type": "function", + "file": "git2/status.h", + "line": 408, + "lineto": 409, + "args": [ + { + "name": "statuslist", + "type": "git_status_list *", + "comment": "Existing status list object" + } + ], + "argline": "git_status_list *statuslist", + "sig": "git_status_list *", + "return": { + "type": "size_t", + "comment": " the number of status entries" + }, + "description": "

Gets the count of status entries in this list.

\n", + "comments": "

If there are no changes in status (at least according the options given when the status list was created), this can return 0.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v1.9.1/status.html#git_status_list_entrycount-10", + "ex/v1.9.1/status.html#git_status_list_entrycount-11" + ] + } + }, + "git_status_byindex": { + "type": "function", + "file": "git2/status.h", + "line": 420, + "lineto": 422, + "args": [ + { + "name": "statuslist", + "type": "git_status_list *", + "comment": "Existing status list object" + }, + { "name": "idx", "type": "size_t", "comment": "Position of the entry" } + ], + "argline": "git_status_list *statuslist, size_t idx", + "sig": "git_status_list *::size_t", + "return": { + "type": "const git_status_entry *", + "comment": " Pointer to the entry; NULL if out of bounds" + }, + "description": "

Get a pointer to one of the entries in the status list.

\n", + "comments": "

The entry is not modifiable and should not be freed.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v1.9.1/status.html#git_status_byindex-12", + "ex/v1.9.1/status.html#git_status_byindex-13", + "ex/v1.9.1/status.html#git_status_byindex-14", + "ex/v1.9.1/status.html#git_status_byindex-15", + "ex/v1.9.1/status.html#git_status_byindex-16", + "ex/v1.9.1/status.html#git_status_byindex-17" + ] + } + }, + "git_status_list_free": { + "type": "function", + "file": "git2/status.h", + "line": 429, + "lineto": 430, + "args": [ + { + "name": "statuslist", + "type": "git_status_list *", + "comment": "Existing status list object" + } + ], + "argline": "git_status_list *statuslist", + "sig": "git_status_list *", + "return": { "type": "void", "comment": null }, + "description": "

Free an existing status list

\n", + "comments": "", + "group": "status", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_status_list_free-18"] + } + }, + "git_status_should_ignore": { + "type": "function", + "file": "git2/status.h", + "line": 448, + "lineto": 451, + "args": [ + { + "name": "ignored", + "type": "int *", + "comment": "Boolean returning 0 if the file is not ignored, 1 if it is" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "path", + "type": "const char *", + "comment": "The file to check ignores for, rooted at the repo's workdir." + } + ], + "argline": "int *ignored, git_repository *repo, const char *path", + "sig": "int *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." + }, + "description": "

Test if the ignore rules apply to a given file.

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the directory containing the file, would it be added or not?

\n", + "group": "status" + }, + "git_strarray_dispose": { + "type": "function", + "file": "git2/strarray.h", + "line": 37, + "lineto": 37, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "The git_strarray that contains strings to free" + } + ], + "argline": "git_strarray *array", + "sig": "git_strarray *", + "return": { "type": "void", "comment": null }, + "description": "

Free the strings contained in a string array. This method should\n be called on git_strarray objects that were provided by the\n library. Not doing so, will result in a memory leak.

\n", + "comments": "

This does not free the git_strarray itself, since the library will never allocate that object directly itself.

\n", + "group": "strarray", + "examples": { + "checkout.c": ["ex/v1.9.1/checkout.html#git_strarray_dispose-26"], + "general.c": ["ex/v1.9.1/general.html#git_strarray_dispose-90"], + "remote.c": [ + "ex/v1.9.1/remote.html#git_strarray_dispose-11", + "ex/v1.9.1/remote.html#git_strarray_dispose-12" + ], + "tag.c": ["ex/v1.9.1/tag.html#git_strarray_dispose-15"] + } + }, + "git_submodule_update_options_init": { + "type": "function", + "file": "git2/submodule.h", + "line": 180, + "lineto": 181, + "args": [ + { + "name": "opts", + "type": "git_submodule_update_options *", + "comment": "The `git_submodule_update_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`." + } + ], + "argline": "git_submodule_update_options *opts, unsigned int version", + "sig": "git_submodule_update_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_submodule_update_options structure

\n", + "comments": "

Initializes a git_submodule_update_options with default values. Equivalent to creating an instance with GIT_SUBMODULE_UPDATE_OPTIONS_INIT.

\n", + "group": "submodule" + }, + "git_submodule_update": { + "type": "function", + "file": "git2/submodule.h", + "line": 201, + "lineto": 201, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule object" + }, + { + "name": "init", + "type": "int", + "comment": "If the submodule is not initialized, setting this flag to true\n will initialize the submodule before updating. Otherwise, this will\n return an error if attempting to update an uninitialized repository.\n but setting this to true forces them to be updated." + }, + { + "name": "options", + "type": "git_submodule_update_options *", + "comment": "configuration options for the update. If NULL, the\n function works as though GIT_SUBMODULE_UPDATE_OPTIONS_INIT was passed." + } + ], + "argline": "git_submodule *submodule, int init, git_submodule_update_options *options", + "sig": "git_submodule *::int::git_submodule_update_options *", + "return": { + "type": "int", + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `git_error_last` for a detailed error message)." + }, + "description": "

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n the containing repository. If the submodule repository doesn't contain\n the target commit (e.g. because fetchRecurseSubmodules isn't set), then\n the submodule is fetched using the fetch options supplied in options.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_lookup": { + "type": "function", + "file": "git2/submodule.h", + "line": 230, + "lineto": 233, + "args": [ + { + "name": "out", + "type": "git_submodule **", + "comment": "Output ptr to submodule; pass NULL to just get return code" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The parent repository" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of or path to the submodule; trailing slashes okay" + } + ], + "argline": "git_submodule **out, git_repository *repo, const char *name", + "sig": "git_submodule **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if submodule does not exist,\n GIT_EEXISTS if a repository is found in working directory only,\n -1 on other errors." + }, + "description": "

Lookup submodule information by name or path.

\n", + "comments": "

Given either the submodule name or path (they are usually the same), this returns a structure describing the submodule.

\n\n

There are two expected error scenarios:

\n\n\n\n

You must call git_submodule_free when done with the submodule.

\n", + "group": "submodule" + }, + "git_submodule_dup": { + "type": "function", + "file": "git2/submodule.h", + "line": 243, + "lineto": 243, + "args": [ + { + "name": "out", + "type": "git_submodule **", + "comment": "Pointer to store the copy of the submodule." + }, + { + "name": "source", + "type": "git_submodule *", + "comment": "Original submodule to copy." + } + ], + "argline": "git_submodule **out, git_submodule *source", + "sig": "git_submodule **::git_submodule *", + "return": { "type": "int", "comment": " 0" }, + "description": "

Create an in-memory copy of a submodule. The copy must be explicitly\n free'd or it will leak.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_free": { + "type": "function", + "file": "git2/submodule.h", + "line": 250, + "lineto": 250, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { "type": "void", "comment": null }, + "description": "

Release a submodule

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_foreach": { + "type": "function", + "file": "git2/submodule.h", + "line": 270, + "lineto": 273, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + }, + { + "name": "callback", + "type": "git_submodule_cb", + "comment": "Function to be called with the name of each submodule.\n Return a non-zero value to terminate the iteration." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra data to pass to callback" + } + ], + "argline": "git_repository *repo, git_submodule_cb callback, void *payload", + "sig": "git_repository *::git_submodule_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, or non-zero return value of callback" + }, + "description": "

Iterate over all tracked submodules of a repository.

\n", + "comments": "

See the note on git_submodule above. This iterates over the tracked submodules as described therein.

\n\n

If you are concerned about items in the working directory that look like submodules but are not tracked, the diff API will generate a diff record for workdir items that look like submodules but are not tracked, showing them as added in the workdir. Also, the status API will treat the entire subdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.

\n", + "group": "submodule", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_submodule_foreach-19"] + } + }, + "git_submodule_add_setup": { + "type": "function", + "file": "git2/submodule.h", + "line": 301, + "lineto": 306, + "args": [ + { + "name": "out", + "type": "git_submodule **", + "comment": "The newly created submodule ready to open for clone" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository in which you want to create the submodule" + }, + { + "name": "url", + "type": "const char *", + "comment": "URL for the submodule's remote" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path at which the submodule should be created" + }, + { + "name": "use_gitlink", + "type": "int", + "comment": "Should workdir contain a gitlink to the repo in\n .git/modules vs. repo directly in workdir." + } + ], + "argline": "git_submodule **out, git_repository *repo, const char *url, const char *path, int use_gitlink", + "sig": "git_submodule **::git_repository *::const char *::const char *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS if submodule already exists,\n -1 on other errors." + }, + "description": "

Set up a new git submodule for checkout.

\n", + "comments": "

This does "git submodule add" up to the fetch and checkout of the submodule contents. It preps a new submodule, creates an entry in .gitmodules and creates an empty initialized repository either at the given path in the working directory or in .git/modules with a gitlink from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the submodule repo and perform the clone step as needed (if you don't need anything custom see git_submodule_add_clone()). Lastly, call git_submodule_add_finalize() to wrap up adding the new submodule and .gitmodules to the index to be ready to commit.

\n\n

You must call git_submodule_free on the submodule object when done.

\n", + "group": "submodule" + }, + "git_submodule_clone": { + "type": "function", + "file": "git2/submodule.h", + "line": 319, + "lineto": 322, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "The newly created repository object. Optional." + }, + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule currently waiting for its clone." + }, + { + "name": "opts", + "type": "const git_submodule_update_options *", + "comment": "The options to use." + } + ], + "argline": "git_repository **out, git_submodule *submodule, const git_submodule_update_options *opts", + "sig": "git_repository **::git_submodule *::const git_submodule_update_options *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on other errors (see git_clone)." + }, + "description": "

Perform the clone step for a newly created submodule.

\n", + "comments": "

This performs the necessary git_clone to setup a newly-created submodule.

\n", + "group": "submodule" + }, + "git_submodule_add_finalize": { + "type": "function", + "file": "git2/submodule.h", + "line": 335, + "lineto": 335, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to finish adding." + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Resolve the setup of a new git submodule.

\n", + "comments": "

This should be called on a submodule once you have called add setup and done the clone of the submodule. This adds the .gitmodules file and the newly cloned submodule to the index to be ready to be committed (but doesn't actually do the commit).

\n", + "group": "submodule" + }, + "git_submodule_add_to_index": { + "type": "function", + "file": "git2/submodule.h", + "line": 347, + "lineto": 349, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to add to the index" + }, + { + "name": "write_index", + "type": "int", + "comment": "Boolean if this should immediately write the index\n file. If you pass this as false, you will have to get the\n git_index and explicitly call `git_index_write()` on it to\n save the change." + } + ], + "argline": "git_submodule *submodule, int write_index", + "sig": "git_submodule *::int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Add current submodule HEAD commit to index of superproject.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_owner": { + "type": "function", + "file": "git2/submodule.h", + "line": 362, + "lineto": 362, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "git_repository *", + "comment": " Pointer to `git_repository`" + }, + "description": "

Get the containing repository for a submodule.

\n", + "comments": "

This returns a pointer to the repository that contains the submodule. This is a just a reference to the repository that was passed to the original git_submodule_lookup() call, so if that repository has been freed, then this may be a dangling reference.

\n", + "group": "submodule" + }, + "git_submodule_name": { + "type": "function", + "file": "git2/submodule.h", + "line": 370, + "lineto": 370, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "const char *", + "comment": " Pointer to the submodule name" + }, + "description": "

Get the name of submodule.

\n", + "comments": "", + "group": "submodule", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_submodule_name-20"] + } + }, + "git_submodule_path": { + "type": "function", + "file": "git2/submodule.h", + "line": 381, + "lineto": 381, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "const char *", + "comment": " Pointer to the submodule path" + }, + "description": "

Get the path to the submodule.

\n", + "comments": "

The path is almost always the same as the submodule name, but the two are actually not required to match.

\n", + "group": "submodule", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_submodule_path-21"] + } + }, + "git_submodule_url": { + "type": "function", + "file": "git2/submodule.h", + "line": 389, + "lineto": 389, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "const char *", + "comment": " Pointer to the submodule url" + }, + "description": "

Get the URL for the submodule.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_resolve_url": { + "type": "function", + "file": "git2/submodule.h", + "line": 399, + "lineto": 399, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the absolute submodule url in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Pointer to repository object" + }, + { "name": "url", "type": "const char *", "comment": "Relative url" } + ], + "argline": "git_buf *out, git_repository *repo, const char *url", + "sig": "git_buf *::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Resolve a submodule url relative to the given repository.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_branch": { + "type": "function", + "file": "git2/submodule.h", + "line": 407, + "lineto": 407, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "const char *", + "comment": " Pointer to the submodule branch" + }, + "description": "

Get the branch for the submodule.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_set_branch": { + "type": "function", + "file": "git2/submodule.h", + "line": 420, + "lineto": 420, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submodule to configure" + }, + { + "name": "branch", + "type": "const char *", + "comment": "Branch that should be used for the submodule" + } + ], + "argline": "git_repository *repo, const char *name, const char *branch", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Set the branch for the submodule in the configuration

\n", + "comments": "

After calling this, you may wish to call git_submodule_sync() to write the changes to the checked out submodule repository.

\n", + "group": "submodule" + }, + "git_submodule_set_url": { + "type": "function", + "file": "git2/submodule.h", + "line": 434, + "lineto": 434, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submodule to configure" + }, + { + "name": "url", + "type": "const char *", + "comment": "URL that should be used for the submodule" + } + ], + "argline": "git_repository *repo, const char *name, const char *url", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Set the URL for the submodule in the configuration

\n", + "comments": "

After calling this, you may wish to call git_submodule_sync() to write the changes to the checked out submodule repository.

\n", + "group": "submodule" + }, + "git_submodule_index_id": { + "type": "function", + "file": "git2/submodule.h", + "line": 442, + "lineto": 442, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "const git_oid *", + "comment": " Pointer to git_oid or NULL if submodule is not in index." + }, + "description": "

Get the OID for the submodule in the index.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_head_id": { + "type": "function", + "file": "git2/submodule.h", + "line": 450, + "lineto": 450, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "const git_oid *", + "comment": " Pointer to git_oid or NULL if submodule is not in the HEAD." + }, + "description": "

Get the OID for the submodule in the current HEAD tree.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_wd_id": { + "type": "function", + "file": "git2/submodule.h", + "line": 463, + "lineto": 463, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Pointer to submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "const git_oid *", + "comment": " Pointer to git_oid or NULL if submodule is not checked out." + }, + "description": "

Get the OID for the submodule in the current working directory.

\n", + "comments": "

This returns the OID that corresponds to looking up 'HEAD' in the checked out submodule. If there are pending changes in the index or anything else, this won't notice that. You should call git_submodule_status() for a more complete picture about the state of the working directory.

\n", + "group": "submodule" + }, + "git_submodule_ignore": { + "type": "function", + "file": "git2/submodule.h", + "line": 488, + "lineto": 489, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to check" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "git_submodule_ignore_t", + "comment": " The current git_submodule_ignore_t valyue what will be used for\n this submodule." + }, + "description": "

Get the ignore rule that will be used for the submodule.

\n", + "comments": "

These values control the behavior of git_submodule_status() for this submodule. There are four ignore values:

\n\n\n", + "group": "submodule" + }, + "git_submodule_set_ignore": { + "type": "function", + "file": "git2/submodule.h", + "line": 501, + "lineto": 504, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submdule" + }, + { + "name": "ignore", + "type": "git_submodule_ignore_t", + "comment": "The new value for the ignore rule" + } + ], + "argline": "git_repository *repo, const char *name, git_submodule_ignore_t ignore", + "sig": "git_repository *::const char *::git_submodule_ignore_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the ignore rule for the submodule in the configuration

\n", + "comments": "

This does not affect any currently-loaded instances.

\n", + "group": "submodule" + }, + "git_submodule_update_strategy": { + "type": "function", + "file": "git2/submodule.h", + "line": 516, + "lineto": 517, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to check" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "git_submodule_update_t", + "comment": " The current git_submodule_update_t value that will be used\n for this submodule." + }, + "description": "

Get the update rule that will be used for the submodule.

\n", + "comments": "

This value controls the behavior of the git submodule update command. There are four useful values documented with git_submodule_update_t.

\n", + "group": "submodule" + }, + "git_submodule_set_update": { + "type": "function", + "file": "git2/submodule.h", + "line": 529, + "lineto": 532, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submodule to configure" + }, + { + "name": "update", + "type": "git_submodule_update_t", + "comment": "The new value to use" + } + ], + "argline": "git_repository *repo, const char *name, git_submodule_update_t update", + "sig": "git_repository *::const char *::git_submodule_update_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Set the update rule for the submodule in the configuration

\n", + "comments": "

This setting won't affect any existing instances.

\n", + "group": "submodule" + }, + "git_submodule_fetch_recurse_submodules": { + "type": "function", + "file": "git2/submodule.h", + "line": 546, + "lineto": 547, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "the submodule to examine" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "git_submodule_recurse_t", + "comment": " the submodule recursion configuration" + }, + "description": "

Read the fetchRecurseSubmodules rule for a submodule.

\n", + "comments": "

This accesses the submodule..fetchRecurseSubmodules value for the submodule that controls fetching behavior for the submodule.

\n\n

Note that at this time, libgit2 does not honor this setting and the fetch functionality current ignores submodules.

\n", + "group": "submodule" + }, + "git_submodule_set_fetch_recurse_submodules": { + "type": "function", + "file": "git2/submodule.h", + "line": 559, + "lineto": 562, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the submodule to configure" + }, + { + "name": "fetch_recurse_submodules", + "type": "git_submodule_recurse_t", + "comment": "the submodule recursion configuration" + } + ], + "argline": "git_repository *repo, const char *name, git_submodule_recurse_t fetch_recurse_submodules", + "sig": "git_repository *::const char *::git_submodule_recurse_t", + "return": { + "type": "int", + "comment": " old value for fetchRecurseSubmodules" + }, + "description": "

Set the fetchRecurseSubmodules rule for a submodule in the configuration

\n", + "comments": "

This setting won't affect any existing instances.

\n", + "group": "submodule" + }, + "git_submodule_init": { + "type": "function", + "file": "git2/submodule.h", + "line": 577, + "lineto": 577, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to write into the superproject config" + }, + { + "name": "overwrite", + "type": "int", + "comment": "By default, existing entries will not be overwritten,\n but setting this to true forces them to be updated." + } + ], + "argline": "git_submodule *submodule, int overwrite", + "sig": "git_submodule *::int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure." + }, + "description": "

Copy submodule info into ".git/config" file.

\n", + "comments": "

Just like "git submodule init", this copies information about the submodule into ".git/config". You can use the accessor functions above to alter the in-memory git_submodule object and control what is written to the config, overriding what is in .gitmodules.

\n", + "group": "submodule" + }, + "git_submodule_repo_init": { + "type": "function", + "file": "git2/submodule.h", + "line": 592, + "lineto": 595, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Output pointer to the created git repository." + }, + { + "name": "sm", + "type": "const git_submodule *", + "comment": "The submodule to create a new subrepository from." + }, + { + "name": "use_gitlink", + "type": "int", + "comment": "Should the workdir contain a gitlink to\n the repo in .git/modules vs. repo directly in workdir." + } + ], + "argline": "git_repository **out, const git_submodule *sm, int use_gitlink", + "sig": "git_repository **::const git_submodule *::int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure." + }, + "description": "

Set up the subrepository for a submodule in preparation for clone.

\n", + "comments": "

This function can be called to init and set up a submodule repository from a submodule in preparation to clone it from its remote.

\n", + "group": "submodule" + }, + "git_submodule_sync": { + "type": "function", + "file": "git2/submodule.h", + "line": 608, + "lineto": 608, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to copy." + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { "type": "int", "comment": " 0 or an error code." }, + "description": "

Copy submodule remote info into submodule repo.

\n", + "comments": "

This copies the information about the submodules URL into the checked out submodule config, acting like "git submodule sync". This is useful if you have altered the URL for the submodule (or it has been altered by a fetch of upstream changes) and you need to update your local repo.

\n", + "group": "submodule" + }, + "git_submodule_open": { + "type": "function", + "file": "git2/submodule.h", + "line": 622, + "lineto": 624, + "args": [ + { + "name": "repo", + "type": "git_repository **", + "comment": "Pointer to the submodule repo which was opened" + }, + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule to be opened" + } + ], + "argline": "git_repository **repo, git_submodule *submodule", + "sig": "git_repository **::git_submodule *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 if submodule repo could not be opened." + }, + "description": "

Open the repository for a submodule.

\n", + "comments": "

This is a newly opened repository object. The caller is responsible for calling git_repository_free() on it when done. Multiple calls to this function will return distinct git_repository objects. This will only work if the submodule is checked out into the working directory.

\n", + "group": "submodule" + }, + "git_submodule_reload": { + "type": "function", + "file": "git2/submodule.h", + "line": 636, + "lineto": 636, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to reload" + }, + { + "name": "force", + "type": "int", + "comment": "Force reload even if the data doesn't seem out of date" + } + ], + "argline": "git_submodule *submodule, int force", + "sig": "git_submodule *::int", + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, + "description": "

Reread submodule info from config, index, and HEAD.

\n", + "comments": "

Call this to reread cached submodule information for this submodule if you have reason to believe that it has changed.

\n", + "group": "submodule" + }, + "git_submodule_status": { + "type": "function", + "file": "git2/submodule.h", + "line": 652, + "lineto": 656, + "args": [ + { + "name": "status", + "type": "unsigned int *", + "comment": "Combination of `GIT_SUBMODULE_STATUS` flags" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the submodule" + }, + { + "name": "ignore", + "type": "git_submodule_ignore_t", + "comment": "the ignore rules to follow" + } + ], + "argline": "unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore", + "sig": "unsigned int *::git_repository *::const char *::git_submodule_ignore_t", + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, + "description": "

Get the status for a submodule.

\n", + "comments": "

This looks at a submodule and tries to determine the status. It will return a combination of the GIT_SUBMODULE_STATUS values above. How deeply it examines the working directory to do this will depend on the git_submodule_ignore_t value for the submodule.

\n", + "group": "submodule", + "examples": { + "status.c": ["ex/v1.9.1/status.html#git_submodule_status-22"] + } + }, + "git_submodule_location": { + "type": "function", + "file": "git2/submodule.h", + "line": 672, + "lineto": 674, + "args": [ + { + "name": "location_status", + "type": "unsigned int *", + "comment": "Combination of first four `GIT_SUBMODULE_STATUS` flags" + }, + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule for which to get status" + } + ], + "argline": "unsigned int *location_status, git_submodule *submodule", + "sig": "unsigned int *::git_submodule *", + "return": { "type": "int", "comment": " 0 on success, \n<\n0 on error" }, + "description": "

Get the locations of submodule information.

\n", + "comments": "

This is a bit like a very lightweight version of git_submodule_status. It just returns a made of the first four submodule status values (i.e. the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.). This can be useful if you want to know if the submodule is present in the working directory at this point in time, etc.

\n", + "group": "submodule" + }, + "git_tag_lookup": { + "type": "function", + "file": "git2/tag.h", + "line": 33, + "lineto": 34, + "args": [ + { + "name": "out", + "type": "git_tag **", + "comment": "pointer to the looked up tag" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the tag." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the tag to locate." + } + ], + "argline": "git_tag **out, git_repository *repo, const git_oid *id", + "sig": "git_tag **::git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tag object from the repository.

\n", + "comments": "", + "group": "tag", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_tag_lookup-91"] } + }, + "git_tag_lookup_prefix": { + "type": "function", + "file": "git2/tag.h", + "line": 48, + "lineto": 49, + "args": [ + { + "name": "out", + "type": "git_tag **", + "comment": "pointer to the looked up tag" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the tag." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the tag to locate." + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the short identifier" + } + ], + "argline": "git_tag **out, git_repository *repo, const git_oid *id, size_t len", + "sig": "git_tag **::git_repository *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tag object from the repository,\n given a prefix of its identifier (short id).

\n", + "comments": "", + "group": "tag" + }, + "git_tag_free": { + "type": "function", + "file": "git2/tag.h", + "line": 61, + "lineto": 61, + "args": [ + { "name": "tag", "type": "git_tag *", "comment": "the tag to close" } + ], + "argline": "git_tag *tag", + "sig": "git_tag *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open tag

\n", + "comments": "

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to release memory. Failure to do so will cause a memory leak.

\n", + "group": "tag", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_tag_free-92"] } + }, + "git_tag_id": { + "type": "function", + "file": "git2/tag.h", + "line": 69, + "lineto": 69, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const git_oid *", + "comment": " object identity for the tag." + }, + "description": "

Get the id of a tag.

\n", + "comments": "", + "group": "tag" + }, + "git_tag_owner": { + "type": "function", + "file": "git2/tag.h", + "line": 77, + "lineto": 77, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "A previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this tag." + }, + "description": "

Get the repository that contains the tag.

\n", + "comments": "", + "group": "tag" + }, + "git_tag_target": { + "type": "function", + "file": "git2/tag.h", + "line": 89, + "lineto": 89, + "args": [ + { + "name": "target_out", + "type": "git_object **", + "comment": "pointer where to store the target" + }, + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "git_object **target_out, const git_tag *tag", + "sig": "git_object **::const git_tag *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Get the tagged object of a tag

\n", + "comments": "

This method performs a repository lookup for the given object and returns it

\n", + "group": "tag", + "examples": { "general.c": ["ex/v1.9.1/general.html#git_tag_target-93"] } + }, + "git_tag_target_id": { + "type": "function", + "file": "git2/tag.h", + "line": 97, + "lineto": 97, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { "type": "const git_oid *", "comment": " pointer to the OID" }, + "description": "

Get the OID of the tagged object of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_target_id-31"] + } + }, + "git_tag_target_type": { + "type": "function", + "file": "git2/tag.h", + "line": 105, + "lineto": 105, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "git_object_t", + "comment": " type of the tagged object" + }, + "description": "

Get the type of a tag's tagged object

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_target_type-32"], + "general.c": ["ex/v1.9.1/general.html#git_tag_target_type-94"] + } + }, + "git_tag_name": { + "type": "function", + "file": "git2/tag.h", + "line": 113, + "lineto": 113, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { "type": "const char *", "comment": " name of the tag" }, + "description": "

Get the name of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_name-33"], + "general.c": ["ex/v1.9.1/general.html#git_tag_name-95"], + "tag.c": ["ex/v1.9.1/tag.html#git_tag_name-16"] + } + }, + "git_tag_tagger": { + "type": "function", + "file": "git2/tag.h", + "line": 121, + "lineto": 121, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const git_signature *", + "comment": " reference to the tag's author or NULL when unspecified" + }, + "description": "

Get the tagger (author) of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tag_tagger-34"] + } + }, + "git_tag_message": { + "type": "function", + "file": "git2/tag.h", + "line": 129, + "lineto": 129, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const char *", + "comment": " message of the tag or NULL when unspecified" + }, + "description": "

Get the message of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": [ + "ex/v1.9.1/cat-file.html#git_tag_message-35", + "ex/v1.9.1/cat-file.html#git_tag_message-36" + ], + "general.c": ["ex/v1.9.1/general.html#git_tag_message-96"], + "tag.c": ["ex/v1.9.1/tag.html#git_tag_message-17"] + } + }, + "git_tag_create": { + "type": "function", + "file": "git2/tag.h", + "line": 171, + "lineto": 178, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the\n newly created tag. If the tag already exists, this parameter\n will be the oid of the existing tag, and the function will\n return a GIT_EEXISTS error code." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "tagger", + "type": "const git_signature *", + "comment": "Signature of the tagger for this tag, and\n of the tagging time" + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this tag" + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + } + ], + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message, int force", + "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA tag object is written to the ODB, and a proper reference\n\tis written in the /refs/tags folder, pointing to it" + }, + "description": "

Create a new tag in the repository from an object

\n", + "comments": "

A new reference will also be created pointing to this tag object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.

\n", + "group": "tag", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_tag_create-18"] } + }, + "git_tag_annotation_create": { + "type": "function", + "file": "git2/tag.h", + "line": 203, + "lineto": 209, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the\n newly created tag" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name for the tag" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "tagger", + "type": "const git_signature *", + "comment": "Signature of the tagger for this tag, and\n of the tagging time" + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this tag" + } + ], + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message", + "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Create a new tag in the object database pointing to a git_object

\n", + "comments": "

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n", + "group": "tag" + }, + "git_tag_create_from_buffer": { + "type": "function", + "file": "git2/tag.h", + "line": 220, + "lineto": 224, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the newly created tag" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the tag" + }, + { "name": "buffer", "type": "const char *", "comment": "Raw tag data" }, + { "name": "force", "type": "int", "comment": "Overwrite existing tags" } + ], + "argline": "git_oid *oid, git_repository *repo, const char *buffer, int force", + "sig": "git_oid *::git_repository *::const char *::int", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "

Create a new tag in the repository from a buffer

\n", + "comments": "", + "group": "tag" + }, + "git_tag_create_lightweight": { + "type": "function", + "file": "git2/tag.h", + "line": 256, + "lineto": 261, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the provided\n target object. If the tag already exists, this parameter\n will be filled with the oid of the existing pointed object\n and the function will return a GIT_EEXISTS error code." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the lightweight tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + } + ], + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, int force", + "sig": "git_oid *::git_repository *::const char *::const git_object *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA proper reference is written in the /refs/tags folder,\n pointing to the provided target object" + }, + "description": "

Create a new lightweight tag pointing at a target object

\n", + "comments": "

A new direct reference will be created pointing to this target object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "group": "tag", + "examples": { + "tag.c": ["ex/v1.9.1/tag.html#git_tag_create_lightweight-19"] + } + }, + "git_tag_delete": { + "type": "function", + "file": "git2/tag.h", + "line": 276, + "lineto": 278, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where lives the tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name of the tag to be deleted;\n this name is validated for consistency." + } + ], + "argline": "git_repository *repo, const char *tag_name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Delete an existing tag reference.

\n", + "comments": "

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", + "group": "tag", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_tag_delete-20"] } + }, + "git_tag_list": { + "type": "function", + "file": "git2/tag.h", + "line": 293, + "lineto": 295, + "args": [ + { + "name": "tag_names", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe tag names will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the tags" + } + ], + "argline": "git_strarray *tag_names, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Fill a list with all the tags in the Repository

\n", + "comments": "

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", + "group": "tag" + }, + "git_tag_list_match": { + "type": "function", + "file": "git2/tag.h", + "line": 315, + "lineto": 318, + "args": [ + { + "name": "tag_names", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe tag names will be stored" + }, + { + "name": "pattern", + "type": "const char *", + "comment": "Standard fnmatch pattern" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the tags" + } + ], + "argline": "git_strarray *tag_names, const char *pattern, git_repository *repo", + "sig": "git_strarray *::const char *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Fill a list with all the tags in the Repository\n which name match a defined pattern

\n", + "comments": "

If an empty pattern is provided, all the tags will be returned.

\n\n

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", + "group": "tag", + "examples": { "tag.c": ["ex/v1.9.1/tag.html#git_tag_list_match-21"] } + }, + "git_tag_foreach": { + "type": "function", + "file": "git2/tag.h", + "line": 340, + "lineto": 343, + "args": [ + { "name": "repo", "type": "git_repository *", "comment": "Repository" }, + { + "name": "callback", + "type": "git_tag_foreach_cb", + "comment": "Callback function" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to callback data (optional)" + } + ], + "argline": "git_repository *repo, git_tag_foreach_cb callback, void *payload", + "sig": "git_repository *::git_tag_foreach_cb::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Call callback `cb' for each tag in the repository

\n", + "comments": "", + "group": "tag" + }, + "git_tag_peel": { + "type": "function", + "file": "git2/tag.h", + "line": 356, + "lineto": 358, + "args": [ + { + "name": "tag_target_out", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" + }, + { + "name": "tag", + "type": "const git_tag *", + "comment": "The tag to be processed" + } + ], + "argline": "git_object **tag_target_out, const git_tag *tag", + "sig": "git_object **::const git_tag *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Recursively peel a tag until a non tag git_object is found

\n", + "comments": "

The retrieved tag_target object is owned by the repository and should be closed with the git_object_free method.

\n", + "group": "tag" + }, + "git_tag_dup": { + "type": "function", + "file": "git2/tag.h", + "line": 368, + "lineto": 368, + "args": [ + { + "name": "out", + "type": "git_tag **", + "comment": "Pointer to store the copy of the tag" + }, + { + "name": "source", + "type": "git_tag *", + "comment": "Original tag to copy" + } + ], + "argline": "git_tag **out, git_tag *source", + "sig": "git_tag **::git_tag *", + "return": { "type": "int", "comment": " 0" }, + "description": "

Create an in-memory copy of a tag. The copy must be explicitly\n free'd or it will leak.

\n", + "comments": "", + "group": "tag" + }, + "git_tag_name_is_valid": { + "type": "function", + "file": "git2/tag.h", + "line": 380, + "lineto": 380, + "args": [ + { + "name": "valid", + "type": "int *", + "comment": "output pointer to set with validity of given tag name" + }, + { + "name": "name", + "type": "const char *", + "comment": "a tag name to test" + } + ], + "argline": "int *valid, const char *name", + "sig": "int *::const char *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Determine whether a tag name is valid, meaning that (when prefixed\n with refs/tags/) that it is a valid reference name, and that any\n additional tag name restrictions are imposed (eg, it cannot start\n with a -).

\n", + "comments": "", + "group": "tag" + }, + "git_trace_set": { + "type": "function", + "file": "git2/trace.h", + "line": 68, + "lineto": 68, + "args": [ + { + "name": "level", + "type": "git_trace_level_t", + "comment": "Level to set tracing to" + }, + { + "name": "cb", + "type": "git_trace_cb", + "comment": "Function to call with trace data" + } + ], + "argline": "git_trace_level_t level, git_trace_cb cb", + "sig": "git_trace_level_t::git_trace_cb", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Sets the system tracing configuration to the specified level with the\n specified callback. When system events occur at a level equal to, or\n lower than, the given level they will be reported to the given callback.

\n", + "comments": "", + "group": "trace" + }, + "git_transaction_new": { + "type": "function", + "file": "git2/transaction.h", + "line": 32, + "lineto": 32, + "args": [ + { + "name": "out", + "type": "git_transaction **", + "comment": "the resulting transaction" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to lock" + } + ], + "argline": "git_transaction **out, git_repository *repo", + "sig": "git_transaction **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a new transaction object

\n", + "comments": "

This does not lock anything, but sets up the transaction object to know from which repository to lock.

\n", + "group": "transaction" + }, + "git_transaction_lock_ref": { + "type": "function", + "file": "git2/transaction.h", + "line": 44, + "lineto": 44, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference to lock" + } + ], + "argline": "git_transaction *tx, const char *refname", + "sig": "git_transaction *::const char *", + "return": { "type": "int", "comment": " 0 or an error message" }, + "description": "

Lock a reference

\n", + "comments": "

Lock the specified reference. This is the first step to updating a reference.

\n", + "group": "transaction" + }, + "git_transaction_set_target": { + "type": "function", + "file": "git2/transaction.h", + "line": 59, + "lineto": 59, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference to update" + }, + { + "name": "target", + "type": "const git_oid *", + "comment": "target to set the reference to" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to use in the reflog; pass NULL to read the identity from the config" + }, + { + "name": "msg", + "type": "const char *", + "comment": "message to use in the reflog" + } + ], + "argline": "git_transaction *tx, const char *refname, const git_oid *target, const git_signature *sig, const char *msg", + "sig": "git_transaction *::const char *::const git_oid *::const git_signature *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Set the target of a reference

\n", + "comments": "

Set the target of the specified reference. This reference must be locked.

\n", + "group": "transaction" + }, + "git_transaction_set_symbolic_target": { + "type": "function", + "file": "git2/transaction.h", + "line": 74, + "lineto": 74, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "reference to update" + }, + { + "name": "target", + "type": "const char *", + "comment": "target to set the reference to" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to use in the reflog; pass NULL to read the identity from the config" + }, + { + "name": "msg", + "type": "const char *", + "comment": "message to use in the reflog" + } + ], + "argline": "git_transaction *tx, const char *refname, const char *target, const git_signature *sig, const char *msg", + "sig": "git_transaction *::const char *::const char *::const git_signature *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Set the target of a reference

\n", + "comments": "

Set the target of the specified reference. This reference must be locked.

\n", + "group": "transaction" + }, + "git_transaction_set_reflog": { + "type": "function", + "file": "git2/transaction.h", + "line": 87, + "lineto": 87, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference whose reflog to set" + }, + { + "name": "reflog", + "type": "const git_reflog *", + "comment": "the reflog as it should be written out" + } + ], + "argline": "git_transaction *tx, const char *refname, const git_reflog *reflog", + "sig": "git_transaction *::const char *::const git_reflog *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Set the reflog of a reference

\n", + "comments": "

Set the specified reference's reflog. If this is combined with setting the target, that update won't be written to the reflog.

\n", + "group": "transaction" + }, + "git_transaction_remove": { + "type": "function", + "file": "git2/transaction.h", + "line": 96, + "lineto": 96, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference to remove" + } + ], + "argline": "git_transaction *tx, const char *refname", + "sig": "git_transaction *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code" + }, + "description": "

Remove a reference

\n", + "comments": "", + "group": "transaction" + }, + "git_transaction_commit": { + "type": "function", + "file": "git2/transaction.h", + "line": 107, + "lineto": 107, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + } + ], + "argline": "git_transaction *tx", + "sig": "git_transaction *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Commit the changes from the transaction

\n", + "comments": "

Perform the changes that have been queued. The updates will be made one by one, and the first failure will stop the processing.

\n", + "group": "transaction" + }, + "git_transaction_free": { + "type": "function", + "file": "git2/transaction.h", + "line": 117, + "lineto": 117, + "args": [ + { + "name": "tx", + "type": "git_transaction *", + "comment": "the transaction" + } + ], + "argline": "git_transaction *tx", + "sig": "git_transaction *", + "return": { "type": "void", "comment": null }, + "description": "

Free the resources allocated by this transaction

\n", + "comments": "

If any references remain locked, they will be unlocked without any changes made to them.

\n", + "group": "transaction" + }, + "git_tree_lookup": { + "type": "function", + "file": "git2/tree.h", + "line": 32, + "lineto": 33, + "args": [ + { + "name": "out", + "type": "git_tree **", + "comment": "Pointer to the looked up tree" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repo to use when locating the tree." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "Identity of the tree to locate." + } + ], + "argline": "git_tree **out, git_repository *repo, const git_oid *id", + "sig": "git_tree **::git_repository *::const git_oid *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tree object from the repository.

\n", + "comments": "", + "group": "tree", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_tree_lookup-13"], + "general.c": [ + "ex/v1.9.1/general.html#git_tree_lookup-97", + "ex/v1.9.1/general.html#git_tree_lookup-98" + ], + "init.c": ["ex/v1.9.1/init.html#git_tree_lookup-13"], + "merge.c": ["ex/v1.9.1/merge.html#git_tree_lookup-37"] + } + }, + "git_tree_lookup_prefix": { + "type": "function", + "file": "git2/tree.h", + "line": 47, + "lineto": 51, + "args": [ + { + "name": "out", + "type": "git_tree **", + "comment": "pointer to the looked up tree" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when locating the tree." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "identity of the tree to locate." + }, + { + "name": "len", + "type": "size_t", + "comment": "the length of the short identifier" + } + ], + "argline": "git_tree **out, git_repository *repo, const git_oid *id, size_t len", + "sig": "git_tree **::git_repository *::const git_oid *::size_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a tree object from the repository,\n given a prefix of its identifier (short id).

\n", + "comments": "", + "group": "tree" + }, + "git_tree_free": { + "type": "function", + "file": "git2/tree.h", + "line": 63, + "lineto": 63, + "args": [ + { "name": "tree", "type": "git_tree *", "comment": "The tree to close" } + ], + "argline": "git_tree *tree", + "sig": "git_tree *", + "return": { "type": "void", "comment": null }, + "description": "

Close an open tree

\n", + "comments": "

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to release memory. Failure to do so will cause a memory leak.

\n", + "group": "tree", + "examples": { + "commit.c": ["ex/v1.9.1/commit.html#git_tree_free-14"], + "diff.c": [ + "ex/v1.9.1/diff.html#git_tree_free-19", + "ex/v1.9.1/diff.html#git_tree_free-20" + ], + "general.c": [ + "ex/v1.9.1/general.html#git_tree_free-99", + "ex/v1.9.1/general.html#git_tree_free-100" + ], + "init.c": ["ex/v1.9.1/init.html#git_tree_free-14"], + "log.c": [ + "ex/v1.9.1/log.html#git_tree_free-55", + "ex/v1.9.1/log.html#git_tree_free-56", + "ex/v1.9.1/log.html#git_tree_free-57", + "ex/v1.9.1/log.html#git_tree_free-58", + "ex/v1.9.1/log.html#git_tree_free-59" + ] + } + }, + "git_tree_id": { + "type": "function", + "file": "git2/tree.h", + "line": 71, + "lineto": 71, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + } + ], + "argline": "const git_tree *tree", + "sig": "const git_tree *", + "return": { + "type": "const git_oid *", + "comment": " object identity for the tree." + }, + "description": "

Get the id of a tree.

\n", + "comments": "", + "group": "tree" + }, + "git_tree_owner": { + "type": "function", + "file": "git2/tree.h", + "line": 79, + "lineto": 79, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "A previously loaded tree." + } + ], + "argline": "const git_tree *tree", + "sig": "const git_tree *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this tree." + }, + "description": "

Get the repository that contains the tree.

\n", + "comments": "", + "group": "tree" + }, + "git_tree_entrycount": { + "type": "function", + "file": "git2/tree.h", + "line": 87, + "lineto": 87, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + } + ], + "argline": "const git_tree *tree", + "sig": "const git_tree *", + "return": { + "type": "size_t", + "comment": " the number of entries in the tree" + }, + "description": "

Get the number of entries listed in a tree

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entrycount-37"], + "general.c": ["ex/v1.9.1/general.html#git_tree_entrycount-101"] + } + }, + "git_tree_entry_byname": { + "type": "function", + "file": "git2/tree.h", + "line": 99, + "lineto": 100, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + }, + { + "name": "filename", + "type": "const char *", + "comment": "the filename of the desired entry" + } + ], + "argline": "const git_tree *tree, const char *filename", + "sig": "const git_tree *::const char *", + "return": { + "type": "const git_tree_entry *", + "comment": " the tree entry; NULL if not found" + }, + "description": "

Lookup a tree entry by its filename

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", + "group": "tree", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_tree_entry_byname-102"] + } + }, + "git_tree_entry_byindex": { + "type": "function", + "file": "git2/tree.h", + "line": 112, + "lineto": 113, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position in the entry list" + } + ], + "argline": "const git_tree *tree, size_t idx", + "sig": "const git_tree *::size_t", + "return": { + "type": "const git_tree_entry *", + "comment": " the tree entry; NULL if not found" + }, + "description": "

Lookup a tree entry by its position in the tree

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_byindex-38"], + "general.c": ["ex/v1.9.1/general.html#git_tree_entry_byindex-103"] + } + }, + "git_tree_entry_byid": { + "type": "function", + "file": "git2/tree.h", + "line": 127, + "lineto": 128, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the sha being looked for" + } + ], + "argline": "const git_tree *tree, const git_oid *id", + "sig": "const git_tree *::const git_oid *", + "return": { + "type": "const git_tree_entry *", + "comment": " the tree entry; NULL if not found" + }, + "description": "

Lookup a tree entry by SHA value.

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n", + "group": "tree" + }, + "git_tree_entry_bypath": { + "type": "function", + "file": "git2/tree.h", + "line": 142, + "lineto": 145, + "args": [ + { + "name": "out", + "type": "git_tree_entry **", + "comment": "Pointer where to store the tree entry" + }, + { + "name": "root", + "type": "const git_tree *", + "comment": "Previously loaded tree which is the root of the relative path" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to the contained entry" + } + ], + "argline": "git_tree_entry **out, const git_tree *root, const char *path", + "sig": "git_tree_entry **::const git_tree *::const char *", + "return": { + "type": "int", + "comment": " 0 on success; GIT_ENOTFOUND if the path does not exist" + }, + "description": "

Retrieve a tree entry contained in a tree or in any of its subtrees,\n given its relative path.

\n", + "comments": "

Unlike the other lookup functions, the returned tree entry is owned by the user and must be freed explicitly with git_tree_entry_free().

\n", + "group": "tree" + }, + "git_tree_entry_dup": { + "type": "function", + "file": "git2/tree.h", + "line": 157, + "lineto": 157, + "args": [ + { + "name": "dest", + "type": "git_tree_entry **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "const git_tree_entry *", + "comment": "tree entry to duplicate" + } + ], + "argline": "git_tree_entry **dest, const git_tree_entry *source", + "sig": "git_tree_entry **::const git_tree_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Duplicate a tree entry

\n", + "comments": "

Create a copy of a tree entry. The returned copy is owned by the user, and must be freed explicitly with git_tree_entry_free().

\n", + "group": "tree" + }, + "git_tree_entry_free": { + "type": "function", + "file": "git2/tree.h", + "line": 168, + "lineto": 168, + "args": [ + { + "name": "entry", + "type": "git_tree_entry *", + "comment": "The entry to free" + } + ], + "argline": "git_tree_entry *entry", + "sig": "git_tree_entry *", + "return": { "type": "void", "comment": null }, + "description": "

Free a user-owned tree entry

\n", + "comments": "

IMPORTANT: This function is only needed for tree entries owned by the user, such as the ones returned by git_tree_entry_dup() or git_tree_entry_bypath().

\n", + "group": "tree" + }, + "git_tree_entry_name": { + "type": "function", + "file": "git2/tree.h", + "line": 176, + "lineto": 176, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" + } + ], + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", + "return": { "type": "const char *", "comment": " the name of the file" }, + "description": "

Get the filename of a tree entry

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_name-39"], + "general.c": [ + "ex/v1.9.1/general.html#git_tree_entry_name-104", + "ex/v1.9.1/general.html#git_tree_entry_name-105" + ] + } + }, + "git_tree_entry_id": { + "type": "function", + "file": "git2/tree.h", + "line": 184, + "lineto": 184, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" + } + ], + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", + "return": { + "type": "const git_oid *", + "comment": " the oid of the object" + }, + "description": "

Get the id of the object pointed by the entry

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_id-40"] + } + }, + "git_tree_entry_type": { + "type": "function", + "file": "git2/tree.h", + "line": 192, + "lineto": 192, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" + } + ], + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", + "return": { + "type": "git_object_t", + "comment": " the type of the pointed object" + }, + "description": "

Get the type of the object pointed by the entry

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_type-41"] + } + }, + "git_tree_entry_filemode": { + "type": "function", + "file": "git2/tree.h", + "line": 200, + "lineto": 200, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" + } + ], + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", + "return": { + "type": "git_filemode_t", + "comment": " filemode as an integer" + }, + "description": "

Get the UNIX file attributes of a tree entry

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": ["ex/v1.9.1/cat-file.html#git_tree_entry_filemode-42"] + } + }, + "git_tree_entry_filemode_raw": { + "type": "function", + "file": "git2/tree.h", + "line": 212, + "lineto": 212, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" + } + ], + "argline": "const git_tree_entry *entry", + "sig": "const git_tree_entry *", + "return": { + "type": "git_filemode_t", + "comment": " filemode as an integer" + }, + "description": "

Get the raw UNIX file attributes of a tree entry

\n", + "comments": "

This function does not perform any normalization and is only useful if you need to be able to recreate the original tree object.

\n", + "group": "tree" + }, + "git_tree_entry_cmp": { + "type": "function", + "file": "git2/tree.h", + "line": 220, + "lineto": 220, + "args": [ + { + "name": "e1", + "type": "const git_tree_entry *", + "comment": "first tree entry" + }, + { + "name": "e2", + "type": "const git_tree_entry *", + "comment": "second tree entry" + } + ], + "argline": "const git_tree_entry *e1, const git_tree_entry *e2", + "sig": "const git_tree_entry *::const git_tree_entry *", + "return": { + "type": "int", + "comment": " \n<\n0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2" + }, + "description": "

Compare two tree entries

\n", + "comments": "", + "group": "tree" + }, + "git_tree_entry_to_object": { + "type": "function", + "file": "git2/tree.h", + "line": 232, + "lineto": 235, + "args": [ + { + "name": "object_out", + "type": "git_object **", + "comment": "pointer to the converted object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository where to lookup the pointed object" + }, + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "a tree entry" + } + ], + "argline": "git_object **object_out, git_repository *repo, const git_tree_entry *entry", + "sig": "git_object **::git_repository *::const git_tree_entry *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Convert a tree entry to the git_object it points to.

\n", + "comments": "

You must call git_object_free() on the object when you are done with it.

\n", + "group": "tree", + "examples": { + "general.c": ["ex/v1.9.1/general.html#git_tree_entry_to_object-106"] + } + }, + "git_treebuilder_new": { + "type": "function", + "file": "git2/tree.h", + "line": 254, + "lineto": 255, + "args": [ + { + "name": "out", + "type": "git_treebuilder **", + "comment": "Pointer where to store the tree builder" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository in which to store the object" + }, + { + "name": "source", + "type": "const git_tree *", + "comment": "Source tree to initialize the builder (optional)" + } + ], + "argline": "git_treebuilder **out, git_repository *repo, const git_tree *source", + "sig": "git_treebuilder **::git_repository *::const git_tree *", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "

Create a new tree builder.

\n", + "comments": "

The tree builder can be used to create or modify trees in memory and write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no entries and will have to be filled manually.

\n", + "group": "treebuilder" + }, + "git_treebuilder_clear": { + "type": "function", + "file": "git2/tree.h", + "line": 263, + "lineto": 263, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Builder to clear" + } + ], + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "

Clear all the entries in the builder

\n", + "comments": "", + "group": "treebuilder" + }, + "git_treebuilder_entrycount": { + "type": "function", + "file": "git2/tree.h", + "line": 271, + "lineto": 271, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "a previously loaded treebuilder." + } + ], + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", + "return": { + "type": "size_t", + "comment": " the number of entries in the treebuilder" + }, + "description": "

Get the number of entries listed in a treebuilder

\n", + "comments": "", + "group": "treebuilder" + }, + "git_treebuilder_free": { + "type": "function", + "file": "git2/tree.h", + "line": 282, + "lineto": 282, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Builder to free" + } + ], + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", + "return": { "type": "void", "comment": null }, + "description": "

Free a tree builder

\n", + "comments": "

This will clear all the entries and free to builder. Failing to free the builder after you're done using it will result in a memory leak

\n", + "group": "treebuilder" + }, + "git_treebuilder_get": { + "type": "function", + "file": "git2/tree.h", + "line": 294, + "lineto": 295, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" + }, + { + "name": "filename", + "type": "const char *", + "comment": "Name of the entry" + } + ], + "argline": "git_treebuilder *bld, const char *filename", + "sig": "git_treebuilder *::const char *", + "return": { + "type": "const git_tree_entry *", + "comment": " pointer to the entry; NULL if not found" + }, + "description": "

Get an entry from the builder from its filename

\n", + "comments": "

The returned entry is owned by the builder and should not be freed manually.

\n", + "group": "treebuilder" + }, + "git_treebuilder_insert": { + "type": "function", + "file": "git2/tree.h", + "line": 325, + "lineto": 330, + "args": [ + { + "name": "out", + "type": "const git_tree_entry **", + "comment": "Pointer to store the entry (optional)" + }, + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" + }, + { + "name": "filename", + "type": "const char *", + "comment": "Filename of the entry" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "SHA1 oid of the entry" + }, + { + "name": "filemode", + "type": "git_filemode_t", + "comment": "Folder attributes of the entry. This parameter must\n\t\t\tbe valued with one of the following entries: 0040000, 0100644,\n\t\t\t0100755, 0120000 or 0160000." + } + ], + "argline": "const git_tree_entry **out, git_treebuilder *bld, const char *filename, const git_oid *id, git_filemode_t filemode", + "sig": "const git_tree_entry **::git_treebuilder *::const char *::const git_oid *::git_filemode_t", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add or update an entry to the builder

\n", + "comments": "

Insert a new entry for filename in the builder with the given attributes.

\n\n

If an entry named filename already exists, its attributes will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the newly created/updated entry. Pass NULL if you do not need it. The pointer may not be valid past the next operation in this builder. Duplicate the entry if you want to keep it.

\n\n

By default the entry that you are inserting will be checked for validity; that it exists in the object database and is of the correct type. If you do not want this behavior, set the GIT_OPT_ENABLE_STRICT_OBJECT_CREATION library option to false.

\n", + "group": "treebuilder" + }, + "git_treebuilder_remove": { + "type": "function", + "file": "git2/tree.h", + "line": 339, + "lineto": 340, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" + }, + { + "name": "filename", + "type": "const char *", + "comment": "Filename of the entry to remove" + } + ], + "argline": "git_treebuilder *bld, const char *filename", + "sig": "git_treebuilder *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Remove an entry from the builder by its filename

\n", + "comments": "", + "group": "treebuilder" + }, + "git_treebuilder_filter": { + "type": "function", + "file": "git2/tree.h", + "line": 368, + "lineto": 371, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" + }, + { + "name": "filter", + "type": "git_treebuilder_filter_cb", + "comment": "Callback to filter entries" + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra data to pass to filter callback" + } + ], + "argline": "git_treebuilder *bld, git_treebuilder_filter_cb filter, void *payload", + "sig": "git_treebuilder *::git_treebuilder_filter_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Selectively remove entries in the tree

\n", + "comments": "

The filter callback will be called for each entry in the tree with a pointer to the entry and the provided payload; if the callback returns non-zero, the entry will be filtered (removed from the builder).

\n", + "group": "treebuilder" + }, + "git_treebuilder_write": { + "type": "function", + "file": "git2/tree.h", + "line": 383, + "lineto": 384, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer to store the OID of the newly written tree" + }, + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder to write" + } + ], + "argline": "git_oid *id, git_treebuilder *bld", + "sig": "git_oid *::git_treebuilder *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Write the contents of the tree builder as a tree object

\n", + "comments": "

The tree builder will be written to the given repo, and its identifying SHA1 hash will be stored in the id pointer.

\n", + "group": "treebuilder" + }, + "git_tree_walk": { + "type": "function", + "file": "git2/tree.h", + "line": 420, + "lineto": 424, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "The tree to walk" + }, + { + "name": "mode", + "type": "git_treewalk_mode", + "comment": "Traversal mode (pre or post-order)" + }, + { + "name": "callback", + "type": "git_treewalk_cb", + "comment": "Function to call on each tree entry" + }, + { + "name": "payload", + "type": "void *", + "comment": "Opaque pointer to be passed on each callback" + } + ], + "argline": "const git_tree *tree, git_treewalk_mode mode, git_treewalk_cb callback, void *payload", + "sig": "const git_tree *::git_treewalk_mode::git_treewalk_cb::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Traverse the entries in a tree and its subtrees in post or pre order.

\n", + "comments": "

The entries will be traversed in the specified order, children subtrees will be automatically loaded as required, and the callback will be called once per entry with the current (relative) root for the entry and the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be skipped on the traversal (in pre mode). A negative value stops the walk.

\n", + "group": "tree" + }, + "git_tree_dup": { + "type": "function", + "file": "git2/tree.h", + "line": 434, + "lineto": 434, + "args": [ + { + "name": "out", + "type": "git_tree **", + "comment": "Pointer to store the copy of the tree" + }, + { + "name": "source", + "type": "git_tree *", + "comment": "Original tree to copy" + } + ], + "argline": "git_tree **out, git_tree *source", + "sig": "git_tree **::git_tree *", + "return": { "type": "int", "comment": " 0" }, + "description": "

Create an in-memory copy of a tree. The copy must be explicitly\n free'd or it will leak.

\n", + "comments": "", + "group": "tree" + }, + "git_tree_create_updated": { + "type": "function", + "file": "git2/tree.h", + "line": 481, + "lineto": 481, + "args": [ + { "name": "out", "type": "git_oid *", "comment": "id of the new tree" }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to create the tree, must be the\n same as for `baseline`" + }, + { + "name": "baseline", + "type": "git_tree *", + "comment": "the tree to base these changes on" + }, + { + "name": "nupdates", + "type": "size_t", + "comment": "the number of elements in the update list" + }, + { + "name": "updates", + "type": "const git_tree_update *", + "comment": "the list of updates to perform" + } + ], + "argline": "git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates", + "sig": "git_oid *::git_repository *::git_tree *::size_t::const git_tree_update *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Create a tree based on another one with the specified modifications

\n", + "comments": "

Given the baseline perform the changes described in the list of updates and create a new tree.

\n\n

This function is optimized for common file/directory addition, removal and replacement in trees. It is much more efficient than reading the tree into a git_index and modifying that, but in exchange it is not as flexible.

\n\n

Deleting and adding the same entry is undefined behaviour, changing a tree to a blob or viceversa is not supported.

\n", + "group": "tree" + }, + "git_worktree_list": { + "type": "function", + "file": "git2/worktree.h", + "line": 35, + "lineto": 35, + "args": [ + { + "name": "out", + "type": "git_strarray *", + "comment": "pointer to the array of working tree names" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to use when listing working trees" + } + ], + "argline": "git_strarray *out, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

List names of linked working trees

\n", + "comments": "

The returned list should be released with git_strarray_free when no longer needed.

\n", + "group": "worktree" + }, + "git_worktree_lookup": { + "type": "function", + "file": "git2/worktree.h", + "line": 45, + "lineto": 45, + "args": [ + { + "name": "out", + "type": "git_worktree **", + "comment": "Output pointer to looked up worktree or `NULL`" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing worktrees" + }, + { + "name": "name", + "type": "const char *", + "comment": "Name of the working tree to look up" + } + ], + "argline": "git_worktree **out, git_repository *repo, const char *name", + "sig": "git_worktree **::git_repository *::const char *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Lookup a working tree by its name for a given repository

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_open_from_repository": { + "type": "function", + "file": "git2/worktree.h", + "line": 58, + "lineto": 58, + "args": [ + { + "name": "out", + "type": "git_worktree **", + "comment": "Out-pointer for the newly allocated worktree" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository to look up worktree for" + } + ], + "argline": "git_worktree **out, git_repository *repo", + "sig": "git_worktree **::git_repository *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Open a worktree of a given repository

\n", + "comments": "

If a repository is not the main tree but a worktree, this function will look up the worktree inside the parent repository and create a new git_worktree structure.

\n", + "group": "worktree" + }, + "git_worktree_free": { + "type": "function", + "file": "git2/worktree.h", + "line": 65, + "lineto": 65, + "args": [ + { + "name": "wt", + "type": "git_worktree *", + "comment": "worktree handle to close. If NULL nothing occurs." + } + ], + "argline": "git_worktree *wt", + "sig": "git_worktree *", + "return": { "type": "void", "comment": null }, + "description": "

Free a previously allocated worktree

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_validate": { + "type": "function", + "file": "git2/worktree.h", + "line": 77, + "lineto": 77, + "args": [ + { + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to check" + } + ], + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", + "return": { + "type": "int", + "comment": " 0 when worktree is valid, error-code otherwise" + }, + "description": "

Check if worktree is valid

\n", + "comments": "

A valid worktree requires both the git data structures inside the linked parent repository and the linked working copy to be present.

\n", + "group": "worktree" + }, + "git_worktree_add_options_init": { + "type": "function", + "file": "git2/worktree.h", + "line": 116, + "lineto": 117, + "args": [ + { + "name": "opts", + "type": "git_worktree_add_options *", + "comment": "The `git_worktree_add_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_WORKTREE_ADD_OPTIONS_VERSION`." + } + ], + "argline": "git_worktree_add_options *opts, unsigned int version", + "sig": "git_worktree_add_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_worktree_add_options structure

\n", + "comments": "

Initializes a git_worktree_add_options with default values. Equivalent to creating an instance with GIT_WORKTREE_ADD_OPTIONS_INIT.

\n", + "group": "worktree" + }, + "git_worktree_add": { + "type": "function", + "file": "git2/worktree.h", + "line": 133, + "lineto": 135, + "args": [ + { + "name": "out", + "type": "git_worktree **", + "comment": "Output pointer containing new working tree" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository to create working tree for" + }, + { + "name": "name", + "type": "const char *", + "comment": "Name of the working tree" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to create working tree at" + }, + { + "name": "opts", + "type": "const git_worktree_add_options *", + "comment": "Options to modify default behavior. May be NULL" + } + ], + "argline": "git_worktree **out, git_repository *repo, const char *name, const char *path, const git_worktree_add_options *opts", + "sig": "git_worktree **::git_repository *::const char *::const char *::const git_worktree_add_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Add a new working tree

\n", + "comments": "

Add a new working tree for the repository, that is create the required data structures inside the repository and check out the current HEAD at path

\n", + "group": "worktree" + }, + "git_worktree_lock": { + "type": "function", + "file": "git2/worktree.h", + "line": 147, + "lineto": 147, + "args": [ + { + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to lock" + }, + { + "name": "reason", + "type": "const char *", + "comment": "Reason why the working tree is being locked" + } + ], + "argline": "git_worktree *wt, const char *reason", + "sig": "git_worktree *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero otherwise" + }, + "description": "

Lock worktree if not already locked

\n", + "comments": "

Lock a worktree, optionally specifying a reason why the linked working tree is being locked.

\n", + "group": "worktree" + }, + "git_worktree_unlock": { + "type": "function", + "file": "git2/worktree.h", + "line": 156, + "lineto": 156, + "args": [ + { + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to unlock" + } + ], + "argline": "git_worktree *wt", + "sig": "git_worktree *", + "return": { + "type": "int", + "comment": " 0 on success, 1 if worktree was not locked, error-code\n otherwise" + }, + "description": "

Unlock a locked worktree

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_is_locked": { + "type": "function", + "file": "git2/worktree.h", + "line": 170, + "lineto": 170, + "args": [ + { + "name": "reason", + "type": "git_buf *", + "comment": "Buffer to store reason in. If NULL no reason is stored." + }, + { + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to check" + } + ], + "argline": "git_buf *reason, const git_worktree *wt", + "sig": "git_buf *::const git_worktree *", + "return": { + "type": "int", + "comment": " 0 when the working tree not locked, a value greater\n than zero if it is locked, less than zero if there was an\n error" + }, + "description": "

Check if worktree is locked

\n", + "comments": "

A worktree may be locked if the linked working tree is stored on a portable device which is not available.

\n", + "group": "worktree" + }, + "git_worktree_name": { + "type": "function", + "file": "git2/worktree.h", + "line": 179, + "lineto": 179, + "args": [ + { + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to get the name for" + } + ], + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", + "return": { + "type": "const char *", + "comment": " The worktree's name. The pointer returned is valid for the\n lifetime of the git_worktree" + }, + "description": "

Retrieve the name of the worktree

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_path": { + "type": "function", + "file": "git2/worktree.h", + "line": 188, + "lineto": 188, + "args": [ + { + "name": "wt", + "type": "const git_worktree *", + "comment": "Worktree to get the path for" + } + ], + "argline": "const git_worktree *wt", + "sig": "const git_worktree *", + "return": { + "type": "const char *", + "comment": " The worktree's filesystem path. The pointer returned\n is valid for the lifetime of the git_worktree." + }, + "description": "

Retrieve the filesystem path for the worktree

\n", + "comments": "", + "group": "worktree" + }, + "git_worktree_prune_options_init": { + "type": "function", + "file": "git2/worktree.h", + "line": 233, + "lineto": 235, + "args": [ + { + "name": "opts", + "type": "git_worktree_prune_options *", + "comment": "The `git_worktree_prune_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The struct version; pass `GIT_WORKTREE_PRUNE_OPTIONS_VERSION`." + } + ], + "argline": "git_worktree_prune_options *opts, unsigned int version", + "sig": "git_worktree_prune_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initialize git_worktree_prune_options structure

\n", + "comments": "

Initializes a git_worktree_prune_options with default values. Equivalent to creating an instance with GIT_WORKTREE_PRUNE_OPTIONS_INIT.

\n", + "group": "worktree" + }, + "git_worktree_is_prunable": { + "type": "function", + "file": "git2/worktree.h", + "line": 257, + "lineto": 258, + "args": [ + { + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to check." + }, + { + "name": "opts", + "type": "git_worktree_prune_options *", + "comment": "The prunable options." + } + ], + "argline": "git_worktree *wt, git_worktree_prune_options *opts", + "sig": "git_worktree *::git_worktree_prune_options *", + "return": { + "type": "int", + "comment": " 1 if the worktree is prunable, 0 otherwise, or an error code." + }, + "description": "

Is the worktree prunable with the given options?

\n", + "comments": "

A worktree is not prunable in the following scenarios:

\n\n\n\n

If the worktree is not valid and not locked or if the above flags have been passed in, this function will return a positive value. If the worktree is not prunable, an error message will be set (visible in giterr_last) with details about why.

\n", + "group": "worktree" + }, + "git_worktree_prune": { + "type": "function", + "file": "git2/worktree.h", + "line": 272, + "lineto": 273, + "args": [ + { + "name": "wt", + "type": "git_worktree *", + "comment": "Worktree to prune" + }, + { + "name": "opts", + "type": "git_worktree_prune_options *", + "comment": "Specifies which checks to override. See\n `git_worktree_is_prunable`. May be NULL" + } + ], + "argline": "git_worktree *wt, git_worktree_prune_options *opts", + "sig": "git_worktree *::git_worktree_prune_options *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Prune working tree

\n", + "comments": "

Prune the working tree, that is remove the git data structures on disk. The repository will only be pruned of git_worktree_is_prunable succeeds.

\n", + "group": "worktree" + } + }, + "callbacks": { + "git_apply_delta_cb": { + "type": "callback", + "file": "git2/apply.h", + "line": 41, + "lineto": 43, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "The delta to be applied" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified payload" + } + ], + "argline": "const git_diff_delta *delta, void *payload", + "sig": "const git_diff_delta *::void *", + "return": { + "type": "int", + "comment": " 0 if the delta is applied, \n<\n 0 if the apply process will be aborted\n\tor > 0 if the delta will not be applied." + }, + "description": "

When applying a patch, callback that will be made per delta (file).

\n", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the delta will not be applied, but the apply process continues - returns 0, the delta is applied, and the apply process continues.

\n" + }, + "git_apply_hunk_cb": { + "type": "callback", + "file": "git2/apply.h", + "line": 59, + "lineto": 61, + "args": [ + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": "The hunk to be applied" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified payload" + } + ], + "argline": "const git_diff_hunk *hunk, void *payload", + "sig": "const git_diff_hunk *::void *", + "return": { + "type": "int", + "comment": " 0 if the hunk is applied, \n<\n 0 if the apply process will be aborted\n\tor > 0 if the hunk will not be applied." + }, + "description": "

When applying a patch, callback that will be made per hunk.

\n", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the hunk will not be applied, but the apply process continues - returns 0, the hunk is applied, and the apply process continues.

\n" + }, + "git_attr_foreach_cb": { + "type": "callback", + "file": "git2/attr.h", + "line": 304, + "lineto": 304, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "The attribute name." + }, + { + "name": "value", + "type": "const char *", + "comment": "The attribute value. May be NULL if the attribute is explicitly\n set to UNSPECIFIED using the '!' sign." + }, + { + "name": "payload", + "type": "void *", + "comment": "A user-specified pointer." + } + ], + "argline": "const char *name, const char *value, void *payload", + "sig": "const char *::const char *::void *", + "return": { + "type": "int", + "comment": " 0 to continue looping, non-zero to stop. This value will be returned\n from git_attr_foreach." + }, + "description": "

The callback used with git_attr_foreach.

\n", + "comments": "

This callback will be invoked only once per attribute name, even if there are multiple rules for a given file. The highest priority rule will be used.

\n" + }, + "git_transport_certificate_check_cb": { + "type": "callback", + "file": "git2/cert.h", + "line": 72, + "lineto": 72, + "args": [ + { + "name": "cert", + "type": "git_cert *", + "comment": "The host certificate" + }, + { + "name": "valid", + "type": "int", + "comment": "Whether the libgit2 checks (OpenSSL or WinHTTP) think\n this certificate is valid" + }, + { + "name": "host", + "type": "const char *", + "comment": "Hostname of the host libgit2 connected to" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "git_cert *cert, int valid, const char *host, void *payload", + "sig": "git_cert *::int::const char *::void *", + "return": { + "type": "int", + "comment": " 0 to proceed with the connection, \n<\n 0 to fail the connection\n or > 0 to indicate that the callback refused to act and that\n the existing validity determination should be honored" + }, + "description": "

Callback for the user's custom certificate checks.

\n", + "comments": "" + }, + "git_checkout_notify_cb": { + "type": "callback", + "file": "git2/checkout.h", + "line": 275, + "lineto": 281, + "args": [ + { + "name": "why", + "type": "git_checkout_notify_t", + "comment": "the notification reason" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path to the file being checked out" + }, + { + "name": "baseline", + "type": "const git_diff_file *", + "comment": "the baseline's diff file information" + }, + { + "name": "target", + "type": "const git_diff_file *", + "comment": "the checkout target diff file information" + }, + { + "name": "workdir", + "type": "const git_diff_file *", + "comment": "the working directory diff file information" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-supplied callback payload" + } + ], + "argline": "git_checkout_notify_t why, const char *path, const git_diff_file *baseline, const git_diff_file *target, const git_diff_file *workdir, void *payload", + "sig": "git_checkout_notify_t::const char *::const git_diff_file *::const git_diff_file *::const git_diff_file *::void *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Checkout notification callback function.

\n", + "comments": "" + }, + "git_checkout_progress_cb": { + "type": "callback", + "file": "git2/checkout.h", + "line": 291, + "lineto": 295, + "args": [ + { + "name": "path", + "type": "const char *", + "comment": "the path to the file being checked out" + }, + { + "name": "completed_steps", + "type": "size_t", + "comment": "number of checkout steps completed" + }, + { + "name": "total_steps", + "type": "size_t", + "comment": "number of total steps in the checkout process" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-supplied callback payload" + } + ], + "argline": "const char *path, size_t completed_steps, size_t total_steps, void *payload", + "sig": "const char *::size_t::size_t::void *", + "return": { "type": "void", "comment": null }, + "description": "

Checkout progress notification function.

\n", + "comments": "" + }, + "git_checkout_perfdata_cb": { + "type": "callback", + "file": "git2/checkout.h", + "line": 303, + "lineto": 305, + "args": [ + { + "name": "perfdata", + "type": "const git_checkout_perfdata *", + "comment": "the performance data for the checkout" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-supplied callback payload" + } + ], + "argline": "const git_checkout_perfdata *perfdata, void *payload", + "sig": "const git_checkout_perfdata *::void *", + "return": { "type": "void", "comment": null }, + "description": "

Checkout performance data reporting function.

\n", + "comments": "" + }, + "git_remote_create_cb": { + "type": "callback", + "file": "git2/clone.h", + "line": 73, + "lineto": 78, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "the resulting remote" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to create the remote" + }, + { + "name": "name", + "type": "const char *", + "comment": "the remote's name" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote's url" + }, + { "name": "payload", "type": "void *", "comment": "an opaque payload" } + ], + "argline": "git_remote **out, git_repository *repo, const char *name, const char *url, void *payload", + "sig": "git_remote **::git_repository *::const char *::const char *::void *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

The signature of a function matching git_remote_create, with an additional\n void* as a callback payload.

\n", + "comments": "

Callers of git_clone may provide a function matching this signature to override the remote creation and customization process during a clone operation.

\n" + }, + "git_repository_create_cb": { + "type": "callback", + "file": "git2/clone.h", + "line": 94, + "lineto": 98, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "the resulting repository" + }, + { + "name": "path", + "type": "const char *", + "comment": "path in which to create the repository" + }, + { + "name": "bare", + "type": "int", + "comment": "whether the repository is bare. This is the value from the clone options" + }, + { + "name": "payload", + "type": "void *", + "comment": "payload specified by the options" + } + ], + "argline": "git_repository **out, const char *path, int bare, void *payload", + "sig": "git_repository **::const char *::int::void *", + "return": { + "type": "int", + "comment": " 0, or a negative value to indicate error" + }, + "description": "

The signature of a function matching git_repository_init, with an\n additional void * as callback payload.

\n", + "comments": "

Callers of git_clone my provide a function matching this signature to override the repository creation and customization process during a clone operation.

\n" + }, + "git_commit_create_cb": { + "type": "callback", + "file": "git2/commit.h", + "line": 643, + "lineto": 652, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "pointer that this callback will populate with the object\n id of the commit that is created" + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "the author name and time of the commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "the committer name and time of the commit" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "the encoding of the given message, or NULL\n to assume UTF8" + }, + { + "name": "message", + "type": "const char *", + "comment": "the commit message" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "the tree to be committed" + }, + { + "name": "parent_count", + "type": "size_t", + "comment": "the number of parents for this commit" + }, + { + "name": "parents", + "type": "const git_commit *[]", + "comment": "the commit parents" + }, + { + "name": "payload", + "type": "void *", + "comment": "the payload pointer in the rebase options" + } + ], + "argline": "git_oid *out, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents, void *payload", + "sig": "git_oid *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]::void *", + "return": { + "type": "int", + "comment": " 0 if this callback has created the commit and populated the out\n parameter, GIT_PASSTHROUGH if the callback has not created a\n commit and wants the calling function to create the commit as\n if no callback had been specified, any other value to stop\n and return a failure" + }, + "description": "

Commit creation callback: used when a function is going to create\n commits (for example, in git_rebase_commit) to allow callers to\n override the commit creation behavior. For example, users may\n wish to sign commits by providing this information to\n git_commit_create_buffer, signing that buffer, then calling\n git_commit_create_with_signature. The resultant commit id\n should be set in the out object id parameter.

\n", + "comments": "" + }, + "git_config_foreach_cb": { + "type": "callback", + "file": "git2/config.h", + "line": 140, + "lineto": 140, + "args": [ + { + "name": "entry", + "type": "const git_config_entry *", + "comment": "the entry currently being enumerated" + }, + { + "name": "payload", + "type": "void *", + "comment": "a user-specified pointer" + } + ], + "argline": "const git_config_entry *entry, void *payload", + "sig": "const git_config_entry *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration." + }, + "description": "

A config enumeration callback.

\n", + "comments": "" + }, + "git_credential_acquire_cb": { + "type": "callback", + "file": "git2/credential.h", + "line": 134, + "lineto": 139, + "args": [ + { + "name": "out", + "type": "git_credential **", + "comment": "The newly created credential object." + }, + { + "name": "url", + "type": "const char *", + "comment": "The resource for which we are demanding a credential." + }, + { + "name": "username_from_url", + "type": "const char *", + "comment": "The username that was embedded in a \"user\n@\nhost\"\n remote url, or NULL if not included." + }, + { + "name": "allowed_types", + "type": "unsigned int", + "comment": "A bitmask stating which credential types are OK to return." + }, + { + "name": "payload", + "type": "void *", + "comment": "The payload provided when specifying this callback." + } + ], + "argline": "git_credential **out, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload", + "sig": "git_credential **::const char *::const char *::unsigned int::void *", + "return": { + "type": "int", + "comment": " 0 for success, \n<\n 0 to indicate an error, > 0 to indicate\n no credential was acquired" + }, + "description": "

Credential acquisition callback.

\n", + "comments": "

This callback is usually involved any time another system might need authentication. As such, you are expected to provide a valid git_credential object back, depending on allowed_types (a git_credential_t bitmask).

\n\n

Note that most authentication details are your responsibility - this callback will be called until the authentication succeeds, or you report an error. As such, it's easy to get in a loop if you fail to stop providing the same incorrect credentials.

\n" + }, + "git_credential_ssh_interactive_cb": { + "type": "callback", + "file": "git2/credential.h", + "line": 259, + "lineto": 265, + "args": [ + { "name": "name", "type": "const char *", "comment": "the name" }, + { + "name": "name_len", + "type": "int", + "comment": "the length of the name" + }, + { + "name": "instruction", + "type": "const char *", + "comment": "the authentication instruction" + }, + { + "name": "instruction_len", + "type": "int", + "comment": "the length of the instruction" + }, + { + "name": "num_prompts", + "type": "int", + "comment": "the number of prompts" + }, + { + "name": "prompts", + "type": "const LIBSSH2_USERAUTH_KBDINT_PROMPT *", + "comment": "the prompts" + }, + { + "name": "responses", + "type": "LIBSSH2_USERAUTH_KBDINT_RESPONSE *", + "comment": "the responses" + }, + { "name": "abstract", "type": "void **", "comment": "the abstract" } + ], + "argline": "const char *name, int name_len, const char *instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, void **abstract", + "sig": "const char *::int::const char *::int::int::const LIBSSH2_USERAUTH_KBDINT_PROMPT *::LIBSSH2_USERAUTH_KBDINT_RESPONSE *::void **", + "return": { "type": "void", "comment": null }, + "description": "

Callback for interactive SSH credentials.

\n", + "comments": "" + }, + "git_credential_sign_cb": { + "type": "callback", + "file": "git2/credential.h", + "line": 308, + "lineto": 312, + "args": [ + { + "name": "session", + "type": "LIBSSH2_SESSION *", + "comment": "the libssh2 session" + }, + { + "name": "sig", + "type": "unsigned char **", + "comment": "the signature" + }, + { + "name": "sig_len", + "type": "size_t *", + "comment": "the length of the signature" + }, + { + "name": "data", + "type": "const unsigned char *", + "comment": "the data" + }, + { + "name": "data_len", + "type": "size_t", + "comment": "the length of the data" + }, + { "name": "abstract", "type": "void **", "comment": "the abstract" } + ], + "argline": "LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract", + "sig": "LIBSSH2_SESSION *::unsigned char **::size_t *::const unsigned char *::size_t::void **", + "return": { + "type": "int", + "comment": " 0 for success, \n<\n 0 to indicate an error, > 0 to indicate\n no credential was acquired" + }, + "description": "

Callback for credential signing.

\n", + "comments": "" + }, + "git_commit_signing_cb": { + "type": "callback", + "file": "git2/deprecated.h", + "line": 285, + "lineto": 289, + "args": [ + { "name": "signature", "type": "git_buf *", "comment": null }, + { "name": "signature_field", "type": "git_buf *", "comment": null }, + { "name": "commit_content", "type": "const char *", "comment": null }, + { "name": "payload", "type": "void *", "comment": null } + ], + "argline": "git_buf *signature, git_buf *signature_field, const char *commit_content, void *payload", + "sig": "git_buf *::git_buf *::const char *::void *", + "return": { "type": "int", "comment": null }, + "description": "

Provide a commit signature during commit creation.

\n", + "comments": "

Callers should instead define a git_commit_create_cb that generates a commit buffer using git_commit_create_buffer, sign that buffer and call git_commit_create_with_signature.

\n" + }, + "git_headlist_cb": { + "type": "callback", + "file": "git2/deprecated.h", + "line": 967, + "lineto": 967, + "args": [ + { "name": "rhead", "type": "git_remote_head *", "comment": null }, + { "name": "payload", "type": "void *", "comment": null } + ], + "argline": "git_remote_head *rhead, void *payload", + "sig": "git_remote_head *::void *", + "return": { "type": "int", "comment": null }, + "description": "

Callback for listing the remote heads

\n", + "comments": "" + }, + "git_diff_notify_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 352, + "lineto": 356, + "args": [ + { + "name": "diff_so_far", + "type": "const git_diff *", + "comment": "the diff structure as it currently exists" + }, + { + "name": "delta_to_add", + "type": "const git_diff_delta *", + "comment": "the delta that is to be added" + }, + { + "name": "matched_pathspec", + "type": "const char *", + "comment": "the pathspec" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" + } + ], + "argline": "const git_diff *diff_so_far, const git_diff_delta *delta_to_add, const char *matched_pathspec, void *payload", + "sig": "const git_diff *::const git_diff_delta *::const char *::void *", + "return": { + "type": "int", + "comment": " 0 on success, 1 to skip this delta, or an error code" + }, + "description": "

Diff notification callback function.

\n", + "comments": "

The callback will be called for each file, just before the git_diff_delta gets inserted into the diff.

\n\n

When the callback: - returns < 0, the diff process will be aborted. - returns > 0, the delta will not be inserted into the diff, but the diff process continues. - returns 0, the delta is inserted into the diff, and the diff process continues.

\n" + }, + "git_diff_progress_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 369, + "lineto": 373, + "args": [ + { + "name": "diff_so_far", + "type": "const git_diff *", + "comment": "The diff being generated." + }, + { + "name": "old_path", + "type": "const char *", + "comment": "The path to the old file or NULL." + }, + { + "name": "new_path", + "type": "const char *", + "comment": "The path to the new file or NULL." + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" + } + ], + "argline": "const git_diff *diff_so_far, const char *old_path, const char *new_path, void *payload", + "sig": "const git_diff *::const char *::const char *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

Diff progress callback.

\n", + "comments": "

Called before each file comparison.

\n" + }, + "git_diff_file_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 504, + "lineto": 507, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "A pointer to the delta data for the file" + }, + { + "name": "progress", + "type": "float", + "comment": "Goes from 0 to 1 over the diff" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified pointer from foreach function" + } + ], + "argline": "const git_diff_delta *delta, float progress, void *payload", + "sig": "const git_diff_delta *::float::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made per file.

\n", + "comments": "" + }, + "git_diff_binary_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 576, + "lineto": 579, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "the delta" + }, + { + "name": "binary", + "type": "const git_diff_binary *", + "comment": "the binary content" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" + } + ], + "argline": "const git_diff_delta *delta, const git_diff_binary *binary, void *payload", + "sig": "const git_diff_delta *::const git_diff_binary *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made for\n binary content within the diff.

\n", + "comments": "" + }, + "git_diff_hunk_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 607, + "lineto": 610, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "the delta" + }, + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": "the hunk" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" + } + ], + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made per hunk.

\n", + "comments": "" + }, + "git_diff_line_cb": { + "type": "callback", + "file": "git2/diff.h", + "line": 674, + "lineto": 678, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "the delta that contains the line" + }, + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": "the hunk that contains the line" + }, + { + "name": "line", + "type": "const git_diff_line *", + "comment": "the line in the diff" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified callback payload" + } + ], + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", + "return": { "type": "int", "comment": " 0 or an error code" }, + "description": "

When iterating over a diff, callback that will be made per text diff\n line. In this context, the provided range will be NULL.

\n", + "comments": "

When printing a diff, callback that will be made to output each line of text. This uses some extra GIT_DIFF_LINE_... constants for output of lines of file and hunk headers.

\n" + }, + "git_index_matched_path_cb": { + "type": "callback", + "file": "git2/index.h", + "line": 158, + "lineto": 159, + "args": [ + { "name": "path", "type": "const char *", "comment": "the path" }, + { + "name": "matched_pathspec", + "type": "const char *", + "comment": "the given pathspec" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified payload" + } + ], + "argline": "const char *path, const char *matched_pathspec, void *payload", + "sig": "const char *::const char *::void *", + "return": { + "type": "int", + "comment": " 0 to continue with the index operation, positive number to skip this file for the index operation, negative number on failure" + }, + "description": "

Callback for APIs that add/remove/update files matching pathspec

\n", + "comments": "" + }, + "git_indexer_progress_cb": { + "type": "callback", + "file": "git2/indexer.h", + "line": 68, + "lineto": 68, + "args": [ + { + "name": "stats", + "type": "const git_indexer_progress *", + "comment": "Structure containing information about the state of the transfer" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by caller" + } + ], + "argline": "const git_indexer_progress *stats, void *payload", + "sig": "const git_indexer_progress *::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Type for progress callbacks during indexing. Return a value less\n than zero to cancel the indexing or download.

\n", + "comments": "" + }, + "git_note_foreach_cb": { + "type": "callback", + "file": "git2/notes.h", + "line": 29, + "lineto": 32, + "args": [ + { + "name": "blob_id", + "type": "const git_oid *", + "comment": "object id of the blob containing the message" + }, + { + "name": "annotated_object_id", + "type": "const git_oid *", + "comment": "the id of the object being annotated" + }, + { + "name": "payload", + "type": "void *", + "comment": "user-specified data to the foreach function" + } + ], + "argline": "const git_oid *blob_id, const git_oid *annotated_object_id, void *payload", + "sig": "const git_oid *::const git_oid *::void *", + "return": { + "type": "int", + "comment": " 0 on success, or a negative number on failure" + }, + "description": "

Callback for git_note_foreach.

\n", + "comments": "" + }, + "git_odb_foreach_cb": { + "type": "callback", + "file": "git2/odb.h", + "line": 43, + "lineto": 43, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": "an id of an object in the object database" + }, + { + "name": "payload", + "type": "void *", + "comment": "the payload from the initial call to git_odb_foreach" + } + ], + "argline": "const git_oid *id, void *payload", + "sig": "const git_oid *::void *", + "return": { "type": "int", "comment": " 0 on success, or an error code" }, + "description": "

Function type for callbacks from git_odb_foreach.

\n", + "comments": "" + }, + "git_packbuilder_foreach_cb": { + "type": "callback", + "file": "git2/pack.h", + "line": 208, + "lineto": 208, + "args": [ + { + "name": "buf", + "type": "void *", + "comment": "A pointer to the object's data" + }, + { + "name": "size", + "type": "size_t", + "comment": "The size of the underlying object" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_packbuilder_foreach" + } + ], + "argline": "void *buf, size_t size, void *payload", + "sig": "void *::size_t::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over packed objects

\n", + "comments": "" + }, + "git_packbuilder_progress": { + "type": "callback", + "file": "git2/pack.h", + "line": 245, + "lineto": 249, + "args": [ + { + "name": "stage", + "type": "int", + "comment": "the stage of the packbuilder" + }, + { + "name": "current", + "type": "uint32_t", + "comment": "the current object" + }, + { + "name": "total", + "type": "uint32_t", + "comment": "the total number of objects" + }, + { + "name": "payload", + "type": "void *", + "comment": "the callback payload" + } + ], + "argline": "int stage, uint32_t current, uint32_t total, void *payload", + "sig": "int::uint32_t::uint32_t::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Packbuilder progress notification function.

\n", + "comments": "" + }, + "git_reference_foreach_cb": { + "type": "callback", + "file": "git2/refs.h", + "line": 439, + "lineto": 439, + "args": [ + { + "name": "reference", + "type": "git_reference *", + "comment": "The reference object" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_reference_foreach" + } + ], + "argline": "git_reference *reference, void *payload", + "sig": "git_reference *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over references

\n", + "comments": "" + }, + "git_reference_foreach_name_cb": { + "type": "callback", + "file": "git2/refs.h", + "line": 450, + "lineto": 450, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "The reference name" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_reference_foreach_name" + } + ], + "argline": "const char *name, void *payload", + "sig": "const char *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over reference names

\n", + "comments": "" + }, + "git_push_transfer_progress_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 481, + "lineto": 485, + "args": [ + { + "name": "current", + "type": "unsigned int", + "comment": "The number of objects pushed so far" + }, + { + "name": "total", + "type": "unsigned int", + "comment": "The total number of objects to push" + }, + { + "name": "bytes", + "type": "size_t", + "comment": "The number of bytes pushed" + }, + { + "name": "payload", + "type": "void *", + "comment": "The user-specified payload callback" + } + ], + "argline": "unsigned int current, unsigned int total, size_t bytes, void *payload", + "sig": "unsigned int::unsigned int::size_t::void *", + "return": { + "type": "int", + "comment": " 0 or an error code to stop the transfer" + }, + "description": "

Push network progress notification callback.

\n", + "comments": "" + }, + "git_push_negotiation": { + "type": "callback", + "file": "git2/remote.h", + "line": 518, + "lineto": 521, + "args": [ + { + "name": "updates", + "type": "const git_push_update **", + "comment": "an array containing the updates which will be sent\n as commands to the destination." + }, + { + "name": "len", + "type": "size_t", + "comment": "number of elements in `updates`" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "const git_push_update **updates, size_t len, void *payload", + "sig": "const git_push_update **::size_t::void *", + "return": { + "type": "int", + "comment": " 0 or an error code to stop the push" + }, + "description": "

Callback used to inform of upcoming updates.

\n", + "comments": "" + }, + "git_push_update_reference_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 535, + "lineto": 535, + "args": [ + { + "name": "refname", + "type": "const char *", + "comment": "refname specifying to the remote ref" + }, + { + "name": "status", + "type": "const char *", + "comment": "status message sent from the remote" + }, + { + "name": "data", + "type": "void *", + "comment": "data provided by the caller" + } + ], + "argline": "const char *refname, const char *status, void *data", + "sig": "const char *::const char *::void *", + "return": { + "type": "int", + "comment": " 0 on success, otherwise an error" + }, + "description": "

Callback used to inform of the update status from the remote.

\n", + "comments": "

Called for each updated reference on push. If status is not NULL, the update was rejected by the remote server and status contains the reason given.

\n" + }, + "git_url_resolve_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 551, + "lineto": 551, + "args": [ + { + "name": "url_resolved", + "type": "git_buf *", + "comment": "The buffer to write the resolved URL to" + }, + { + "name": "url", + "type": "const char *", + "comment": "The URL to resolve" + }, + { + "name": "direction", + "type": "int", + "comment": "GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "git_buf *url_resolved, const char *url, int direction, void *payload", + "sig": "git_buf *::const char *::int::void *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_PASSTHROUGH or an error\n " + }, + "description": "

Callback to resolve URLs before connecting to remote

\n", + "comments": "

If you return GIT_PASSTHROUGH, you don't need to write anything to url_resolved.

\n" + }, + "git_remote_ready_cb": { + "type": "callback", + "file": "git2/remote.h", + "line": 564, + "lineto": 564, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "The remote to be connected" + }, + { + "name": "direction", + "type": "int", + "comment": "GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "git_remote *remote, int direction, void *payload", + "sig": "git_remote *::int::void *", + "return": { "type": "int", "comment": " 0 on success, or an error" }, + "description": "

Callback invoked immediately before we attempt to connect to the\n given url. Callers may change the URL before the connection by\n calling git_remote_set_instance_url in the callback.

\n", + "comments": "" + }, + "git_repository_fetchhead_foreach_cb": { + "type": "callback", + "file": "git2/repository.h", + "line": 746, + "lineto": 750, + "args": [ + { + "name": "ref_name", + "type": "const char *", + "comment": "The reference name" + }, + { + "name": "remote_url", + "type": "const char *", + "comment": "The remote URL" + }, + { + "name": "oid", + "type": "const git_oid *", + "comment": "The reference target OID" + }, + { + "name": "is_merge", + "type": "unsigned int", + "comment": "Was the reference the result of a merge" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_repository_fetchhead_foreach" + } + ], + "argline": "const char *ref_name, const char *remote_url, const git_oid *oid, unsigned int is_merge, void *payload", + "sig": "const char *::const char *::const git_oid *::unsigned int::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over each FETCH_HEAD entry

\n", + "comments": "" + }, + "git_repository_mergehead_foreach_cb": { + "type": "callback", + "file": "git2/repository.h", + "line": 777, + "lineto": 778, + "args": [ + { + "name": "oid", + "type": "const git_oid *", + "comment": "The merge OID" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_repository_mergehead_foreach" + } + ], + "argline": "const git_oid *oid, void *payload", + "sig": "const git_oid *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over each MERGE_HEAD entry

\n", + "comments": "" + }, + "git_revwalk_hide_cb": { + "type": "callback", + "file": "git2/revwalk.h", + "line": 283, + "lineto": 285, + "args": [ + { + "name": "commit_id", + "type": "const git_oid *", + "comment": "oid of Commit" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified pointer to data to be passed as data payload" + } + ], + "argline": "const git_oid *commit_id, void *payload", + "sig": "const git_oid *::void *", + "return": { + "type": "int", + "comment": " non-zero to hide the commmit and it parent." + }, + "description": "

This is a callback function that user can provide to hide a\n commit and its parents. If the callback function returns non-zero value,\n then this commit and its parents will be hidden.

\n", + "comments": "" + }, + "git_stash_apply_progress_cb": { + "type": "callback", + "file": "git2/stash.h", + "line": 181, + "lineto": 183, + "args": [ + { + "name": "progress", + "type": "git_stash_apply_progress_t", + "comment": "the progress information" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified payload to the apply function" + } + ], + "argline": "git_stash_apply_progress_t progress, void *payload", + "sig": "git_stash_apply_progress_t::void *", + "return": { "type": "int", "comment": " 0 on success, -1 on error" }, + "description": "

Stash application progress notification function.\n Return 0 to continue processing, or a negative value to\n abort the stash application.

\n", + "comments": "" + }, + "git_stash_cb": { + "type": "callback", + "file": "git2/stash.h", + "line": 268, + "lineto": 272, + "args": [ + { + "name": "index", + "type": "size_t", + "comment": "The position within the stash list. 0 points to the\n most recent stashed state." + }, + { + "name": "message", + "type": "const char *", + "comment": "The stash message." + }, + { + "name": "stash_id", + "type": "const git_oid *", + "comment": "The commit oid of the stashed state." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra parameter to callback function." + } + ], + "argline": "size_t index, const char *message, const git_oid *stash_id, void *payload", + "sig": "size_t::const char *::const git_oid *::void *", + "return": { + "type": "int", + "comment": " 0 to continue iterating or non-zero to stop." + }, + "description": "

This is a callback function you can provide to iterate over all the\n stashed states that will be invoked per entry.

\n", + "comments": "" + }, + "git_status_cb": { + "type": "callback", + "file": "git2/status.h", + "line": 62, + "lineto": 63, + "args": [ + { + "name": "path", + "type": "const char *", + "comment": "is the path to the file" + }, + { + "name": "status_flags", + "type": "unsigned int", + "comment": "the `git_status_t` values for file's status" + }, + { + "name": "payload", + "type": "void *", + "comment": "the user-specified payload to the foreach function" + } + ], + "argline": "const char *path, unsigned int status_flags, void *payload", + "sig": "const char *::unsigned int::void *", + "return": { + "type": "int", + "comment": " 0 on success, or a negative number on failure" + }, + "description": "

Function pointer to receive status on individual files

\n", + "comments": "" + }, + "git_submodule_cb": { + "type": "callback", + "file": "git2/submodule.h", + "line": 125, + "lineto": 126, + "args": [ + { + "name": "sm", + "type": "git_submodule *", + "comment": "git_submodule currently being visited" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the submodule" + }, + { + "name": "payload", + "type": "void *", + "comment": "value you passed to the foreach function as payload" + } + ], + "argline": "git_submodule *sm, const char *name, void *payload", + "sig": "git_submodule *::const char *::void *", + "return": { "type": "int", "comment": " 0 on success or error code" }, + "description": "

Function pointer to receive each submodule

\n", + "comments": "" + }, + "git_tag_foreach_cb": { + "type": "callback", + "file": "git2/tag.h", + "line": 330, + "lineto": 330, + "args": [ + { "name": "name", "type": "const char *", "comment": "The tag name" }, + { "name": "oid", "type": "git_oid *", "comment": "The tag's OID" }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to git_tag_foreach" + } + ], + "argline": "const char *name, git_oid *oid, void *payload", + "sig": "const char *::git_oid *::void *", + "return": { + "type": "int", + "comment": " non-zero to terminate the iteration" + }, + "description": "

Callback used to iterate over tag names

\n", + "comments": "" + }, + "git_trace_cb": { + "type": "callback", + "file": "git2/trace.h", + "line": 55, + "lineto": 57, + "args": [ + { + "name": "level", + "type": "git_trace_level_t", + "comment": "the trace level" + }, + { + "name": "msg", + "type": "const char *", + "comment": "the trace message" + } + ], + "argline": "git_trace_level_t level, const char *msg", + "sig": "git_trace_level_t::const char *", + "return": { "type": "void", "comment": null }, + "description": "

An instance for a tracing function

\n", + "comments": "" + }, + "git_transport_message_cb": { + "type": "callback", + "file": "git2/transport.h", + "line": 35, + "lineto": 35, + "args": [ + { + "name": "str", + "type": "const char *", + "comment": "The message from the transport" + }, + { + "name": "len", + "type": "int", + "comment": "The length of the message" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "const char *str, int len, void *payload", + "sig": "const char *::int::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Callback for messages received by the transport.

\n", + "comments": "

Return a negative value to cancel the network operation.

\n" + }, + "git_transport_cb": { + "type": "callback", + "file": "git2/transport.h", + "line": 45, + "lineto": 45, + "args": [ + { + "name": "out", + "type": "git_transport **", + "comment": "the transport generate" + }, + { + "name": "owner", + "type": "git_remote *", + "comment": "the owner for the transport" + }, + { + "name": "param", + "type": "void *", + "comment": "the param to the transport creation" + } + ], + "argline": "git_transport **out, git_remote *owner, void *param", + "sig": "git_transport **::git_remote *::void *", + "return": { "type": "int", "comment": " 0 on success or an error code" }, + "description": "

Signature of a function which creates a transport.

\n", + "comments": "" + }, + "git_treebuilder_filter_cb": { + "type": "callback", + "file": "git2/tree.h", + "line": 353, + "lineto": 354, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "the tree entry for the callback to examine" + }, + { + "name": "payload", + "type": "void *", + "comment": "the payload from the caller" + } + ], + "argline": "const git_tree_entry *entry, void *payload", + "sig": "const git_tree_entry *::void *", + "return": { + "type": "int", + "comment": " 0 to do nothing, non-zero to remove the entry" + }, + "description": "

Callback for git_treebuilder_filter

\n", + "comments": "

The return value is treated as a boolean, with zero indicating that the entry should be left alone and any non-zero value meaning that the entry should be removed from the treebuilder list (i.e. filtered out).

\n" + }, + "git_treewalk_cb": { + "type": "callback", + "file": "git2/tree.h", + "line": 394, + "lineto": 395, + "args": [ + { + "name": "root", + "type": "const char *", + "comment": "the current (relative) root to the entry" + }, + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": "the tree entry" + }, + { + "name": "payload", + "type": "void *", + "comment": "the caller-provided callback payload" + } + ], + "argline": "const char *root, const git_tree_entry *entry, void *payload", + "sig": "const char *::const git_tree_entry *::void *", + "return": { + "type": "int", + "comment": " a positive value to skip the entry, a negative value to stop the walk" + }, + "description": "

Callback for the tree traversal method.

\n", + "comments": "" + } + }, + "globals": {}, + "types": [ + [ + "git_annotated_commit", + { + "decl": "git_annotated_commit", + "type": "struct", + "value": "git_annotated_commit", + "file": "git2/types.h", + "line": 214, + "lineto": 214, + "tdef": "typedef", + "description": " Annotated commits are commits with additional metadata about how the\n commit was resolved, which can be used for maintaining the user's\n \"intent\" through commands like merge and rebase.", + "comments": "

For example, if a user wants to conceptually "merge HEAD", then the commit portion of an annotated commit will point to the HEAD commit, but the annotation will denote the ref HEAD. This allows git to perform the internal bookkeeping so that the system knows both the content of what is being merged but also how the content was looked up so that it can be recorded in the reflog appropriately.

\n", + "used": { + "returns": [], + "needs": [ + "git_annotated_commit_free", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_lookup", + "git_annotated_commit_ref", + "git_branch_create_from_annotated", + "git_merge", + "git_merge_analysis", + "git_merge_analysis_for_ref", + "git_rebase_init", + "git_repository_set_head_detached_from_annotated", + "git_reset_from_annotated" + ] + } + } + ], + [ + "git_apply_flags_t", + { + "decl": ["GIT_APPLY_CHECK"], + "type": "enum", + "file": "git2/apply.h", + "line": 72, + "lineto": 78, + "block": "GIT_APPLY_CHECK", + "tdef": "typedef", + "description": " Flags controlling the behavior of `git_apply`.", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the hunk will not be applied, but the apply process continues - returns 0, the hunk is applied, and the apply process continues.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_APPLY_CHECK", + "comments": "

Don't actually make changes, just test that the patch applies.\n This is the equivalent of git apply --check.

\n", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_apply_location_t", + { + "decl": [ + "GIT_APPLY_LOCATION_WORKDIR", + "GIT_APPLY_LOCATION_INDEX", + "GIT_APPLY_LOCATION_BOTH" + ], + "type": "enum", + "file": "git2/apply.h", + "line": 148, + "lineto": 166, + "block": "GIT_APPLY_LOCATION_WORKDIR\nGIT_APPLY_LOCATION_INDEX\nGIT_APPLY_LOCATION_BOTH", + "tdef": "typedef", + "description": " Possible application locations for git_apply ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_APPLY_LOCATION_WORKDIR", + "comments": "

Apply the patch to the workdir, leaving the index untouched.\n This is the equivalent of git apply with no location argument.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_APPLY_LOCATION_INDEX", + "comments": "

Apply the patch to the index, leaving the working directory\n untouched. This is the equivalent of git apply --cached.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_APPLY_LOCATION_BOTH", + "comments": "

Apply the patch to both the working directory and the index.\n This is the equivalent of git apply --index.

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": ["git_apply"] } + } + ], + [ + "git_apply_options", + { + "decl": [ + "unsigned int version", + "git_apply_delta_cb delta_cb", + "git_apply_hunk_cb hunk_cb", + "void * payload", + "unsigned int flags" + ], + "type": "struct", + "value": "git_apply_options", + "file": "git2/apply.h", + "line": 95, + "lineto": 109, + "block": "unsigned int version\ngit_apply_delta_cb delta_cb\ngit_apply_hunk_cb hunk_cb\nvoid * payload\nunsigned int flags", + "tdef": "typedef", + "description": " Apply options structure.", + "comments": "

When the callback: - returns < 0, the apply process will be aborted. - returns > 0, the hunk will not be applied, but the apply process continues - returns 0, the hunk is applied, and the apply process continues.

\n\n

Initialize with GIT_APPLY_OPTIONS_INIT. Alternatively, you can use git_apply_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "git_apply_delta_cb", + "name": "delta_cb", + "comments": " When applying a patch, callback that will be made per delta (file). " + }, + { + "type": "git_apply_hunk_cb", + "name": "hunk_cb", + "comments": " When applying a patch, callback that will be made per hunk. " + }, + { + "type": "void *", + "name": "payload", + "comments": " Payload passed to both `delta_cb` \n&\n `hunk_cb`. " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " Bitmask of `git_apply_flags_t` " + } + ], + "used": { + "returns": [], + "needs": ["git_apply", "git_apply_options_init", "git_apply_to_tree"] + } + } + ], + [ + "git_attr_options", + { + "decl": [ + "unsigned int version", + "unsigned int flags", + "git_oid * commit_id", + "git_oid attr_commit_id" + ], + "type": "struct", + "value": "git_attr_options", + "file": "git2/attr.h", + "line": 154, + "lineto": 171, + "block": "unsigned int version\nunsigned int flags\ngit_oid * commit_id\ngit_oid attr_commit_id", + "tdef": "typedef", + "description": " An options structure for querying attributes.", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "flags", + "comments": " A combination of GIT_ATTR_CHECK flags " + }, + { "type": "git_oid *", "name": "commit_id", "comments": "" }, + { + "type": "git_oid", + "name": "attr_commit_id", + "comments": " The commit to load attributes from, when\n `GIT_ATTR_CHECK_INCLUDE_COMMIT` is specified." + } + ], + "used": { + "returns": [], + "needs": [ + "git_attr_foreach_ext", + "git_attr_get_ext", + "git_attr_get_many_ext" + ] + } + } + ], + [ + "git_attr_value_t", + { + "decl": [ + "GIT_ATTR_VALUE_UNSPECIFIED", + "GIT_ATTR_VALUE_TRUE", + "GIT_ATTR_VALUE_FALSE", + "GIT_ATTR_VALUE_STRING" + ], + "type": "enum", + "file": "git2/attr.h", + "line": 86, + "lineto": 91, + "block": "GIT_ATTR_VALUE_UNSPECIFIED\nGIT_ATTR_VALUE_TRUE\nGIT_ATTR_VALUE_FALSE\nGIT_ATTR_VALUE_STRING", + "tdef": "typedef", + "description": " Possible states for an attribute", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_ATTR_VALUE_UNSPECIFIED", + "comments": "

The attribute has been left unspecified

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_ATTR_VALUE_TRUE", + "comments": "

The attribute has been set

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_ATTR_VALUE_FALSE", + "comments": "

The attribute has been unset

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_ATTR_VALUE_STRING", + "comments": "

This attribute has a value

\n", + "value": 3 + } + ], + "used": { "returns": ["git_attr_value"], "needs": [] } + } + ], + [ + "git_blame", + { + "decl": "git_blame", + "type": "struct", + "value": "git_blame", + "file": "git2/blame.h", + "line": 236, + "lineto": 236, + "tdef": "typedef", + "description": " Opaque structure to hold blame results ", + "comments": "", + "used": { + "returns": [ + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_line_byindex" + ], + "needs": [ + "git_blame_buffer", + "git_blame_free", + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_get_hunk_count", + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_hunkcount", + "git_blame_init_options", + "git_blame_line_byindex", + "git_blame_linecount", + "git_blame_options_init" + ] + } + } + ], + [ + "git_blame_flag_t", + { + "decl": [ + "GIT_BLAME_NORMAL", + "GIT_BLAME_TRACK_COPIES_SAME_FILE", + "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES", + "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", + "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", + "GIT_BLAME_FIRST_PARENT", + "GIT_BLAME_USE_MAILMAP", + "GIT_BLAME_IGNORE_WHITESPACE" + ], + "type": "enum", + "file": "git2/blame.h", + "line": 31, + "lineto": 82, + "block": "GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT\nGIT_BLAME_USE_MAILMAP\nGIT_BLAME_IGNORE_WHITESPACE", + "tdef": "typedef", + "description": " Flags for indicating option behavior for git_blame APIs.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_BLAME_NORMAL", + "comments": "

Normal blame, the default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_SAME_FILE", + "comments": "

Track lines that have moved within a file (like git blame -M).

\n\n

This is not yet implemented and reserved for future use.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES", + "comments": "

Track lines that have moved across files in the same commit\n (like git blame -C).

\n\n

This is not yet implemented and reserved for future use.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", + "comments": "

Track lines that have been copied from another file that exists\n in the same commit (like git blame -CC). Implies SAME_FILE.

\n\n

This is not yet implemented and reserved for future use.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", + "comments": "

Track lines that have been copied from another file that exists in\n any commit (like git blame -CCC). Implies SAME_COMMIT_COPIES.

\n\n

This is not yet implemented and reserved for future use.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_BLAME_FIRST_PARENT", + "comments": "

Restrict the search of commits to those reachable following only\n the first parents.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_BLAME_USE_MAILMAP", + "comments": "

Use mailmap file to map author and committer names and email\n addresses to canonical real names and email addresses. The\n mailmap will be read from the working directory, or HEAD in a\n bare repository.

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_BLAME_IGNORE_WHITESPACE", + "comments": "

Ignore whitespace differences

\n", + "value": 64 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_blame_line", + { + "decl": ["const char * ptr", "size_t len"], + "type": "struct", + "value": "git_blame_line", + "file": "git2/blame.h", + "line": 230, + "lineto": 233, + "block": "const char * ptr\nsize_t len", + "tdef": "typedef", + "description": " Structure that represents a line in a blamed file.", + "comments": "", + "fields": [ + { "type": "const char *", "name": "ptr", "comments": "" }, + { "type": "size_t", "name": "len", "comments": "" } + ], + "used": { "returns": ["git_blame_line_byindex"], "needs": [] } + } + ], + [ + "git_blame_options", + { + "decl": [ + "unsigned int version", + "unsigned int flags", + "uint16_t min_match_characters", + "git_oid newest_commit", + "git_oid oldest_commit", + "size_t min_line", + "size_t max_line" + ], + "type": "struct", + "value": "git_blame_options", + "file": "git2/blame.h", + "line": 91, + "lineto": 128, + "block": "unsigned int version\nunsigned int flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nsize_t min_line\nsize_t max_line", + "tdef": "typedef", + "description": " Blame options structure", + "comments": "

Initialize with GIT_BLAME_OPTIONS_INIT. Alternatively, you can use git_blame_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "flags", + "comments": " A combination of `git_blame_flag_t` " + }, + { + "type": "uint16_t", + "name": "min_match_characters", + "comments": " The lower bound on the number of alphanumeric characters that\n must be detected as moving/copying within a file for it to\n associate those lines with the parent commit. The default value\n is 20.\n\n This value only takes effect if any of the `GIT_BLAME_TRACK_COPIES_*`\n flags are specified." + }, + { + "type": "git_oid", + "name": "newest_commit", + "comments": " The id of the newest commit to consider. The default is HEAD. " + }, + { + "type": "git_oid", + "name": "oldest_commit", + "comments": " The id of the oldest commit to consider.\n The default is the first commit encountered with a NULL parent." + }, + { + "type": "size_t", + "name": "min_line", + "comments": " The first line in the file to blame.\n The default is 1 (line numbers start with 1)." + }, + { + "type": "size_t", + "name": "max_line", + "comments": " The last line in the file to blame.\n The default is the last line of the file." + } + ], + "used": { + "returns": [], + "needs": ["git_blame_init_options", "git_blame_options_init"] + } + } + ], + [ + "git_blob", + { + "decl": "git_blob", + "type": "struct", + "value": "git_blob", + "file": "git2/types.h", + "line": 138, + "lineto": 138, + "tdef": "typedef", + "description": " In-memory representation of a blob object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_blob_dup", + "git_blob_filter", + "git_blob_filter_options_init", + "git_blob_filtered_content", + "git_blob_free", + "git_blob_id", + "git_blob_is_binary", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_blob_owner", + "git_blob_rawcontent", + "git_blob_rawsize", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_filter_list_apply_to_blob", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_blob", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs" + ] + } + } + ], + [ + "git_blob_filter_flag_t", + { + "decl": [ + "GIT_BLOB_FILTER_CHECK_FOR_BINARY", + "GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES", + "GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD", + "GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT" + ], + "type": "enum", + "file": "git2/blob.h", + "line": 111, + "lineto": 132, + "block": "GIT_BLOB_FILTER_CHECK_FOR_BINARY\nGIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES\nGIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD\nGIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT", + "tdef": "typedef", + "description": " Flags to control the functionality of `git_blob_filter`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_BLOB_FILTER_CHECK_FOR_BINARY", + "comments": "

When set, filters will not be applied to binary files.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES", + "comments": "

When set, filters will not load configuration from the\n system-wide gitattributes in /etc (or system equivalent).

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD", + "comments": "

When set, filters will be loaded from a .gitattributes file\n in the HEAD commit.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT", + "comments": "

When set, filters will be loaded from a .gitattributes file\n in the specified commit.

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_blob_filter_options", + { + "decl": [ + "int version", + "uint32_t flags", + "git_oid * commit_id", + "git_oid attr_commit_id" + ], + "type": "struct", + "value": "git_blob_filter_options", + "file": "git2/blob.h", + "line": 144, + "lineto": 176, + "block": "int version\nuint32_t flags\ngit_oid * commit_id\ngit_oid attr_commit_id", + "tdef": "typedef", + "description": " The options used when applying filter options to a file.", + "comments": "

Initialize with GIT_BLOB_FILTER_OPTIONS_INIT. Alternatively, you can use git_blob_filter_options_init.

\n\n

[version] GIT_BLOB_FILTER_OPTIONS_VERSION [init_macro] GIT_BLOB_FILTER_OPTIONS_INIT [init_function] git_blob_filter_options_init

\n", + "fields": [ + { + "type": "int", + "name": "version", + "comments": " Version number of the options structure. " + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Flags to control the filtering process, see `git_blob_filter_flag_t` above.\n\n \n\n[flags] git_blob_filter_flag_t" + }, + { + "type": "git_oid *", + "name": "commit_id", + "comments": " This value is unused and reserved for API compatibility.\n\n " + }, + { + "type": "git_oid", + "name": "attr_commit_id", + "comments": " The commit to load attributes from, when\n `GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT` is specified." + } + ], + "used": { + "returns": [], + "needs": ["git_blob_filter", "git_blob_filter_options_init"] + } + } + ], + [ + "git_branch_iterator", + { + "decl": "git_branch_iterator", + "type": "struct", + "value": "git_branch_iterator", + "file": "git2/branch.h", + "line": 97, + "lineto": 97, + "tdef": "typedef", + "description": " Iterator type for branches ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_branch_iterator_free", + "git_branch_iterator_new", + "git_branch_next" + ] + } + } + ], + [ + "git_branch_t", + { + "decl": ["GIT_BRANCH_LOCAL", "GIT_BRANCH_REMOTE", "GIT_BRANCH_ALL"], + "type": "enum", + "file": "git2/types.h", + "line": 231, + "lineto": 235, + "block": "GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE\nGIT_BRANCH_ALL", + "tdef": "typedef", + "description": " Basic type of any Git branch. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_BRANCH_LOCAL", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_BRANCH_REMOTE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_BRANCH_ALL", + "comments": "", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [ + "git_branch_iterator_new", + "git_branch_lookup", + "git_branch_next" + ] + } + } + ], + [ + "git_buf", + { + "decl": ["char * ptr", "size_t reserved", "size_t size"], + "type": "struct", + "value": "git_buf", + "file": "git2/buffer.h", + "line": 36, + "lineto": 55, + "block": "char * ptr\nsize_t reserved\nsize_t size", + "tdef": "typedef", + "description": " A data buffer for exporting data from libgit2", + "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the caller and have the caller take responsibility for freeing that memory. To make ownership clear in these cases, libgit2 uses git_buf to return this data. Callers should use git_buf_dispose() to release the memory when they are done.

\n\n

A git_buf contains a pointer to a NUL-terminated C string, and the length of the string (not including the NUL terminator).

\n", + "fields": [ + { + "type": "char *", + "name": "ptr", + "comments": " The buffer contents. `ptr` points to the start of the buffer\n being returned. The buffer's length (in bytes) is specified\n by the `size` member of the structure, and contains a NUL\n terminator at position `(size + 1)`." + }, + { + "type": "size_t", + "name": "reserved", + "comments": " This field is reserved and unused." + }, + { + "type": "size_t", + "name": "size", + "comments": " The length (in bytes) of the buffer pointed to by `ptr`,\n not including a NUL terminator." + } + ], + "used": { + "returns": [], + "needs": [ + "git_blob_filter", + "git_blob_filtered_content", + "git_branch_remote_name", + "git_branch_upstream_merge", + "git_branch_upstream_name", + "git_branch_upstream_remote", + "git_buf_contains_nul", + "git_buf_dispose", + "git_buf_free", + "git_buf_grow", + "git_buf_is_binary", + "git_buf_set", + "git_commit_create_buffer", + "git_commit_extract_signature", + "git_commit_header_field", + "git_commit_signing_cb", + "git_config_find_global", + "git_config_find_programdata", + "git_config_find_system", + "git_config_find_xdg", + "git_config_get_path", + "git_config_get_string_buf", + "git_config_parse_path", + "git_describe_format", + "git_diff_commit_as_email", + "git_diff_format_email", + "git_diff_stats_to_buf", + "git_diff_to_buf", + "git_email_create_from_commit", + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_stream_data", + "git_message_prettify", + "git_object_short_id", + "git_packbuilder_write_buf", + "git_patch_to_buf", + "git_refspec_rtransform", + "git_refspec_transform", + "git_remote_default_branch", + "git_repository_discover", + "git_repository_item_path", + "git_repository_message", + "git_submodule_resolve_url", + "git_treebuilder_write_with_buffer", + "git_url_resolve_cb", + "git_worktree_is_locked" + ] + } + } + ], + [ + "git_cert", + { + "decl": "git_cert", + "type": "struct", + "value": "git_cert", + "file": "git2/types.h", + "line": 278, + "lineto": 278, + "block": "git_cert_t cert_type", + "tdef": "typedef", + "description": " Parent type for `git_cert_hostkey` and `git_cert_x509`.", + "comments": "", + "fields": [ + { + "type": "git_cert_t", + "name": "cert_type", + "comments": " Type of certificate. A `GIT_CERT_` value." + } + ], + "used": { + "returns": [], + "needs": ["git_transport_certificate_check_cb"] + } + } + ], + [ + "git_cert_hostkey", + { + "decl": [ + "git_cert parent", + "git_cert_ssh_t type", + "unsigned char [16] hash_md5", + "unsigned char [20] hash_sha1", + "unsigned char [32] hash_sha256", + "git_cert_ssh_raw_type_t raw_type", + "const char * hostkey", + "size_t hostkey_len" + ], + "type": "struct", + "value": "git_cert_hostkey", + "file": "git2/cert.h", + "line": 108, + "lineto": 151, + "block": "git_cert parent\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1\nunsigned char [32] hash_sha256\ngit_cert_ssh_raw_type_t raw_type\nconst char * hostkey\nsize_t hostkey_len", + "tdef": "typedef", + "description": " Hostkey information taken from libssh2", + "comments": "", + "fields": [ + { + "type": "git_cert", + "name": "parent", + "comments": " The parent cert " + }, + { + "type": "git_cert_ssh_t", + "name": "type", + "comments": " A bitmask containing the available fields." + }, + { + "type": "unsigned char [16]", + "name": "hash_md5", + "comments": " Hostkey hash. If `type` has `GIT_CERT_SSH_MD5` set, this will\n have the MD5 hash of the hostkey." + }, + { + "type": "unsigned char [20]", + "name": "hash_sha1", + "comments": " Hostkey hash. If `type` has `GIT_CERT_SSH_SHA1` set, this will\n have the SHA-1 hash of the hostkey." + }, + { + "type": "unsigned char [32]", + "name": "hash_sha256", + "comments": " Hostkey hash. If `type` has `GIT_CERT_SSH_SHA256` set, this will\n have the SHA-256 hash of the hostkey." + }, + { + "type": "git_cert_ssh_raw_type_t", + "name": "raw_type", + "comments": " Raw hostkey type. If `type` has `GIT_CERT_SSH_RAW` set, this will\n have the type of the raw hostkey." + }, + { + "type": "const char *", + "name": "hostkey", + "comments": " Pointer to the raw hostkey. If `type` has `GIT_CERT_SSH_RAW` set,\n this will have the raw contents of the hostkey." + }, + { + "type": "size_t", + "name": "hostkey_len", + "comments": " Raw hostkey length. If `type` has `GIT_CERT_SSH_RAW` set, this will\n have the length of the raw contents of the hostkey." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_cert_ssh_t", + { + "decl": [ + "GIT_CERT_SSH_MD5", + "GIT_CERT_SSH_SHA1", + "GIT_CERT_SSH_SHA256", + "GIT_CERT_SSH_RAW" + ], + "type": "enum", + "file": "git2/cert.h", + "line": 77, + "lineto": 86, + "block": "GIT_CERT_SSH_MD5\nGIT_CERT_SSH_SHA1\nGIT_CERT_SSH_SHA256\nGIT_CERT_SSH_RAW", + "tdef": "typedef", + "description": " Type of SSH host fingerprint", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CERT_SSH_MD5", + "comments": "

MD5 is available

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CERT_SSH_SHA1", + "comments": "

SHA-1 is available

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CERT_SSH_SHA256", + "comments": "

SHA-256 is available

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CERT_SSH_RAW", + "comments": "

Raw hostkey is available

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_cert_t", + { + "decl": [ + "GIT_CERT_NONE", + "GIT_CERT_X509", + "GIT_CERT_HOSTKEY_LIBSSH2", + "GIT_CERT_STRARRAY" + ], + "type": "enum", + "file": "git2/cert.h", + "line": 25, + "lineto": 48, + "block": "GIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY\nGIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY", + "tdef": "typedef", + "description": " Type of host certificate structure that is passed to the check callback", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CERT_NONE", + "comments": "

No information about the certificate is available. This may\n happen when using curl.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CERT_X509", + "comments": "

The data argument to the callback will be a pointer to\n the DER-encoded data.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CERT_HOSTKEY_LIBSSH2", + "comments": "

The data argument to the callback will be a pointer to a\n git_cert_hostkey structure.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CERT_STRARRAY", + "comments": "

The data argument to the callback will be a pointer to a\n git_strarray with name:content strings containing\n information about the certificate. This is used when using\n curl.

\n", + "value": 3 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_cert_x509", + { + "decl": ["git_cert parent", "void * data", "size_t len"], + "type": "struct", + "value": "git_cert_x509", + "file": "git2/cert.h", + "line": 156, + "lineto": 168, + "block": "git_cert parent\nvoid * data\nsize_t len", + "tdef": "typedef", + "description": " X.509 certificate information", + "comments": "", + "fields": [ + { + "type": "git_cert", + "name": "parent", + "comments": " The parent cert " + }, + { + "type": "void *", + "name": "data", + "comments": " Pointer to the X.509 certificate data" + }, + { + "type": "size_t", + "name": "len", + "comments": " Length of the memory block pointed to by `data`." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_checkout_notify_t", + { + "decl": [ + "GIT_CHECKOUT_NOTIFY_NONE", + "GIT_CHECKOUT_NOTIFY_CONFLICT", + "GIT_CHECKOUT_NOTIFY_DIRTY", + "GIT_CHECKOUT_NOTIFY_UPDATED", + "GIT_CHECKOUT_NOTIFY_UNTRACKED", + "GIT_CHECKOUT_NOTIFY_IGNORED", + "GIT_CHECKOUT_NOTIFY_ALL" + ], + "type": "enum", + "file": "git2/checkout.h", + "line": 224, + "lineto": 255, + "block": "GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL", + "tdef": "typedef", + "description": " Checkout notification flags", + "comments": "

Checkout will invoke an options notification callback (notify_cb) for certain cases - you pick which ones via notify_flags:

\n\n

Returning a non-zero value from this callback will cancel the checkout. The non-zero return value will be propagated back and returned by the git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk, so canceling on any notification will still happen prior to any files being modified.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_CONFLICT", + "comments": "

Invokes checkout on conflicting paths.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_DIRTY", + "comments": "

Notifies about "dirty" files, i.e. those that do not need an update\n but no longer match the baseline. Core git displays these files when\n checkout runs, but won't stop the checkout.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_UPDATED", + "comments": "

Sends notification for any file changed.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_UNTRACKED", + "comments": "

Notifies about untracked files.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_IGNORED", + "comments": "

Notifies about ignored files.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_ALL", + "comments": "

Notifies about ignored files.

\n", + "value": 65535 + } + ], + "used": { "returns": [], "needs": ["git_checkout_notify_cb"] } + } + ], + [ + "git_checkout_options", + { + "decl": [ + "unsigned int version", + "unsigned int checkout_strategy", + "int disable_filters", + "unsigned int dir_mode", + "unsigned int file_mode", + "int file_open_flags", + "unsigned int notify_flags", + "git_checkout_notify_cb notify_cb", + "void * notify_payload", + "git_checkout_progress_cb progress_cb", + "void * progress_payload", + "git_strarray paths", + "git_tree * baseline", + "git_index * baseline_index", + "const char * target_directory", + "const char * ancestor_label", + "const char * our_label", + "const char * their_label", + "git_checkout_perfdata_cb perfdata_cb", + "void * perfdata_payload" + ], + "type": "struct", + "value": "git_checkout_options", + "file": "git2/checkout.h", + "line": 317, + "lineto": 391, + "block": "unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\ngit_index * baseline_index\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_checkout_perfdata_cb perfdata_cb\nvoid * perfdata_payload", + "tdef": "typedef", + "description": " Checkout options structure", + "comments": "

Initialize with GIT_CHECKOUT_OPTIONS_INIT. Alternatively, you can use git_checkout_options_init.

\n\n

[version] GIT_CHECKOUT_OPTIONS_VERSION [init_macro] GIT_CHECKOUT_OPTIONS_INIT [init_function] git_checkout_options_init

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "unsigned int", + "name": "checkout_strategy", + "comments": " default will be a safe checkout " + }, + { + "type": "int", + "name": "disable_filters", + "comments": " don't apply filters like CRLF conversion " + }, + { + "type": "unsigned int", + "name": "dir_mode", + "comments": " default is 0755 " + }, + { + "type": "unsigned int", + "name": "file_mode", + "comments": " default is 0644 or 0755 as dictated by blob " + }, + { + "type": "int", + "name": "file_open_flags", + "comments": " default is O_CREAT | O_TRUNC | O_WRONLY " + }, + { + "type": "unsigned int", + "name": "notify_flags", + "comments": " Checkout notification flags specify what operations the notify\n callback is invoked for.\n\n \n\n[flags] git_checkout_notify_t" + }, + { + "type": "git_checkout_notify_cb", + "name": "notify_cb", + "comments": " Optional callback to get notifications on specific file states.\n " + }, + { + "type": "void *", + "name": "notify_payload", + "comments": " Payload passed to notify_cb " + }, + { + "type": "git_checkout_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of checkout progress. " + }, + { + "type": "void *", + "name": "progress_payload", + "comments": " Payload passed to progress_cb " + }, + { + "type": "git_strarray", + "name": "paths", + "comments": " A list of wildmatch patterns or paths.\n\n By default, all paths are processed. If you pass an array of wildmatch\n patterns, those will be used to filter which paths should be taken into\n account.\n\n Use GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as a simple list." + }, + { + "type": "git_tree *", + "name": "baseline", + "comments": " The expected content of the working directory; defaults to HEAD.\n\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." + }, + { + "type": "git_index *", + "name": "baseline_index", + "comments": " Like `baseline` above, though expressed as an index. This\n option overrides `baseline`." + }, + { + "type": "const char *", + "name": "target_directory", + "comments": " alternative checkout path to workdir " + }, + { + "type": "const char *", + "name": "ancestor_label", + "comments": " the name of the common ancestor side of conflicts " + }, + { + "type": "const char *", + "name": "our_label", + "comments": " the name of the \"our\" side of conflicts " + }, + { + "type": "const char *", + "name": "their_label", + "comments": " the name of the \"their\" side of conflicts " + }, + { + "type": "git_checkout_perfdata_cb", + "name": "perfdata_cb", + "comments": " Optional callback to notify the consumer of performance data. " + }, + { + "type": "void *", + "name": "perfdata_payload", + "comments": " Payload passed to perfdata_cb " + } + ], + "used": { + "returns": [], + "needs": [ + "git_checkout_head", + "git_checkout_index", + "git_checkout_options_init", + "git_checkout_tree", + "git_merge", + "git_reset", + "git_reset_from_annotated" + ] + } + } + ], + [ + "git_checkout_perfdata", + { + "decl": [ + "size_t mkdir_calls", + "size_t stat_calls", + "size_t chmod_calls" + ], + "type": "struct", + "value": "git_checkout_perfdata", + "file": "git2/checkout.h", + "line": 258, + "lineto": 262, + "block": "size_t mkdir_calls\nsize_t stat_calls\nsize_t chmod_calls", + "tdef": "typedef", + "description": " Checkout performance-reporting structure ", + "comments": "", + "fields": [ + { "type": "size_t", "name": "mkdir_calls", "comments": "" }, + { "type": "size_t", "name": "stat_calls", "comments": "" }, + { "type": "size_t", "name": "chmod_calls", "comments": "" } + ], + "used": { "returns": [], "needs": ["git_checkout_perfdata_cb"] } + } + ], + [ + "git_checkout_strategy_t", + { + "decl": [ + "GIT_CHECKOUT_SAFE", + "GIT_CHECKOUT_FORCE", + "GIT_CHECKOUT_RECREATE_MISSING", + "GIT_CHECKOUT_ALLOW_CONFLICTS", + "GIT_CHECKOUT_REMOVE_UNTRACKED", + "GIT_CHECKOUT_REMOVE_IGNORED", + "GIT_CHECKOUT_UPDATE_ONLY", + "GIT_CHECKOUT_DONT_UPDATE_INDEX", + "GIT_CHECKOUT_NO_REFRESH", + "GIT_CHECKOUT_SKIP_UNMERGED", + "GIT_CHECKOUT_USE_OURS", + "GIT_CHECKOUT_USE_THEIRS", + "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", + "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", + "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", + "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", + "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", + "GIT_CHECKOUT_DONT_REMOVE_EXISTING", + "GIT_CHECKOUT_DONT_WRITE_INDEX", + "GIT_CHECKOUT_DRY_RUN", + "GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3", + "GIT_CHECKOUT_NONE", + "GIT_CHECKOUT_UPDATE_SUBMODULES", + "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED" + ], + "type": "enum", + "file": "git2/checkout.h", + "line": 113, + "lineto": 206, + "block": "GIT_CHECKOUT_SAFE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_RECREATE_MISSING\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_DONT_REMOVE_EXISTING\nGIT_CHECKOUT_DONT_WRITE_INDEX\nGIT_CHECKOUT_DRY_RUN\nGIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3\nGIT_CHECKOUT_NONE\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", + "tdef": "typedef", + "description": " Checkout behavior flags", + "comments": "

In libgit2, checkout is used to update the working directory and index to match a target tree. Unlike git checkout, it does not move the HEAD commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to check out, the "baseline" tree of what was checked out previously, the working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of two strategies for update:

\n\n\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout notification callback (see below) that displays information about dirty files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a notification callback that cancels the operation if a dirty-but-existing file is found in the working directory. This core git command isn't quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modify the behavior of checkout:

\n\n\n", + "fields": [ + { + "type": "int", + "name": "GIT_CHECKOUT_SAFE", + "comments": "

Allow safe updates that cannot overwrite uncommitted data.\n If the uncommitted changes don't conflict with the checked\n out files, the checkout will still proceed, leaving the\n changes intact.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_FORCE", + "comments": "

Allow all updates to force working directory to look like\n the index, potentially losing data in the process.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_RECREATE_MISSING", + "comments": "

Allow checkout to recreate missing files

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_ALLOW_CONFLICTS", + "comments": "

Allow checkout to make safe updates even if conflicts are found

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_REMOVE_UNTRACKED", + "comments": "

Remove untracked files not in index (that are not ignored)

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_REMOVE_IGNORED", + "comments": "

Remove ignored files not in index

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_UPDATE_ONLY", + "comments": "

Only update existing files, don't create new ones

\n", + "value": 128 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_UPDATE_INDEX", + "comments": "

Normally checkout updates index entries as it goes; this stops that.\n Implies GIT_CHECKOUT_DONT_WRITE_INDEX.

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NO_REFRESH", + "comments": "

Don't refresh index/config/etc before doing checkout

\n", + "value": 512 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_SKIP_UNMERGED", + "comments": "

Allow checkout to skip unmerged files

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_USE_OURS", + "comments": "

For unmerged files, checkout stage 2 from index

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_USE_THEIRS", + "comments": "

For unmerged files, checkout stage 3 from index

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", + "comments": "

Treat pathspec as simple list of exact match file paths

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", + "comments": "

Ignore directories in use, they will be left empty

\n", + "value": 262144 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", + "comments": "

Don't overwrite ignored files that exist in the checkout target

\n", + "value": 524288 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", + "comments": "

Write normal merge files for conflicts

\n", + "value": 1048576 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", + "comments": "

Include common ancestor data in diff3 format files for conflicts

\n", + "value": 2097152 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_REMOVE_EXISTING", + "comments": "

Don't overwrite existing files or folders

\n", + "value": 4194304 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_WRITE_INDEX", + "comments": "

Normally checkout writes the index upon completion; this prevents that.

\n", + "value": 8388608 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DRY_RUN", + "comments": "

Perform a "dry run", reporting what would be done but\n without actually making changes in the working directory\n or the index.

\n", + "value": 16777216 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3", + "comments": "

Include common ancestor data in zdiff3 format for conflicts

\n", + "value": 33554432 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NONE", + "comments": "

Do not do a checkout and do not fire callbacks; this is primarily\n useful only for internal functions that will perform the\n checkout themselves but need to pass checkout options into\n another function, for example, git_clone.

\n", + "value": 1073741824 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_UPDATE_SUBMODULES", + "comments": "

Recursively checkout submodules with same options (NOT IMPLEMENTED)

\n", + "value": 65536 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", + "comments": "

Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)

\n", + "value": 131072 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_cherrypick_options", + { + "decl": [ + "unsigned int version", + "unsigned int mainline", + "git_merge_options merge_opts", + "git_checkout_options checkout_opts" + ], + "type": "struct", + "value": "git_cherrypick_options", + "file": "git2/cherrypick.h", + "line": 29, + "lineto": 37, + "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", + "tdef": "typedef", + "description": " Cherry-pick options", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "mainline", + "comments": " For merge commits, the \"mainline\" is treated as the parent. " + }, + { + "type": "git_merge_options", + "name": "merge_opts", + "comments": " Options for the merging " + }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " Options for the checkout " + } + ], + "used": { + "returns": [], + "needs": ["git_cherrypick", "git_cherrypick_options_init"] + } + } + ], + [ + "git_clone_local_t", + { + "decl": [ + "GIT_CLONE_LOCAL_AUTO", + "GIT_CLONE_LOCAL", + "GIT_CLONE_NO_LOCAL", + "GIT_CLONE_LOCAL_NO_LINKS" + ], + "type": "enum", + "file": "git2/clone.h", + "line": 37, + "lineto": 57, + "block": "GIT_CLONE_LOCAL_AUTO\nGIT_CLONE_LOCAL\nGIT_CLONE_NO_LOCAL\nGIT_CLONE_LOCAL_NO_LINKS", + "tdef": "typedef", + "description": " Options for bypassing the git-aware transport on clone. Bypassing\n it means that instead of a fetch, libgit2 will copy the object\n database directory instead of figuring out what it needs, which is\n faster. If possible, it will hardlink the files to save space.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CLONE_LOCAL_AUTO", + "comments": "

Auto-detect (default), libgit2 will bypass the git-aware\n transport for local paths, but use a normal fetch for\n file:// urls.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CLONE_LOCAL", + "comments": "

Bypass the git-aware transport even for a file:// url.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CLONE_NO_LOCAL", + "comments": "

Do no bypass the git-aware transport

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CLONE_LOCAL_NO_LINKS", + "comments": "

Bypass the git-aware transport, but do not try to use\n hardlinks.

\n", + "value": 3 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_clone_options", + { + "decl": [ + "unsigned int version", + "git_checkout_options checkout_opts", + "git_fetch_options fetch_opts", + "int bare", + "git_clone_local_t local", + "const char * checkout_branch", + "git_repository_create_cb repository_cb", + "void * repository_cb_payload", + "git_remote_create_cb remote_cb", + "void * remote_cb_payload" + ], + "type": "struct", + "value": "git_clone_options", + "file": "git2/clone.h", + "line": 110, + "lineto": 171, + "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint bare\ngit_clone_local_t local\nconst char * checkout_branch\ngit_repository_create_cb repository_cb\nvoid * repository_cb_payload\ngit_remote_create_cb remote_cb\nvoid * remote_cb_payload", + "tdef": "typedef", + "description": " Clone options structure", + "comments": "

Initialize with GIT_CLONE_OPTIONS_INIT. Alternatively, you can use git_clone_options_init.

\n\n

[version] GIT_CLONE_OPTIONS_VERSION [init_macro] GIT_CLONE_OPTIONS_INIT [init_function] git_clone_options_init

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to `GIT_CHECKOUT_NONE`\n or `GIT_CHECKOUT_DRY_RUN`." + }, + { + "type": "git_fetch_options", + "name": "fetch_opts", + "comments": " Options which control the fetch, including callbacks.\n\n The callbacks are used for reporting fetch progress, and for acquiring\n credentials in the event they are needed." + }, + { + "type": "int", + "name": "bare", + "comments": " Set to zero (false) to create a standard repo, or non-zero\n for a bare repo" + }, + { + "type": "git_clone_local_t", + "name": "local", + "comments": " Whether to use a fetch or copy the object database." + }, + { + "type": "const char *", + "name": "checkout_branch", + "comments": " The name of the branch to checkout. NULL means use the\n remote's default branch." + }, + { + "type": "git_repository_create_cb", + "name": "repository_cb", + "comments": " A callback used to create the new repository into which to\n clone. If NULL, the 'bare' field will be used to determine\n whether to create a bare repository." + }, + { + "type": "void *", + "name": "repository_cb_payload", + "comments": " An opaque payload to pass to the git_repository creation callback.\n This parameter is ignored unless repository_cb is non-NULL." + }, + { + "type": "git_remote_create_cb", + "name": "remote_cb", + "comments": " A callback used to create the git_remote, prior to its being\n used to perform the clone operation. See the documentation for\n git_remote_create_cb for details. This parameter may be NULL,\n indicating that git_clone should provide default behavior." + }, + { + "type": "void *", + "name": "remote_cb_payload", + "comments": " An opaque payload to pass to the git_remote creation callback.\n This parameter is ignored unless remote_cb is non-NULL." + } + ], + "used": { + "returns": [], + "needs": ["git_clone", "git_clone_options_init"] + } + } + ], + [ + "git_commit", + { + "decl": "git_commit", + "type": "struct", + "value": "git_commit", + "file": "git2/types.h", + "line": 141, + "lineto": 141, + "tdef": "typedef", + "description": " Parsed representation of a commit object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_branch_create", + "git_cherrypick", + "git_cherrypick_commit", + "git_commit_amend", + "git_commit_author", + "git_commit_author_with_mailmap", + "git_commit_body", + "git_commit_committer", + "git_commit_committer_with_mailmap", + "git_commit_create", + "git_commit_create_buffer", + "git_commit_create_cb", + "git_commit_create_from_stage", + "git_commit_dup", + "git_commit_free", + "git_commit_header_field", + "git_commit_id", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_commit_message", + "git_commit_message_encoding", + "git_commit_message_raw", + "git_commit_nth_gen_ancestor", + "git_commit_owner", + "git_commit_parent", + "git_commit_parent_id", + "git_commit_parentcount", + "git_commit_raw_header", + "git_commit_summary", + "git_commit_time", + "git_commit_time_offset", + "git_commit_tree", + "git_commit_tree_id", + "git_commitarray_dispose", + "git_diff_commit_as_email", + "git_email_create_from_commit", + "git_merge_commits", + "git_odb_set_commit_graph", + "git_repository_commit_parents", + "git_revert", + "git_revert_commit" + ] + } + } + ], + [ + "git_commit_graph", + { + "decl": "git_commit_graph", + "type": "struct", + "value": "git_commit_graph", + "file": "git2/types.h", + "line": 114, + "lineto": 114, + "tdef": "typedef", + "description": " A git commit-graph ", + "comments": "", + "used": { "returns": [], "needs": ["git_odb_set_commit_graph"] } + } + ], + [ + "git_commit_graph_split_strategy_t", + { + "decl": ["GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE"], + "type": "enum", + "file": "git2/sys/commit_graph.h", + "line": 93, + "lineto": 99, + "block": "GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE", + "tdef": "typedef", + "description": " The strategy to use when adding a new set of commits to a pre-existing\n commit-graph chain.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE", + "comments": "

Do not split commit-graph files. The other split strategy-related option\n fields are ignored.

\n", + "value": 0 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_commit_graph_writer", + { + "decl": "git_commit_graph_writer", + "type": "struct", + "value": "git_commit_graph_writer", + "file": "git2/types.h", + "line": 117, + "lineto": 117, + "tdef": "typedef", + "description": " a writer for commit-graph files. ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_commitarray", + { + "decl": ["git_commit *const * commits", "size_t count"], + "type": "struct", + "value": "git_commitarray", + "file": "git2/commit.h", + "line": 655, + "lineto": 658, + "block": "git_commit *const * commits\nsize_t count", + "tdef": "typedef", + "description": " An array of commits returned from the library ", + "comments": "", + "fields": [ + { "type": "git_commit *const *", "name": "commits", "comments": "" }, + { "type": "size_t", "name": "count", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_commitarray_dispose", "git_repository_commit_parents"] + } + } + ], + [ + "git_config", + { + "decl": "git_config", + "type": "struct", + "value": "git_config", + "file": "git2/types.h", + "line": 162, + "lineto": 162, + "tdef": "typedef", + "description": " Memory representation of a set of config files ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_config_add_file_ondisk", + "git_config_backend_foreach_match", + "git_config_delete_entry", + "git_config_delete_multivar", + "git_config_entry_free", + "git_config_foreach", + "git_config_foreach_cb", + "git_config_foreach_match", + "git_config_free", + "git_config_get_bool", + "git_config_get_entry", + "git_config_get_int32", + "git_config_get_int64", + "git_config_get_mapped", + "git_config_get_multivar_foreach", + "git_config_get_path", + "git_config_get_string", + "git_config_get_string_buf", + "git_config_iterator_free", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_lock", + "git_config_lookup_map_value", + "git_config_multivar_iterator_new", + "git_config_new", + "git_config_next", + "git_config_open_default", + "git_config_open_global", + "git_config_open_level", + "git_config_open_ondisk", + "git_config_set_bool", + "git_config_set_int32", + "git_config_set_int64", + "git_config_set_multivar", + "git_config_set_string", + "git_config_set_writeorder", + "git_config_snapshot", + "git_repository_config", + "git_repository_config_snapshot" + ] + } + } + ], + [ + "git_config_backend", + { + "decl": "git_config_backend", + "type": "struct", + "value": "git_config_backend", + "file": "git2/types.h", + "line": 165, + "lineto": 165, + "tdef": "typedef", + "description": " Interface to access a configuration file ", + "comments": "", + "used": { "returns": [], "needs": ["git_config_backend_foreach_match"] } + } + ], + [ + "git_config_backend_memory_options", + { + "decl": [ + "unsigned int version", + "const char * backend_type", + "const char * origin_path" + ], + "type": "struct", + "value": "git_config_backend_memory_options", + "file": "git2/sys/config.h", + "line": 148, + "lineto": 162, + "block": "unsigned int version\nconst char * backend_type\nconst char * origin_path", + "tdef": "typedef", + "description": " Options for in-memory configuration backends. ", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "const char *", + "name": "backend_type", + "comments": " The type of this backend (eg, \"command line\"). If this is\n NULL, then this will be \"in-memory\"." + }, + { + "type": "const char *", + "name": "origin_path", + "comments": " The path to the origin; if this is NULL then it will be\n left unset in the resulting configuration entries." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_config_entry", + { + "decl": [ + "const char * name", + "const char * value", + "const char * backend_type", + "const char * origin_path", + "unsigned int include_depth", + "git_config_level_t level" + ], + "type": "struct", + "value": "git_config_entry", + "file": "git2/config.h", + "line": 103, + "lineto": 124, + "block": "const char * name\nconst char * value\nconst char * backend_type\nconst char * origin_path\nunsigned int include_depth\ngit_config_level_t level", + "tdef": "typedef", + "description": " An entry in a configuration file", + "comments": "", + "fields": [ + { + "type": "const char *", + "name": "name", + "comments": " Name of the configuration entry (normalized). " + }, + { + "type": "const char *", + "name": "value", + "comments": " Literal (string) value of the entry. " + }, + { + "type": "const char *", + "name": "backend_type", + "comments": " The type of backend that this entry exists in (eg, \"file\"). " + }, + { + "type": "const char *", + "name": "origin_path", + "comments": " The path to the origin of this entry. For config files, this is\n the path to the file." + }, + { + "type": "unsigned int", + "name": "include_depth", + "comments": " Depth of includes where this variable was found. " + }, + { + "type": "git_config_level_t", + "name": "level", + "comments": " Configuration level for the file this was found in. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_config_entry_free", + "git_config_foreach_cb", + "git_config_get_entry", + "git_config_next" + ] + } + } + ], + [ + "git_config_iterator", + { + "decl": "git_config_iterator", + "type": "struct", + "value": "git_config_iterator", + "file": "git2/config.h", + "line": 145, + "lineto": 145, + "tdef": "typedef", + "description": " An opaque structure for a configuration iterator.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_config_iterator_free", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_multivar_iterator_new", + "git_config_next" + ] + } + } + ], + [ + "git_config_level_t", + { + "decl": [ + "GIT_CONFIG_LEVEL_PROGRAMDATA", + "GIT_CONFIG_LEVEL_SYSTEM", + "GIT_CONFIG_LEVEL_XDG", + "GIT_CONFIG_LEVEL_GLOBAL", + "GIT_CONFIG_LEVEL_LOCAL", + "GIT_CONFIG_LEVEL_WORKTREE", + "GIT_CONFIG_LEVEL_APP", + "GIT_CONFIG_HIGHEST_LEVEL" + ], + "type": "enum", + "file": "git2/config.h", + "line": 49, + "lineto": 98, + "block": "GIT_CONFIG_LEVEL_PROGRAMDATA\nGIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_WORKTREE\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL", + "tdef": "typedef", + "description": " Priority level of a config file.", + "comments": "

These priority levels correspond to the natural escalation logic (from higher to lower) when reading or searching for config entries in git.git. Meaning that for the same key, the configuration in the local configuration is preferred over the configuration in the system configuration file.

\n\n

Callers can add their own custom configuration, beginning at the GIT_CONFIG_LEVEL_APP level.

\n\n

Writes, by default, occur in the highest priority level backend that is writable. This ordering can be overridden with git_config_set_writeorder.

\n\n

git_config_open_default() and git_repository_config() honor those priority levels as well.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_PROGRAMDATA", + "comments": "

System-wide on Windows, for compatibility with "Portable Git".

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_SYSTEM", + "comments": "

System-wide configuration file; /etc/gitconfig on Linux.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_XDG", + "comments": "

XDG compatible configuration file; typically\n ~/.config/git/config.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_GLOBAL", + "comments": "

Global configuration file is the user-specific configuration;\n typically ~/.gitconfig.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_LOCAL", + "comments": "

Local configuration, the repository-specific configuration file;\n typically $GIT_DIR/config.

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_WORKTREE", + "comments": "

Worktree-specific configuration; typically\n $GIT_DIR/config.worktree.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_APP", + "comments": "

Application-specific configuration file. Callers into libgit2\n can add their own configuration beginning at this level.

\n", + "value": 7 + }, + { + "type": "int", + "name": "GIT_CONFIG_HIGHEST_LEVEL", + "comments": "

Not a configuration level; callers can use this value when\n querying configuration levels to specify that they want to\n have data from the highest-level currently configuration.\n This can be used to indicate that callers want the most\n specific config file available that actually is loaded.

\n", + "value": -1 + } + ], + "used": { + "returns": [], + "needs": [ + "git_config_add_file_ondisk", + "git_config_open_level", + "git_config_set_writeorder" + ] + } + } + ], + [ + "git_configmap", + { + "decl": [ + "git_configmap_t type", + "const char * str_match", + "int map_value" + ], + "type": "struct", + "value": "git_configmap", + "file": "git2/config.h", + "line": 160, + "lineto": 164, + "block": "git_configmap_t type\nconst char * str_match\nint map_value", + "tdef": "typedef", + "description": " Mapping from config variables to values.", + "comments": "", + "fields": [ + { "type": "git_configmap_t", "name": "type", "comments": "" }, + { "type": "const char *", "name": "str_match", "comments": "" }, + { "type": "int", "name": "map_value", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_config_get_mapped", "git_config_lookup_map_value"] + } + } + ], + [ + "git_configmap_t", + { + "decl": [ + "GIT_CONFIGMAP_FALSE", + "GIT_CONFIGMAP_TRUE", + "GIT_CONFIGMAP_INT32", + "GIT_CONFIGMAP_STRING" + ], + "type": "enum", + "file": "git2/config.h", + "line": 150, + "lineto": 155, + "block": "GIT_CONFIGMAP_FALSE\nGIT_CONFIGMAP_TRUE\nGIT_CONFIGMAP_INT32\nGIT_CONFIGMAP_STRING", + "tdef": "typedef", + "description": " Config var type", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CONFIGMAP_FALSE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CONFIGMAP_TRUE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CONFIGMAP_INT32", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CONFIGMAP_STRING", + "comments": "", + "value": 3 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential", + { + "decl": "git_credential", + "type": "struct", + "value": "git_credential", + "file": "git2/credential.h", + "line": 87, + "lineto": 87, + "tdef": "typedef", + "description": " The base structure for all credential types", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_credential_acquire_cb", + "git_credential_default_new", + "git_credential_free", + "git_credential_get_username", + "git_credential_has_username", + "git_credential_ssh_custom_new", + "git_credential_ssh_interactive_new", + "git_credential_ssh_key_from_agent", + "git_credential_ssh_key_memory_new", + "git_credential_ssh_key_new", + "git_credential_username_new", + "git_credential_userpass", + "git_credential_userpass_plaintext_new" + ] + } + } + ], + [ + "git_credential_default", + { + "decl": "git_credential_default", + "type": "struct", + "value": "git_credential_default", + "file": "git2/credential.h", + "line": 95, + "lineto": 95, + "tdef": "typedef", + "description": " A key for NTLM/Kerberos \"default\" credentials ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_ssh_custom", + { + "decl": "git_credential_ssh_custom", + "type": "struct", + "value": "git_credential_ssh_custom", + "file": "git2/credential.h", + "line": 110, + "lineto": 110, + "tdef": "typedef", + "description": " A key with a custom signature function", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_ssh_interactive", + { + "decl": "git_credential_ssh_interactive", + "type": "struct", + "value": "git_credential_ssh_interactive", + "file": "git2/credential.h", + "line": 105, + "lineto": 105, + "tdef": "typedef", + "description": " Keyboard-interactive based ssh authentication", + "comments": "", + "used": { + "returns": [], + "needs": ["git_credential_ssh_interactive_new"] + } + } + ], + [ + "git_credential_ssh_key", + { + "decl": "git_credential_ssh_key", + "type": "struct", + "value": "git_credential_ssh_key", + "file": "git2/credential.h", + "line": 100, + "lineto": 100, + "tdef": "typedef", + "description": " A ssh key from disk", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_t", + { + "decl": [ + "GIT_CREDENTIAL_USERPASS_PLAINTEXT", + "GIT_CREDENTIAL_SSH_KEY", + "GIT_CREDENTIAL_SSH_CUSTOM", + "GIT_CREDENTIAL_DEFAULT", + "GIT_CREDENTIAL_SSH_INTERACTIVE", + "GIT_CREDENTIAL_USERNAME", + "GIT_CREDENTIAL_SSH_MEMORY" + ], + "type": "enum", + "file": "git2/credential.h", + "line": 30, + "lineto": 82, + "block": "GIT_CREDENTIAL_USERPASS_PLAINTEXT\nGIT_CREDENTIAL_SSH_KEY\nGIT_CREDENTIAL_SSH_CUSTOM\nGIT_CREDENTIAL_DEFAULT\nGIT_CREDENTIAL_SSH_INTERACTIVE\nGIT_CREDENTIAL_USERNAME\nGIT_CREDENTIAL_SSH_MEMORY", + "tdef": "typedef", + "description": " Supported credential types", + "comments": "

This represents the various types of authentication methods supported by the library.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_CREDENTIAL_USERPASS_PLAINTEXT", + "comments": "

A vanilla user/password request

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CREDENTIAL_SSH_KEY", + "comments": "

An SSH key-based authentication request

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CREDENTIAL_SSH_CUSTOM", + "comments": "

An SSH key-based authentication request, with a custom signature

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CREDENTIAL_DEFAULT", + "comments": "

An NTLM/Negotiate-based authentication request.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_CREDENTIAL_SSH_INTERACTIVE", + "comments": "

An SSH interactive authentication request

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_CREDENTIAL_USERNAME", + "comments": "

Username-only authentication request

\n\n

Used as a pre-authentication step if the underlying transport\n (eg. SSH, with no username in its URL) does not know which username\n to use.

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_CREDENTIAL_SSH_MEMORY", + "comments": "

An SSH key-based authentication request

\n\n

Allows credentials to be read from memory instead of files.\n Note that because of differences in crypto backend support, it might\n not be functional.

\n", + "value": 64 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_username", + { + "decl": "git_credential_username", + "type": "struct", + "value": "git_credential_username", + "file": "git2/credential.h", + "line": 92, + "lineto": 92, + "tdef": "typedef", + "description": " Username-only credential information ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_credential_userpass_payload", + { + "decl": ["const char * username", "const char * password"], + "type": "struct", + "value": "git_credential_userpass_payload", + "file": "git2/credential_helpers.h", + "line": 24, + "lineto": 27, + "block": "const char * username\nconst char * password", + "tdef": "typedef", + "description": " Payload for git_credential_userpass_plaintext.", + "comments": "", + "fields": [ + { "type": "const char *", "name": "username", "comments": "" }, + { "type": "const char *", "name": "password", "comments": "" } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_delta_t", + { + "decl": [ + "GIT_DELTA_UNMODIFIED", + "GIT_DELTA_ADDED", + "GIT_DELTA_DELETED", + "GIT_DELTA_MODIFIED", + "GIT_DELTA_RENAMED", + "GIT_DELTA_COPIED", + "GIT_DELTA_IGNORED", + "GIT_DELTA_UNTRACKED", + "GIT_DELTA_TYPECHANGE", + "GIT_DELTA_UNREADABLE", + "GIT_DELTA_CONFLICTED" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 224, + "lineto": 236, + "block": "GIT_DELTA_UNMODIFIED\nGIT_DELTA_ADDED\nGIT_DELTA_DELETED\nGIT_DELTA_MODIFIED\nGIT_DELTA_RENAMED\nGIT_DELTA_COPIED\nGIT_DELTA_IGNORED\nGIT_DELTA_UNTRACKED\nGIT_DELTA_TYPECHANGE\nGIT_DELTA_UNREADABLE\nGIT_DELTA_CONFLICTED", + "tdef": "typedef", + "description": " What type of change is described by a git_diff_delta?", + "comments": "

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE in the option flags (otherwise type changes will be split into ADDED / DELETED pairs).

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DELTA_UNMODIFIED", + "comments": "

no changes

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DELTA_ADDED", + "comments": "

entry does not exist in old version

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DELTA_DELETED", + "comments": "

entry does not exist in new version

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DELTA_MODIFIED", + "comments": "

entry content changed between old and new

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_DELTA_RENAMED", + "comments": "

entry was renamed between old and new

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DELTA_COPIED", + "comments": "

entry was copied from another old entry

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_DELTA_IGNORED", + "comments": "

entry is ignored item in workdir

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_DELTA_UNTRACKED", + "comments": "

entry is untracked item in workdir

\n", + "value": 7 + }, + { + "type": "int", + "name": "GIT_DELTA_TYPECHANGE", + "comments": "

type of entry changed between old and new

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DELTA_UNREADABLE", + "comments": "

entry is unreadable

\n", + "value": 9 + }, + { + "type": "int", + "name": "GIT_DELTA_CONFLICTED", + "comments": "

entry in the index is conflicted

\n", + "value": 10 + } + ], + "used": { + "returns": [], + "needs": ["git_diff_num_deltas_of_type", "git_diff_status_char"] + } + } + ], + [ + "git_describe_format_options", + { + "decl": [ + "unsigned int version", + "unsigned int abbreviated_size", + "int always_use_long_format", + "const char * dirty_suffix" + ], + "type": "struct", + "value": "git_describe_format_options", + "file": "git2/describe.h", + "line": 100, + "lineto": 120, + "block": "unsigned int version\nunsigned int abbreviated_size\nint always_use_long_format\nconst char * dirty_suffix", + "tdef": "typedef", + "description": " Describe format options structure", + "comments": "

Initialize with GIT_DESCRIBE_FORMAT_OPTIONS_INIT. Alternatively, you can use git_describe_format_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "abbreviated_size", + "comments": " Size of the abbreviated commit id to use. This value is the\n lower bound for the length of the abbreviated string. The\n default is 7." + }, + { + "type": "int", + "name": "always_use_long_format", + "comments": " Set to use the long format even when a shorter name could be used." + }, + { + "type": "const char *", + "name": "dirty_suffix", + "comments": " If the workdir is dirty and this is set, this string will\n be appended to the description string." + } + ], + "used": { + "returns": [], + "needs": ["git_describe_format", "git_describe_format_options_init"] + } + } + ], + [ + "git_describe_options", + { + "decl": [ + "unsigned int version", + "unsigned int max_candidates_tags", + "unsigned int describe_strategy", + "const char * pattern", + "int only_follow_first_parent", + "int show_commit_oid_as_fallback" + ], + "type": "struct", + "value": "git_describe_options", + "file": "git2/describe.h", + "line": 47, + "lineto": 65, + "block": "unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback", + "tdef": "typedef", + "description": " Describe options structure", + "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT. Alternatively, you can use git_describe_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "max_candidates_tags", + "comments": " default: 10 " + }, + { + "type": "unsigned int", + "name": "describe_strategy", + "comments": " default: GIT_DESCRIBE_DEFAULT " + }, + { "type": "const char *", "name": "pattern", "comments": "" }, + { + "type": "int", + "name": "only_follow_first_parent", + "comments": " When calculating the distance from the matching tag or\n reference, only walk down the first-parent ancestry." + }, + { + "type": "int", + "name": "show_commit_oid_as_fallback", + "comments": " If no matching tag or reference is found, the describe\n operation would normally fail. If this option is set, it\n will instead fall back to showing the full id of the\n commit." + } + ], + "used": { + "returns": [], + "needs": [ + "git_describe_commit", + "git_describe_options_init", + "git_describe_workdir" + ] + } + } + ], + [ + "git_describe_result", + { + "decl": "git_describe_result", + "type": "struct", + "value": "git_describe_result", + "file": "git2/describe.h", + "line": 146, + "lineto": 146, + "tdef": "typedef", + "description": " A struct that stores the result of a describe operation.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_describe_commit", + "git_describe_format", + "git_describe_result_free", + "git_describe_workdir" + ] + } + } + ], + [ + "git_describe_strategy_t", + { + "decl": [ + "GIT_DESCRIBE_DEFAULT", + "GIT_DESCRIBE_TAGS", + "GIT_DESCRIBE_ALL" + ], + "type": "enum", + "file": "git2/describe.h", + "line": 34, + "lineto": 38, + "block": "GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL", + "tdef": "typedef", + "description": " Reference lookup strategy", + "comments": "

These behave like the --tags and --all options to git-describe, namely they say to look for any reference in either refs/tags/ or refs/ respectively.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DESCRIBE_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DESCRIBE_TAGS", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DESCRIBE_ALL", + "comments": "", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff", + { + "decl": "git_diff", + "type": "struct", + "value": "git_diff", + "file": "git2/diff.h", + "line": 196, + "lineto": 196, + "tdef": "typedef", + "description": " The diff object that contains all individual file deltas.", + "comments": "

A diff represents the cumulative list of differences between two snapshots of a repository (possibly filtered by a set of file name patterns).

\n\n

Calculating diffs is generally done in two phases: building a list of diffs then traversing it. This makes is easier to share logic across the various types of diffs (tree vs tree, workdir vs index, etc.), and also allows you to insert optional diff post-processing phases, such as rename detection, in between the steps. When you are done with a diff object, it must be freed.

\n\n

This is an opaque structure which will be allocated by one of the diff generator functions below (such as git_diff_tree_to_tree). You are responsible for releasing the object memory when done, using the git_diff_free() function.

\n", + "used": { + "returns": [ + "git_diff_get_delta", + "git_patch_get_delta", + "git_pathspec_match_list_diff_entry" + ], + "needs": [ + "git_apply", + "git_apply_delta_cb", + "git_apply_hunk_cb", + "git_apply_to_tree", + "git_checkout_notify_cb", + "git_diff_binary_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_file_cb", + "git_diff_find_options_init", + "git_diff_find_similar", + "git_diff_foreach", + "git_diff_format_email", + "git_diff_format_email_options_init", + "git_diff_free", + "git_diff_from_buffer", + "git_diff_get_delta", + "git_diff_get_stats", + "git_diff_hunk_cb", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_is_sorted_icase", + "git_diff_line_cb", + "git_diff_merge", + "git_diff_notify_cb", + "git_diff_num_deltas", + "git_diff_num_deltas_of_type", + "git_diff_options_init", + "git_diff_patchid", + "git_diff_patchid_options_init", + "git_diff_print", + "git_diff_progress_cb", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf", + "git_diff_to_buf", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers", + "git_patch_from_diff", + "git_patch_get_hunk", + "git_patch_get_line_in_hunk", + "git_patch_print", + "git_pathspec_match_diff" + ] + } + } + ], + [ + "git_diff_binary", + { + "decl": [ + "unsigned int contains_data", + "git_diff_binary_file old_file", + "git_diff_binary_file new_file" + ], + "type": "struct", + "value": "git_diff_binary", + "file": "git2/diff.h", + "line": 553, + "lineto": 565, + "block": "unsigned int contains_data\ngit_diff_binary_file old_file\ngit_diff_binary_file new_file", + "tdef": "typedef", + "description": " Structure describing the binary contents of a diff.", + "comments": "

A binary file / delta is a file (or pair) for which no text diffs should be generated. A diff can contain delta entries that are binary, but no diff content will be output for those files. There is a base heuristic for binary detection and you can further tune the behavior with git attributes or diff flags and option settings.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "contains_data", + "comments": " Whether there is data in this binary structure or not.\n\n If this is `1`, then this was produced and included binary content.\n If this is `0` then this was generated knowing only that a binary\n file changed but without providing the data, probably from a patch\n that said `Binary files a/file.txt and b/file.txt differ`." + }, + { + "type": "git_diff_binary_file", + "name": "old_file", + "comments": " The contents of the old file. " + }, + { + "type": "git_diff_binary_file", + "name": "new_file", + "comments": " The contents of the new file. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_binary_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach" + ] + } + } + ], + [ + "git_diff_binary_file", + { + "decl": [ + "git_diff_binary_t type", + "const char * data", + "size_t datalen", + "size_t inflatedlen" + ], + "type": "struct", + "value": "git_diff_binary_file", + "file": "git2/diff.h", + "line": 530, + "lineto": 542, + "block": "git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen", + "tdef": "typedef", + "description": " The contents of one of the files in a binary diff. ", + "comments": "", + "fields": [ + { + "type": "git_diff_binary_t", + "name": "type", + "comments": " The type of binary data for this file. " + }, + { + "type": "const char *", + "name": "data", + "comments": " The binary data, deflated. " + }, + { + "type": "size_t", + "name": "datalen", + "comments": " The length of the binary data. " + }, + { + "type": "size_t", + "name": "inflatedlen", + "comments": " The length of the binary data after inflation. " + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_binary_t", + { + "decl": [ + "GIT_DIFF_BINARY_NONE", + "GIT_DIFF_BINARY_LITERAL", + "GIT_DIFF_BINARY_DELTA" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 518, + "lineto": 527, + "block": "GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA", + "tdef": "typedef", + "description": " When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_BINARY_NONE", + "comments": "

There is no binary delta.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_BINARY_LITERAL", + "comments": "

The binary data is the literal contents of the file.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_BINARY_DELTA", + "comments": "

The binary data is the delta from one side to the other.

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_delta", + { + "decl": [ + "git_delta_t status", + "uint32_t flags", + "uint16_t similarity", + "uint16_t nfiles", + "git_diff_file old_file", + "git_diff_file new_file" + ], + "type": "struct", + "value": "git_diff_delta", + "file": "git2/diff.h", + "line": 324, + "lineto": 331, + "block": "git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file", + "tdef": "typedef", + "description": " Description of changes to one entry.", + "comments": "

A delta is a file pair with an old and new revision. The old version may be absent if the file was just created and the new version may be absent if the file was deleted. A diff is mostly just a list of deltas.

\n\n

When iterating over a diff, this will be passed to most callbacks and you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file represents to "to" side of the diff. What those means depend on the function that was used to generate the diff and will be documented below. You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file", they actually may correspond to entries that represent a file, a symbolic link, a submodule commit id, or even a tree (if you are tracking type changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will be filled in, but we generally try to fill in as much as possible. One example is that the "flags" field may not have either the BINARY or the NOT_BINARY flag set to avoid examining file contents if you do not pass in hunk and/or line callbacks to the diff foreach iteration function. It will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar() which does a similarity analysis of files in the diff. Use that function to do rename and copy detection, and to split heavily modified files in add/delete pairs. After that call, deltas with a status of GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to break, but to not actually break the records, then GIT_DELTA_MODIFIED records may have a non-zero similarity score if the self-similarity is below the split threshold. To display this value like core Git, invert the score (a la printf("M%03d", 100 - delta->similarity)).

\n", + "fields": [ + { "type": "git_delta_t", "name": "status", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " git_diff_flag_t values " + }, + { + "type": "uint16_t", + "name": "similarity", + "comments": " for RENAMED and COPIED, value 0-100 " + }, + { + "type": "uint16_t", + "name": "nfiles", + "comments": " number of files in this delta " + }, + { "type": "git_diff_file", "name": "old_file", "comments": "" }, + { "type": "git_diff_file", "name": "new_file", "comments": "" } + ], + "used": { + "returns": [ + "git_diff_get_delta", + "git_patch_get_delta", + "git_pathspec_match_list_diff_entry" + ], + "needs": [ + "git_apply_delta_cb", + "git_diff_binary_cb", + "git_diff_file_cb", + "git_diff_hunk_cb", + "git_diff_line_cb", + "git_diff_notify_cb" + ] + } + } + ], + [ + "git_diff_file", + { + "decl": [ + "git_oid id", + "const char * path", + "git_object_size_t size", + "uint32_t flags", + "uint16_t mode", + "uint16_t id_abbrev" + ], + "type": "struct", + "value": "git_diff_file", + "file": "git2/diff.h", + "line": 245, + "lineto": 282, + "block": "git_oid id\nconst char * path\ngit_object_size_t size\nuint32_t flags\nuint16_t mode\nuint16_t id_abbrev", + "tdef": "typedef", + "description": " Description of one side of a delta.", + "comments": "

Although this is called a "file", it could represent a file, a symbolic link, a submodule commit id, or even a tree (although that only if you are tracking type changes or ignored/untracked directories).

\n", + "fields": [ + { + "type": "git_oid", + "name": "id", + "comments": " The `git_oid` of the item. If the entry represents an\n absent side of a diff (e.g. the `old_file` of a `GIT_DELTA_ADDED` delta),\n then the oid will be zeroes." + }, + { + "type": "const char *", + "name": "path", + "comments": " The NUL-terminated path to the entry relative to the working\n directory of the repository." + }, + { + "type": "git_object_size_t", + "name": "size", + "comments": " The size of the entry in bytes." + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " A combination of the `git_diff_flag_t` types" + }, + { + "type": "uint16_t", + "name": "mode", + "comments": " Roughly, the stat() `st_mode` value for the item. This will\n be restricted to one of the `git_filemode_t` values." + }, + { + "type": "uint16_t", + "name": "id_abbrev", + "comments": " Represents the known length of the `id` field, when\n converted to a hex string. It is generally `GIT_OID_SHA1_HEXSIZE`, unless this\n delta was created from reading a patch file, in which case it may be\n abbreviated to something reasonable, like 7 characters." + } + ], + "used": { + "returns": [], + "needs": [ + "git_checkout_notify_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach" + ] + } + } + ], + [ + "git_diff_find_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "uint16_t rename_threshold", + "uint16_t rename_from_rewrite_threshold", + "uint16_t copy_threshold", + "uint16_t break_rewrite_threshold", + "size_t rename_limit", + "git_diff_similarity_metric * metric" + ], + "type": "struct", + "value": "git_diff_find_options", + "file": "git2/diff.h", + "line": 774, + "lineto": 828, + "block": "unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric", + "tdef": "typedef", + "description": " Control behavior of rename and copy detection", + "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Combination of git_diff_find_t values (default GIT_DIFF_FIND_BY_CONFIG).\n NOTE: if you don't explicitly set this, `diff.renames` could be set\n to false, resulting in `git_diff_find_similar` doing nothing." + }, + { + "type": "uint16_t", + "name": "rename_threshold", + "comments": " Threshold above which similar files will be considered renames.\n This is equivalent to the -M option. Defaults to 50." + }, + { + "type": "uint16_t", + "name": "rename_from_rewrite_threshold", + "comments": " Threshold below which similar files will be eligible to be a rename source.\n This is equivalent to the first part of the -B option. Defaults to 50." + }, + { + "type": "uint16_t", + "name": "copy_threshold", + "comments": " Threshold above which similar files will be considered copies.\n This is equivalent to the -C option. Defaults to 50." + }, + { + "type": "uint16_t", + "name": "break_rewrite_threshold", + "comments": " Threshold below which similar files will be split into a delete/add pair.\n This is equivalent to the last part of the -B option. Defaults to 60." + }, + { + "type": "size_t", + "name": "rename_limit", + "comments": " Maximum number of matches to consider for a particular file.\n\n This is a little different from the `-l` option from Git because we\n will still process up to this many matches before abandoning the search.\n Defaults to 1000." + }, + { + "type": "git_diff_similarity_metric *", + "name": "metric", + "comments": " The `metric` option allows you to plug in a custom similarity metric.\n\n Set it to NULL to use the default internal metric.\n\n The default metric is based on sampling hashes of ranges of data in\n the file, which is a pretty good similarity approximation that should\n work fairly well for both text and binary data while still being\n pretty fast with a fixed memory overhead." + } + ], + "used": { + "returns": [], + "needs": ["git_diff_find_options_init", "git_diff_find_similar"] + } + } + ], + [ + "git_diff_find_t", + { + "decl": [ + "GIT_DIFF_FIND_BY_CONFIG", + "GIT_DIFF_FIND_RENAMES", + "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", + "GIT_DIFF_FIND_COPIES", + "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", + "GIT_DIFF_FIND_REWRITES", + "GIT_DIFF_BREAK_REWRITES", + "GIT_DIFF_FIND_AND_BREAK_REWRITES", + "GIT_DIFF_FIND_FOR_UNTRACKED", + "GIT_DIFF_FIND_ALL", + "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", + "GIT_DIFF_FIND_IGNORE_WHITESPACE", + "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", + "GIT_DIFF_FIND_EXACT_MATCH_ONLY", + "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", + "GIT_DIFF_FIND_REMOVE_UNMODIFIED" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 683, + "lineto": 752, + "block": "GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED", + "tdef": "typedef", + "description": " Flags to control the behavior of diff rename/copy detection.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FIND_BY_CONFIG", + "comments": "

Obey diff.renames. Overridden by any other GIT_DIFF_FIND_... flag.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_RENAMES", + "comments": "

Look for renames? (--find-renames)

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", + "comments": "

Consider old side of MODIFIED for renames? (--break-rewrites=N)

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_COPIES", + "comments": "

Look for copies? (a la --find-copies).

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", + "comments": "

Consider UNMODIFIED as copy sources? (--find-copies-harder).

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNMODIFIED when\n the initial git_diff is being generated.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_REWRITES", + "comments": "

Mark significant rewrites for split (--break-rewrites=/M)

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_DIFF_BREAK_REWRITES", + "comments": "

Actually split large rewrites into delete/add pairs

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_AND_BREAK_REWRITES", + "comments": "

Mark rewrites for split and break into delete/add pairs

\n", + "value": 48 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_FOR_UNTRACKED", + "comments": "

Find renames/copies for UNTRACKED items in working directory.

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNTRACKED when the\n initial git_diff is being generated (and obviously the diff must\n be against the working directory for this to make sense).

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_ALL", + "comments": "

Turn on all finding features.

\n", + "value": 255 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", + "comments": "

Measure similarity ignoring leading whitespace (default)

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_IGNORE_WHITESPACE", + "comments": "

Measure similarity ignoring all whitespace

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", + "comments": "

Measure similarity including all data

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_EXACT_MATCH_ONLY", + "comments": "

Measure similarity only by comparing SHAs (fast and cheap)

\n", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", + "comments": "

Do not break rewrites unless they contribute to a rename.

\n\n

Normally, GIT_DIFF_FIND_AND_BREAK_REWRITES will measure the self-\n similarity of modified files and split the ones that have changed a\n lot into a DELETE / ADD pair. Then the sides of that pair will be\n considered candidates for rename and copy detection.

\n\n

If you add this flag in and the split pair is not used for an\n actual rename or copy, then the modified record will be restored to\n a regular MODIFIED record instead of being split.

\n", + "value": 32768 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_REMOVE_UNMODIFIED", + "comments": "

Remove any UNMODIFIED deltas after find_similar is done.

\n\n

Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the\n --find-copies-harder behavior requires building a diff with the\n GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED\n records in the final result, pass this flag to have them removed.

\n", + "value": 65536 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_flag_t", + { + "decl": [ + "GIT_DIFF_FLAG_BINARY", + "GIT_DIFF_FLAG_NOT_BINARY", + "GIT_DIFF_FLAG_VALID_ID", + "GIT_DIFF_FLAG_EXISTS", + "GIT_DIFF_FLAG_VALID_SIZE" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 206, + "lineto": 212, + "block": "GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID\nGIT_DIFF_FLAG_EXISTS\nGIT_DIFF_FLAG_VALID_SIZE", + "tdef": "typedef", + "description": " Flags for the delta object and the file objects on each side.", + "comments": "

These flags are used for both the flags value of the git_diff_delta and the flags for the git_diff_file objects representing the old and new sides of the delta. Values outside of this public range should be considered reserved for internal or future use.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FLAG_BINARY", + "comments": "

file(s) treated as binary data

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_NOT_BINARY", + "comments": "

file(s) treated as text data

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_VALID_ID", + "comments": "

id value is known correct

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_EXISTS", + "comments": "

file exists at this side of the delta

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_VALID_SIZE", + "comments": "

file size value is known correct

\n", + "value": 16 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_format_email_flags_t", + { + "decl": [ + "GIT_DIFF_FORMAT_EMAIL_NONE", + "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER" + ], + "type": "enum", + "file": "git2/deprecated.h", + "line": 325, + "lineto": 331, + "block": "GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", + "tdef": "typedef", + "description": " Formatting options for diff e-mail generation", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FORMAT_EMAIL_NONE", + "comments": "

Normal patch, the default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", + "comments": "

Don't insert "[PATCH]" in the subject header

\n", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_format_email_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "size_t patch_no", + "size_t total_patches", + "const git_oid * id", + "const char * summary", + "const char * body", + "const git_signature * author" + ], + "type": "struct", + "value": "git_diff_format_email_options", + "file": "git2/deprecated.h", + "line": 338, + "lineto": 361, + "block": "unsigned int version\nuint32_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst char * body\nconst git_signature * author", + "tdef": "typedef", + "description": " Options for controlling the formatting of the generated e-mail.", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " see `git_diff_format_email_flags_t` above " + }, + { + "type": "size_t", + "name": "patch_no", + "comments": " This patch number " + }, + { + "type": "size_t", + "name": "total_patches", + "comments": " Total number of patches in this series " + }, + { + "type": "const git_oid *", + "name": "id", + "comments": " id to use for the commit " + }, + { + "type": "const char *", + "name": "summary", + "comments": " Summary of the change " + }, + { + "type": "const char *", + "name": "body", + "comments": " Commit message's body " + }, + { + "type": "const git_signature *", + "name": "author", + "comments": " Author of the change " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_format_email", + "git_diff_format_email_options_init" + ] + } + } + ], + [ + "git_diff_format_t", + { + "decl": [ + "GIT_DIFF_FORMAT_PATCH", + "GIT_DIFF_FORMAT_PATCH_HEADER", + "GIT_DIFF_FORMAT_RAW", + "GIT_DIFF_FORMAT_NAME_ONLY", + "GIT_DIFF_FORMAT_NAME_STATUS", + "GIT_DIFF_FORMAT_PATCH_ID" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 1156, + "lineto": 1163, + "block": "GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS\nGIT_DIFF_FORMAT_PATCH_ID", + "tdef": "typedef", + "description": " Possible output formats for diff data", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FORMAT_PATCH", + "comments": "

full git diff

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_PATCH_HEADER", + "comments": "

just the file headers of patch

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_RAW", + "comments": "

like git diff --raw

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_NAME_ONLY", + "comments": "

like git diff --name-only

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_NAME_STATUS", + "comments": "

like git diff --name-status

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_PATCH_ID", + "comments": "

git diff as used by git patch-id

\n", + "value": 6 + } + ], + "used": { + "returns": [], + "needs": ["git_diff_print", "git_diff_to_buf"] + } + } + ], + [ + "git_diff_hunk", + { + "decl": [ + "int old_start", + "int old_lines", + "int new_start", + "int new_lines", + "size_t header_len", + "char [128] header" + ], + "type": "struct", + "value": "git_diff_hunk", + "file": "git2/diff.h", + "line": 590, + "lineto": 597, + "block": "int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header", + "tdef": "typedef", + "description": " Structure describing a hunk of a diff.", + "comments": "

A hunk is a span of modified lines in a delta along with some stable surrounding context. You can configure the amount of context and other properties of how hunks are generated. Each hunk also comes with a header that described where it starts and ends in both the old and new versions in the delta.

\n", + "fields": [ + { + "type": "int", + "name": "old_start", + "comments": " Starting line number in old_file " + }, + { + "type": "int", + "name": "old_lines", + "comments": " Number of lines in old_file " + }, + { + "type": "int", + "name": "new_start", + "comments": " Starting line number in new_file " + }, + { + "type": "int", + "name": "new_lines", + "comments": " Number of lines in new_file " + }, + { + "type": "size_t", + "name": "header_len", + "comments": " Number of bytes in header text " + }, + { + "type": "char [128]", + "name": "header", + "comments": " Header text, NUL-byte terminated " + } + ], + "used": { + "returns": [], + "needs": [ + "git_apply_hunk_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach", + "git_diff_hunk_cb", + "git_diff_line_cb", + "git_patch_get_hunk" + ] + } + } + ], + [ + "git_diff_line", + { + "decl": [ + "char origin", + "int old_lineno", + "int new_lineno", + "int num_lines", + "size_t content_len", + "git_off_t content_offset", + "const char * content" + ], + "type": "struct", + "value": "git_diff_line", + "file": "git2/diff.h", + "line": 650, + "lineto": 658, + "block": "char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content", + "tdef": "typedef", + "description": " Structure describing a line (or data span) of a diff.", + "comments": "

A line is a range of characters inside a hunk. It could be a context line (i.e. in both old and new versions), an added line (i.e. only in the new version), or a removed line (i.e. only in the old version). Unfortunately, we don't know anything about the encoding of data in the file being diffed, so we cannot tell you much about the line content. Line data will not be NUL-byte terminated, however, because it will be just a span of bytes inside the larger file.

\n", + "fields": [ + { + "type": "char", + "name": "origin", + "comments": " A git_diff_line_t value " + }, + { + "type": "int", + "name": "old_lineno", + "comments": " Line number in old file or -1 for added line " + }, + { + "type": "int", + "name": "new_lineno", + "comments": " Line number in new file or -1 for deleted line " + }, + { + "type": "int", + "name": "num_lines", + "comments": " Number of newline characters in content " + }, + { + "type": "size_t", + "name": "content_len", + "comments": " Number of bytes of data " + }, + { + "type": "git_off_t", + "name": "content_offset", + "comments": " Offset in the original file to the content " + }, + { + "type": "const char *", + "name": "content", + "comments": " Pointer to diff text, not NUL-byte terminated " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach", + "git_diff_line_cb", + "git_diff_print", + "git_patch_get_line_in_hunk", + "git_patch_print" + ] + } + } + ], + [ + "git_diff_line_t", + { + "decl": [ + "GIT_DIFF_LINE_CONTEXT", + "GIT_DIFF_LINE_ADDITION", + "GIT_DIFF_LINE_DELETION", + "GIT_DIFF_LINE_CONTEXT_EOFNL", + "GIT_DIFF_LINE_ADD_EOFNL", + "GIT_DIFF_LINE_DEL_EOFNL", + "GIT_DIFF_LINE_FILE_HDR", + "GIT_DIFF_LINE_HUNK_HDR", + "GIT_DIFF_LINE_BINARY" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 621, + "lineto": 637, + "block": "GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\nGIT_DIFF_LINE_ADD_EOFNL\nGIT_DIFF_LINE_DEL_EOFNL\nGIT_DIFF_LINE_FILE_HDR\nGIT_DIFF_LINE_HUNK_HDR\nGIT_DIFF_LINE_BINARY", + "tdef": "typedef", + "description": " Line origin constants.", + "comments": "

These values describe where a line came from and will be passed to the git_diff_line_cb when iterating over a diff. There are some special origin constants at the end that are used for the text output callbacks to demarcate lines that are actually part of the file or hunk headers.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_LINE_CONTEXT", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_ADDITION", + "comments": "", + "value": 43 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_DELETION", + "comments": "", + "value": 45 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_CONTEXT_EOFNL", + "comments": "

Both files have no LF at end

\n", + "value": 61 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_ADD_EOFNL", + "comments": "

Old has no LF at end, new does

\n", + "value": 62 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_DEL_EOFNL", + "comments": "

Old has LF at end, new does not

\n", + "value": 60 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_FILE_HDR", + "comments": "", + "value": 70 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_HUNK_HDR", + "comments": "", + "value": 72 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_BINARY", + "comments": "

For "Binary files x and y differ"

\n", + "value": 66 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_option_t", + { + "decl": [ + "GIT_DIFF_NORMAL", + "GIT_DIFF_REVERSE", + "GIT_DIFF_INCLUDE_IGNORED", + "GIT_DIFF_RECURSE_IGNORED_DIRS", + "GIT_DIFF_INCLUDE_UNTRACKED", + "GIT_DIFF_RECURSE_UNTRACKED_DIRS", + "GIT_DIFF_INCLUDE_UNMODIFIED", + "GIT_DIFF_INCLUDE_TYPECHANGE", + "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", + "GIT_DIFF_IGNORE_FILEMODE", + "GIT_DIFF_IGNORE_SUBMODULES", + "GIT_DIFF_IGNORE_CASE", + "GIT_DIFF_INCLUDE_CASECHANGE", + "GIT_DIFF_DISABLE_PATHSPEC_MATCH", + "GIT_DIFF_SKIP_BINARY_CHECK", + "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", + "GIT_DIFF_UPDATE_INDEX", + "GIT_DIFF_INCLUDE_UNREADABLE", + "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", + "GIT_DIFF_INDENT_HEURISTIC", + "GIT_DIFF_IGNORE_BLANK_LINES", + "GIT_DIFF_FORCE_TEXT", + "GIT_DIFF_FORCE_BINARY", + "GIT_DIFF_IGNORE_WHITESPACE", + "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", + "GIT_DIFF_IGNORE_WHITESPACE_EOL", + "GIT_DIFF_SHOW_UNTRACKED_CONTENT", + "GIT_DIFF_SHOW_UNMODIFIED", + "GIT_DIFF_PATIENCE", + "GIT_DIFF_MINIMAL", + "GIT_DIFF_SHOW_BINARY" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 28, + "lineto": 174, + "block": "GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_INDENT_HEURISTIC\nGIT_DIFF_IGNORE_BLANK_LINES\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY", + "tdef": "typedef", + "description": " Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_NORMAL", + "comments": "

Normal diff, the default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_REVERSE", + "comments": "

Reverse the sides of the diff

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_IGNORED", + "comments": "

Include ignored files in the diff

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_RECURSE_IGNORED_DIRS", + "comments": "

Even with GIT_DIFF_INCLUDE_IGNORED, an entire ignored directory\n will be marked with only a single entry in the diff; this flag\n adds all files under the directory as IGNORED entries, too.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNTRACKED", + "comments": "

Include untracked files in the diff

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DIFF_RECURSE_UNTRACKED_DIRS", + "comments": "

Even with GIT_DIFF_INCLUDE_UNTRACKED, an entire untracked\n directory will be marked with only a single entry in the diff\n (a la what core Git does in git status); this flag adds all\n files under untracked directories as UNTRACKED entries, too.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNMODIFIED", + "comments": "

Include unmodified files in the diff

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_TYPECHANGE", + "comments": "

Normally, a type change between files will be converted into a\n DELETED record for the old and an ADDED record for the new; this\n options enabled the generation of TYPECHANGE delta records.

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", + "comments": "

Even with GIT_DIFF_INCLUDE_TYPECHANGE, blob->tree changes still\n generally show as a DELETED blob. This flag tries to correctly\n label blob->tree transitions as TYPECHANGE records with new_file's\n mode set to tree. Note: the tree SHA will not be available.

\n", + "value": 128 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_FILEMODE", + "comments": "

Ignore file mode changes

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_SUBMODULES", + "comments": "

Treat all submodules as unmodified

\n", + "value": 512 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_CASE", + "comments": "

Use case insensitive filename comparisons

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_CASECHANGE", + "comments": "

May be combined with GIT_DIFF_IGNORE_CASE to specify that a file\n that has changed case will be returned as an add/delete pair.

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_DIFF_DISABLE_PATHSPEC_MATCH", + "comments": "

If the pathspec is set in the diff options, this flags indicates\n that the paths will be treated as literal paths instead of\n fnmatch patterns. Each path in the list must either be a full\n path to a file or a directory. (A trailing slash indicates that\n the path will only match a directory). If a directory is\n specified, all children will be included.

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_DIFF_SKIP_BINARY_CHECK", + "comments": "

Disable updating of the binary flag in delta records. This is\n useful when iterating over a diff if you don't need hunk and data\n callbacks and want to avoid having to load file completely.

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", + "comments": "

When diff finds an untracked directory, to match the behavior of\n core Git, it scans the contents for IGNORED and UNTRACKED files.\n If all contents are IGNORED, then the directory is IGNORED; if\n any contents are not IGNORED, then the directory is UNTRACKED.\n This is extra work that may not matter in many cases. This flag\n turns off that scan and immediately labels an untracked directory\n as UNTRACKED (changing the behavior to not match core Git).

\n", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_DIFF_UPDATE_INDEX", + "comments": "

When diff finds a file in the working directory with stat\n information different from the index, but the OID ends up being the\n same, write the correct stat information into the index. Note:\n without this flag, diff will always leave the index untouched.

\n", + "value": 32768 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNREADABLE", + "comments": "

Include unreadable files in the diff

\n", + "value": 65536 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", + "comments": "

Include unreadable files in the diff

\n", + "value": 131072 + }, + { + "type": "int", + "name": "GIT_DIFF_INDENT_HEURISTIC", + "comments": "

Use a heuristic that takes indentation and whitespace into account\n which generally can produce better diffs when dealing with ambiguous\n diff hunks.

\n", + "value": 262144 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_BLANK_LINES", + "comments": "

Ignore blank lines

\n", + "value": 524288 + }, + { + "type": "int", + "name": "GIT_DIFF_FORCE_TEXT", + "comments": "

Treat all files as text, disabling binary attributes \n&\n detection

\n", + "value": 1048576 + }, + { + "type": "int", + "name": "GIT_DIFF_FORCE_BINARY", + "comments": "

Treat all files as binary, disabling text diffs

\n", + "value": 2097152 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE", + "comments": "

Ignore all whitespace

\n", + "value": 4194304 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", + "comments": "

Ignore changes in amount of whitespace

\n", + "value": 8388608 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE_EOL", + "comments": "

Ignore whitespace at end of line

\n", + "value": 16777216 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_UNTRACKED_CONTENT", + "comments": "

When generating patch text, include the content of untracked\n files. This automatically turns on GIT_DIFF_INCLUDE_UNTRACKED but\n it does not turn on GIT_DIFF_RECURSE_UNTRACKED_DIRS. Add that\n flag if you want the content of every single UNTRACKED file.

\n", + "value": 33554432 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_UNMODIFIED", + "comments": "

When generating output, include the names of unmodified files if\n they are included in the git_diff. Normally these are skipped in\n the formats that list files (e.g. name-only, name-status, raw).\n Even with this, these will not be included in patch format.

\n", + "value": 67108864 + }, + { + "type": "int", + "name": "GIT_DIFF_PATIENCE", + "comments": "

Use the "patience diff" algorithm

\n", + "value": 268435456 + }, + { + "type": "int", + "name": "GIT_DIFF_MINIMAL", + "comments": "

Take extra time to find minimal diff

\n", + "value": 536870912 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_BINARY", + "comments": "

Include the necessary deflate / delta information so that git-apply\n can apply given diff information to binary files.

\n", + "value": 1073741824 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_submodule_ignore_t ignore_submodules", + "git_strarray pathspec", + "git_diff_notify_cb notify_cb", + "git_diff_progress_cb progress_cb", + "void * payload", + "uint32_t context_lines", + "uint32_t interhunk_lines", + "git_oid_t oid_type", + "uint16_t id_abbrev", + "git_off_t max_size", + "const char * old_prefix", + "const char * new_prefix" + ], + "type": "struct", + "value": "git_diff_options", + "file": "git2/diff.h", + "line": 383, + "lineto": 471, + "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\ngit_diff_progress_cb progress_cb\nvoid * payload\nuint32_t context_lines\nuint32_t interhunk_lines\ngit_oid_t oid_type\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", + "tdef": "typedef", + "description": " Structure describing options about how the diff should be executed.", + "comments": "

Setting all values of the structure to zero will yield the default values. Similarly, passing NULL for the options structure will give the defaults. The default values are marked below.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " version for the struct " + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " A combination of `git_diff_option_t` values above.\n Defaults to GIT_DIFF_NORMAL" + }, + { + "type": "git_submodule_ignore_t", + "name": "ignore_submodules", + "comments": " Overrides the submodule ignore setting for all submodules in the diff. " + }, + { + "type": "git_strarray", + "name": "pathspec", + "comments": " An array of paths / fnmatch patterns to constrain diff.\n All paths are included by default." + }, + { + "type": "git_diff_notify_cb", + "name": "notify_cb", + "comments": " An optional callback function, notifying the consumer of changes to\n the diff as new deltas are added." + }, + { + "type": "git_diff_progress_cb", + "name": "progress_cb", + "comments": " An optional callback function, notifying the consumer of which files\n are being examined as the diff is generated." + }, + { + "type": "void *", + "name": "payload", + "comments": " The payload to pass to the callback functions. " + }, + { + "type": "uint32_t", + "name": "context_lines", + "comments": " The number of unchanged lines that define the boundary of a hunk\n (and to display before and after). Defaults to 3." + }, + { + "type": "uint32_t", + "name": "interhunk_lines", + "comments": " The maximum number of unchanged lines between hunk boundaries before\n the hunks will be merged into one. Defaults to 0." + }, + { + "type": "git_oid_t", + "name": "oid_type", + "comments": " The object ID type to emit in diffs; this is used by functions\n that operate without a repository - namely `git_diff_buffers`,\n or `git_diff_blobs` and `git_diff_blob_to_buffer` when one blob\n is `NULL`.\n\n This may be omitted (set to `0`). If a repository is available,\n the object ID format of the repository will be used. If no\n repository is available then the default is `GIT_OID_SHA`.\n\n If this is specified and a repository is available, then the\n specified `oid_type` must match the repository's object ID\n format." + }, + { + "type": "uint16_t", + "name": "id_abbrev", + "comments": " The abbreviation length to use when formatting object ids.\n Defaults to the value of 'core.abbrev' from the config, or 7 if unset." + }, + { + "type": "git_off_t", + "name": "max_size", + "comments": " A size (in bytes) above which a blob will be marked as binary\n automatically; pass a negative value to disable.\n Defaults to 512MB." + }, + { + "type": "const char *", + "name": "old_prefix", + "comments": " The virtual \"directory\" prefix for old file names in hunk headers.\n Default is \"a\"." + }, + { + "type": "const char *", + "name": "new_prefix", + "comments": " The virtual \"directory\" prefix for new file names in hunk headers.\n Defaults to \"b\"." + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_options_init", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers" + ] + } + } + ], + [ + "git_diff_parse_options", + { + "decl": ["unsigned int version", "git_oid_t oid_type"], + "type": "struct", + "value": "git_diff_parse_options", + "file": "git2/diff.h", + "line": 1322, + "lineto": 1325, + "block": "unsigned int version\ngit_oid_t oid_type", + "tdef": "typedef", + "description": " Options for parsing a diff / patch file.", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { "type": "git_oid_t", "name": "oid_type", "comments": "" } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_patchid_options", + { + "decl": ["unsigned int version"], + "type": "struct", + "value": "git_diff_patchid_options", + "file": "git2/diff.h", + "line": 1459, + "lineto": 1461, + "block": "unsigned int version", + "tdef": "typedef", + "description": " Patch ID options structure", + "comments": "

Initialize with GIT_PATCHID_OPTIONS_INIT. Alternatively, you can use git_diff_patchid_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_diff_patchid", "git_diff_patchid_options_init"] + } + } + ], + [ + "git_diff_similarity_metric", + { + "decl": [ + "int (*)(void **, const git_diff_file *, const char *, void *) file_signature", + "int (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature", + "void (*)(void *, void *) free_signature", + "int (*)(int *, void *, void *, void *) similarity", + "void * payload" + ], + "type": "struct", + "value": "git_diff_similarity_metric", + "file": "git2/diff.h", + "line": 757, + "lineto": 767, + "block": "int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload", + "tdef": "typedef", + "description": " Pluggable similarity metric", + "comments": "", + "fields": [ + { + "type": "int (*)(void **, const git_diff_file *, const char *, void *)", + "name": "file_signature", + "comments": "" + }, + { + "type": "int (*)(void **, const git_diff_file *, const char *, size_t, void *)", + "name": "buffer_signature", + "comments": "" + }, + { + "type": "void (*)(void *, void *)", + "name": "free_signature", + "comments": "" + }, + { + "type": "int (*)(int *, void *, void *, void *)", + "name": "similarity", + "comments": "" + }, + { "type": "void *", "name": "payload", "comments": "" } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_diff_stats", + { + "decl": "git_diff_stats", + "type": "struct", + "value": "git_diff_stats", + "file": "git2/diff.h", + "line": 1369, + "lineto": 1369, + "tdef": "typedef", + "description": " This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_diff_get_stats", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf" + ] + } + } + ], + [ + "git_diff_stats_format_t", + { + "decl": [ + "GIT_DIFF_STATS_NONE", + "GIT_DIFF_STATS_FULL", + "GIT_DIFF_STATS_SHORT", + "GIT_DIFF_STATS_NUMBER", + "GIT_DIFF_STATS_INCLUDE_SUMMARY" + ], + "type": "enum", + "file": "git2/diff.h", + "line": 1374, + "lineto": 1389, + "block": "GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY", + "tdef": "typedef", + "description": " Formatting options for diff stats", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_STATS_NONE", + "comments": "

No stats

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_FULL", + "comments": "

Full statistics, equivalent of --stat

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_SHORT", + "comments": "

Short statistics, equivalent of --shortstat

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_NUMBER", + "comments": "

Number statistics, equivalent of --numstat

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_INCLUDE_SUMMARY", + "comments": "

Extended header information such as creations, renames and mode changes, equivalent of --summary

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": ["git_diff_stats_to_buf"] } + } + ], + [ + "git_direction", + { + "decl": ["GIT_DIRECTION_FETCH", "GIT_DIRECTION_PUSH"], + "type": "enum", + "file": "git2/net.h", + "line": 32, + "lineto": 35, + "block": "GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH", + "tdef": "typedef", + "description": " Direction of the connection.", + "comments": "

We need this because we need to know whether we should call git-upload-pack or git-receive-pack on the remote end when get_refs gets called.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DIRECTION_FETCH", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIRECTION_PUSH", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": ["git_refspec_direction"], + "needs": ["git_remote_connect", "git_remote_connect_ext"] + } + } + ], + [ + "git_email_create_flags_t", + { + "decl": [ + "GIT_EMAIL_CREATE_DEFAULT", + "GIT_EMAIL_CREATE_OMIT_NUMBERS", + "GIT_EMAIL_CREATE_ALWAYS_NUMBER", + "GIT_EMAIL_CREATE_NO_RENAMES" + ], + "type": "enum", + "file": "git2/email.h", + "line": 24, + "lineto": 39, + "block": "GIT_EMAIL_CREATE_DEFAULT\nGIT_EMAIL_CREATE_OMIT_NUMBERS\nGIT_EMAIL_CREATE_ALWAYS_NUMBER\nGIT_EMAIL_CREATE_NO_RENAMES", + "tdef": "typedef", + "description": " Formatting options for diff e-mail generation", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_EMAIL_CREATE_DEFAULT", + "comments": "

Normal patch, the default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_EMAIL_CREATE_OMIT_NUMBERS", + "comments": "

Do not include patch numbers in the subject prefix.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_EMAIL_CREATE_ALWAYS_NUMBER", + "comments": "

Include numbers in the subject prefix even when the\n patch is for a single commit (1/1).

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_EMAIL_CREATE_NO_RENAMES", + "comments": "

Do not perform rename or similarity detection.

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_email_create_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_diff_options diff_opts", + "git_diff_find_options diff_find_opts", + "const char * subject_prefix", + "size_t start_number", + "size_t reroll_number" + ], + "type": "struct", + "value": "git_email_create_options", + "file": "git2/email.h", + "line": 44, + "lineto": 72, + "block": "unsigned int version\nuint32_t flags\ngit_diff_options diff_opts\ngit_diff_find_options diff_find_opts\nconst char * subject_prefix\nsize_t start_number\nsize_t reroll_number", + "tdef": "typedef", + "description": " Options for controlling the formatting of the generated e-mail.", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " see `git_email_create_flags_t` above " + }, + { + "type": "git_diff_options", + "name": "diff_opts", + "comments": " Options to use when creating diffs " + }, + { + "type": "git_diff_find_options", + "name": "diff_find_opts", + "comments": " Options for finding similarities within diffs " + }, + { + "type": "const char *", + "name": "subject_prefix", + "comments": " The subject prefix, by default \"PATCH\". If set to an empty\n string (\"\") then only the patch numbers will be shown in the\n prefix. If the subject_prefix is empty and patch numbers\n are not being shown, the prefix will be omitted entirely." + }, + { + "type": "size_t", + "name": "start_number", + "comments": " The starting patch number; this cannot be 0. By default,\n this is 1." + }, + { + "type": "size_t", + "name": "reroll_number", + "comments": " The \"re-roll\" number. By default, there is no re-roll. " + } + ], + "used": { "returns": [], "needs": ["git_email_create_from_commit"] } + } + ], + [ + "git_error", + { + "decl": ["char * message", "int klass"], + "type": "struct", + "value": "git_error", + "file": "git2/errors.h", + "line": 125, + "lineto": 128, + "block": "char * message\nint klass", + "tdef": "typedef", + "description": " Structure to store extra details of the last error that occurred.", + "comments": "

This is kept on a per-thread basis if GIT_THREADS was defined when the library was build, otherwise one is kept globally for the library

\n", + "fields": [ + { + "type": "char *", + "name": "message", + "comments": " The error message for the last error. " + }, + { + "type": "int", + "name": "klass", + "comments": " The category of the last error. \n\n git_error_t " + } + ], + "used": { "returns": ["git_error_last", "giterr_last"], "needs": [] } + } + ], + [ + "git_error_code", + { + "decl": [ + "GIT_OK", + "GIT_ERROR", + "GIT_ENOTFOUND", + "GIT_EEXISTS", + "GIT_EAMBIGUOUS", + "GIT_EBUFS", + "GIT_EUSER", + "GIT_EBAREREPO", + "GIT_EUNBORNBRANCH", + "GIT_EUNMERGED", + "GIT_ENONFASTFORWARD", + "GIT_EINVALIDSPEC", + "GIT_ECONFLICT", + "GIT_ELOCKED", + "GIT_EMODIFIED", + "GIT_EAUTH", + "GIT_ECERTIFICATE", + "GIT_EAPPLIED", + "GIT_EPEEL", + "GIT_EEOF", + "GIT_EINVALID", + "GIT_EUNCOMMITTED", + "GIT_EDIRECTORY", + "GIT_EMERGECONFLICT", + "GIT_PASSTHROUGH", + "GIT_ITEROVER", + "GIT_RETRY", + "GIT_EMISMATCH", + "GIT_EINDEXDIRTY", + "GIT_EAPPLYFAIL", + "GIT_EOWNER", + "GIT_TIMEOUT", + "GIT_EUNCHANGED", + "GIT_ENOTSUPPORTED", + "GIT_EREADONLY" + ], + "type": "enum", + "file": "git2/errors.h", + "line": 21, + "lineto": 73, + "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_EMERGECONFLICT\nGIT_PASSTHROUGH\nGIT_ITEROVER\nGIT_RETRY\nGIT_EMISMATCH\nGIT_EINDEXDIRTY\nGIT_EAPPLYFAIL\nGIT_EOWNER\nGIT_TIMEOUT\nGIT_EUNCHANGED\nGIT_ENOTSUPPORTED\nGIT_EREADONLY", + "tdef": "typedef", + "description": " Generic return codes ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_OK", + "comments": "

No error occurred; the call was successful.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_ERROR", + "comments": "

An error occurred; call git_error_last for more information.

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_ENOTFOUND", + "comments": "

Requested object could not be found.

\n", + "value": -3 + }, + { + "type": "int", + "name": "GIT_EEXISTS", + "comments": "

Object exists preventing operation.

\n", + "value": -4 + }, + { + "type": "int", + "name": "GIT_EAMBIGUOUS", + "comments": "

More than one object matches.

\n", + "value": -5 + }, + { + "type": "int", + "name": "GIT_EBUFS", + "comments": "

Output buffer too short to hold data.

\n", + "value": -6 + }, + { + "type": "int", + "name": "GIT_EUSER", + "comments": "

GIT_EUSER is a special error that is never generated by libgit2\n code. You can return it from a callback (e.g to stop an iteration)\n to know that it was generated by the callback and not by libgit2.

\n", + "value": -7 + }, + { + "type": "int", + "name": "GIT_EBAREREPO", + "comments": "

Operation not allowed on bare repository.

\n", + "value": -8 + }, + { + "type": "int", + "name": "GIT_EUNBORNBRANCH", + "comments": "

HEAD refers to branch with no commits.

\n", + "value": -9 + }, + { + "type": "int", + "name": "GIT_EUNMERGED", + "comments": "

Merge in progress prevented operation

\n", + "value": -10 + }, + { + "type": "int", + "name": "GIT_ENONFASTFORWARD", + "comments": "

Reference was not fast-forwardable

\n", + "value": -11 + }, + { + "type": "int", + "name": "GIT_EINVALIDSPEC", + "comments": "

Name/ref spec was not in a valid format

\n", + "value": -12 + }, + { + "type": "int", + "name": "GIT_ECONFLICT", + "comments": "

Checkout conflicts prevented operation

\n", + "value": -13 + }, + { + "type": "int", + "name": "GIT_ELOCKED", + "comments": "

Lock file prevented operation

\n", + "value": -14 + }, + { + "type": "int", + "name": "GIT_EMODIFIED", + "comments": "

Reference value does not match expected

\n", + "value": -15 + }, + { + "type": "int", + "name": "GIT_EAUTH", + "comments": "

Authentication error

\n", + "value": -16 + }, + { + "type": "int", + "name": "GIT_ECERTIFICATE", + "comments": "

Server certificate is invalid

\n", + "value": -17 + }, + { + "type": "int", + "name": "GIT_EAPPLIED", + "comments": "

Patch/merge has already been applied

\n", + "value": -18 + }, + { + "type": "int", + "name": "GIT_EPEEL", + "comments": "

The requested peel operation is not possible

\n", + "value": -19 + }, + { + "type": "int", + "name": "GIT_EEOF", + "comments": "

Unexpected EOF

\n", + "value": -20 + }, + { + "type": "int", + "name": "GIT_EINVALID", + "comments": "

Invalid operation or input

\n", + "value": -21 + }, + { + "type": "int", + "name": "GIT_EUNCOMMITTED", + "comments": "

Uncommitted changes in index prevented operation

\n", + "value": -22 + }, + { + "type": "int", + "name": "GIT_EDIRECTORY", + "comments": "

The operation is not valid for a directory

\n", + "value": -23 + }, + { + "type": "int", + "name": "GIT_EMERGECONFLICT", + "comments": "

A merge conflict exists and cannot continue

\n", + "value": -24 + }, + { + "type": "int", + "name": "GIT_PASSTHROUGH", + "comments": "

A user-configured callback refused to act

\n", + "value": -30 + }, + { + "type": "int", + "name": "GIT_ITEROVER", + "comments": "

Signals end of iteration with iterator

\n", + "value": -31 + }, + { + "type": "int", + "name": "GIT_RETRY", + "comments": "

Internal only

\n", + "value": -32 + }, + { + "type": "int", + "name": "GIT_EMISMATCH", + "comments": "

Hashsum mismatch in object

\n", + "value": -33 + }, + { + "type": "int", + "name": "GIT_EINDEXDIRTY", + "comments": "

Unsaved changes in the index would be overwritten

\n", + "value": -34 + }, + { + "type": "int", + "name": "GIT_EAPPLYFAIL", + "comments": "

Patch application failed

\n", + "value": -35 + }, + { + "type": "int", + "name": "GIT_EOWNER", + "comments": "

The object is not owned by the current user

\n", + "value": -36 + }, + { + "type": "int", + "name": "GIT_TIMEOUT", + "comments": "

The operation timed out

\n", + "value": -37 + }, + { + "type": "int", + "name": "GIT_EUNCHANGED", + "comments": "

There were no changes

\n", + "value": -38 + }, + { + "type": "int", + "name": "GIT_ENOTSUPPORTED", + "comments": "

An option is not supported

\n", + "value": -39 + }, + { + "type": "int", + "name": "GIT_EREADONLY", + "comments": "

The subject is read-only

\n", + "value": -40 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_error_t", + { + "decl": [ + "GIT_ERROR_NONE", + "GIT_ERROR_NOMEMORY", + "GIT_ERROR_OS", + "GIT_ERROR_INVALID", + "GIT_ERROR_REFERENCE", + "GIT_ERROR_ZLIB", + "GIT_ERROR_REPOSITORY", + "GIT_ERROR_CONFIG", + "GIT_ERROR_REGEX", + "GIT_ERROR_ODB", + "GIT_ERROR_INDEX", + "GIT_ERROR_OBJECT", + "GIT_ERROR_NET", + "GIT_ERROR_TAG", + "GIT_ERROR_TREE", + "GIT_ERROR_INDEXER", + "GIT_ERROR_SSL", + "GIT_ERROR_SUBMODULE", + "GIT_ERROR_THREAD", + "GIT_ERROR_STASH", + "GIT_ERROR_CHECKOUT", + "GIT_ERROR_FETCHHEAD", + "GIT_ERROR_MERGE", + "GIT_ERROR_SSH", + "GIT_ERROR_FILTER", + "GIT_ERROR_REVERT", + "GIT_ERROR_CALLBACK", + "GIT_ERROR_CHERRYPICK", + "GIT_ERROR_DESCRIBE", + "GIT_ERROR_REBASE", + "GIT_ERROR_FILESYSTEM", + "GIT_ERROR_PATCH", + "GIT_ERROR_WORKTREE", + "GIT_ERROR_SHA", + "GIT_ERROR_HTTP", + "GIT_ERROR_INTERNAL", + "GIT_ERROR_GRAFTS" + ], + "type": "enum", + "file": "git2/errors.h", + "line": 79, + "lineto": 117, + "block": "GIT_ERROR_NONE\nGIT_ERROR_NOMEMORY\nGIT_ERROR_OS\nGIT_ERROR_INVALID\nGIT_ERROR_REFERENCE\nGIT_ERROR_ZLIB\nGIT_ERROR_REPOSITORY\nGIT_ERROR_CONFIG\nGIT_ERROR_REGEX\nGIT_ERROR_ODB\nGIT_ERROR_INDEX\nGIT_ERROR_OBJECT\nGIT_ERROR_NET\nGIT_ERROR_TAG\nGIT_ERROR_TREE\nGIT_ERROR_INDEXER\nGIT_ERROR_SSL\nGIT_ERROR_SUBMODULE\nGIT_ERROR_THREAD\nGIT_ERROR_STASH\nGIT_ERROR_CHECKOUT\nGIT_ERROR_FETCHHEAD\nGIT_ERROR_MERGE\nGIT_ERROR_SSH\nGIT_ERROR_FILTER\nGIT_ERROR_REVERT\nGIT_ERROR_CALLBACK\nGIT_ERROR_CHERRYPICK\nGIT_ERROR_DESCRIBE\nGIT_ERROR_REBASE\nGIT_ERROR_FILESYSTEM\nGIT_ERROR_PATCH\nGIT_ERROR_WORKTREE\nGIT_ERROR_SHA\nGIT_ERROR_HTTP\nGIT_ERROR_INTERNAL\nGIT_ERROR_GRAFTS", + "tdef": "typedef", + "description": " Error classes are the category of error. They reflect the area of the\n code where an error occurred.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_ERROR_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_ERROR_NOMEMORY", + "comments": "", + "value": 1 + }, + { "type": "int", "name": "GIT_ERROR_OS", "comments": "", "value": 2 }, + { + "type": "int", + "name": "GIT_ERROR_INVALID", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_ERROR_REFERENCE", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_ERROR_ZLIB", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_ERROR_REPOSITORY", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_ERROR_CONFIG", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_ERROR_REGEX", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_ERROR_ODB", + "comments": "", + "value": 9 + }, + { + "type": "int", + "name": "GIT_ERROR_INDEX", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GIT_ERROR_OBJECT", + "comments": "", + "value": 11 + }, + { + "type": "int", + "name": "GIT_ERROR_NET", + "comments": "", + "value": 12 + }, + { + "type": "int", + "name": "GIT_ERROR_TAG", + "comments": "", + "value": 13 + }, + { + "type": "int", + "name": "GIT_ERROR_TREE", + "comments": "", + "value": 14 + }, + { + "type": "int", + "name": "GIT_ERROR_INDEXER", + "comments": "", + "value": 15 + }, + { + "type": "int", + "name": "GIT_ERROR_SSL", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_ERROR_SUBMODULE", + "comments": "", + "value": 17 + }, + { + "type": "int", + "name": "GIT_ERROR_THREAD", + "comments": "", + "value": 18 + }, + { + "type": "int", + "name": "GIT_ERROR_STASH", + "comments": "", + "value": 19 + }, + { + "type": "int", + "name": "GIT_ERROR_CHECKOUT", + "comments": "", + "value": 20 + }, + { + "type": "int", + "name": "GIT_ERROR_FETCHHEAD", + "comments": "", + "value": 21 + }, + { + "type": "int", + "name": "GIT_ERROR_MERGE", + "comments": "", + "value": 22 + }, + { + "type": "int", + "name": "GIT_ERROR_SSH", + "comments": "", + "value": 23 + }, + { + "type": "int", + "name": "GIT_ERROR_FILTER", + "comments": "", + "value": 24 + }, + { + "type": "int", + "name": "GIT_ERROR_REVERT", + "comments": "", + "value": 25 + }, + { + "type": "int", + "name": "GIT_ERROR_CALLBACK", + "comments": "", + "value": 26 + }, + { + "type": "int", + "name": "GIT_ERROR_CHERRYPICK", + "comments": "", + "value": 27 + }, + { + "type": "int", + "name": "GIT_ERROR_DESCRIBE", + "comments": "", + "value": 28 + }, + { + "type": "int", + "name": "GIT_ERROR_REBASE", + "comments": "", + "value": 29 + }, + { + "type": "int", + "name": "GIT_ERROR_FILESYSTEM", + "comments": "", + "value": 30 + }, + { + "type": "int", + "name": "GIT_ERROR_PATCH", + "comments": "", + "value": 31 + }, + { + "type": "int", + "name": "GIT_ERROR_WORKTREE", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_ERROR_SHA", + "comments": "", + "value": 33 + }, + { + "type": "int", + "name": "GIT_ERROR_HTTP", + "comments": "", + "value": 34 + }, + { + "type": "int", + "name": "GIT_ERROR_INTERNAL", + "comments": "", + "value": 35 + }, + { + "type": "int", + "name": "GIT_ERROR_GRAFTS", + "comments": "", + "value": 36 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_feature_t", + { + "decl": [ + "GIT_FEATURE_THREADS", + "GIT_FEATURE_HTTPS", + "GIT_FEATURE_SSH", + "GIT_FEATURE_NSEC", + "GIT_FEATURE_HTTP_PARSER", + "GIT_FEATURE_REGEX", + "GIT_FEATURE_I18N", + "GIT_FEATURE_AUTH_NTLM", + "GIT_FEATURE_AUTH_NEGOTIATE", + "GIT_FEATURE_COMPRESSION", + "GIT_FEATURE_SHA1", + "GIT_FEATURE_SHA256" + ], + "type": "enum", + "file": "git2/common.h", + "line": 138, + "lineto": 177, + "block": "GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH\nGIT_FEATURE_NSEC\nGIT_FEATURE_HTTP_PARSER\nGIT_FEATURE_REGEX\nGIT_FEATURE_I18N\nGIT_FEATURE_AUTH_NTLM\nGIT_FEATURE_AUTH_NEGOTIATE\nGIT_FEATURE_COMPRESSION\nGIT_FEATURE_SHA1\nGIT_FEATURE_SHA256", + "tdef": "typedef", + "description": " Configurable features of libgit2; either optional settings (like\n threading), or features that can be enabled by one of a number of\n different backend \"providers\" (like HTTPS, which can be provided by\n OpenSSL, mbedTLS, or system libraries).", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FEATURE_THREADS", + "comments": "

libgit2 is thread-aware and can be used from multiple threads\n (as described in the documentation).

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_FEATURE_HTTPS", + "comments": "

HTTPS remotes

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_FEATURE_SSH", + "comments": "

SSH remotes

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_FEATURE_NSEC", + "comments": "

Sub-second resolution in index timestamps

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_FEATURE_HTTP_PARSER", + "comments": "

HTTP parsing; always available

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_FEATURE_REGEX", + "comments": "

Regular expression support; always available

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_FEATURE_I18N", + "comments": "

Internationalization support for filename translation

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_FEATURE_AUTH_NTLM", + "comments": "

NTLM support over HTTPS

\n", + "value": 128 + }, + { + "type": "int", + "name": "GIT_FEATURE_AUTH_NEGOTIATE", + "comments": "

Kerberos (SPNEGO) authentication support over HTTPS

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_FEATURE_COMPRESSION", + "comments": "

zlib support; always available

\n", + "value": 512 + }, + { + "type": "int", + "name": "GIT_FEATURE_SHA1", + "comments": "

SHA1 object support; always available

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_FEATURE_SHA256", + "comments": "

SHA256 object support

\n", + "value": 2048 + } + ], + "used": { "returns": [], "needs": ["git_libgit2_feature_backend"] } + } + ], + [ + "git_fetch_depth_t", + { + "decl": ["GIT_FETCH_DEPTH_FULL", "GIT_FETCH_DEPTH_UNSHALLOW"], + "type": "enum", + "file": "git2/remote.h", + "line": 760, + "lineto": 766, + "block": "GIT_FETCH_DEPTH_FULL\nGIT_FETCH_DEPTH_UNSHALLOW", + "tdef": "typedef", + "description": " Constants for fetch depth (shallowness of fetch). ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FETCH_DEPTH_FULL", + "comments": "

The fetch is "full" (not shallow). This is the default.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FETCH_DEPTH_UNSHALLOW", + "comments": "

The fetch should "unshallow" and fetch missing data.

\n", + "value": 2147483647 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_fetch_options", + { + "decl": [ + "int version", + "git_remote_callbacks callbacks", + "git_fetch_prune_t prune", + "unsigned int update_fetchhead", + "git_remote_autotag_option_t download_tags", + "git_proxy_options proxy_opts", + "int depth", + "git_remote_redirect_t follow_redirects", + "git_strarray custom_headers" + ], + "type": "struct", + "value": "git_fetch_options", + "file": "git2/remote.h", + "line": 776, + "lineto": 828, + "block": "int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nunsigned int update_fetchhead\ngit_remote_autotag_option_t download_tags\ngit_proxy_options proxy_opts\nint depth\ngit_remote_redirect_t follow_redirects\ngit_strarray custom_headers", + "tdef": "typedef", + "description": " Fetch options structure.", + "comments": "

Zero out for defaults. Initialize with GIT_FETCH_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;\n
\n", + "fields": [ + { "type": "int", "name": "version", "comments": "" }, + { + "type": "git_remote_callbacks", + "name": "callbacks", + "comments": " Callbacks to use for this fetch operation" + }, + { + "type": "git_fetch_prune_t", + "name": "prune", + "comments": " Whether to perform a prune after the fetch" + }, + { + "type": "unsigned int", + "name": "update_fetchhead", + "comments": " How to handle reference updates; see `git_remote_update_flags`." + }, + { + "type": "git_remote_autotag_option_t", + "name": "download_tags", + "comments": " Determines how to behave regarding tags on the remote, such\n as auto-downloading tags for objects we're downloading or\n downloading all of them.\n\n The default is to auto-follow tags." + }, + { + "type": "git_proxy_options", + "name": "proxy_opts", + "comments": " Proxy options to use, by default no proxy is used." + }, + { + "type": "int", + "name": "depth", + "comments": " Depth of the fetch to perform, or `GIT_FETCH_DEPTH_FULL`\n (or `0`) for full history, or `GIT_FETCH_DEPTH_UNSHALLOW`\n to \"unshallow\" a shallow repository.\n\n The default is full (`GIT_FETCH_DEPTH_FULL` or `0`)." + }, + { + "type": "git_remote_redirect_t", + "name": "follow_redirects", + "comments": " Whether to allow off-site redirects. If this is not\n specified, the `http.followRedirects` configuration setting\n will be consulted." + }, + { + "type": "git_strarray", + "name": "custom_headers", + "comments": " Extra headers for this fetch operation" + } + ], + "used": { + "returns": [], + "needs": [ + "git_fetch_options_init", + "git_remote_download", + "git_remote_fetch" + ] + } + } + ], + [ + "git_fetch_prune_t", + { + "decl": [ + "GIT_FETCH_PRUNE_UNSPECIFIED", + "GIT_FETCH_PRUNE", + "GIT_FETCH_NO_PRUNE" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 719, + "lineto": 732, + "block": "GIT_FETCH_PRUNE_UNSPECIFIED\nGIT_FETCH_PRUNE\nGIT_FETCH_NO_PRUNE", + "tdef": "typedef", + "description": " Acceptable prune settings when fetching ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FETCH_PRUNE_UNSPECIFIED", + "comments": "

Use the setting from the configuration

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FETCH_PRUNE", + "comments": "

Force pruning on

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_FETCH_NO_PRUNE", + "comments": "

Force pruning off

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_filemode_t", + { + "decl": [ + "GIT_FILEMODE_UNREADABLE", + "GIT_FILEMODE_TREE", + "GIT_FILEMODE_BLOB", + "GIT_FILEMODE_BLOB_EXECUTABLE", + "GIT_FILEMODE_LINK", + "GIT_FILEMODE_COMMIT" + ], + "type": "enum", + "file": "git2/types.h", + "line": 238, + "lineto": 245, + "block": "GIT_FILEMODE_UNREADABLE\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT", + "tdef": "typedef", + "description": " Valid modes for index and tree entries. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FILEMODE_UNREADABLE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILEMODE_TREE", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_FILEMODE_BLOB", + "comments": "", + "value": 33188 + }, + { + "type": "int", + "name": "GIT_FILEMODE_BLOB_EXECUTABLE", + "comments": "", + "value": 33261 + }, + { + "type": "int", + "name": "GIT_FILEMODE_LINK", + "comments": "", + "value": 40960 + }, + { + "type": "int", + "name": "GIT_FILEMODE_COMMIT", + "comments": "", + "value": 57344 + } + ], + "used": { + "returns": ["git_tree_entry_filemode", "git_tree_entry_filemode_raw"], + "needs": ["git_treebuilder_insert"] + } + } + ], + [ + "git_filter", + { + "decl": "git_filter", + "type": "struct", + "value": "git_filter", + "file": "git2/filter.h", + "line": 109, + "lineto": 109, + "tdef": "typedef", + "description": " A filter that can transform file data", + "comments": "

This represents a filter that can be used to transform or even replace file data. Libgit2 includes one built in filter and it is possible to write your own (see git2/sys/filter.h for information on that).

\n\n

The two builtin filters are:

\n\n\n", + "used": { + "returns": [], + "needs": [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + } + } + ], + [ + "git_filter_flag_t", + { + "decl": [ + "GIT_FILTER_DEFAULT", + "GIT_FILTER_ALLOW_UNSAFE", + "GIT_FILTER_NO_SYSTEM_ATTRIBUTES", + "GIT_FILTER_ATTRIBUTES_FROM_HEAD", + "GIT_FILTER_ATTRIBUTES_FROM_COMMIT" + ], + "type": "enum", + "file": "git2/filter.h", + "line": 47, + "lineto": 64, + "block": "GIT_FILTER_DEFAULT\nGIT_FILTER_ALLOW_UNSAFE\nGIT_FILTER_NO_SYSTEM_ATTRIBUTES\nGIT_FILTER_ATTRIBUTES_FROM_HEAD\nGIT_FILTER_ATTRIBUTES_FROM_COMMIT", + "tdef": "typedef", + "description": " Filter option flags.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FILTER_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILTER_ALLOW_UNSAFE", + "comments": "

Don't error for safecrlf violations, allow them to continue.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_FILTER_NO_SYSTEM_ATTRIBUTES", + "comments": "

Don't load /etc/gitattributes (or the system equivalent)

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_FILTER_ATTRIBUTES_FROM_HEAD", + "comments": "

Load attributes from .gitattributes in the root of HEAD

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_FILTER_ATTRIBUTES_FROM_COMMIT", + "comments": "

Load attributes from .gitattributes in a given commit.\n This can only be specified in a git_filter_options.

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_filter_list", + { + "decl": "git_filter_list", + "type": "struct", + "value": "git_filter_list", + "file": "git2/filter.h", + "line": 121, + "lineto": 121, + "tdef": "typedef", + "description": " List of filters to be applied", + "comments": "

This represents a list of filters to be applied to a file / blob. You can build the list with one call, apply it with another, and dispose it with a third. In typical usage, there are not many occasions where a git_filter_list is needed directly since the library will generally handle conversions for you, but it can be convenient to be able to build and apply the list sometimes.

\n", + "used": { + "returns": [], + "needs": [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + } + } + ], + [ + "git_filter_mode_t", + { + "decl": [ + "GIT_FILTER_TO_WORKTREE", + "GIT_FILTER_SMUDGE", + "GIT_FILTER_TO_ODB", + "GIT_FILTER_CLEAN" + ], + "type": "enum", + "file": "git2/filter.h", + "line": 37, + "lineto": 42, + "block": "GIT_FILTER_TO_WORKTREE\nGIT_FILTER_SMUDGE\nGIT_FILTER_TO_ODB\nGIT_FILTER_CLEAN", + "tdef": "typedef", + "description": " Filters are applied in one of two directions: smudging - which is\n exporting a file from the Git object database to the working directory,\n and cleaning - which is importing a file from the working directory to\n the Git object database. These values control which direction of\n change is being applied.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FILTER_TO_WORKTREE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILTER_SMUDGE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILTER_TO_ODB", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_FILTER_CLEAN", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": ["git_filter_list_load", "git_filter_list_load_ext"] + } + } + ], + [ + "git_filter_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_oid * commit_id", + "git_oid attr_commit_id" + ], + "type": "struct", + "value": "git_filter_options", + "file": "git2/filter.h", + "line": 69, + "lineto": 86, + "block": "unsigned int version\nuint32_t flags\ngit_oid * commit_id\ngit_oid attr_commit_id", + "tdef": "typedef", + "description": " Filtering options", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " See `git_filter_flag_t` above " + }, + { "type": "git_oid *", "name": "commit_id", "comments": "" }, + { + "type": "git_oid", + "name": "attr_commit_id", + "comments": " The commit to load attributes from, when\n `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified." + } + ], + "used": { "returns": [], "needs": ["git_filter_list_load_ext"] } + } + ], + [ + "git_filter_source", + { + "decl": "git_filter_source", + "type": "struct", + "value": "git_filter_source", + "file": "git2/sys/filter.h", + "line": 109, + "lineto": 109, + "tdef": "typedef", + "description": " A filter source represents a file/blob to be processed", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_hashsig_option_t", + { + "decl": [ + "GIT_HASHSIG_NORMAL", + "GIT_HASHSIG_IGNORE_WHITESPACE", + "GIT_HASHSIG_SMART_WHITESPACE", + "GIT_HASHSIG_ALLOW_SMALL_FILES" + ], + "type": "enum", + "file": "git2/sys/hashsig.h", + "line": 35, + "lineto": 55, + "block": "GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE\nGIT_HASHSIG_ALLOW_SMALL_FILES", + "tdef": "typedef", + "description": " Options for hashsig computation", + "comments": "

The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE, GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_HASHSIG_NORMAL", + "comments": "

Use all data

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_HASHSIG_IGNORE_WHITESPACE", + "comments": "

Ignore whitespace

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_HASHSIG_SMART_WHITESPACE", + "comments": "

Ignore

\n\n

and all space after

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_HASHSIG_ALLOW_SMALL_FILES", + "comments": "

Allow hashing of small files

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index", + { + "decl": "git_index", + "type": "struct", + "value": "git_index", + "file": "git2/types.h", + "line": 153, + "lineto": 153, + "tdef": "typedef", + "description": " Memory representation of an index file. ", + "comments": "", + "used": { + "returns": [ + "git_index_get_byindex", + "git_index_get_bypath", + "git_remote_stats" + ], + "needs": [ + "git_apply_to_tree", + "git_checkout_index", + "git_cherrypick_commit", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_tree_to_index", + "git_index_add", + "git_index_add_all", + "git_index_add_bypath", + "git_index_add_from_buffer", + "git_index_caps", + "git_index_checksum", + "git_index_clear", + "git_index_conflict_add", + "git_index_conflict_cleanup", + "git_index_conflict_get", + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_conflict_remove", + "git_index_entry_is_conflict", + "git_index_entry_stage", + "git_index_entrycount", + "git_index_find", + "git_index_find_prefix", + "git_index_free", + "git_index_get_byindex", + "git_index_get_bypath", + "git_index_has_conflicts", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_new", + "git_index_open", + "git_index_owner", + "git_index_path", + "git_index_read", + "git_index_read_tree", + "git_index_remove", + "git_index_remove_all", + "git_index_remove_bypath", + "git_index_remove_directory", + "git_index_set_caps", + "git_index_set_version", + "git_index_update_all", + "git_index_version", + "git_index_write", + "git_index_write_tree", + "git_index_write_tree_to", + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_name", + "git_indexer_new", + "git_indexer_options_init", + "git_indexer_progress_cb", + "git_merge_commits", + "git_merge_file_from_index", + "git_merge_trees", + "git_odb_write_pack", + "git_packbuilder_write", + "git_pathspec_match_index", + "git_rebase_inmemory_index", + "git_repository_index", + "git_revert_commit" + ] + } + } + ], + [ + "git_index_add_option_t", + { + "decl": [ + "GIT_INDEX_ADD_DEFAULT", + "GIT_INDEX_ADD_FORCE", + "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", + "GIT_INDEX_ADD_CHECK_PATHSPEC" + ], + "type": "enum", + "file": "git2/index.h", + "line": 162, + "lineto": 167, + "block": "GIT_INDEX_ADD_DEFAULT\nGIT_INDEX_ADD_FORCE\nGIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\nGIT_INDEX_ADD_CHECK_PATHSPEC", + "tdef": "typedef", + "description": " Flags for APIs that add files matching pathspec ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_ADD_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_INDEX_ADD_FORCE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEX_ADD_CHECK_PATHSPEC", + "comments": "", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index_capability_t", + { + "decl": [ + "GIT_INDEX_CAPABILITY_IGNORE_CASE", + "GIT_INDEX_CAPABILITY_NO_FILEMODE", + "GIT_INDEX_CAPABILITY_NO_SYMLINKS", + "GIT_INDEX_CAPABILITY_FROM_OWNER" + ], + "type": "enum", + "file": "git2/index.h", + "line": 142, + "lineto": 147, + "block": "GIT_INDEX_CAPABILITY_IGNORE_CASE\nGIT_INDEX_CAPABILITY_NO_FILEMODE\nGIT_INDEX_CAPABILITY_NO_SYMLINKS\nGIT_INDEX_CAPABILITY_FROM_OWNER", + "tdef": "typedef", + "description": " Capabilities of system that affect index actions. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_IGNORE_CASE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_NO_FILEMODE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_NO_SYMLINKS", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_INDEX_CAPABILITY_FROM_OWNER", + "comments": "", + "value": -1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index_conflict_iterator", + { + "decl": "git_index_conflict_iterator", + "type": "struct", + "value": "git_index_conflict_iterator", + "file": "git2/types.h", + "line": 159, + "lineto": 159, + "tdef": "typedef", + "description": " An iterator for conflicts in the index. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next" + ] + } + } + ], + [ + "git_index_entry", + { + "decl": [ + "git_index_time ctime", + "git_index_time mtime", + "uint32_t dev", + "uint32_t ino", + "uint32_t mode", + "uint32_t uid", + "uint32_t gid", + "uint32_t file_size", + "git_oid id", + "uint16_t flags", + "uint16_t flags_extended", + "const char * path" + ], + "type": "struct", + "value": "git_index_entry", + "file": "git2/index.h", + "line": 58, + "lineto": 75, + "block": "git_index_time ctime\ngit_index_time mtime\nuint32_t dev\nuint32_t ino\nuint32_t mode\nuint32_t uid\nuint32_t gid\nuint32_t file_size\ngit_oid id\nuint16_t flags\nuint16_t flags_extended\nconst char * path", + "tdef": "typedef", + "description": " In-memory representation of a file entry in the index.", + "comments": "

This is a public structure that represents a file entry in the index. The meaning of the fields corresponds to core Git's documentation (in "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be accessed via the first set of GIT_INDEX_ENTRY_... bitmasks below. These flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be accessed via the later GIT_INDEX_ENTRY_... bitmasks below. Some of these flags are read from and written to disk, but some are set aside for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This is enough to detect changes, which is enough for the index to function as a cache, but it should not be taken as an authoritative source for that data.

\n", + "fields": [ + { "type": "git_index_time", "name": "ctime", "comments": "" }, + { "type": "git_index_time", "name": "mtime", "comments": "" }, + { "type": "uint32_t", "name": "dev", "comments": "" }, + { "type": "uint32_t", "name": "ino", "comments": "" }, + { "type": "uint32_t", "name": "mode", "comments": "" }, + { "type": "uint32_t", "name": "uid", "comments": "" }, + { "type": "uint32_t", "name": "gid", "comments": "" }, + { "type": "uint32_t", "name": "file_size", "comments": "" }, + { "type": "git_oid", "name": "id", "comments": "" }, + { "type": "uint16_t", "name": "flags", "comments": "" }, + { "type": "uint16_t", "name": "flags_extended", "comments": "" }, + { "type": "const char *", "name": "path", "comments": "" } + ], + "used": { + "returns": ["git_index_get_byindex", "git_index_get_bypath"], + "needs": [ + "git_index_add", + "git_index_add_from_buffer", + "git_index_conflict_add", + "git_index_conflict_get", + "git_index_conflict_next", + "git_index_entry_is_conflict", + "git_index_entry_stage", + "git_index_iterator_next", + "git_merge_file_from_index" + ] + } + } + ], + [ + "git_index_entry_extended_flag_t", + { + "decl": [ + "GIT_INDEX_ENTRY_INTENT_TO_ADD", + "GIT_INDEX_ENTRY_SKIP_WORKTREE", + "GIT_INDEX_ENTRY_EXTENDED_FLAGS", + "GIT_INDEX_ENTRY_UPTODATE" + ], + "type": "enum", + "file": "git2/index.h", + "line": 132, + "lineto": 139, + "block": "GIT_INDEX_ENTRY_INTENT_TO_ADD\nGIT_INDEX_ENTRY_SKIP_WORKTREE\nGIT_INDEX_ENTRY_EXTENDED_FLAGS\nGIT_INDEX_ENTRY_UPTODATE", + "tdef": "typedef", + "description": " Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`", + "comments": "

In memory, the flags_extended fields are divided into two parts: the fields that are read from and written to disk, and other fields that in-memory only and used by libgit2. Only the flags in GIT_INDEX_ENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the git_index_entry flags_extended value that belong on disk. You can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry flags_extended value that are only used in-memory by libgit2. You can use them to interpret the data in the flags_extended.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_ENTRY_INTENT_TO_ADD", + "comments": "", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_SKIP_WORKTREE", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_EXTENDED_FLAGS", + "comments": "", + "value": 24576 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_UPTODATE", + "comments": "", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index_entry_flag_t", + { + "decl": ["GIT_INDEX_ENTRY_EXTENDED", "GIT_INDEX_ENTRY_VALID"], + "type": "enum", + "file": "git2/index.h", + "line": 95, + "lineto": 98, + "block": "GIT_INDEX_ENTRY_EXTENDED\nGIT_INDEX_ENTRY_VALID", + "tdef": "typedef", + "description": " Flags for index entries", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_ENTRY_EXTENDED", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_INDEX_ENTRY_VALID", + "comments": "", + "value": 32768 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index_iterator", + { + "decl": "git_index_iterator", + "type": "struct", + "value": "git_index_iterator", + "file": "git2/types.h", + "line": 156, + "lineto": 156, + "tdef": "typedef", + "description": " An iterator for entries in the index. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next" + ] + } + } + ], + [ + "git_index_stage_t", + { + "decl": [ + "GIT_INDEX_STAGE_ANY", + "GIT_INDEX_STAGE_NORMAL", + "GIT_INDEX_STAGE_ANCESTOR", + "GIT_INDEX_STAGE_OURS", + "GIT_INDEX_STAGE_THEIRS" + ], + "type": "enum", + "file": "git2/index.h", + "line": 170, + "lineto": 190, + "block": "GIT_INDEX_STAGE_ANY\nGIT_INDEX_STAGE_NORMAL\nGIT_INDEX_STAGE_ANCESTOR\nGIT_INDEX_STAGE_OURS\nGIT_INDEX_STAGE_THEIRS", + "tdef": "typedef", + "description": " Git index stage states ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_STAGE_ANY", + "comments": "

Match any index stage.

\n\n

Some index APIs take a stage to match; pass this value to match\n any entry matching the path regardless of stage.

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_NORMAL", + "comments": "

A normal staged file in the index.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_ANCESTOR", + "comments": "

The ancestor side of a conflict.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_OURS", + "comments": "

The "ours" side of a conflict.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEX_STAGE_THEIRS", + "comments": "

The "theirs" side of a conflict.

\n", + "value": 3 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_index_time", + { + "decl": ["int32_t seconds", "uint32_t nanoseconds"], + "type": "struct", + "value": "git_index_time", + "file": "git2/index.h", + "line": 31, + "lineto": 35, + "block": "int32_t seconds\nuint32_t nanoseconds", + "tdef": "typedef", + "description": " Time structure used in a git index entry ", + "comments": "", + "fields": [ + { "type": "int32_t", "name": "seconds", "comments": "" }, + { "type": "uint32_t", "name": "nanoseconds", "comments": "" } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_indexer", + { + "decl": "git_indexer", + "type": "struct", + "value": "git_indexer", + "file": "git2/indexer.h", + "line": 27, + "lineto": 27, + "tdef": "typedef", + "description": " A git indexer object ", + "comments": "", + "used": { + "returns": ["git_remote_stats"], + "needs": [ + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_name", + "git_indexer_new", + "git_indexer_options_init", + "git_indexer_progress_cb", + "git_odb_write_pack", + "git_packbuilder_write" + ] + } + } + ], + [ + "git_indexer_options", + { + "decl": [ + "unsigned int version", + "git_indexer_progress_cb progress_cb", + "void * progress_cb_payload", + "unsigned char verify" + ], + "type": "struct", + "value": "git_indexer_options", + "file": "git2/indexer.h", + "line": 73, + "lineto": 100, + "block": "unsigned int version\ngit_indexer_progress_cb progress_cb\nvoid * progress_cb_payload\nunsigned char verify", + "tdef": "typedef", + "description": " Options for indexer configuration", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_indexer_progress_cb", + "name": "progress_cb", + "comments": " progress_cb function to call with progress information " + }, + { + "type": "void *", + "name": "progress_cb_payload", + "comments": " progress_cb_payload payload for the progress callback " + }, + { + "type": "unsigned char", + "name": "verify", + "comments": " Do connectivity checks for the received pack " + } + ], + "used": { + "returns": [], + "needs": ["git_indexer_new", "git_indexer_options_init"] + } + } + ], + [ + "git_indexer_progress", + { + "decl": [ + "unsigned int total_objects", + "unsigned int indexed_objects", + "unsigned int received_objects", + "unsigned int local_objects", + "unsigned int total_deltas", + "unsigned int indexed_deltas", + "size_t received_bytes" + ], + "type": "struct", + "value": "git_indexer_progress", + "file": "git2/indexer.h", + "line": 34, + "lineto": 58, + "block": "unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes", + "tdef": "typedef", + "description": " This structure is used to provide callers information about the\n progress of indexing a packfile, either directly or part of a\n fetch or clone that downloads a packfile.", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "total_objects", + "comments": " number of objects in the packfile being indexed " + }, + { + "type": "unsigned int", + "name": "indexed_objects", + "comments": " received objects that have been hashed " + }, + { + "type": "unsigned int", + "name": "received_objects", + "comments": " received_objects: objects which have been downloaded " + }, + { + "type": "unsigned int", + "name": "local_objects", + "comments": " locally-available objects that have been injected in order\n to fix a thin pack" + }, + { + "type": "unsigned int", + "name": "total_deltas", + "comments": " number of deltas in the packfile being indexed " + }, + { + "type": "unsigned int", + "name": "indexed_deltas", + "comments": " received deltas that have been indexed " + }, + { + "type": "size_t", + "name": "received_bytes", + "comments": " size of the packfile received up to now " + } + ], + "used": { + "returns": ["git_remote_stats"], + "needs": [ + "git_indexer_append", + "git_indexer_commit", + "git_indexer_progress_cb", + "git_odb_write_pack", + "git_packbuilder_write" + ] + } + } + ], + [ + "git_libgit2_opt_t", + { + "decl": [ + "GIT_OPT_GET_MWINDOW_SIZE", + "GIT_OPT_SET_MWINDOW_SIZE", + "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", + "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", + "GIT_OPT_GET_SEARCH_PATH", + "GIT_OPT_SET_SEARCH_PATH", + "GIT_OPT_SET_CACHE_OBJECT_LIMIT", + "GIT_OPT_SET_CACHE_MAX_SIZE", + "GIT_OPT_ENABLE_CACHING", + "GIT_OPT_GET_CACHED_MEMORY", + "GIT_OPT_GET_TEMPLATE_PATH", + "GIT_OPT_SET_TEMPLATE_PATH", + "GIT_OPT_SET_SSL_CERT_LOCATIONS", + "GIT_OPT_SET_USER_AGENT", + "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", + "GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION", + "GIT_OPT_SET_SSL_CIPHERS", + "GIT_OPT_GET_USER_AGENT", + "GIT_OPT_ENABLE_OFS_DELTA", + "GIT_OPT_ENABLE_FSYNC_GITDIR", + "GIT_OPT_GET_WINDOWS_SHAREMODE", + "GIT_OPT_SET_WINDOWS_SHAREMODE", + "GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION", + "GIT_OPT_SET_ALLOCATOR", + "GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY", + "GIT_OPT_GET_PACK_MAX_OBJECTS", + "GIT_OPT_SET_PACK_MAX_OBJECTS", + "GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS", + "GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE", + "GIT_OPT_GET_MWINDOW_FILE_LIMIT", + "GIT_OPT_SET_MWINDOW_FILE_LIMIT", + "GIT_OPT_SET_ODB_PACKED_PRIORITY", + "GIT_OPT_SET_ODB_LOOSE_PRIORITY", + "GIT_OPT_GET_EXTENSIONS", + "GIT_OPT_SET_EXTENSIONS", + "GIT_OPT_GET_OWNER_VALIDATION", + "GIT_OPT_SET_OWNER_VALIDATION", + "GIT_OPT_GET_HOMEDIR", + "GIT_OPT_SET_HOMEDIR", + "GIT_OPT_SET_SERVER_CONNECT_TIMEOUT", + "GIT_OPT_GET_SERVER_CONNECT_TIMEOUT", + "GIT_OPT_SET_SERVER_TIMEOUT", + "GIT_OPT_GET_SERVER_TIMEOUT", + "GIT_OPT_SET_USER_AGENT_PRODUCT", + "GIT_OPT_GET_USER_AGENT_PRODUCT", + "GIT_OPT_ADD_SSL_X509_CERT" + ], + "type": "enum", + "file": "git2/common.h", + "line": 214, + "lineto": 261, + "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION\nGIT_OPT_SET_SSL_CIPHERS\nGIT_OPT_GET_USER_AGENT\nGIT_OPT_ENABLE_OFS_DELTA\nGIT_OPT_ENABLE_FSYNC_GITDIR\nGIT_OPT_GET_WINDOWS_SHAREMODE\nGIT_OPT_SET_WINDOWS_SHAREMODE\nGIT_OPT_ENABLE_STRICT_HASH_VERIFICATION\nGIT_OPT_SET_ALLOCATOR\nGIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY\nGIT_OPT_GET_PACK_MAX_OBJECTS\nGIT_OPT_SET_PACK_MAX_OBJECTS\nGIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS\nGIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE\nGIT_OPT_GET_MWINDOW_FILE_LIMIT\nGIT_OPT_SET_MWINDOW_FILE_LIMIT\nGIT_OPT_SET_ODB_PACKED_PRIORITY\nGIT_OPT_SET_ODB_LOOSE_PRIORITY\nGIT_OPT_GET_EXTENSIONS\nGIT_OPT_SET_EXTENSIONS\nGIT_OPT_GET_OWNER_VALIDATION\nGIT_OPT_SET_OWNER_VALIDATION\nGIT_OPT_GET_HOMEDIR\nGIT_OPT_SET_HOMEDIR\nGIT_OPT_SET_SERVER_CONNECT_TIMEOUT\nGIT_OPT_GET_SERVER_CONNECT_TIMEOUT\nGIT_OPT_SET_SERVER_TIMEOUT\nGIT_OPT_GET_SERVER_TIMEOUT\nGIT_OPT_SET_USER_AGENT_PRODUCT\nGIT_OPT_GET_USER_AGENT_PRODUCT\nGIT_OPT_ADD_SSL_X509_CERT", + "tdef": "typedef", + "description": " Global library options", + "comments": "

These are used to select which global option to set or get and are used in git_libgit2_opts().

\n", + "fields": [ + { + "type": "int", + "name": "GIT_OPT_GET_MWINDOW_SIZE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_OPT_SET_MWINDOW_SIZE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_OPT_GET_SEARCH_PATH", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SEARCH_PATH", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_OPT_SET_CACHE_OBJECT_LIMIT", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_OPT_SET_CACHE_MAX_SIZE", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_CACHING", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_OPT_GET_CACHED_MEMORY", + "comments": "", + "value": 9 + }, + { + "type": "int", + "name": "GIT_OPT_GET_TEMPLATE_PATH", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GIT_OPT_SET_TEMPLATE_PATH", + "comments": "", + "value": 11 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SSL_CERT_LOCATIONS", + "comments": "", + "value": 12 + }, + { + "type": "int", + "name": "GIT_OPT_SET_USER_AGENT", + "comments": "", + "value": 13 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", + "comments": "", + "value": 14 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION", + "comments": "", + "value": 15 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SSL_CIPHERS", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_OPT_GET_USER_AGENT", + "comments": "", + "value": 17 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_OFS_DELTA", + "comments": "", + "value": 18 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_FSYNC_GITDIR", + "comments": "", + "value": 19 + }, + { + "type": "int", + "name": "GIT_OPT_GET_WINDOWS_SHAREMODE", + "comments": "", + "value": 20 + }, + { + "type": "int", + "name": "GIT_OPT_SET_WINDOWS_SHAREMODE", + "comments": "", + "value": 21 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION", + "comments": "", + "value": 22 + }, + { + "type": "int", + "name": "GIT_OPT_SET_ALLOCATOR", + "comments": "", + "value": 23 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY", + "comments": "", + "value": 24 + }, + { + "type": "int", + "name": "GIT_OPT_GET_PACK_MAX_OBJECTS", + "comments": "", + "value": 25 + }, + { + "type": "int", + "name": "GIT_OPT_SET_PACK_MAX_OBJECTS", + "comments": "", + "value": 26 + }, + { + "type": "int", + "name": "GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS", + "comments": "", + "value": 27 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE", + "comments": "", + "value": 28 + }, + { + "type": "int", + "name": "GIT_OPT_GET_MWINDOW_FILE_LIMIT", + "comments": "", + "value": 29 + }, + { + "type": "int", + "name": "GIT_OPT_SET_MWINDOW_FILE_LIMIT", + "comments": "", + "value": 30 + }, + { + "type": "int", + "name": "GIT_OPT_SET_ODB_PACKED_PRIORITY", + "comments": "", + "value": 31 + }, + { + "type": "int", + "name": "GIT_OPT_SET_ODB_LOOSE_PRIORITY", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_OPT_GET_EXTENSIONS", + "comments": "", + "value": 33 + }, + { + "type": "int", + "name": "GIT_OPT_SET_EXTENSIONS", + "comments": "", + "value": 34 + }, + { + "type": "int", + "name": "GIT_OPT_GET_OWNER_VALIDATION", + "comments": "", + "value": 35 + }, + { + "type": "int", + "name": "GIT_OPT_SET_OWNER_VALIDATION", + "comments": "", + "value": 36 + }, + { + "type": "int", + "name": "GIT_OPT_GET_HOMEDIR", + "comments": "", + "value": 37 + }, + { + "type": "int", + "name": "GIT_OPT_SET_HOMEDIR", + "comments": "", + "value": 38 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SERVER_CONNECT_TIMEOUT", + "comments": "", + "value": 39 + }, + { + "type": "int", + "name": "GIT_OPT_GET_SERVER_CONNECT_TIMEOUT", + "comments": "", + "value": 40 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SERVER_TIMEOUT", + "comments": "", + "value": 41 + }, + { + "type": "int", + "name": "GIT_OPT_GET_SERVER_TIMEOUT", + "comments": "", + "value": 42 + }, + { + "type": "int", + "name": "GIT_OPT_SET_USER_AGENT_PRODUCT", + "comments": "", + "value": 43 + }, + { + "type": "int", + "name": "GIT_OPT_GET_USER_AGENT_PRODUCT", + "comments": "", + "value": 44 + }, + { + "type": "int", + "name": "GIT_OPT_ADD_SSL_X509_CERT", + "comments": "", + "value": 45 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_mailmap", + { + "decl": "git_mailmap", + "type": "struct", + "value": "git_mailmap", + "file": "git2/types.h", + "line": 382, + "lineto": 382, + "tdef": "typedef", + "description": " Representation of .mailmap file state. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_commit_author_with_mailmap", + "git_commit_committer_with_mailmap", + "git_mailmap_add_entry", + "git_mailmap_free", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_new", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" + ] + } + } + ], + [ + "git_merge_analysis_t", + { + "decl": [ + "GIT_MERGE_ANALYSIS_NONE", + "GIT_MERGE_ANALYSIS_NORMAL", + "GIT_MERGE_ANALYSIS_UP_TO_DATE", + "GIT_MERGE_ANALYSIS_FASTFORWARD", + "GIT_MERGE_ANALYSIS_UNBORN" + ], + "type": "enum", + "file": "git2/merge.h", + "line": 347, + "lineto": 376, + "block": "GIT_MERGE_ANALYSIS_NONE\nGIT_MERGE_ANALYSIS_NORMAL\nGIT_MERGE_ANALYSIS_UP_TO_DATE\nGIT_MERGE_ANALYSIS_FASTFORWARD\nGIT_MERGE_ANALYSIS_UNBORN", + "tdef": "typedef", + "description": " The results of `git_merge_analysis` indicate the merge opportunities.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_NONE", + "comments": "

No merge is possible. (Unused.)

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_NORMAL", + "comments": "

A "normal" merge; both HEAD and the given merge input have diverged\n from their common ancestor. The divergent commits must be merged.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_UP_TO_DATE", + "comments": "

All given merge inputs are reachable from HEAD, meaning the\n repository is up-to-date and no merge needs to be performed.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_FASTFORWARD", + "comments": "

The given merge input is a fast-forward from HEAD and no merge\n needs to be performed. Instead, the client can check out the\n given merge input.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_UNBORN", + "comments": "

The HEAD of the current repository is "unborn" and does not point to\n a valid commit. No merge can be performed, but the caller may wish\n to simply set HEAD to the target commit(s).

\n", + "value": 8 + } + ], + "used": { + "returns": [], + "needs": ["git_merge_analysis", "git_merge_analysis_for_ref"] + } + } + ], + [ + "git_merge_driver_source", + { + "decl": "git_merge_driver_source", + "type": "struct", + "value": "git_merge_driver_source", + "file": "git2/sys/merge.h", + "line": 49, + "lineto": 49, + "tdef": "typedef", + "description": " A merge driver source represents the file to be merged", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_merge_file_favor_t", + { + "decl": [ + "GIT_MERGE_FILE_FAVOR_NORMAL", + "GIT_MERGE_FILE_FAVOR_OURS", + "GIT_MERGE_FILE_FAVOR_THEIRS", + "GIT_MERGE_FILE_FAVOR_UNION" + ], + "type": "enum", + "file": "git2/merge.h", + "line": 115, + "lineto": 145, + "block": "GIT_MERGE_FILE_FAVOR_NORMAL\nGIT_MERGE_FILE_FAVOR_OURS\nGIT_MERGE_FILE_FAVOR_THEIRS\nGIT_MERGE_FILE_FAVOR_UNION", + "tdef": "typedef", + "description": " Merge file favor options for `git_merge_options` instruct the file-level\n merging functionality how to deal with conflicting regions of the files.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_NORMAL", + "comments": "

When a region of a file is changed in both branches, a conflict\n will be recorded in the index so that git_checkout can produce\n a merge file with conflict markers in the working directory.\n This is the default.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_OURS", + "comments": "

When a region of a file is changed in both branches, the file\n created in the index will contain the "ours" side of any conflicting\n region. The index will not record a conflict.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_THEIRS", + "comments": "

When a region of a file is changed in both branches, the file\n created in the index will contain the "theirs" side of any conflicting\n region. The index will not record a conflict.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_UNION", + "comments": "

When a region of a file is changed in both branches, the file\n created in the index will contain each unique line from each side,\n which has the result of combining both files. The index will not\n record a conflict.

\n", + "value": 3 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_merge_file_flag_t", + { + "decl": [ + "GIT_MERGE_FILE_DEFAULT", + "GIT_MERGE_FILE_STYLE_MERGE", + "GIT_MERGE_FILE_STYLE_DIFF3", + "GIT_MERGE_FILE_SIMPLIFY_ALNUM", + "GIT_MERGE_FILE_IGNORE_WHITESPACE", + "GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE", + "GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL", + "GIT_MERGE_FILE_DIFF_PATIENCE", + "GIT_MERGE_FILE_DIFF_MINIMAL", + "GIT_MERGE_FILE_STYLE_ZDIFF3", + "GIT_MERGE_FILE_ACCEPT_CONFLICTS" + ], + "type": "enum", + "file": "git2/merge.h", + "line": 150, + "lineto": 187, + "block": "GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM\nGIT_MERGE_FILE_IGNORE_WHITESPACE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\nGIT_MERGE_FILE_DIFF_PATIENCE\nGIT_MERGE_FILE_DIFF_MINIMAL\nGIT_MERGE_FILE_STYLE_ZDIFF3\nGIT_MERGE_FILE_ACCEPT_CONFLICTS", + "tdef": "typedef", + "description": " File merging flags", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_FILE_DEFAULT", + "comments": "

Defaults

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_STYLE_MERGE", + "comments": "

Create standard conflicted merge files

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_STYLE_DIFF3", + "comments": "

Create diff3-style files

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_SIMPLIFY_ALNUM", + "comments": "

Condense non-alphanumeric regions for simplified diff file

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_IGNORE_WHITESPACE", + "comments": "

Ignore all whitespace

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE", + "comments": "

Ignore changes in amount of whitespace

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL", + "comments": "

Ignore whitespace at end of line

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_DIFF_PATIENCE", + "comments": "

Use the "patience diff" algorithm

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_DIFF_MINIMAL", + "comments": "

Take extra time to find minimal diff

\n", + "value": 128 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_STYLE_ZDIFF3", + "comments": "

Create zdiff3 ("zealous diff3")-style files

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_ACCEPT_CONFLICTS", + "comments": "

Do not produce file conflicts when common regions have\n changed; keep the conflict markers in the file and accept\n that as the merge result.

\n", + "value": 512 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_merge_file_input", + { + "decl": [ + "unsigned int version", + "const char * ptr", + "size_t size", + "const char * path", + "unsigned int mode" + ], + "type": "struct", + "value": "git_merge_file_input", + "file": "git2/merge.h", + "line": 35, + "lineto": 49, + "block": "unsigned int version\nconst char * ptr\nsize_t size\nconst char * path\nunsigned int mode", + "tdef": "typedef", + "description": " The file inputs to `git_merge_file`. Callers should populate the\n `git_merge_file_input` structure with descriptions of the files in\n each side of the conflict for use in producing the merge file.", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "const char *", + "name": "ptr", + "comments": " Pointer to the contents of the file. " + }, + { + "type": "size_t", + "name": "size", + "comments": " Size of the contents pointed to in `ptr`. " + }, + { + "type": "const char *", + "name": "path", + "comments": " File name of the conflicted file, or `NULL` to not merge the path. " + }, + { + "type": "unsigned int", + "name": "mode", + "comments": " File mode of the conflicted file, or `0` to not merge the mode. " + } + ], + "used": { + "returns": [], + "needs": ["git_merge_file", "git_merge_file_input_init"] + } + } + ], + [ + "git_merge_file_options", + { + "decl": [ + "unsigned int version", + "const char * ancestor_label", + "const char * our_label", + "const char * their_label", + "git_merge_file_favor_t favor", + "uint32_t flags", + "unsigned short marker_size" + ], + "type": "struct", + "value": "git_merge_file_options", + "file": "git2/merge.h", + "line": 195, + "lineto": 225, + "block": "unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\nuint32_t flags\nunsigned short marker_size", + "tdef": "typedef", + "description": " Options for merging a file", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "const char *", + "name": "ancestor_label", + "comments": " Label for the ancestor file side of the conflict which will be prepended\n to labels in diff3-format merge files." + }, + { + "type": "const char *", + "name": "our_label", + "comments": " Label for our file side of the conflict which will be prepended\n to labels in merge files." + }, + { + "type": "const char *", + "name": "their_label", + "comments": " Label for their file side of the conflict which will be prepended\n to labels in merge files." + }, + { + "type": "git_merge_file_favor_t", + "name": "favor", + "comments": " The file to favor in region conflicts. " + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " see `git_merge_file_flag_t` above " + }, + { + "type": "unsigned short", + "name": "marker_size", + "comments": " The size of conflict markers (eg, \"\n<\n<\n<\n<\n<\n<\n<\n\"). Default is\n GIT_MERGE_CONFLICT_MARKER_SIZE. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_options_init" + ] + } + } + ], + [ + "git_merge_file_result", + { + "decl": [ + "unsigned int automergeable", + "const char * path", + "unsigned int mode", + "const char * ptr", + "size_t len" + ], + "type": "struct", + "value": "git_merge_file_result", + "file": "git2/merge.h", + "line": 248, + "lineto": 269, + "block": "unsigned int automergeable\nconst char * path\nunsigned int mode\nconst char * ptr\nsize_t len", + "tdef": "typedef", + "description": " Information about file-level merging", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "automergeable", + "comments": " True if the output was automerged, false if the output contains\n conflict markers." + }, + { + "type": "const char *", + "name": "path", + "comments": " The path that the resultant merge file should use, or NULL if a\n filename conflict would occur." + }, + { + "type": "unsigned int", + "name": "mode", + "comments": " The mode that the resultant merge file should use. " + }, + { + "type": "const char *", + "name": "ptr", + "comments": " The contents of the merge. " + }, + { + "type": "size_t", + "name": "len", + "comments": " The length of the merge contents. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_result_free" + ] + } + } + ], + [ + "git_merge_flag_t", + { + "decl": [ + "GIT_MERGE_FIND_RENAMES", + "GIT_MERGE_FAIL_ON_CONFLICT", + "GIT_MERGE_SKIP_REUC", + "GIT_MERGE_NO_RECURSIVE", + "GIT_MERGE_VIRTUAL_BASE" + ], + "type": "enum", + "file": "git2/merge.h", + "line": 74, + "lineto": 109, + "block": "GIT_MERGE_FIND_RENAMES\nGIT_MERGE_FAIL_ON_CONFLICT\nGIT_MERGE_SKIP_REUC\nGIT_MERGE_NO_RECURSIVE\nGIT_MERGE_VIRTUAL_BASE", + "tdef": "typedef", + "description": " Flags for `git_merge` options. A combination of these flags can be\n passed in via the `flags` value in the `git_merge_options`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_FIND_RENAMES", + "comments": "

Detect renames that occur between the common ancestor and the "ours"\n side or the common ancestor and the "theirs" side. This will enable\n the ability to merge between a modified and renamed file.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_FAIL_ON_CONFLICT", + "comments": "

If a conflict occurs, exit immediately instead of attempting to\n continue resolving conflicts. The merge operation will fail with\n GIT_EMERGECONFLICT and no index will be returned.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_SKIP_REUC", + "comments": "

Do not write the REUC extension on the generated index

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_MERGE_NO_RECURSIVE", + "comments": "

If the commits being merged have multiple merge bases, do not build\n a recursive merge base (by merging the multiple merge bases),\n instead simply use the first base. This flag provides a similar\n merge base to git-merge-resolve.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_MERGE_VIRTUAL_BASE", + "comments": "

Treat this merge as if it is to produce the virtual base\n of a recursive merge. This will ensure that there are\n no conflicts, any conflicting regions will keep conflict\n markers in the merge result.

\n", + "value": 16 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_merge_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "unsigned int rename_threshold", + "unsigned int target_limit", + "git_diff_similarity_metric * metric", + "unsigned int recursion_limit", + "const char * default_driver", + "git_merge_file_favor_t file_favor", + "uint32_t file_flags" + ], + "type": "struct", + "value": "git_merge_options", + "file": "git2/merge.h", + "line": 274, + "lineto": 323, + "block": "unsigned int version\nuint32_t flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\nunsigned int recursion_limit\nconst char * default_driver\ngit_merge_file_favor_t file_favor\nuint32_t file_flags", + "tdef": "typedef", + "description": " Merging options", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " See `git_merge_flag_t` above " + }, + { + "type": "unsigned int", + "name": "rename_threshold", + "comments": " Similarity to consider a file renamed (default 50). If\n `GIT_MERGE_FIND_RENAMES` is enabled, added files will be compared\n with deleted files to determine their similarity. Files that are\n more similar than the rename threshold (percentage-wise) will be\n treated as a rename." + }, + { + "type": "unsigned int", + "name": "target_limit", + "comments": " Maximum similarity sources to examine for renames (default 200).\n If the number of rename candidates (add / delete pairs) is greater\n than this value, inexact rename detection is aborted.\n\n This setting overrides the `merge.renameLimit` configuration value." + }, + { + "type": "git_diff_similarity_metric *", + "name": "metric", + "comments": " Pluggable similarity metric; pass NULL to use internal metric " + }, + { + "type": "unsigned int", + "name": "recursion_limit", + "comments": " Maximum number of times to merge common ancestors to build a\n virtual merge base when faced with criss-cross merges. When this\n limit is reached, the next ancestor will simply be used instead of\n attempting to merge it. The default is unlimited." + }, + { + "type": "const char *", + "name": "default_driver", + "comments": " Default merge driver to be used when both sides of a merge have\n changed. The default is the `text` driver." + }, + { + "type": "git_merge_file_favor_t", + "name": "file_favor", + "comments": " Flags for handling conflicting content, to be used with the standard\n (`text`) merge driver." + }, + { + "type": "uint32_t", + "name": "file_flags", + "comments": " see `git_merge_file_flag_t` above " + } + ], + "used": { + "returns": [], + "needs": [ + "git_cherrypick_commit", + "git_merge", + "git_merge_commits", + "git_merge_options_init", + "git_merge_trees", + "git_revert_commit" + ] + } + } + ], + [ + "git_merge_preference_t", + { + "decl": [ + "GIT_MERGE_PREFERENCE_NONE", + "GIT_MERGE_PREFERENCE_NO_FASTFORWARD", + "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY" + ], + "type": "enum", + "file": "git2/merge.h", + "line": 381, + "lineto": 399, + "block": "GIT_MERGE_PREFERENCE_NONE\nGIT_MERGE_PREFERENCE_NO_FASTFORWARD\nGIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", + "tdef": "typedef", + "description": " The user's stated preference for merges.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_PREFERENCE_NONE", + "comments": "

No configuration was found that suggests a preferred behavior for\n merge.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_PREFERENCE_NO_FASTFORWARD", + "comments": "

There is a merge.ff=false configuration setting, suggesting that\n the user does not want to allow a fast-forward merge.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", + "comments": "

There is a merge.ff=only configuration setting, suggesting that\n the user only wants fast-forward merges.

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": ["git_merge_analysis", "git_merge_analysis_for_ref"] + } + } + ], + [ + "git_message_trailer", + { + "decl": ["const char * key", "const char * value"], + "type": "struct", + "value": "git_message_trailer", + "file": "git2/message.h", + "line": 43, + "lineto": 46, + "block": "const char * key\nconst char * value", + "tdef": "typedef", + "description": " Represents a single git message trailer.", + "comments": "", + "fields": [ + { "type": "const char *", "name": "key", "comments": "" }, + { "type": "const char *", "name": "value", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_message_trailer_array_free", "git_message_trailers"] + } + } + ], + [ + "git_message_trailer_array", + { + "decl": [ + "git_message_trailer * trailers", + "size_t count", + "char * _trailer_block" + ], + "type": "struct", + "value": "git_message_trailer_array", + "file": "git2/message.h", + "line": 54, + "lineto": 60, + "block": "git_message_trailer * trailers\nsize_t count\nchar * _trailer_block", + "tdef": "typedef", + "description": " Represents an array of git message trailers.", + "comments": "

Struct members under the private comment are private, subject to change and should not be used by callers.

\n", + "fields": [ + { + "type": "git_message_trailer *", + "name": "trailers", + "comments": "" + }, + { "type": "size_t", "name": "count", "comments": "" }, + { "type": "char *", "name": "_trailer_block", "comments": "" } + ], + "used": { + "returns": [], + "needs": ["git_message_trailer_array_free", "git_message_trailers"] + } + } + ], + [ + "git_midx_writer", + { + "decl": "git_midx_writer", + "type": "struct", + "value": "git_midx_writer", + "file": "git2/types.h", + "line": 105, + "lineto": 105, + "tdef": "typedef", + "description": " a writer for multi-pack-index files. ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_note", + { + "decl": "git_note", + "type": "struct", + "value": "git_note", + "file": "git2/types.h", + "line": 174, + "lineto": 174, + "tdef": "typedef", + "description": " Representation of a git note ", + "comments": "", + "used": { + "returns": [], + "needs": ["git_note_iterator_free", "git_note_next"] + } + } + ], + [ + "git_note_iterator", + { + "decl": "git_note_iterator", + "type": "struct", + "value": "git_note_iterator", + "file": "git2/notes.h", + "line": 37, + "lineto": 37, + "tdef": "typedef", + "description": " note iterator", + "comments": "", + "used": { + "returns": [], + "needs": ["git_note_iterator_free", "git_note_next"] + } + } + ], + [ + "git_object", + { + "decl": "git_object", + "type": "struct", + "value": "git_object", + "file": "git2/types.h", + "line": 129, + "lineto": 129, + "tdef": "typedef", + "description": " Representation of a generic object in a repository ", + "comments": "", + "used": { + "returns": [ + "git_blob_rawsize", + "git_object_string2type", + "git_object_type", + "git_odb_object_type", + "git_tag_target_type", + "git_tree_entry_type" + ], + "needs": [ + "git_checkout_tree", + "git_describe_commit", + "git_object__size", + "git_object_dup", + "git_object_free", + "git_object_id", + "git_object_lookup", + "git_object_lookup_bypath", + "git_object_lookup_prefix", + "git_object_owner", + "git_object_peel", + "git_object_rawcontent_is_valid", + "git_object_short_id", + "git_object_type", + "git_object_type2string", + "git_object_typeisloose", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read_header", + "git_odb_write", + "git_reference_peel", + "git_repository_hashfile", + "git_reset", + "git_reset_default", + "git_revparse_ext", + "git_revparse_single", + "git_tag_annotation_create", + "git_tag_create", + "git_tag_create_lightweight", + "git_tag_peel", + "git_tag_target", + "git_tree_entry_to_object" + ] + } + } + ], + [ + "git_object_t", + { + "decl": [ + "GIT_OBJECT_ANY", + "GIT_OBJECT_INVALID", + "GIT_OBJECT_COMMIT", + "GIT_OBJECT_TREE", + "GIT_OBJECT_BLOB", + "GIT_OBJECT_TAG", + "GIT_OBJECT_OFS_DELTA", + "GIT_OBJECT_REF_DELTA" + ], + "type": "enum", + "file": "git2/types.h", + "line": 73, + "lineto": 82, + "block": "GIT_OBJECT_ANY\nGIT_OBJECT_INVALID\nGIT_OBJECT_COMMIT\nGIT_OBJECT_TREE\nGIT_OBJECT_BLOB\nGIT_OBJECT_TAG\nGIT_OBJECT_OFS_DELTA\nGIT_OBJECT_REF_DELTA", + "tdef": "typedef", + "description": " Basic type (loose or packed) of any Git object. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_OBJECT_ANY", + "comments": "

Object can be any of the following

\n", + "value": -2 + }, + { + "type": "int", + "name": "GIT_OBJECT_INVALID", + "comments": "

Object is invalid.

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_OBJECT_COMMIT", + "comments": "

A commit object.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_OBJECT_TREE", + "comments": "

A tree (directory listing) object.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_OBJECT_BLOB", + "comments": "

A file revision object.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_OBJECT_TAG", + "comments": "

An annotated tag object.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_OBJECT_OFS_DELTA", + "comments": "

A delta, base is given by an offset.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_OBJECT_REF_DELTA", + "comments": "

A delta, base is given by object id.

\n", + "value": 7 + } + ], + "used": { + "returns": [ + "git_object_string2type", + "git_object_type", + "git_odb_object_type", + "git_tag_target_type", + "git_tree_entry_type" + ], + "needs": [ + "git_object__size", + "git_object_lookup", + "git_object_lookup_bypath", + "git_object_lookup_prefix", + "git_object_peel", + "git_object_rawcontent_is_valid", + "git_object_type2string", + "git_object_typeisloose", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read_header", + "git_odb_write", + "git_reference_peel", + "git_repository_hashfile" + ] + } + } + ], + [ + "git_odb", + { + "decl": "git_odb", + "type": "struct", + "value": "git_odb", + "file": "git2/types.h", + "line": 88, + "lineto": 88, + "tdef": "typedef", + "description": " An object database stores the objects (commit, trees, blobs, tags,\n etc) for a repository.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_indexer_new", + "git_odb_add_alternate", + "git_odb_add_backend", + "git_odb_add_disk_alternate", + "git_odb_backend_loose", + "git_odb_backend_one_pack", + "git_odb_backend_pack", + "git_odb_exists", + "git_odb_exists_ext", + "git_odb_exists_prefix", + "git_odb_expand_ids", + "git_odb_foreach", + "git_odb_free", + "git_odb_get_backend", + "git_odb_new", + "git_odb_num_backends", + "git_odb_object_data", + "git_odb_object_dup", + "git_odb_object_free", + "git_odb_object_id", + "git_odb_object_size", + "git_odb_object_type", + "git_odb_open", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read", + "git_odb_read_header", + "git_odb_read_prefix", + "git_odb_refresh", + "git_odb_set_commit_graph", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write", + "git_odb_write", + "git_odb_write_multi_pack_index", + "git_odb_write_pack", + "git_repository_odb", + "git_repository_wrap_odb" + ] + } + } + ], + [ + "git_odb_backend", + { + "decl": "git_odb_backend", + "type": "struct", + "value": "git_odb_backend", + "file": "git2/types.h", + "line": 91, + "lineto": 91, + "tdef": "typedef", + "description": " A custom backend in an ODB ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_odb_add_alternate", + "git_odb_add_backend", + "git_odb_backend_loose", + "git_odb_backend_one_pack", + "git_odb_backend_pack", + "git_odb_get_backend" + ] + } + } + ], + [ + "git_odb_backend_loose_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "int compression_level", + "unsigned int dir_mode", + "unsigned int file_mode", + "git_oid_t oid_type" + ], + "type": "struct", + "value": "git_odb_backend_loose_options", + "file": "git2/odb_backend.h", + "line": 49, + "lineto": 75, + "block": "unsigned int version\nuint32_t flags\nint compression_level\nunsigned int dir_mode\nunsigned int file_mode\ngit_oid_t oid_type", + "tdef": "typedef", + "description": " Options for configuring a loose object backend. ", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " version for the struct " + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " A combination of the `git_odb_backend_loose_flag_t` types. " + }, + { + "type": "int", + "name": "compression_level", + "comments": " zlib compression level to use (0-9), where 1 is the fastest\n at the expense of larger files, and 9 produces the best\n compression at the expense of speed. 0 indicates that no\n compression should be performed. -1 is the default (currently\n optimizing for speed)." + }, + { + "type": "unsigned int", + "name": "dir_mode", + "comments": " Permissions to use creating a directory or 0 for defaults " + }, + { + "type": "unsigned int", + "name": "file_mode", + "comments": " Permissions to use creating a file or 0 for defaults " + }, + { + "type": "git_oid_t", + "name": "oid_type", + "comments": " Type of object IDs to use for this object database, or\n 0 for default (currently SHA1)." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_odb_backend_pack_options", + { + "decl": ["unsigned int version", "git_oid_t oid_type"], + "type": "struct", + "value": "git_odb_backend_pack_options", + "file": "git2/odb_backend.h", + "line": 24, + "lineto": 32, + "block": "unsigned int version\ngit_oid_t oid_type", + "tdef": "typedef", + "description": " Options for configuring a packfile object backend. ", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " version for the struct " + }, + { + "type": "git_oid_t", + "name": "oid_type", + "comments": " Type of object IDs to use for this object database, or\n 0 for default (currently SHA1)." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_odb_expand_id", + { + "decl": ["git_oid id", "unsigned short length", "git_object_t type"], + "type": "struct", + "value": "git_odb_expand_id", + "file": "git2/odb.h", + "line": 250, + "lineto": 265, + "block": "git_oid id\nunsigned short length\ngit_object_t type", + "tdef": "typedef", + "description": " The information about object IDs to query in `git_odb_expand_ids`,\n which will be populated upon return.", + "comments": "", + "fields": [ + { + "type": "git_oid", + "name": "id", + "comments": " The object ID to expand " + }, + { + "type": "unsigned short", + "name": "length", + "comments": " The length of the object ID (in nibbles, or packets of 4 bits; the\n number of hex characters)" + }, + { + "type": "git_object_t", + "name": "type", + "comments": " The (optional) type of the object to search for; leave as `0` or set\n to `GIT_OBJECT_ANY` to query for any object matching the ID." + } + ], + "used": { "returns": [], "needs": ["git_odb_expand_ids"] } + } + ], + [ + "git_odb_lookup_flags_t", + { + "decl": ["GIT_ODB_LOOKUP_NO_REFRESH"], + "type": "enum", + "file": "git2/odb.h", + "line": 26, + "lineto": 34, + "block": "GIT_ODB_LOOKUP_NO_REFRESH", + "tdef": "typedef", + "description": " Flags controlling the behavior of ODB lookup operations ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_ODB_LOOKUP_NO_REFRESH", + "comments": "

Don't call git_odb_refresh if the lookup fails. Useful when doing\n a batch of lookup operations for objects that may legitimately not\n exist. When using this flag, you may wish to manually call\n git_odb_refresh before processing a batch of objects.

\n", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_odb_object", + { + "decl": "git_odb_object", + "type": "struct", + "value": "git_odb_object", + "file": "git2/types.h", + "line": 96, + "lineto": 96, + "tdef": "typedef", + "description": " A \"raw\" object read from the object database.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_odb_object_data", + "git_odb_object_dup", + "git_odb_object_free", + "git_odb_object_id", + "git_odb_object_size", + "git_odb_object_type", + "git_odb_read", + "git_odb_read_prefix" + ] + } + } + ], + [ + "git_odb_options", + { + "decl": ["unsigned int version", "git_oid_t oid_type"], + "type": "struct", + "value": "git_odb_options", + "file": "git2/odb.h", + "line": 46, + "lineto": 54, + "block": "unsigned int version\ngit_oid_t oid_type", + "tdef": "typedef", + "description": " Options for configuring a loose object backend. ", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " version for the struct " + }, + { + "type": "git_oid_t", + "name": "oid_type", + "comments": " Type of object IDs to use for this object database, or\n 0 for default (currently SHA1)." + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_odb_stream", + { + "decl": "git_odb_stream", + "type": "struct", + "value": "git_odb_stream", + "file": "git2/types.h", + "line": 99, + "lineto": 99, + "block": "git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\ngit_object_size_t declared_size\ngit_object_size_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const git_oid *) finalize_write\nvoid (*)(git_odb_stream *) free", + "tdef": "typedef", + "description": " A stream to read/write from the ODB ", + "comments": "", + "fields": [ + { "type": "git_odb_backend *", "name": "backend", "comments": "" }, + { "type": "unsigned int", "name": "mode", "comments": "" }, + { "type": "void *", "name": "hash_ctx", "comments": "" }, + { + "type": "git_object_size_t", + "name": "declared_size", + "comments": "" + }, + { + "type": "git_object_size_t", + "name": "received_bytes", + "comments": "" + }, + { + "type": "int (*)(git_odb_stream *, char *, size_t)", + "name": "read", + "comments": "" + }, + { + "type": "int (*)(git_odb_stream *, const char *, size_t)", + "name": "write", + "comments": "" + }, + { + "type": "int (*)(git_odb_stream *, const git_oid *)", + "name": "finalize_write", + "comments": "" + }, + { + "type": "void (*)(git_odb_stream *)", + "name": "free", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write" + ] + } + } + ], + [ + "git_odb_stream_t", + { + "decl": ["GIT_STREAM_RDONLY", "GIT_STREAM_WRONLY", "GIT_STREAM_RW"], + "type": "enum", + "file": "git2/odb_backend.h", + "line": 182, + "lineto": 186, + "block": "GIT_STREAM_RDONLY\nGIT_STREAM_WRONLY\nGIT_STREAM_RW", + "tdef": "typedef", + "description": " Streaming mode ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STREAM_RDONLY", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STREAM_WRONLY", + "comments": "", + "value": 4 + }, + { "type": "int", "name": "GIT_STREAM_RW", "comments": "", "value": 6 } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_odb_writepack", + { + "decl": "git_odb_writepack", + "type": "struct", + "value": "git_odb_writepack", + "file": "git2/types.h", + "line": 102, + "lineto": 102, + "block": "git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_indexer_progress *) append\nint (*)(git_odb_writepack *, git_indexer_progress *) commit\nvoid (*)(git_odb_writepack *) free", + "tdef": "typedef", + "description": " A stream to write a packfile to the ODB ", + "comments": "", + "fields": [ + { "type": "git_odb_backend *", "name": "backend", "comments": "" }, + { + "type": "int (*)(git_odb_writepack *, const void *, size_t, git_indexer_progress *)", + "name": "append", + "comments": "" + }, + { + "type": "int (*)(git_odb_writepack *, git_indexer_progress *)", + "name": "commit", + "comments": "" + }, + { + "type": "void (*)(git_odb_writepack *)", + "name": "free", + "comments": "" + } + ], + "used": { "returns": [], "needs": ["git_odb_write_pack"] } + } + ], + [ + "git_oid", + { + "decl": ["unsigned char [20] id"], + "type": "struct", + "value": "git_oid", + "file": "git2/oid.h", + "line": 103, + "lineto": 112, + "block": "unsigned char [20] id", + "tdef": "typedef", + "description": " Unique identity of any object (commit, tree, blob, tag). ", + "comments": "", + "fields": [ + { + "type": "unsigned char [20]", + "name": "id", + "comments": " raw binary formatted id " + } + ], + "used": { + "returns": [ + "git_annotated_commit_id", + "git_blob_id", + "git_commit_id", + "git_commit_parent_id", + "git_commit_tree_id", + "git_index_checksum", + "git_indexer_hash", + "git_object_id", + "git_odb_object_id", + "git_oid_shorten_new", + "git_packbuilder_hash", + "git_rebase_onto_id", + "git_rebase_orig_head_id", + "git_reference_target", + "git_reference_target_peel", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_repository_oid_type", + "git_submodule_head_id", + "git_submodule_index_id", + "git_submodule_wd_id", + "git_tag_id", + "git_tag_target_id", + "git_tree_entry_id", + "git_tree_id" + ], + "needs": [ + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_lookup", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream_commit", + "git_blob_create_from_workdir", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_commit_amend", + "git_commit_create", + "git_commit_create_cb", + "git_commit_create_from_stage", + "git_commit_create_v", + "git_commit_create_with_signature", + "git_commit_extract_signature", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_diff_patchid", + "git_graph_ahead_behind", + "git_graph_descendant_of", + "git_graph_reachable_from_any", + "git_index_write_tree", + "git_index_write_tree_to", + "git_merge_base", + "git_merge_base_many", + "git_merge_base_octopus", + "git_merge_bases", + "git_merge_bases_many", + "git_note_foreach_cb", + "git_note_next", + "git_object_lookup", + "git_object_lookup_prefix", + "git_odb_exists", + "git_odb_exists_ext", + "git_odb_exists_prefix", + "git_odb_foreach_cb", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_read", + "git_odb_read_header", + "git_odb_read_prefix", + "git_odb_stream_finalize_write", + "git_odb_write", + "git_oid_cmp", + "git_oid_cpy", + "git_oid_equal", + "git_oid_fmt", + "git_oid_fromraw", + "git_oid_fromstr", + "git_oid_fromstrn", + "git_oid_fromstrp", + "git_oid_is_zero", + "git_oid_ncmp", + "git_oid_nfmt", + "git_oid_pathfmt", + "git_oid_shorten_add", + "git_oid_shorten_free", + "git_oid_strcmp", + "git_oid_streq", + "git_oid_tostr", + "git_oid_tostr_s", + "git_oidarray_dispose", + "git_oidarray_free", + "git_packbuilder_insert", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_recur", + "git_packbuilder_insert_tree", + "git_rebase_commit", + "git_reference_create", + "git_reference_create_matching", + "git_reference_name_to_id", + "git_reference_set_target", + "git_reflog_append", + "git_repository_fetchhead_foreach_cb", + "git_repository_hashfile", + "git_repository_mergehead_foreach_cb", + "git_repository_set_head_detached", + "git_revwalk_hide", + "git_revwalk_hide_cb", + "git_revwalk_next", + "git_revwalk_push", + "git_stash_cb", + "git_stash_save", + "git_stash_save_with_opts", + "git_tag_annotation_create", + "git_tag_create", + "git_tag_create_from_buffer", + "git_tag_create_lightweight", + "git_tag_foreach_cb", + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_transaction_set_target", + "git_tree_create_updated", + "git_tree_entry_byid", + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_treebuilder_insert", + "git_treebuilder_write", + "git_treebuilder_write_with_buffer" + ] + } + } + ], + [ + "git_oid_shorten", + { + "decl": "git_oid_shorten", + "type": "struct", + "value": "git_oid_shorten", + "file": "git2/oid.h", + "line": 317, + "lineto": 317, + "tdef": "typedef", + "description": " OID Shortener object", + "comments": "", + "used": { + "returns": ["git_oid_shorten_new"], + "needs": ["git_oid_shorten_add", "git_oid_shorten_free"] + } + } + ], + [ + "git_oid_t", + { + "decl": ["GIT_OID_SHA1"], + "type": "enum", + "file": "git2/oid.h", + "line": 23, + "lineto": 32, + "block": "GIT_OID_SHA1", + "tdef": "typedef", + "description": " The type of object id. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_OID_SHA1", + "comments": "

SHA1

\n", + "value": 1 + } + ], + "used": { "returns": ["git_repository_oid_type"], "needs": [] } + } + ], + [ + "git_oidarray", + { + "decl": ["git_oid * ids", "size_t count"], + "type": "struct", + "value": "git_oidarray", + "file": "git2/oidarray.h", + "line": 23, + "lineto": 26, + "block": "git_oid * ids\nsize_t count", + "tdef": "typedef", + "description": " Array of object ids ", + "comments": "", + "fields": [ + { "type": "git_oid *", "name": "ids", "comments": "" }, + { "type": "size_t", "name": "count", "comments": "" } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_bases", + "git_merge_bases_many", + "git_oidarray_dispose", + "git_oidarray_free" + ] + } + } + ], + [ + "git_packbuilder", + { + "decl": "git_packbuilder", + "type": "struct", + "value": "git_packbuilder", + "file": "git2/types.h", + "line": 177, + "lineto": 177, + "tdef": "typedef", + "description": " Representation of a git packbuilder ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_packbuilder_foreach", + "git_packbuilder_free", + "git_packbuilder_hash", + "git_packbuilder_insert", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_recur", + "git_packbuilder_insert_tree", + "git_packbuilder_insert_walk", + "git_packbuilder_name", + "git_packbuilder_new", + "git_packbuilder_object_count", + "git_packbuilder_set_callbacks", + "git_packbuilder_set_threads", + "git_packbuilder_write", + "git_packbuilder_write_buf", + "git_packbuilder_written" + ] + } + } + ], + [ + "git_packbuilder_stage_t", + { + "decl": [ + "GIT_PACKBUILDER_ADDING_OBJECTS", + "GIT_PACKBUILDER_DELTAFICATION" + ], + "type": "enum", + "file": "git2/pack.h", + "line": 52, + "lineto": 55, + "block": "GIT_PACKBUILDER_ADDING_OBJECTS\nGIT_PACKBUILDER_DELTAFICATION", + "tdef": "typedef", + "description": " Stages that are reported by the packbuilder progress callback.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_PACKBUILDER_ADDING_OBJECTS", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PACKBUILDER_DELTAFICATION", + "comments": "", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_patch", + { + "decl": "git_patch", + "type": "struct", + "value": "git_patch", + "file": "git2/patch.h", + "line": 29, + "lineto": 29, + "tdef": "typedef", + "description": " The diff patch is used to store all the text diffs for a delta.", + "comments": "

You can easily loop over the content of patches and get information about them.

\n", + "used": { + "returns": [], + "needs": [ + "git_patch_free", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers", + "git_patch_from_diff", + "git_patch_get_delta", + "git_patch_get_hunk", + "git_patch_get_line_in_hunk", + "git_patch_line_stats", + "git_patch_num_hunks", + "git_patch_num_lines_in_hunk", + "git_patch_owner", + "git_patch_print", + "git_patch_size", + "git_patch_to_buf" + ] + } + } + ], + [ + "git_path_fs", + { + "decl": ["GIT_PATH_FS_GENERIC", "GIT_PATH_FS_NTFS", "GIT_PATH_FS_HFS"], + "type": "enum", + "file": "git2/sys/path.h", + "line": 44, + "lineto": 51, + "block": "GIT_PATH_FS_GENERIC\nGIT_PATH_FS_NTFS\nGIT_PATH_FS_HFS", + "tdef": "typedef", + "description": " The kinds of checks to perform according to which filesystem we are trying to\n protect.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_PATH_FS_GENERIC", + "comments": "

Do both NTFS- and HFS-specific checks

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATH_FS_NTFS", + "comments": "

Do NTFS-specific checks only

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATH_FS_HFS", + "comments": "

Do HFS-specific checks only

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_pathspec", + { + "decl": "git_pathspec", + "type": "struct", + "value": "git_pathspec", + "file": "git2/pathspec.h", + "line": 27, + "lineto": 27, + "tdef": "typedef", + "description": " Compiled pathspec", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_pathspec_free", + "git_pathspec_match_diff", + "git_pathspec_match_index", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free", + "git_pathspec_match_tree", + "git_pathspec_match_workdir", + "git_pathspec_matches_path", + "git_pathspec_new" + ] + } + } + ], + [ + "git_pathspec_flag_t", + { + "decl": [ + "GIT_PATHSPEC_DEFAULT", + "GIT_PATHSPEC_IGNORE_CASE", + "GIT_PATHSPEC_USE_CASE", + "GIT_PATHSPEC_NO_GLOB", + "GIT_PATHSPEC_NO_MATCH_ERROR", + "GIT_PATHSPEC_FIND_FAILURES", + "GIT_PATHSPEC_FAILURES_ONLY" + ], + "type": "enum", + "file": "git2/pathspec.h", + "line": 37, + "lineto": 80, + "block": "GIT_PATHSPEC_DEFAULT\nGIT_PATHSPEC_IGNORE_CASE\nGIT_PATHSPEC_USE_CASE\nGIT_PATHSPEC_NO_GLOB\nGIT_PATHSPEC_NO_MATCH_ERROR\nGIT_PATHSPEC_FIND_FAILURES\nGIT_PATHSPEC_FAILURES_ONLY", + "tdef": "typedef", + "description": " Options controlling how pathspec match should be executed", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_PATHSPEC_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_IGNORE_CASE", + "comments": "

GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise\n match will use native case sensitivity of platform filesystem

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_USE_CASE", + "comments": "

GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise\n match will use native case sensitivity of platform filesystem

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_NO_GLOB", + "comments": "

GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple\n string comparison for matching

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_NO_MATCH_ERROR", + "comments": "

GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error\n code GIT_ENOTFOUND if no matches are found; otherwise no matches is\n still success (return 0) but git_pathspec_match_list_entrycount\n will indicate 0 matches.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_FIND_FAILURES", + "comments": "

GIT_PATHSPEC_FIND_FAILURES means that the git_pathspec_match_list\n should track which patterns matched which files so that at the end of\n the match we can identify patterns that did not match any files.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_FAILURES_ONLY", + "comments": "

GIT_PATHSPEC_FAILURES_ONLY means that the git_pathspec_match_list\n does not need to keep the actual matching filenames. Use this to\n just test if there were any matches at all or in combination with\n GIT_PATHSPEC_FIND_FAILURES to validate a pathspec.

\n", + "value": 32 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_pathspec_match_list", + { + "decl": "git_pathspec_match_list", + "type": "struct", + "value": "git_pathspec_match_list", + "file": "git2/pathspec.h", + "line": 32, + "lineto": 32, + "tdef": "typedef", + "description": " List of filenames matching a pathspec", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_pathspec_match_diff", + "git_pathspec_match_index", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free", + "git_pathspec_match_tree", + "git_pathspec_match_workdir" + ] + } + } + ], + [ + "git_proxy_options", + { + "decl": [ + "unsigned int version", + "git_proxy_t type", + "const char * url", + "git_credential_acquire_cb credentials", + "git_transport_certificate_check_cb certificate_check", + "void * payload" + ], + "type": "struct", + "value": "git_proxy_options", + "file": "git2/proxy.h", + "line": 50, + "lineto": 85, + "block": "unsigned int version\ngit_proxy_t type\nconst char * url\ngit_credential_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\nvoid * payload", + "tdef": "typedef", + "description": " Options for connecting through a proxy", + "comments": "

Note that not all types may be supported, depending on the platform and compilation options.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_proxy_t", + "name": "type", + "comments": " The type of proxy to use, by URL, auto-detect." + }, + { + "type": "const char *", + "name": "url", + "comments": " The URL of the proxy." + }, + { + "type": "git_credential_acquire_cb", + "name": "credentials", + "comments": " This will be called if the remote host requires\n authentication in order to connect to it.\n\n Returning GIT_PASSTHROUGH will make libgit2 behave as\n though this field isn't set." + }, + { + "type": "git_transport_certificate_check_cb", + "name": "certificate_check", + "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 0 to allow the connection\n or a negative value to indicate an error." + }, + { + "type": "void *", + "name": "payload", + "comments": " Payload to be provided to the credentials and certificate\n check callbacks." + } + ], + "used": { + "returns": [], + "needs": ["git_proxy_options_init", "git_remote_connect"] + } + } + ], + [ + "git_proxy_t", + { + "decl": ["GIT_PROXY_NONE", "GIT_PROXY_AUTO", "GIT_PROXY_SPECIFIED"], + "type": "enum", + "file": "git2/proxy.h", + "line": 26, + "lineto": 42, + "block": "GIT_PROXY_NONE\nGIT_PROXY_AUTO\nGIT_PROXY_SPECIFIED", + "tdef": "typedef", + "description": " The type of proxy to use.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_PROXY_NONE", + "comments": "

Do not attempt to connect through a proxy

\n\n

If built against libcurl, it itself may attempt to connect\n to a proxy if the environment variables specify it.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PROXY_AUTO", + "comments": "

Try to auto-detect the proxy from the git configuration.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PROXY_SPECIFIED", + "comments": "

Connect via the URL given in the options

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_push", + { + "decl": "git_push", + "type": "struct", + "value": "git_push", + "file": "git2/types.h", + "line": 269, + "lineto": 269, + "tdef": "typedef", + "description": " Preparation for a push operation. Can be used to configure what to\n push and the level of parallelism of the packfile builder.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_push_negotiation", + "git_push_options_init", + "git_remote_push", + "git_remote_upload" + ] + } + } + ], + [ + "git_push_options", + { + "decl": [ + "unsigned int version", + "unsigned int pb_parallelism", + "git_remote_callbacks callbacks", + "git_proxy_options proxy_opts", + "git_remote_redirect_t follow_redirects", + "git_strarray custom_headers", + "git_strarray remote_push_options" + ], + "type": "struct", + "value": "git_push_options", + "file": "git2/remote.h", + "line": 860, + "lineto": 899, + "block": "unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks\ngit_proxy_options proxy_opts\ngit_remote_redirect_t follow_redirects\ngit_strarray custom_headers\ngit_strarray remote_push_options", + "tdef": "typedef", + "description": " Controls the behavior of a git_push object.", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "pb_parallelism", + "comments": " If the transport being used to push to the remote requires the creation\n of a pack file, this controls the number of worker threads used by\n the packbuilder when creating that pack file to be sent to the remote.\n\n If set to 0, the packbuilder will auto-detect the number of threads\n to create. The default value is 1." + }, + { + "type": "git_remote_callbacks", + "name": "callbacks", + "comments": " Callbacks to use for this push operation" + }, + { + "type": "git_proxy_options", + "name": "proxy_opts", + "comments": " Proxy options to use, by default no proxy is used." + }, + { + "type": "git_remote_redirect_t", + "name": "follow_redirects", + "comments": " Whether to allow off-site redirects. If this is not\n specified, the `http.followRedirects` configuration setting\n will be consulted." + }, + { + "type": "git_strarray", + "name": "custom_headers", + "comments": " Extra headers for this push operation" + }, + { + "type": "git_strarray", + "name": "remote_push_options", + "comments": " \"Push options\" to deliver to the remote." + } + ], + "used": { + "returns": [], + "needs": [ + "git_push_options_init", + "git_remote_push", + "git_remote_upload" + ] + } + } + ], + [ + "git_push_update", + { + "decl": [ + "char * src_refname", + "char * dst_refname", + "git_oid src", + "git_oid dst" + ], + "type": "struct", + "value": "git_push_update", + "file": "git2/remote.h", + "line": 490, + "lineto": 507, + "block": "char * src_refname\nchar * dst_refname\ngit_oid src\ngit_oid dst", + "tdef": "typedef", + "description": " Represents an update which will be performed on the remote during push", + "comments": "", + "fields": [ + { + "type": "char *", + "name": "src_refname", + "comments": " The source name of the reference" + }, + { + "type": "char *", + "name": "dst_refname", + "comments": " The name of the reference to update on the server" + }, + { + "type": "git_oid", + "name": "src", + "comments": " The current target of the reference" + }, + { + "type": "git_oid", + "name": "dst", + "comments": " The new target for the reference" + } + ], + "used": { "returns": [], "needs": ["git_push_negotiation"] } + } + ], + [ + "git_rebase", + { + "decl": "git_rebase", + "type": "struct", + "value": "git_rebase", + "file": "git2/types.h", + "line": 220, + "lineto": 220, + "tdef": "typedef", + "description": " Representation of a rebase ", + "comments": "", + "used": { + "returns": ["git_rebase_operation_byindex"], + "needs": [ + "git_rebase_abort", + "git_rebase_commit", + "git_rebase_finish", + "git_rebase_free", + "git_rebase_init", + "git_rebase_inmemory_index", + "git_rebase_next", + "git_rebase_onto_id", + "git_rebase_onto_name", + "git_rebase_open", + "git_rebase_operation_byindex", + "git_rebase_operation_current", + "git_rebase_operation_entrycount", + "git_rebase_options_init", + "git_rebase_orig_head_id", + "git_rebase_orig_head_name" + ] + } + } + ], + [ + "git_rebase_operation", + { + "decl": [ + "git_rebase_operation_t type", + "const git_oid id", + "const char * exec" + ], + "type": "struct", + "value": "git_rebase_operation", + "file": "git2/rebase.h", + "line": 174, + "lineto": 189, + "block": "git_rebase_operation_t type\nconst git_oid id\nconst char * exec", + "tdef": "typedef", + "description": " A rebase operation", + "comments": "

Describes a single instruction/operation to be performed during the rebase.

\n", + "fields": [ + { + "type": "git_rebase_operation_t", + "name": "type", + "comments": " The type of rebase operation. " + }, + { + "type": "const git_oid", + "name": "id", + "comments": " The commit ID being cherry-picked. This will be populated for\n all operations except those of type `GIT_REBASE_OPERATION_EXEC`." + }, + { + "type": "const char *", + "name": "exec", + "comments": " The executable the user has requested be run. This will only\n be populated for operations of type `GIT_REBASE_OPERATION_EXEC`." + } + ], + "used": { + "returns": ["git_rebase_operation_byindex"], + "needs": ["git_rebase_next"] + } + } + ], + [ + "git_rebase_operation_t", + { + "decl": [ + "GIT_REBASE_OPERATION_PICK", + "GIT_REBASE_OPERATION_REWORD", + "GIT_REBASE_OPERATION_EDIT", + "GIT_REBASE_OPERATION_SQUASH", + "GIT_REBASE_OPERATION_FIXUP", + "GIT_REBASE_OPERATION_EXEC" + ], + "type": "enum", + "file": "git2/rebase.h", + "line": 119, + "lineto": 155, + "block": "GIT_REBASE_OPERATION_PICK\nGIT_REBASE_OPERATION_REWORD\nGIT_REBASE_OPERATION_EDIT\nGIT_REBASE_OPERATION_SQUASH\nGIT_REBASE_OPERATION_FIXUP\nGIT_REBASE_OPERATION_EXEC", + "tdef": "typedef", + "description": " Type of rebase operation in-progress after calling `git_rebase_next`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REBASE_OPERATION_PICK", + "comments": "

The given commit is to be cherry-picked. The client should commit\n the changes and continue if there are no conflicts.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_REWORD", + "comments": "

The given commit is to be cherry-picked, but the client should prompt\n the user to provide an updated commit message.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_EDIT", + "comments": "

The given commit is to be cherry-picked, but the client should stop\n to allow the user to edit the changes before committing them.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_SQUASH", + "comments": "

The given commit is to be squashed into the previous commit. The\n commit message will be merged with the previous message.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_FIXUP", + "comments": "

The given commit is to be squashed into the previous commit. The\n commit message from this commit will be discarded.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_EXEC", + "comments": "

No commit will be cherry-picked. The client should run the given\n command and (if successful) continue.

\n", + "value": 5 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_rebase_options", + { + "decl": [ + "unsigned int version", + "int quiet", + "int inmemory", + "const char * rewrite_notes_ref", + "git_merge_options merge_options", + "git_checkout_options checkout_options", + "git_commit_create_cb commit_create_cb", + "int (*)(git_buf *, git_buf *, const char *, void *) signing_cb", + "void * payload" + ], + "type": "struct", + "value": "git_rebase_options", + "file": "git2/rebase.h", + "line": 32, + "lineto": 114, + "block": "unsigned int version\nint quiet\nint inmemory\nconst char * rewrite_notes_ref\ngit_merge_options merge_options\ngit_checkout_options checkout_options\ngit_commit_create_cb commit_create_cb\nint (*)(git_buf *, git_buf *, const char *, void *) signing_cb\nvoid * payload", + "tdef": "typedef", + "description": " Rebase options", + "comments": "

Use to tell the rebase machinery how to operate.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "int", + "name": "quiet", + "comments": " Used by `git_rebase_init`, this will instruct other clients working\n on this rebase that you want a quiet rebase experience, which they\n may choose to provide in an application-specific manner. This has no\n effect upon libgit2 directly, but is provided for interoperability\n between Git tools." + }, + { + "type": "int", + "name": "inmemory", + "comments": " Used by `git_rebase_init`, this will begin an in-memory rebase,\n which will allow callers to step through the rebase operations and\n commit the rebased changes, but will not rewind HEAD or update the\n repository to be in a rebasing state. This will not interfere with\n the working directory (if there is one)." + }, + { + "type": "const char *", + "name": "rewrite_notes_ref", + "comments": " Used by `git_rebase_finish`, this is the name of the notes reference\n used to rewrite notes for rebased commits when finishing the rebase;\n if NULL, the contents of the configuration option `notes.rewriteRef`\n is examined, unless the configuration option `notes.rewrite.rebase`\n is set to false. If `notes.rewriteRef` is also NULL, notes will\n not be rewritten." + }, + { + "type": "git_merge_options", + "name": "merge_options", + "comments": " Options to control how trees are merged during `git_rebase_next`." + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options to control how files are written during `git_rebase_init`,\n `git_rebase_next` and `git_rebase_abort`. Note that during\n `abort`, these options will add an implied `GIT_CHECKOUT_FORCE`\n to match git semantics." + }, + { + "type": "git_commit_create_cb", + "name": "commit_create_cb", + "comments": " Optional callback that allows users to override commit\n creation in `git_rebase_commit`. If specified, users can\n create their own commit and provide the commit ID, which\n may be useful for signing commits or otherwise customizing\n the commit creation.\n\n If this callback returns `GIT_PASSTHROUGH`, then\n `git_rebase_commit` will continue to create the commit." + }, + { + "type": "int (*)(git_buf *, git_buf *, const char *, void *)", + "name": "signing_cb", + "comments": " If provided, this will be called with the commit content, allowing\n a signature to be added to the rebase commit. Can be skipped with\n GIT_PASSTHROUGH. If GIT_PASSTHROUGH is returned, a commit will be made\n without a signature.\n\n This field is only used when performing git_rebase_commit.\n\n This callback is not invoked if a `git_commit_create_cb` is\n specified.\n\n This callback is deprecated; users should provide a\n creation callback as `commit_create_cb` that produces a\n commit buffer, signs it, and commits it." + }, + { + "type": "void *", + "name": "payload", + "comments": " This will be passed to each of the callbacks in this struct\n as the last parameter." + } + ], + "used": { + "returns": [], + "needs": [ + "git_rebase_init", + "git_rebase_open", + "git_rebase_options_init" + ] + } + } + ], + [ + "git_refdb", + { + "decl": "git_refdb", + "type": "struct", + "value": "git_refdb", + "file": "git2/types.h", + "line": 108, + "lineto": 108, + "tdef": "typedef", + "description": " An open refs database handle. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_refdb_compress", + "git_refdb_free", + "git_refdb_new", + "git_refdb_open", + "git_repository_refdb" + ] + } + } + ], + [ + "git_refdb_backend", + { + "decl": "git_refdb_backend", + "type": "struct", + "value": "git_refdb_backend", + "file": "git2/types.h", + "line": 111, + "lineto": 111, + "tdef": "typedef", + "description": " A custom backend for refs ", + "comments": "", + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_reference", + { + "decl": "git_reference", + "type": "struct", + "value": "git_reference", + "file": "git2/types.h", + "line": 194, + "lineto": 194, + "tdef": "typedef", + "description": " In-memory representation of a reference. ", + "comments": "", + "used": { + "returns": ["git_reference_type"], + "needs": [ + "git_annotated_commit_from_ref", + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_delete", + "git_branch_is_checked_out", + "git_branch_is_head", + "git_branch_lookup", + "git_branch_move", + "git_branch_name", + "git_branch_next", + "git_branch_set_upstream", + "git_branch_upstream", + "git_merge_analysis_for_ref", + "git_reference_cmp", + "git_reference_create", + "git_reference_create_matching", + "git_reference_delete", + "git_reference_dup", + "git_reference_dwim", + "git_reference_foreach", + "git_reference_foreach_cb", + "git_reference_foreach_glob", + "git_reference_foreach_name", + "git_reference_free", + "git_reference_is_branch", + "git_reference_is_note", + "git_reference_is_remote", + "git_reference_is_tag", + "git_reference_iterator_free", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", + "git_reference_lookup", + "git_reference_name", + "git_reference_next", + "git_reference_next_name", + "git_reference_owner", + "git_reference_peel", + "git_reference_rename", + "git_reference_resolve", + "git_reference_set_target", + "git_reference_shorthand", + "git_reference_symbolic_create", + "git_reference_symbolic_create_matching", + "git_reference_symbolic_set_target", + "git_reference_symbolic_target", + "git_reference_target", + "git_reference_target_peel", + "git_reference_type", + "git_repository_head", + "git_repository_head_for_worktree", + "git_revparse_ext" + ] + } + } + ], + [ + "git_reference_format_t", + { + "decl": [ + "GIT_REFERENCE_FORMAT_NORMAL", + "GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL", + "GIT_REFERENCE_FORMAT_REFSPEC_PATTERN", + "GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND" + ], + "type": "enum", + "file": "git2/refs.h", + "line": 663, + "lineto": 692, + "block": "GIT_REFERENCE_FORMAT_NORMAL\nGIT_REFERENCE_FORMAT_ALLOW_ONELEVEL\nGIT_REFERENCE_FORMAT_REFSPEC_PATTERN\nGIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND", + "tdef": "typedef", + "description": " Normalization options for reference lookup", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REFERENCE_FORMAT_NORMAL", + "comments": "

No particular normalization.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL", + "comments": "

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REFERENCE_FORMAT_REFSPEC_PATTERN", + "comments": "

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND", + "comments": "

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_reference_iterator", + { + "decl": "git_reference_iterator", + "type": "struct", + "value": "git_reference_iterator", + "file": "git2/types.h", + "line": 197, + "lineto": 197, + "tdef": "typedef", + "description": " Iterator for references ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_reference_iterator_free", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", + "git_reference_next", + "git_reference_next_name" + ] + } + } + ], + [ + "git_reference_t", + { + "decl": [ + "GIT_REFERENCE_INVALID", + "GIT_REFERENCE_DIRECT", + "GIT_REFERENCE_SYMBOLIC", + "GIT_REFERENCE_ALL" + ], + "type": "enum", + "file": "git2/types.h", + "line": 223, + "lineto": 228, + "block": "GIT_REFERENCE_INVALID\nGIT_REFERENCE_DIRECT\nGIT_REFERENCE_SYMBOLIC\nGIT_REFERENCE_ALL", + "tdef": "typedef", + "description": " Basic type of any Git reference. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REFERENCE_INVALID", + "comments": "

Invalid reference

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REFERENCE_DIRECT", + "comments": "

A reference that points at an object id

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REFERENCE_SYMBOLIC", + "comments": "

A reference that points at another reference

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REFERENCE_ALL", + "comments": "", + "value": 3 + } + ], + "used": { "returns": ["git_reference_type"], "needs": [] } + } + ], + [ + "git_reflog", + { + "decl": "git_reflog", + "type": "struct", + "value": "git_reflog", + "file": "git2/types.h", + "line": 171, + "lineto": 171, + "tdef": "typedef", + "description": " Representation of a reference log ", + "comments": "", + "used": { + "returns": ["git_reflog_entry_byindex"], + "needs": [ + "git_reflog_append", + "git_reflog_drop", + "git_reflog_entry_byindex", + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message", + "git_reflog_entrycount", + "git_reflog_free", + "git_reflog_read", + "git_reflog_write", + "git_transaction_set_reflog" + ] + } + } + ], + [ + "git_reflog_entry", + { + "decl": "git_reflog_entry", + "type": "struct", + "value": "git_reflog_entry", + "file": "git2/types.h", + "line": 168, + "lineto": 168, + "tdef": "typedef", + "description": " Representation of a reference log entry ", + "comments": "", + "used": { + "returns": ["git_reflog_entry_byindex"], + "needs": [ + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message" + ] + } + } + ], + [ + "git_refspec", + { + "decl": "git_refspec", + "type": "struct", + "value": "git_refspec", + "file": "git2/types.h", + "line": 251, + "lineto": 251, + "tdef": "typedef", + "description": " A refspec specifies the mapping between remote and local reference\n names when fetch or pushing.", + "comments": "", + "used": { + "returns": ["git_remote_get_refspec"], + "needs": [ + "git_refspec_direction", + "git_refspec_dst", + "git_refspec_dst_matches", + "git_refspec_force", + "git_refspec_free", + "git_refspec_parse", + "git_refspec_rtransform", + "git_refspec_src", + "git_refspec_src_matches", + "git_refspec_src_matches_negative", + "git_refspec_string", + "git_refspec_transform" + ] + } + } + ], + [ + "git_remote", + { + "decl": "git_remote", + "type": "struct", + "value": "git_remote", + "file": "git2/types.h", + "line": 257, + "lineto": 257, + "tdef": "typedef", + "description": " Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entries).", + "comments": "", + "used": { + "returns": ["git_remote_autotag"], + "needs": [ + "git_headlist_cb", + "git_remote_autotag", + "git_remote_connect", + "git_remote_connect_ext", + "git_remote_connect_options_init", + "git_remote_connected", + "git_remote_create", + "git_remote_create_anonymous", + "git_remote_create_cb", + "git_remote_create_detached", + "git_remote_create_options_init", + "git_remote_create_with_fetchspec", + "git_remote_create_with_opts", + "git_remote_default_branch", + "git_remote_disconnect", + "git_remote_download", + "git_remote_dup", + "git_remote_fetch", + "git_remote_free", + "git_remote_get_fetch_refspecs", + "git_remote_get_push_refspecs", + "git_remote_get_refspec", + "git_remote_init_callbacks", + "git_remote_lookup", + "git_remote_ls", + "git_remote_name", + "git_remote_owner", + "git_remote_prune", + "git_remote_prune_refs", + "git_remote_push", + "git_remote_pushurl", + "git_remote_ready_cb", + "git_remote_refspec_count", + "git_remote_set_autotag", + "git_remote_set_instance_pushurl", + "git_remote_set_instance_url", + "git_remote_stats", + "git_remote_stop", + "git_remote_update_tips", + "git_remote_upload", + "git_remote_url", + "git_transport_cb" + ] + } + } + ], + [ + "git_remote_autotag_option_t", + { + "decl": [ + "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED", + "GIT_REMOTE_DOWNLOAD_TAGS_AUTO", + "GIT_REMOTE_DOWNLOAD_TAGS_NONE", + "GIT_REMOTE_DOWNLOAD_TAGS_ALL" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 739, + "lineto": 757, + "block": "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED\nGIT_REMOTE_DOWNLOAD_TAGS_AUTO\nGIT_REMOTE_DOWNLOAD_TAGS_NONE\nGIT_REMOTE_DOWNLOAD_TAGS_ALL", + "tdef": "typedef", + "description": " Automatic tag following option", + "comments": "

Lets us select the --tags option to use.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED", + "comments": "

Use the setting from the configuration.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_AUTO", + "comments": "

Ask the server for tags pointing to objects we're already\n downloading.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_NONE", + "comments": "

Don't ask for any tags beyond the refspecs.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_ALL", + "comments": "

Ask for the all the tags.

\n", + "value": 3 + } + ], + "used": { + "returns": ["git_remote_autotag"], + "needs": ["git_remote_set_autotag", "git_remote_update_tips"] + } + } + ], + [ + "git_remote_callbacks", + { + "decl": [ + "unsigned int version", + "git_transport_message_cb sideband_progress", + "int (*)(git_remote_completion_t, void *) completion", + "git_credential_acquire_cb credentials", + "git_transport_certificate_check_cb certificate_check", + "git_indexer_progress_cb transfer_progress", + "int (*)(const char *, const git_oid *, const git_oid *, void *) update_tips", + "git_packbuilder_progress pack_progress", + "git_push_transfer_progress_cb push_transfer_progress", + "git_push_update_reference_cb push_update_reference", + "git_push_negotiation push_negotiation", + "git_transport_cb transport", + "git_remote_ready_cb remote_ready", + "void * payload", + "git_url_resolve_cb resolve_url", + "int (*)(const char *, const git_oid *, const git_oid *, git_refspec *, void *) update_refs" + ], + "type": "struct", + "value": "git_remote_callbacks", + "file": "git2/remote.h", + "line": 572, + "lineto": 698, + "block": "unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_t, void *) completion\ngit_credential_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_indexer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress_cb push_transfer_progress\ngit_push_update_reference_cb push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\ngit_remote_ready_cb remote_ready\nvoid * payload\ngit_url_resolve_cb resolve_url\nint (*)(const char *, const git_oid *, const git_oid *, git_refspec *, void *) update_refs", + "tdef": null, + "description": " The callback settings structure", + "comments": "

Set the callbacks to be called by the remote when informing the user about the progress of the network operations.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The version " + }, + { + "type": "git_transport_message_cb", + "name": "sideband_progress", + "comments": " Textual progress from the remote. Text send over the\n progress side-band will be passed to this function (this is\n the 'counting objects' output)." + }, + { + "type": "int (*)(git_remote_completion_t, void *)", + "name": "completion", + "comments": "" + }, + { + "type": "git_credential_acquire_cb", + "name": "credentials", + "comments": " This will be called if the remote host requires\n authentication in order to connect to it.\n\n Returning GIT_PASSTHROUGH will make libgit2 behave as\n though this field isn't set." + }, + { + "type": "git_transport_certificate_check_cb", + "name": "certificate_check", + "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 0 to allow the connection\n or a negative value to indicate an error." + }, + { + "type": "git_indexer_progress_cb", + "name": "transfer_progress", + "comments": " During the download of new data, this will be regularly\n called with the current count of progress done by the\n indexer." + }, + { + "type": "int (*)(const char *, const git_oid *, const git_oid *, void *)", + "name": "update_tips", + "comments": "" + }, + { + "type": "git_packbuilder_progress", + "name": "pack_progress", + "comments": " Function to call with progress information during pack\n building. Be aware that this is called inline with pack\n building operations, so performance may be affected." + }, + { + "type": "git_push_transfer_progress_cb", + "name": "push_transfer_progress", + "comments": " Function to call with progress information during the\n upload portion of a push. Be aware that this is called\n inline with pack building operations, so performance may be\n affected." + }, + { + "type": "git_push_update_reference_cb", + "name": "push_update_reference", + "comments": " See documentation of git_push_update_reference_cb" + }, + { + "type": "git_push_negotiation", + "name": "push_negotiation", + "comments": " Called once between the negotiation step and the upload. It\n provides information about what updates will be performed." + }, + { + "type": "git_transport_cb", + "name": "transport", + "comments": " Create the transport to use for this operation. Leave NULL\n to auto-detect." + }, + { + "type": "git_remote_ready_cb", + "name": "remote_ready", + "comments": " Callback when the remote is ready to connect." + }, + { + "type": "void *", + "name": "payload", + "comments": " This will be passed to each of the callbacks in this struct\n as the last parameter." + }, + { + "type": "git_url_resolve_cb", + "name": "resolve_url", + "comments": " Resolve URL before connecting to remote.\n The returned URL will be used to connect to the remote instead.\n\n This callback is deprecated; users should use\n git_remote_ready_cb and configure the instance URL instead." + }, + { + "type": "int (*)(const char *, const git_oid *, const git_oid *, git_refspec *, void *)", + "name": "update_refs", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_remote_connect", + "git_remote_init_callbacks", + "git_remote_prune", + "git_remote_update_tips" + ] + } + } + ], + [ + "git_remote_completion_t", + { + "decl": [ + "GIT_REMOTE_COMPLETION_DOWNLOAD", + "GIT_REMOTE_COMPLETION_INDEXING", + "GIT_REMOTE_COMPLETION_ERROR" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 466, + "lineto": 470, + "block": "GIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR\nGIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR", + "tdef": "typedef", + "description": " Argument to the completion callback which tells it which operation\n finished.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_COMPLETION_DOWNLOAD", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REMOTE_COMPLETION_INDEXING", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_COMPLETION_ERROR", + "comments": "", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_remote_connect_options", + { + "decl": [ + "unsigned int version", + "git_remote_callbacks callbacks", + "git_proxy_options proxy_opts", + "git_remote_redirect_t follow_redirects", + "git_strarray custom_headers" + ], + "type": "struct", + "value": "git_remote_connect_options", + "file": "git2/remote.h", + "line": 928, + "lineto": 946, + "block": "unsigned int version\ngit_remote_callbacks callbacks\ngit_proxy_options proxy_opts\ngit_remote_redirect_t follow_redirects\ngit_strarray custom_headers", + "tdef": "typedef", + "description": " Remote creation options structure", + "comments": "

Initialize with GIT_REMOTE_CREATE_OPTIONS_INIT. Alternatively, you can use git_remote_create_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_remote_callbacks", + "name": "callbacks", + "comments": " Callbacks to use for this connection " + }, + { + "type": "git_proxy_options", + "name": "proxy_opts", + "comments": " HTTP Proxy settings " + }, + { + "type": "git_remote_redirect_t", + "name": "follow_redirects", + "comments": " Whether to allow off-site redirects. If this is not\n specified, the `http.followRedirects` configuration setting\n will be consulted." + }, + { + "type": "git_strarray", + "name": "custom_headers", + "comments": " Extra HTTP headers to use in this connection " + } + ], + "used": { + "returns": [], + "needs": ["git_remote_connect_ext", "git_remote_connect_options_init"] + } + } + ], + [ + "git_remote_create_flags", + { + "decl": [ + "GIT_REMOTE_CREATE_SKIP_INSTEADOF", + "GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 71, + "lineto": 77, + "block": "GIT_REMOTE_CREATE_SKIP_INSTEADOF\nGIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC", + "tdef": "typedef", + "description": " Remote creation options flags", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_CREATE_SKIP_INSTEADOF", + "comments": "

Ignore the repository apply.insteadOf configuration

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC", + "comments": "

Don't build a fetchspec from the name if none is set

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_remote_create_options", + { + "decl": [ + "unsigned int version", + "git_repository * repository", + "const char * name", + "const char * fetchspec", + "unsigned int flags" + ], + "type": "struct", + "value": "git_remote_create_options", + "file": "git2/remote.h", + "line": 97, + "lineto": 117, + "block": "unsigned int version\ngit_repository * repository\nconst char * name\nconst char * fetchspec\nunsigned int flags", + "tdef": "typedef", + "description": " Remote creation options structure", + "comments": "

Initialize with GIT_REMOTE_CREATE_OPTIONS_INIT. Alternatively, you can use git_remote_create_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_repository *", + "name": "repository", + "comments": " The repository that should own the remote.\n Setting this to NULL results in a detached remote." + }, + { + "type": "const char *", + "name": "name", + "comments": " The remote's name.\n Setting this to NULL results in an in-memory/anonymous remote." + }, + { + "type": "const char *", + "name": "fetchspec", + "comments": " The fetchspec the remote should use. " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " Additional flags for the remote. See git_remote_create_flags. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_remote_create_options_init", + "git_remote_create_with_opts" + ] + } + } + ], + [ + "git_remote_head", + { + "decl": [ + "int local", + "git_oid oid", + "git_oid loid", + "char * name", + "char * symref_target" + ], + "type": "struct", + "value": "git_remote_head", + "file": "git2/net.h", + "line": 41, + "lineto": 51, + "block": "int local\ngit_oid oid\ngit_oid loid\nchar * name\nchar * symref_target", + "tdef": null, + "description": " Description of a reference advertised by a remote server, given out\n on `ls` calls.", + "comments": "", + "fields": [ + { "type": "int", "name": "local", "comments": "" }, + { "type": "git_oid", "name": "oid", "comments": "" }, + { "type": "git_oid", "name": "loid", "comments": "" }, + { "type": "char *", "name": "name", "comments": "" }, + { + "type": "char *", + "name": "symref_target", + "comments": " If the server send a symref mapping for this ref, this will\n point to the target." + } + ], + "used": { "returns": [], "needs": ["git_headlist_cb", "git_remote_ls"] } + } + ], + [ + "git_remote_redirect_t", + { + "decl": [ + "GIT_REMOTE_REDIRECT_NONE", + "GIT_REMOTE_REDIRECT_INITIAL", + "GIT_REMOTE_REDIRECT_ALL" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 49, + "lineto": 66, + "block": "GIT_REMOTE_REDIRECT_NONE\nGIT_REMOTE_REDIRECT_INITIAL\nGIT_REMOTE_REDIRECT_ALL", + "tdef": "typedef", + "description": " Remote redirection settings; whether redirects to another host\n are permitted. By default, git will follow a redirect on the\n initial request (`/info/refs`), but not subsequent requests.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_REDIRECT_NONE", + "comments": "

Do not follow any off-site redirects at any stage of\n the fetch or push.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_REDIRECT_INITIAL", + "comments": "

Allow off-site redirects only upon the initial request.\n This is the default.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REMOTE_REDIRECT_ALL", + "comments": "

Allow redirects at any stage in the fetch or push.

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_remote_update_flags", + { + "decl": [ + "GIT_REMOTE_UPDATE_FETCHHEAD", + "GIT_REMOTE_UPDATE_REPORT_UNCHANGED" + ], + "type": "enum", + "file": "git2/remote.h", + "line": 82, + "lineto": 88, + "block": "GIT_REMOTE_UPDATE_FETCHHEAD\nGIT_REMOTE_UPDATE_REPORT_UNCHANGED", + "tdef": "typedef", + "description": " How to handle reference updates.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_UPDATE_FETCHHEAD", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_UPDATE_REPORT_UNCHANGED", + "comments": "", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_repository", + { + "decl": "git_repository", + "type": "struct", + "value": "git_repository", + "file": "git2/types.h", + "line": 123, + "lineto": 123, + "tdef": "typedef", + "description": " Representation of an existing git repository,\n including all its object contents", + "comments": "", + "used": { + "returns": [ + "git_blob_owner", + "git_commit_owner", + "git_index_owner", + "git_object_owner", + "git_patch_owner", + "git_reference_owner", + "git_remote_owner", + "git_revwalk_repository", + "git_submodule_owner", + "git_tag_owner", + "git_tree_owner" + ], + "needs": [ + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_lookup", + "git_apply", + "git_apply_to_tree", + "git_attr_add_macro", + "git_attr_cache_flush", + "git_attr_foreach", + "git_attr_foreach_ext", + "git_attr_get", + "git_attr_get_ext", + "git_attr_get_many", + "git_attr_get_many_ext", + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_workdir", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_iterator_new", + "git_branch_lookup", + "git_branch_remote_name", + "git_branch_upstream_merge", + "git_branch_upstream_name", + "git_branch_upstream_remote", + "git_checkout_head", + "git_checkout_index", + "git_checkout_tree", + "git_cherrypick", + "git_cherrypick_commit", + "git_clone", + "git_commit_create", + "git_commit_create_buffer", + "git_commit_create_from_stage", + "git_commit_create_v", + "git_commit_create_with_signature", + "git_commit_extract_signature", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_config_add_file_ondisk", + "git_describe_workdir", + "git_diff_commit_as_email", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_filter_list_apply_to_file", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_file", + "git_graph_ahead_behind", + "git_graph_descendant_of", + "git_graph_reachable_from_any", + "git_ignore_add_rule", + "git_ignore_clear_internal_rules", + "git_ignore_path_is_ignored", + "git_index_write_tree_to", + "git_mailmap_from_repository", + "git_merge", + "git_merge_analysis", + "git_merge_analysis_for_ref", + "git_merge_base", + "git_merge_base_many", + "git_merge_base_octopus", + "git_merge_bases", + "git_merge_bases_many", + "git_merge_commits", + "git_merge_file_from_index", + "git_merge_trees", + "git_object_lookup", + "git_object_lookup_prefix", + "git_packbuilder_new", + "git_pathspec_match_workdir", + "git_rebase_init", + "git_rebase_open", + "git_refdb_new", + "git_refdb_open", + "git_reference_create", + "git_reference_create_matching", + "git_reference_dwim", + "git_reference_ensure_log", + "git_reference_foreach", + "git_reference_foreach_glob", + "git_reference_foreach_name", + "git_reference_has_log", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", + "git_reference_list", + "git_reference_lookup", + "git_reference_name_to_id", + "git_reference_remove", + "git_reference_symbolic_create", + "git_reference_symbolic_create_matching", + "git_reflog_delete", + "git_reflog_read", + "git_reflog_rename", + "git_remote_add_fetch", + "git_remote_add_push", + "git_remote_create", + "git_remote_create_anonymous", + "git_remote_create_cb", + "git_remote_create_with_fetchspec", + "git_remote_delete", + "git_remote_list", + "git_remote_lookup", + "git_remote_rename", + "git_remote_set_autotag", + "git_remote_set_pushurl", + "git_remote_set_url", + "git_repository_commit_parents", + "git_repository_commondir", + "git_repository_config", + "git_repository_config_snapshot", + "git_repository_create_cb", + "git_repository_detach_head", + "git_repository_fetchhead_foreach", + "git_repository_free", + "git_repository_get_namespace", + "git_repository_hashfile", + "git_repository_head", + "git_repository_head_detached", + "git_repository_head_detached_for_worktree", + "git_repository_head_for_worktree", + "git_repository_head_unborn", + "git_repository_ident", + "git_repository_index", + "git_repository_init", + "git_repository_init_ext", + "git_repository_init_options_init", + "git_repository_is_bare", + "git_repository_is_empty", + "git_repository_is_shallow", + "git_repository_is_worktree", + "git_repository_item_path", + "git_repository_mergehead_foreach", + "git_repository_message", + "git_repository_message_remove", + "git_repository_odb", + "git_repository_oid_type", + "git_repository_open", + "git_repository_open_bare", + "git_repository_open_ext", + "git_repository_open_from_worktree", + "git_repository_path", + "git_repository_refdb", + "git_repository_set_head", + "git_repository_set_head_detached", + "git_repository_set_head_detached_from_annotated", + "git_repository_set_ident", + "git_repository_set_namespace", + "git_repository_set_workdir", + "git_repository_state", + "git_repository_state_cleanup", + "git_repository_workdir", + "git_repository_wrap_odb", + "git_reset", + "git_reset_default", + "git_reset_from_annotated", + "git_revert", + "git_revert_commit", + "git_revparse", + "git_revparse_ext", + "git_revparse_single", + "git_revwalk_new", + "git_signature_default", + "git_signature_default_from_env", + "git_stash_apply", + "git_stash_drop", + "git_stash_foreach", + "git_stash_pop", + "git_stash_save", + "git_stash_save_with_opts", + "git_status_file", + "git_status_foreach", + "git_status_foreach_ext", + "git_status_list_new", + "git_status_should_ignore", + "git_submodule_add_setup", + "git_submodule_clone", + "git_submodule_foreach", + "git_submodule_lookup", + "git_submodule_open", + "git_submodule_repo_init", + "git_submodule_resolve_url", + "git_submodule_set_branch", + "git_submodule_set_fetch_recurse_submodules", + "git_submodule_set_ignore", + "git_submodule_set_update", + "git_submodule_set_url", + "git_submodule_status", + "git_tag_annotation_create", + "git_tag_create", + "git_tag_create_from_buffer", + "git_tag_create_lightweight", + "git_tag_delete", + "git_tag_foreach", + "git_tag_list", + "git_tag_list_match", + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_transaction_new", + "git_tree_create_updated", + "git_tree_entry_to_object", + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_treebuilder_new", + "git_worktree_add", + "git_worktree_list", + "git_worktree_lookup", + "git_worktree_open_from_repository" + ] + } + } + ], + [ + "git_repository_init_flag_t", + { + "decl": [ + "GIT_REPOSITORY_INIT_BARE", + "GIT_REPOSITORY_INIT_NO_REINIT", + "GIT_REPOSITORY_INIT_NO_DOTGIT_DIR", + "GIT_REPOSITORY_INIT_MKDIR", + "GIT_REPOSITORY_INIT_MKPATH", + "GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE", + "GIT_REPOSITORY_INIT_RELATIVE_GITLINK" + ], + "type": "enum", + "file": "git2/repository.h", + "line": 249, + "lineto": 295, + "block": "GIT_REPOSITORY_INIT_BARE\nGIT_REPOSITORY_INIT_NO_REINIT\nGIT_REPOSITORY_INIT_NO_DOTGIT_DIR\nGIT_REPOSITORY_INIT_MKDIR\nGIT_REPOSITORY_INIT_MKPATH\nGIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK", + "tdef": "typedef", + "description": " Option flags for `git_repository_init_ext`.", + "comments": "

These flags configure extra behaviors to git_repository_init_ext. In every case, the default behavior is the zero value (i.e. flag is not set). Just OR the flag values together for the flags parameter when initializing a new repo.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_BARE", + "comments": "

Create a bare repository with no working directory.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_NO_REINIT", + "comments": "

Return an GIT_EEXISTS error if the repo_path appears to already be\n an git repository.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_NO_DOTGIT_DIR", + "comments": "

Normally a "/.git/" will be appended to the repo path for\n non-bare repos (if it is not already there), but passing this flag\n prevents that behavior.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_MKDIR", + "comments": "

Make the repo_path (and workdir_path) as needed. Init is always willing\n to create the ".git" directory even without this flag. This flag tells\n init to create the trailing component of the repo and workdir paths\n as needed.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_MKPATH", + "comments": "

Recursively make all components of the repo and workdir paths as\n necessary.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE", + "comments": "

libgit2 normally uses internal templates to initialize a new repo.\n This flags enables external templates, looking the "template_path" from\n the options if set, or the init.templatedir global config if not,\n or falling back on "/usr/share/git-core/templates" if it exists.

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_RELATIVE_GITLINK", + "comments": "

If an alternate workdir is specified, use relative paths for the gitdir\n and core.worktree.

\n", + "value": 64 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_repository_init_mode_t", + { + "decl": [ + "GIT_REPOSITORY_INIT_SHARED_UMASK", + "GIT_REPOSITORY_INIT_SHARED_GROUP", + "GIT_REPOSITORY_INIT_SHARED_ALL" + ], + "type": "enum", + "file": "git2/repository.h", + "line": 304, + "lineto": 320, + "block": "GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL", + "tdef": "typedef", + "description": " Mode options for `git_repository_init_ext`.", + "comments": "

Set the mode field of the git_repository_init_options structure either to the custom mode that you would like, or to one of the defined modes.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_SHARED_UMASK", + "comments": "

Use permissions configured by umask - the default.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_SHARED_GROUP", + "comments": "

Use "--shared=group" behavior, chmod'ing the new repo to be group\n writable and "g+sx" for sticky group assignment.

\n", + "value": 1533 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_SHARED_ALL", + "comments": "

Use "--shared=all" behavior, adding world readability.

\n", + "value": 1535 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_repository_init_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "uint32_t mode", + "const char * workdir_path", + "const char * description", + "const char * template_path", + "const char * initial_head", + "const char * origin_url" + ], + "type": "struct", + "value": "git_repository_init_options", + "file": "git2/repository.h", + "line": 328, + "lineto": 387, + "block": "unsigned int version\nuint32_t flags\nuint32_t mode\nconst char * workdir_path\nconst char * description\nconst char * template_path\nconst char * initial_head\nconst char * origin_url", + "tdef": "typedef", + "description": " Extended options structure for `git_repository_init_ext`.", + "comments": "

This contains extra options for git_repository_init_ext that enable additional initialization features.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Combination of GIT_REPOSITORY_INIT flags above." + }, + { + "type": "uint32_t", + "name": "mode", + "comments": " Set to one of the standard GIT_REPOSITORY_INIT_SHARED_... constants\n above, or to a custom value that you would like." + }, + { + "type": "const char *", + "name": "workdir_path", + "comments": " The path to the working dir or NULL for default (i.e. repo_path parent\n on non-bare repos). IF THIS IS RELATIVE PATH, IT WILL BE EVALUATED\n RELATIVE TO THE REPO_PATH. If this is not the \"natural\" working\n directory, a .git gitlink file will be created here linking to the\n repo_path." + }, + { + "type": "const char *", + "name": "description", + "comments": " If set, this will be used to initialize the \"description\" file in the\n repository, instead of using the template content." + }, + { + "type": "const char *", + "name": "template_path", + "comments": " When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, this contains\n the path to use for the template directory. If this is NULL, the config\n or default directory options will be used instead." + }, + { + "type": "const char *", + "name": "initial_head", + "comments": " The name of the head to point HEAD at. If NULL, then this will be\n treated as \"master\" and the HEAD ref will be set to \"refs/heads/master\".\n If this begins with \"refs/\" it will be used verbatim;\n otherwise \"refs/heads/\" will be prefixed." + }, + { + "type": "const char *", + "name": "origin_url", + "comments": " If this is non-NULL, then after the rest of the repository\n initialization is completed, an \"origin\" remote will be added\n pointing to this URL." + } + ], + "used": { + "returns": [], + "needs": [ + "git_repository_init_ext", + "git_repository_init_options_init" + ] + } + } + ], + [ + "git_repository_item_t", + { + "decl": [ + "GIT_REPOSITORY_ITEM_GITDIR", + "GIT_REPOSITORY_ITEM_WORKDIR", + "GIT_REPOSITORY_ITEM_COMMONDIR", + "GIT_REPOSITORY_ITEM_INDEX", + "GIT_REPOSITORY_ITEM_OBJECTS", + "GIT_REPOSITORY_ITEM_REFS", + "GIT_REPOSITORY_ITEM_PACKED_REFS", + "GIT_REPOSITORY_ITEM_REMOTES", + "GIT_REPOSITORY_ITEM_CONFIG", + "GIT_REPOSITORY_ITEM_INFO", + "GIT_REPOSITORY_ITEM_HOOKS", + "GIT_REPOSITORY_ITEM_LOGS", + "GIT_REPOSITORY_ITEM_MODULES", + "GIT_REPOSITORY_ITEM_WORKTREES", + "GIT_REPOSITORY_ITEM_WORKTREE_CONFIG", + "GIT_REPOSITORY_ITEM__LAST" + ], + "type": "enum", + "file": "git2/repository.h", + "line": 512, + "lineto": 529, + "block": "GIT_REPOSITORY_ITEM_GITDIR\nGIT_REPOSITORY_ITEM_WORKDIR\nGIT_REPOSITORY_ITEM_COMMONDIR\nGIT_REPOSITORY_ITEM_INDEX\nGIT_REPOSITORY_ITEM_OBJECTS\nGIT_REPOSITORY_ITEM_REFS\nGIT_REPOSITORY_ITEM_PACKED_REFS\nGIT_REPOSITORY_ITEM_REMOTES\nGIT_REPOSITORY_ITEM_CONFIG\nGIT_REPOSITORY_ITEM_INFO\nGIT_REPOSITORY_ITEM_HOOKS\nGIT_REPOSITORY_ITEM_LOGS\nGIT_REPOSITORY_ITEM_MODULES\nGIT_REPOSITORY_ITEM_WORKTREES\nGIT_REPOSITORY_ITEM_WORKTREE_CONFIG\nGIT_REPOSITORY_ITEM__LAST", + "tdef": "typedef", + "description": " List of items which belong to the git repository layout", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_GITDIR", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_WORKDIR", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_COMMONDIR", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_INDEX", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_OBJECTS", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_REFS", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_PACKED_REFS", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_REMOTES", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_CONFIG", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_INFO", + "comments": "", + "value": 9 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_HOOKS", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_LOGS", + "comments": "", + "value": 11 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_MODULES", + "comments": "", + "value": 12 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_WORKTREES", + "comments": "", + "value": 13 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM_WORKTREE_CONFIG", + "comments": "", + "value": 14 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_ITEM__LAST", + "comments": "", + "value": 15 + } + ], + "used": { "returns": [], "needs": ["git_repository_item_path"] } + } + ], + [ + "git_repository_open_flag_t", + { + "decl": [ + "GIT_REPOSITORY_OPEN_NO_SEARCH", + "GIT_REPOSITORY_OPEN_CROSS_FS", + "GIT_REPOSITORY_OPEN_BARE", + "GIT_REPOSITORY_OPEN_NO_DOTGIT", + "GIT_REPOSITORY_OPEN_FROM_ENV" + ], + "type": "enum", + "file": "git2/repository.h", + "line": 110, + "lineto": 157, + "block": "GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE\nGIT_REPOSITORY_OPEN_NO_DOTGIT\nGIT_REPOSITORY_OPEN_FROM_ENV", + "tdef": "typedef", + "description": " Option flags for `git_repository_open_ext`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_NO_SEARCH", + "comments": "

Only open the repository if it can be immediately found in the\n start_path. Do not walk up from the start_path looking at parent\n directories.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_CROSS_FS", + "comments": "

Unless this flag is set, open will not continue searching across\n filesystem boundaries (i.e. when st_dev changes from the stat\n system call). For example, searching in a user's home directory at\n "/home/user/source/" will not return "/.git/" as the found repo if\n "/" is a different filesystem than "/home".

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_BARE", + "comments": "

Open repository as a bare repo regardless of core.bare config, and\n defer loading config file for faster setup.\n Unlike git_repository_open_bare, this can follow gitlinks.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_NO_DOTGIT", + "comments": "

Do not check for a repository by appending /.git to the start_path;\n only open the repository if start_path itself points to the git\n directory.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_FROM_ENV", + "comments": "

Find and open a git repository, respecting the environment variables\n used by the git command-line tools.\n If set, git_repository_open_ext will ignore the other flags and\n the ceiling_dirs argument, and will allow a NULL path to use\n GIT_DIR or search from the current directory.\n The search for a repository will respect $GIT_CEILING_DIRECTORIES and\n $GIT_DISCOVERY_ACROSS_FILESYSTEM. The opened repository will\n respect $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and\n $GIT_ALTERNATE_OBJECT_DIRECTORIES.\n In the future, this flag will also cause git_repository_open_ext\n to respect $GIT_WORK_TREE and $GIT_COMMON_DIR; currently,\n git_repository_open_ext with this flag will error out if either\n $GIT_WORK_TREE or $GIT_COMMON_DIR is set.

\n", + "value": 16 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_repository_state_t", + { + "decl": [ + "GIT_REPOSITORY_STATE_NONE", + "GIT_REPOSITORY_STATE_MERGE", + "GIT_REPOSITORY_STATE_REVERT", + "GIT_REPOSITORY_STATE_REVERT_SEQUENCE", + "GIT_REPOSITORY_STATE_CHERRYPICK", + "GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE", + "GIT_REPOSITORY_STATE_BISECT", + "GIT_REPOSITORY_STATE_REBASE", + "GIT_REPOSITORY_STATE_REBASE_INTERACTIVE", + "GIT_REPOSITORY_STATE_REBASE_MERGE", + "GIT_REPOSITORY_STATE_APPLY_MAILBOX", + "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE" + ], + "type": "enum", + "file": "git2/repository.h", + "line": 915, + "lineto": 928, + "block": "GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_REVERT_SEQUENCE\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", + "tdef": "typedef", + "description": " Repository state", + "comments": "

These values represent possible states for the repository to be in, based on the current operation which is ongoing.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_MERGE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REVERT", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REVERT_SEQUENCE", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_CHERRYPICK", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_BISECT", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REBASE", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REBASE_INTERACTIVE", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REBASE_MERGE", + "comments": "", + "value": 9 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", + "comments": "", + "value": 11 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_reset_t", + { + "decl": ["GIT_RESET_SOFT", "GIT_RESET_MIXED", "GIT_RESET_HARD"], + "type": "enum", + "file": "git2/reset.h", + "line": 26, + "lineto": 30, + "block": "GIT_RESET_SOFT\nGIT_RESET_MIXED\nGIT_RESET_HARD", + "tdef": "typedef", + "description": " Kinds of reset operation", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_RESET_SOFT", + "comments": "

Move the head to the given commit

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_RESET_MIXED", + "comments": "

SOFT plus reset index to the commit

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_RESET_HARD", + "comments": "

MIXED plus changes in working tree discarded

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": ["git_reset", "git_reset_from_annotated"] + } + } + ], + [ + "git_revert_options", + { + "decl": [ + "unsigned int version", + "unsigned int mainline", + "git_merge_options merge_opts", + "git_checkout_options checkout_opts" + ], + "type": "struct", + "value": "git_revert_options", + "file": "git2/revert.h", + "line": 26, + "lineto": 34, + "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", + "tdef": "typedef", + "description": " Options for revert", + "comments": "", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "unsigned int", + "name": "mainline", + "comments": " For merge commits, the \"mainline\" is treated as the parent. " + }, + { + "type": "git_merge_options", + "name": "merge_opts", + "comments": " Options for the merging " + }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " Options for the checkout " + } + ], + "used": { + "returns": [], + "needs": ["git_revert", "git_revert_options_init"] + } + } + ], + [ + "git_revspec", + { + "decl": ["git_object * from", "git_object * to", "unsigned int flags"], + "type": "struct", + "value": "git_revspec", + "file": "git2/revparse.h", + "line": 83, + "lineto": 90, + "block": "git_object * from\ngit_object * to\nunsigned int flags", + "tdef": "typedef", + "description": " Git Revision Spec: output of a `git_revparse` operation", + "comments": "", + "fields": [ + { + "type": "git_object *", + "name": "from", + "comments": " The left element of the revspec; must be freed by the user " + }, + { + "type": "git_object *", + "name": "to", + "comments": " The right element of the revspec; must be freed by the user " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " The intent of the revspec (i.e. `git_revspec_mode_t` flags) " + } + ], + "used": { "returns": [], "needs": ["git_revparse"] } + } + ], + [ + "git_revspec_t", + { + "decl": [ + "GIT_REVSPEC_SINGLE", + "GIT_REVSPEC_RANGE", + "GIT_REVSPEC_MERGE_BASE" + ], + "type": "enum", + "file": "git2/revparse.h", + "line": 71, + "lineto": 78, + "block": "GIT_REVSPEC_SINGLE\nGIT_REVSPEC_RANGE\nGIT_REVSPEC_MERGE_BASE", + "tdef": "typedef", + "description": " Revparse flags. These indicate the intended behavior of the spec passed to\n git_revparse.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REVSPEC_SINGLE", + "comments": "

The spec targeted a single object.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REVSPEC_RANGE", + "comments": "

The spec targeted a range of commits.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REVSPEC_MERGE_BASE", + "comments": "

The spec used the '...' operator, which invokes special semantics.

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_revwalk", + { + "decl": "git_revwalk", + "type": "struct", + "value": "git_revwalk", + "file": "git2/types.h", + "line": 132, + "lineto": 132, + "tdef": "typedef", + "description": " Representation of an in-progress walk through the commits in a repo ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_packbuilder_insert_walk", + "git_revwalk_add_hide_cb", + "git_revwalk_free", + "git_revwalk_hide", + "git_revwalk_hide_glob", + "git_revwalk_hide_head", + "git_revwalk_hide_ref", + "git_revwalk_new", + "git_revwalk_next", + "git_revwalk_push", + "git_revwalk_push_glob", + "git_revwalk_push_head", + "git_revwalk_push_range", + "git_revwalk_push_ref", + "git_revwalk_repository", + "git_revwalk_reset", + "git_revwalk_simplify_first_parent", + "git_revwalk_sorting" + ] + } + } + ], + [ + "git_signature", + { + "decl": ["char * name", "char * email", "git_time when"], + "type": "struct", + "value": "git_signature", + "file": "git2/types.h", + "line": 187, + "lineto": 191, + "block": "char * name\nchar * email\ngit_time when", + "tdef": "typedef", + "description": " An action signature (e.g. for committers, taggers, etc) ", + "comments": "", + "fields": [ + { + "type": "char *", + "name": "name", + "comments": " full name of the author " + }, + { + "type": "char *", + "name": "email", + "comments": " email of the author " + }, + { + "type": "git_time", + "name": "when", + "comments": " time when the action happened " + } + ], + "used": { + "returns": [ + "git_commit_author", + "git_commit_committer", + "git_reflog_entry_committer", + "git_tag_tagger" + ], + "needs": [ + "git_commit_amend", + "git_commit_author_with_mailmap", + "git_commit_committer_with_mailmap", + "git_commit_create", + "git_commit_create_buffer", + "git_commit_create_cb", + "git_commit_create_v", + "git_mailmap_resolve_signature", + "git_rebase_commit", + "git_rebase_finish", + "git_reflog_append", + "git_signature_default", + "git_signature_default_from_env", + "git_signature_dup", + "git_signature_free", + "git_signature_from_buffer", + "git_signature_new", + "git_signature_now", + "git_stash_save", + "git_tag_annotation_create", + "git_tag_create", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" + ] + } + } + ], + [ + "git_smart_service_t", + { + "decl": [ + "GIT_SERVICE_UPLOADPACK_LS", + "GIT_SERVICE_UPLOADPACK", + "GIT_SERVICE_RECEIVEPACK_LS", + "GIT_SERVICE_RECEIVEPACK" + ], + "type": "enum", + "file": "git2/sys/transport.h", + "line": 323, + "lineto": 328, + "block": "GIT_SERVICE_UPLOADPACK_LS\nGIT_SERVICE_UPLOADPACK\nGIT_SERVICE_RECEIVEPACK_LS\nGIT_SERVICE_RECEIVEPACK", + "tdef": "typedef", + "description": " Actions that the smart transport can ask a subtransport to perform ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_SERVICE_UPLOADPACK_LS", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SERVICE_UPLOADPACK", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SERVICE_RECEIVEPACK_LS", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_SERVICE_RECEIVEPACK", + "comments": "", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_sort_t", + { + "decl": [ + "GIT_SORT_NONE", + "GIT_SORT_TOPOLOGICAL", + "GIT_SORT_TIME", + "GIT_SORT_REVERSE" + ], + "type": "enum", + "file": "git2/revwalk.h", + "line": 26, + "lineto": 53, + "block": "GIT_SORT_NONE\nGIT_SORT_TOPOLOGICAL\nGIT_SORT_TIME\nGIT_SORT_REVERSE", + "tdef": "typedef", + "description": " Flags to specify the sorting which a revwalk should perform.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_SORT_NONE", + "comments": "

Sort the output with the same default method from git: reverse\n chronological order. This is the default sorting for new walkers.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_SORT_TOPOLOGICAL", + "comments": "

Sort the repository contents in topological order (no parents before\n all of its children are shown); this sorting mode can be combined\n with time sorting to produce git's --date-order`.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SORT_TIME", + "comments": "

Sort the repository contents by commit time;\n this sorting mode can be combined with\n topological sorting.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SORT_REVERSE", + "comments": "

Iterate through the repository contents in reverse\n order; this sorting mode can be combined with\n any of the above.

\n", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_stash_apply_flags", + { + "decl": ["GIT_STASH_APPLY_DEFAULT", "GIT_STASH_APPLY_REINSTATE_INDEX"], + "type": "enum", + "file": "git2/stash.h", + "line": 137, + "lineto": 144, + "block": "GIT_STASH_APPLY_DEFAULT\nGIT_STASH_APPLY_REINSTATE_INDEX", + "tdef": "typedef", + "description": " Stash application flags. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_APPLY_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_REINSTATE_INDEX", + "comments": "", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_stash_apply_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_checkout_options checkout_options", + "git_stash_apply_progress_cb progress_cb", + "void * progress_payload" + ], + "type": "struct", + "value": "git_stash_apply_options", + "file": "git2/stash.h", + "line": 192, + "lineto": 204, + "block": "unsigned int version\nuint32_t flags\ngit_checkout_options checkout_options\ngit_stash_apply_progress_cb progress_cb\nvoid * progress_payload", + "tdef": "typedef", + "description": " Stash application options structure", + "comments": "

Initialize with GIT_STASH_APPLY_OPTIONS_INIT. Alternatively, you can use git_stash_apply_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " See `git_stash_apply_flags`, above. " + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options to use when writing files to the working directory. " + }, + { + "type": "git_stash_apply_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of application progress. " + }, + { "type": "void *", "name": "progress_payload", "comments": "" } + ], + "used": { + "returns": [], + "needs": [ + "git_stash_apply", + "git_stash_apply_options_init", + "git_stash_pop" + ] + } + } + ], + [ + "git_stash_apply_progress_t", + { + "decl": [ + "GIT_STASH_APPLY_PROGRESS_NONE", + "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "GIT_STASH_APPLY_PROGRESS_DONE" + ], + "type": "enum", + "file": "git2/stash.h", + "line": 147, + "lineto": 170, + "block": "GIT_STASH_APPLY_PROGRESS_NONE\nGIT_STASH_APPLY_PROGRESS_LOADING_STASH\nGIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX\nGIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED\nGIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED\nGIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED\nGIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED\nGIT_STASH_APPLY_PROGRESS_DONE", + "tdef": "typedef", + "description": " Stash apply progression states ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", + "comments": "

Loading the stashed data from the object database.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", + "comments": "

The stored index is being analyzed.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "comments": "

The modified files are being analyzed.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", + "comments": "

The untracked and ignored files are being analyzed.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "comments": "

The untracked files are being written to disk.

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "comments": "

The modified files are being written to disk.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_DONE", + "comments": "

The stash was applied successfully.

\n", + "value": 7 + } + ], + "used": { "returns": [], "needs": ["git_stash_apply_progress_cb"] } + } + ], + [ + "git_stash_flags", + { + "decl": [ + "GIT_STASH_DEFAULT", + "GIT_STASH_KEEP_INDEX", + "GIT_STASH_INCLUDE_UNTRACKED", + "GIT_STASH_INCLUDE_IGNORED", + "GIT_STASH_KEEP_ALL" + ], + "type": "enum", + "file": "git2/stash.h", + "line": 30, + "lineto": 58, + "block": "GIT_STASH_DEFAULT\nGIT_STASH_KEEP_INDEX\nGIT_STASH_INCLUDE_UNTRACKED\nGIT_STASH_INCLUDE_IGNORED\nGIT_STASH_KEEP_ALL", + "tdef": "typedef", + "description": " Stash flags", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_DEFAULT", + "comments": "

No option, default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_KEEP_INDEX", + "comments": "

All changes already added to the index are left intact in\n the working directory

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STASH_INCLUDE_UNTRACKED", + "comments": "

All untracked files are also stashed and then cleaned up\n from the working directory

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STASH_INCLUDE_IGNORED", + "comments": "

All ignored files are also stashed and then cleaned up from\n the working directory

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_KEEP_ALL", + "comments": "

All changes in the index and working directory are left intact

\n", + "value": 8 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_stash_save_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "const git_signature * stasher", + "const char * message", + "git_strarray paths" + ], + "type": "struct", + "value": "git_stash_save_options", + "file": "git2/stash.h", + "line": 86, + "lineto": 100, + "block": "unsigned int version\nuint32_t flags\nconst git_signature * stasher\nconst char * message\ngit_strarray paths", + "tdef": "typedef", + "description": " Stash save options structure", + "comments": "

Initialize with GIT_STASH_SAVE_OPTIONS_INIT. Alternatively, you can use git_stash_save_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Flags to control the stashing process. (see GIT_STASH_* above) " + }, + { + "type": "const git_signature *", + "name": "stasher", + "comments": " The identity of the person performing the stashing. " + }, + { + "type": "const char *", + "name": "message", + "comments": " Optional description along with the stashed state. " + }, + { + "type": "git_strarray", + "name": "paths", + "comments": " Optional paths that control which files are stashed. " + } + ], + "used": { + "returns": [], + "needs": ["git_stash_save_options_init", "git_stash_save_with_opts"] + } + } + ], + [ + "git_status_entry", + { + "decl": [ + "git_status_t status", + "git_diff_delta * head_to_index", + "git_diff_delta * index_to_workdir" + ], + "type": "struct", + "value": "git_status_entry", + "file": "git2/status.h", + "line": 298, + "lineto": 302, + "block": "git_status_t status\ngit_diff_delta * head_to_index\ngit_diff_delta * index_to_workdir", + "tdef": "typedef", + "description": " A status entry, providing the differences between the file as it exists\n in HEAD and the index, and providing the differences between the index\n and the working directory.", + "comments": "

The status value provides the status flags for this file.

\n\n

The head_to_index value provides detailed information about the differences between the file in HEAD and the file in the index.

\n\n

The index_to_workdir value provides detailed information about the differences between the file in the index and the file in the working directory.

\n", + "fields": [ + { "type": "git_status_t", "name": "status", "comments": "" }, + { + "type": "git_diff_delta *", + "name": "head_to_index", + "comments": "" + }, + { + "type": "git_diff_delta *", + "name": "index_to_workdir", + "comments": "" + } + ], + "used": { "returns": ["git_status_byindex"], "needs": [] } + } + ], + [ + "git_status_list", + { + "decl": "git_status_list", + "type": "struct", + "value": "git_status_list", + "file": "git2/types.h", + "line": 217, + "lineto": 217, + "tdef": "typedef", + "description": " Representation of a status collection ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_status_byindex", + "git_status_list_entrycount", + "git_status_list_free", + "git_status_list_new" + ] + } + } + ], + [ + "git_status_opt_t", + { + "decl": [ + "GIT_STATUS_OPT_INCLUDE_UNTRACKED", + "GIT_STATUS_OPT_INCLUDE_IGNORED", + "GIT_STATUS_OPT_INCLUDE_UNMODIFIED", + "GIT_STATUS_OPT_EXCLUDE_SUBMODULES", + "GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS", + "GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH", + "GIT_STATUS_OPT_RECURSE_IGNORED_DIRS", + "GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX", + "GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR", + "GIT_STATUS_OPT_SORT_CASE_SENSITIVELY", + "GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY", + "GIT_STATUS_OPT_RENAMES_FROM_REWRITES", + "GIT_STATUS_OPT_NO_REFRESH", + "GIT_STATUS_OPT_UPDATE_INDEX", + "GIT_STATUS_OPT_INCLUDE_UNREADABLE", + "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED" + ], + "type": "enum", + "file": "git2/status.h", + "line": 100, + "lineto": 207, + "block": "GIT_STATUS_OPT_INCLUDE_UNTRACKED\nGIT_STATUS_OPT_INCLUDE_IGNORED\nGIT_STATUS_OPT_INCLUDE_UNMODIFIED\nGIT_STATUS_OPT_EXCLUDE_SUBMODULES\nGIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS\nGIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH\nGIT_STATUS_OPT_RECURSE_IGNORED_DIRS\nGIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\nGIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\nGIT_STATUS_OPT_SORT_CASE_SENSITIVELY\nGIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\nGIT_STATUS_OPT_RENAMES_FROM_REWRITES\nGIT_STATUS_OPT_NO_REFRESH\nGIT_STATUS_OPT_UPDATE_INDEX\nGIT_STATUS_OPT_INCLUDE_UNREADABLE\nGIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", + "tdef": "typedef", + "description": " Flags to control status callbacks", + "comments": "

Calling git_status_foreach() is like calling the extended version with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED, and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNTRACKED", + "comments": "

Says that callbacks should be made on untracked files.\n These will only be made if the workdir files are included in the status\n "show" option.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_IGNORED", + "comments": "

Says that ignored files get callbacks.\n Again, these callbacks will only be made if the workdir files are\n included in the status "show" option.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNMODIFIED", + "comments": "

Indicates that callback should be made even on unmodified files.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_EXCLUDE_SUBMODULES", + "comments": "

Indicates that submodules should be skipped.\n This only applies if there are no pending typechanges to the submodule\n (either from or to another type).

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS", + "comments": "

Indicates that all files in untracked directories should be included.\n Normally if an entire directory is new, then just the top-level\n directory is included (with a trailing slash on the entry name).\n This flag says to include all of the individual files in the directory\n instead.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH", + "comments": "

Indicates that the given path should be treated as a literal path,\n and not as a pathspec pattern.

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RECURSE_IGNORED_DIRS", + "comments": "

Indicates that the contents of ignored directories should be included\n in the status. This is like doing git ls-files -o -i --exclude-standard\n with core git.

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX", + "comments": "

Indicates that rename detection should be processed between the head and\n the index and enables the GIT_STATUS_INDEX_RENAMED as a possible status\n flag.

\n", + "value": 128 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR", + "comments": "

Indicates that rename detection should be run between the index and the\n working directory and enabled GIT_STATUS_WT_RENAMED as a possible status\n flag.

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_SORT_CASE_SENSITIVELY", + "comments": "

Overrides the native case sensitivity for the file system and forces\n the output to be in case-sensitive order.

\n", + "value": 512 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY", + "comments": "

Overrides the native case sensitivity for the file system and forces\n the output to be in case-insensitive order.

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RENAMES_FROM_REWRITES", + "comments": "

Iindicates that rename detection should include rewritten files.

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_NO_REFRESH", + "comments": "

Bypasses the default status behavior of doing a "soft" index reload\n (i.e. reloading the index data if the file on disk has been modified\n outside libgit2).

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_UPDATE_INDEX", + "comments": "

Tells libgit2 to refresh the stat cache in the index for files that are\n unchanged but have out of date stat einformation in the index.\n It will result in less work being done on subsequent calls to get status.\n This is mutually exclusive with the NO_REFRESH option.

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE", + "comments": "

Normally files that cannot be opened or read are ignored as\n these are often transient files; this option will return\n unreadable files as GIT_STATUS_WT_UNREADABLE.

\n", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", + "comments": "

Unreadable files will be detected and given the status\n untracked instead of unreadable.

\n", + "value": 32768 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_status_options", + { + "decl": [ + "unsigned int version", + "git_status_show_t show", + "unsigned int flags", + "git_strarray pathspec", + "git_tree * baseline", + "uint16_t rename_threshold" + ], + "type": "struct", + "value": "git_status_options", + "file": "git2/status.h", + "line": 222, + "lineto": 262, + "block": "unsigned int version\ngit_status_show_t show\nunsigned int flags\ngit_strarray pathspec\ngit_tree * baseline\nuint16_t rename_threshold", + "tdef": "typedef", + "description": " Options to control how `git_status_foreach_ext()` will issue callbacks.", + "comments": "

Initialize with GIT_STATUS_OPTIONS_INIT. Alternatively, you can use git_status_options_init.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " The struct version; pass `GIT_STATUS_OPTIONS_VERSION`." + }, + { + "type": "git_status_show_t", + "name": "show", + "comments": " The `show` value is one of the `git_status_show_t` constants that\n control which files to scan and in what order. The default is\n `GIT_STATUS_SHOW_INDEX_AND_WORKDIR`." + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " The `flags` value is an OR'ed combination of the\n `git_status_opt_t` values above. The default is\n `GIT_STATUS_OPT_DEFAULTS`, which matches git's default\n behavior." + }, + { + "type": "git_strarray", + "name": "pathspec", + "comments": " The `pathspec` is an array of path patterns to match (using\n fnmatch-style matching), or just an array of paths to match\n exactly if `GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified\n in the flags." + }, + { + "type": "git_tree *", + "name": "baseline", + "comments": " The `baseline` is the tree to be used for comparison to the\n working directory and index; defaults to HEAD." + }, + { + "type": "uint16_t", + "name": "rename_threshold", + "comments": " Threshold above which similar files will be considered renames.\n This is equivalent to the -M option. Defaults to 50." + } + ], + "used": { + "returns": [], + "needs": [ + "git_status_foreach_ext", + "git_status_list_new", + "git_status_options_init" + ] + } + } + ], + [ + "git_status_show_t", + { + "decl": [ + "GIT_STATUS_SHOW_INDEX_AND_WORKDIR", + "GIT_STATUS_SHOW_INDEX_ONLY", + "GIT_STATUS_SHOW_WORKDIR_ONLY" + ], + "type": "enum", + "file": "git2/status.h", + "line": 72, + "lineto": 90, + "block": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY", + "tdef": "typedef", + "description": " Select the files on which to report status.", + "comments": "

With git_status_foreach_ext, this will control which changes get callbacks. With git_status_list_new, these will control which changes are included in the list.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR", + "comments": "

The default. This roughly matches git status --porcelain regarding\n which files are included and in what order.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STATUS_SHOW_INDEX_ONLY", + "comments": "

Only gives status based on HEAD to index comparison, not looking at\n working directory changes.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STATUS_SHOW_WORKDIR_ONLY", + "comments": "

Only gives status based on index to working directory comparison,\n not comparing the index to the HEAD.

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_status_t", + { + "decl": [ + "GIT_STATUS_CURRENT", + "GIT_STATUS_INDEX_NEW", + "GIT_STATUS_INDEX_MODIFIED", + "GIT_STATUS_INDEX_DELETED", + "GIT_STATUS_INDEX_RENAMED", + "GIT_STATUS_INDEX_TYPECHANGE", + "GIT_STATUS_WT_NEW", + "GIT_STATUS_WT_MODIFIED", + "GIT_STATUS_WT_DELETED", + "GIT_STATUS_WT_TYPECHANGE", + "GIT_STATUS_WT_RENAMED", + "GIT_STATUS_WT_UNREADABLE", + "GIT_STATUS_IGNORED", + "GIT_STATUS_CONFLICTED" + ], + "type": "enum", + "file": "git2/status.h", + "line": 34, + "lineto": 52, + "block": "GIT_STATUS_CURRENT\nGIT_STATUS_INDEX_NEW\nGIT_STATUS_INDEX_MODIFIED\nGIT_STATUS_INDEX_DELETED\nGIT_STATUS_INDEX_RENAMED\nGIT_STATUS_INDEX_TYPECHANGE\nGIT_STATUS_WT_NEW\nGIT_STATUS_WT_MODIFIED\nGIT_STATUS_WT_DELETED\nGIT_STATUS_WT_TYPECHANGE\nGIT_STATUS_WT_RENAMED\nGIT_STATUS_WT_UNREADABLE\nGIT_STATUS_IGNORED\nGIT_STATUS_CONFLICTED", + "tdef": "typedef", + "description": " Status flags for a single file.", + "comments": "

A combination of these values will be returned to indicate the status of a file. Status compares the working directory, the index, and the current HEAD of the repository. The GIT_STATUS_INDEX set of flags represents the status of file in the index relative to the HEAD, and the GIT_STATUS_WT set of flags represent the status of the file in the working directory relative to the index.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_STATUS_CURRENT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_NEW", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_MODIFIED", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_DELETED", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_RENAMED", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_TYPECHANGE", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_NEW", + "comments": "", + "value": 128 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_MODIFIED", + "comments": "", + "value": 256 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_DELETED", + "comments": "", + "value": 512 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_TYPECHANGE", + "comments": "", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_RENAMED", + "comments": "", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_UNREADABLE", + "comments": "", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_STATUS_IGNORED", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_STATUS_CONFLICTED", + "comments": "", + "value": 32768 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_strarray", + { + "decl": ["char ** strings", "size_t count"], + "type": "struct", + "value": "git_strarray", + "file": "git2/strarray.h", + "line": 22, + "lineto": 25, + "block": "char ** strings\nsize_t count", + "tdef": "typedef", + "description": " Array of strings ", + "comments": "", + "fields": [ + { "type": "char **", "name": "strings", "comments": "" }, + { "type": "size_t", "name": "count", "comments": "" } + ], + "used": { + "returns": [], + "needs": [ + "git_index_add_all", + "git_index_remove_all", + "git_index_update_all", + "git_pathspec_new", + "git_reference_list", + "git_remote_connect", + "git_remote_download", + "git_remote_fetch", + "git_remote_get_fetch_refspecs", + "git_remote_get_push_refspecs", + "git_remote_list", + "git_remote_push", + "git_remote_rename", + "git_remote_upload", + "git_reset_default", + "git_strarray_copy", + "git_strarray_dispose", + "git_strarray_free", + "git_tag_list", + "git_tag_list_match", + "git_worktree_list" + ] + } + } + ], + [ + "git_stream_t", + { + "decl": ["GIT_STREAM_STANDARD", "GIT_STREAM_TLS"], + "type": "enum", + "file": "git2/sys/stream.h", + "line": 99, + "lineto": 105, + "block": "GIT_STREAM_STANDARD\nGIT_STREAM_TLS", + "tdef": "typedef", + "description": " The type of stream to register.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STREAM_STANDARD", + "comments": "

A standard (non-TLS) socket.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STREAM_TLS", + "comments": "

A TLS-encrypted socket.

\n", + "value": 2 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_submodule", + { + "decl": "git_submodule", + "type": "struct", + "value": "git_submodule", + "file": "git2/types.h", + "line": 283, + "lineto": 283, + "tdef": "typedef", + "description": " Opaque structure representing a submodule.", + "comments": "", + "used": { + "returns": [ + "git_submodule_fetch_recurse_submodules", + "git_submodule_ignore", + "git_submodule_update_strategy" + ], + "needs": [ + "git_submodule_add_finalize", + "git_submodule_add_setup", + "git_submodule_add_to_index", + "git_submodule_branch", + "git_submodule_cb", + "git_submodule_clone", + "git_submodule_dup", + "git_submodule_fetch_recurse_submodules", + "git_submodule_foreach", + "git_submodule_free", + "git_submodule_head_id", + "git_submodule_ignore", + "git_submodule_index_id", + "git_submodule_init", + "git_submodule_location", + "git_submodule_lookup", + "git_submodule_name", + "git_submodule_open", + "git_submodule_owner", + "git_submodule_path", + "git_submodule_reload", + "git_submodule_repo_init", + "git_submodule_set_fetch_recurse_submodules", + "git_submodule_set_ignore", + "git_submodule_set_update", + "git_submodule_status", + "git_submodule_sync", + "git_submodule_update", + "git_submodule_update_options_init", + "git_submodule_update_strategy", + "git_submodule_url", + "git_submodule_wd_id" + ] + } + } + ], + [ + "git_submodule_ignore_t", + { + "decl": [ + "GIT_SUBMODULE_IGNORE_UNSPECIFIED", + "GIT_SUBMODULE_IGNORE_NONE", + "GIT_SUBMODULE_IGNORE_UNTRACKED", + "GIT_SUBMODULE_IGNORE_DIRTY", + "GIT_SUBMODULE_IGNORE_ALL" + ], + "type": "enum", + "file": "git2/types.h", + "line": 347, + "lineto": 354, + "block": "GIT_SUBMODULE_IGNORE_UNSPECIFIED\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL", + "tdef": "typedef", + "description": " Submodule ignore values", + "comments": "

These values represent settings for the submodule.$name.ignore configuration value which says how deeply to look at the working directory when getting submodule status.

\n\n

You can override this value in memory on a per-submodule basis with git_submodule_set_ignore() and can write the changed value to disk with git_submodule_save(). If you have overwritten the value, you can revert to the on disk value by using GIT_SUBMODULE_IGNORE_RESET.

\n\n

The values are:

\n\n\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_UNSPECIFIED", + "comments": "

use the submodule's configuration

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_NONE", + "comments": "

any change or untracked == dirty

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_UNTRACKED", + "comments": "

dirty if tracked files change

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_DIRTY", + "comments": "

only dirty if HEAD moved

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_ALL", + "comments": "

never dirty

\n", + "value": 4 + } + ], + "used": { + "returns": ["git_submodule_ignore"], + "needs": ["git_submodule_set_ignore", "git_submodule_status"] + } + } + ], + [ + "git_submodule_recurse_t", + { + "decl": [ + "GIT_SUBMODULE_RECURSE_NO", + "GIT_SUBMODULE_RECURSE_YES", + "GIT_SUBMODULE_RECURSE_ONDEMAND" + ], + "type": "enum", + "file": "git2/types.h", + "line": 366, + "lineto": 370, + "block": "GIT_SUBMODULE_RECURSE_NO\nGIT_SUBMODULE_RECURSE_YES\nGIT_SUBMODULE_RECURSE_ONDEMAND", + "tdef": "typedef", + "description": " Options for submodule recurse.", + "comments": "

Represent the value of submodule.$name.fetchRecurseSubmodules

\n\n\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_RECURSE_NO", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_RECURSE_YES", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_RECURSE_ONDEMAND", + "comments": "", + "value": 2 + } + ], + "used": { + "returns": ["git_submodule_fetch_recurse_submodules"], + "needs": ["git_submodule_set_fetch_recurse_submodules"] + } + } + ], + [ + "git_submodule_status_t", + { + "decl": [ + "GIT_SUBMODULE_STATUS_IN_HEAD", + "GIT_SUBMODULE_STATUS_IN_INDEX", + "GIT_SUBMODULE_STATUS_IN_CONFIG", + "GIT_SUBMODULE_STATUS_IN_WD", + "GIT_SUBMODULE_STATUS_INDEX_ADDED", + "GIT_SUBMODULE_STATUS_INDEX_DELETED", + "GIT_SUBMODULE_STATUS_INDEX_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_UNINITIALIZED", + "GIT_SUBMODULE_STATUS_WD_ADDED", + "GIT_SUBMODULE_STATUS_WD_DELETED", + "GIT_SUBMODULE_STATUS_WD_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_WD_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_UNTRACKED" + ], + "type": "enum", + "file": "git2/submodule.h", + "line": 74, + "lineto": 89, + "block": "GIT_SUBMODULE_STATUS_IN_HEAD\nGIT_SUBMODULE_STATUS_IN_INDEX\nGIT_SUBMODULE_STATUS_IN_CONFIG\nGIT_SUBMODULE_STATUS_IN_WD\nGIT_SUBMODULE_STATUS_INDEX_ADDED\nGIT_SUBMODULE_STATUS_INDEX_DELETED\nGIT_SUBMODULE_STATUS_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNINITIALIZED\nGIT_SUBMODULE_STATUS_WD_ADDED\nGIT_SUBMODULE_STATUS_WD_DELETED\nGIT_SUBMODULE_STATUS_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNTRACKED", + "tdef": "typedef", + "description": " Return codes for submodule status.", + "comments": "

A combination of these flags will be returned to describe the status of a submodule. Depending on the "ignore" property of the submodule, some of the flags may never be returned because they indicate changes that are supposed to be ignored.

\n\n

Submodule info is contained in 4 places: the HEAD tree, the index, config files (both .git/config and .gitmodules), and the working directory. Any or all of those places might be missing information about the submodule depending on what state the repo is in. We consider all four places to build the combination of status flags.

\n\n

There are four values that are not really status, but give basic info about what sources of submodule data are available. These will be returned even if ignore is set to "ALL".

\n\n\n\n

The following values will be returned so long as ignore is not "ALL".

\n\n\n\n

The following can only be returned if ignore is "NONE" or "UNTRACKED".

\n\n\n\n

Lastly, the following will only be returned for ignore "NONE".

\n\n\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_HEAD", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_INDEX", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_CONFIG", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_WD", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_INDEX_ADDED", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_INDEX_DELETED", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_INDEX_MODIFIED", + "comments": "", + "value": 64 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_UNINITIALIZED", + "comments": "", + "value": 128 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_ADDED", + "comments": "", + "value": 256 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_DELETED", + "comments": "", + "value": 512 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_MODIFIED", + "comments": "", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED", + "comments": "", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_WD_MODIFIED", + "comments": "", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_UNTRACKED", + "comments": "", + "value": 8192 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_submodule_update_options", + { + "decl": [ + "unsigned int version", + "git_checkout_options checkout_opts", + "git_fetch_options fetch_opts", + "int allow_fetch" + ], + "type": "struct", + "value": "git_submodule_update_options", + "file": "git2/submodule.h", + "line": 135, + "lineto": 158, + "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint allow_fetch", + "tdef": "typedef", + "description": " Submodule update options structure", + "comments": "

Initialize with GIT_SUBMODULE_UPDATE_OPTIONS_INIT. Alternatively, you can use git_submodule_update_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to `GIT_CHECKOUT_NONE`\n or `GIT_CHECKOUT_DRY_RUN`." + }, + { + "type": "git_fetch_options", + "name": "fetch_opts", + "comments": " Options which control the fetch, including callbacks.\n\n The callbacks to use for reporting fetch progress, and for acquiring\n credentials in the event they are needed." + }, + { + "type": "int", + "name": "allow_fetch", + "comments": " Allow fetching from the submodule's default remote if the target\n commit isn't found. Enabled by default." + } + ], + "used": { + "returns": [], + "needs": [ + "git_submodule_clone", + "git_submodule_update", + "git_submodule_update_options_init" + ] + } + } + ], + [ + "git_submodule_update_t", + { + "decl": [ + "GIT_SUBMODULE_UPDATE_CHECKOUT", + "GIT_SUBMODULE_UPDATE_REBASE", + "GIT_SUBMODULE_UPDATE_MERGE", + "GIT_SUBMODULE_UPDATE_NONE", + "GIT_SUBMODULE_UPDATE_DEFAULT" + ], + "type": "enum", + "file": "git2/types.h", + "line": 311, + "lineto": 318, + "block": "GIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE\nGIT_SUBMODULE_UPDATE_DEFAULT", + "tdef": "typedef", + "description": " Submodule update values", + "comments": "

These values represent settings for the submodule.$name.update configuration value which says how to handle git submodule update for this submodule. The value is usually set in the ".gitmodules" file and copied to ".git/config" when the submodule is initialized.

\n\n

You can override this setting on a per-submodule basis with git_submodule_set_update() and write the changed value to disk using git_submodule_save(). If you have overwritten the value, you can revert it by passing GIT_SUBMODULE_UPDATE_RESET to the set function.

\n\n

The values are:

\n\n\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_CHECKOUT", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_REBASE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_MERGE", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_NONE", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_DEFAULT", + "comments": "", + "value": 0 + } + ], + "used": { + "returns": ["git_submodule_update_strategy"], + "needs": ["git_submodule_set_update"] + } + } + ], + [ + "git_tag", + { + "decl": "git_tag", + "type": "struct", + "value": "git_tag", + "file": "git2/types.h", + "line": 135, + "lineto": 135, + "tdef": "typedef", + "description": " Parsed representation of a tag object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_tag_dup", + "git_tag_foreach", + "git_tag_free", + "git_tag_id", + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_tag_message", + "git_tag_name", + "git_tag_owner", + "git_tag_peel", + "git_tag_tagger", + "git_tag_target", + "git_tag_target_id", + "git_tag_target_type" + ] + } + } + ], + [ + "git_time", + { + "decl": ["git_time_t time", "int offset", "char sign"], + "type": "struct", + "value": "git_time", + "file": "git2/types.h", + "line": 180, + "lineto": 184, + "block": "git_time_t time\nint offset\nchar sign", + "tdef": "typedef", + "description": " Time in a signature ", + "comments": "", + "fields": [ + { + "type": "git_time_t", + "name": "time", + "comments": " time in seconds from epoch " + }, + { + "type": "int", + "name": "offset", + "comments": " timezone offset, in minutes " + }, + { + "type": "char", + "name": "sign", + "comments": " indicator for questionable '-0000' offsets in signature " + } + ], + "used": { + "returns": ["git_commit_time"], + "needs": ["git_signature_new"] + } + } + ], + [ + "git_trace_level_t", + { + "decl": [ + "GIT_TRACE_NONE", + "GIT_TRACE_FATAL", + "GIT_TRACE_ERROR", + "GIT_TRACE_WARN", + "GIT_TRACE_INFO", + "GIT_TRACE_DEBUG", + "GIT_TRACE_TRACE" + ], + "type": "enum", + "file": "git2/trace.h", + "line": 26, + "lineto": 47, + "block": "GIT_TRACE_NONE\nGIT_TRACE_FATAL\nGIT_TRACE_ERROR\nGIT_TRACE_WARN\nGIT_TRACE_INFO\nGIT_TRACE_DEBUG\nGIT_TRACE_TRACE", + "tdef": "typedef", + "description": " Available tracing levels. When tracing is set to a particular level,\n callers will be provided tracing at the given level and all lower levels.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_TRACE_NONE", + "comments": "

No tracing will be performed.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_TRACE_FATAL", + "comments": "

Severe errors that may impact the program's execution

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_TRACE_ERROR", + "comments": "

Errors that do not impact the program's execution

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_TRACE_WARN", + "comments": "

Warnings that suggest abnormal data

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_TRACE_INFO", + "comments": "

Informational messages about program execution

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_TRACE_DEBUG", + "comments": "

Detailed data that allows for debugging

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_TRACE_TRACE", + "comments": "

Exceptionally detailed debugging data

\n", + "value": 6 + } + ], + "used": { "returns": [], "needs": ["git_trace_cb", "git_trace_set"] } + } + ], + [ + "git_transaction", + { + "decl": "git_transaction", + "type": "struct", + "value": "git_transaction", + "file": "git2/types.h", + "line": 200, + "lineto": 200, + "tdef": "typedef", + "description": " Transactional interface to references ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_config_lock", + "git_transaction_commit", + "git_transaction_free", + "git_transaction_lock_ref", + "git_transaction_new", + "git_transaction_remove", + "git_transaction_set_reflog", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" + ] + } + } + ], + [ + "git_transport", + { + "decl": "git_transport", + "type": "struct", + "value": "git_transport", + "file": "git2/types.h", + "line": 263, + "lineto": 263, + "tdef": "typedef", + "description": " Interface which represents a transport to communicate with a\n remote.", + "comments": "", + "used": { "returns": [], "needs": ["git_transport_cb"] } + } + ], + [ + "git_tree", + { + "decl": "git_tree", + "type": "struct", + "value": "git_tree", + "file": "git2/types.h", + "line": 147, + "lineto": 147, + "tdef": "typedef", + "description": " Representation of a tree object. ", + "comments": "", + "used": { + "returns": [ + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_treebuilder_get" + ], + "needs": [ + "git_apply_to_tree", + "git_commit_amend", + "git_commit_create", + "git_commit_create_buffer", + "git_commit_create_cb", + "git_commit_create_v", + "git_commit_tree", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_index_read_tree", + "git_merge_trees", + "git_pathspec_match_tree", + "git_tree_create_updated", + "git_tree_dup", + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_tree_entry_bypath", + "git_tree_entry_cmp", + "git_tree_entry_dup", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type", + "git_tree_entrycount", + "git_tree_free", + "git_tree_id", + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_tree_owner", + "git_tree_walk", + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_filter", + "git_treebuilder_filter_cb", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_new", + "git_treebuilder_remove", + "git_treebuilder_write", + "git_treebuilder_write_with_buffer", + "git_treewalk_cb" + ] + } + } + ], + [ + "git_tree_entry", + { + "decl": "git_tree_entry", + "type": "struct", + "value": "git_tree_entry", + "file": "git2/types.h", + "line": 144, + "lineto": 144, + "tdef": "typedef", + "description": " Representation of each one of the entries in a tree object. ", + "comments": "", + "used": { + "returns": [ + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_treebuilder_get" + ], + "needs": [ + "git_tree_entry_bypath", + "git_tree_entry_cmp", + "git_tree_entry_dup", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type", + "git_treebuilder_filter_cb", + "git_treebuilder_insert", + "git_treewalk_cb" + ] + } + } + ], + [ + "git_tree_update", + { + "decl": [ + "git_tree_update_t action", + "git_oid id", + "git_filemode_t filemode", + "const char * path" + ], + "type": "struct", + "value": "git_tree_update", + "file": "git2/tree.h", + "line": 449, + "lineto": 458, + "block": "git_tree_update_t action\ngit_oid id\ngit_filemode_t filemode\nconst char * path", + "tdef": "typedef", + "description": " An action to perform during the update of a tree", + "comments": "", + "fields": [ + { + "type": "git_tree_update_t", + "name": "action", + "comments": " Update action. If it's an removal, only the path is looked at " + }, + { "type": "git_oid", "name": "id", "comments": " The entry's id " }, + { + "type": "git_filemode_t", + "name": "filemode", + "comments": " The filemode/kind of object " + }, + { + "type": "const char *", + "name": "path", + "comments": " The full path from the root tree " + } + ], + "used": { "returns": [], "needs": ["git_tree_create_updated"] } + } + ], + [ + "git_tree_update_t", + { + "decl": ["GIT_TREE_UPDATE_UPSERT", "GIT_TREE_UPDATE_REMOVE"], + "type": "enum", + "file": "git2/tree.h", + "line": 439, + "lineto": 444, + "block": "GIT_TREE_UPDATE_UPSERT\nGIT_TREE_UPDATE_REMOVE", + "tdef": "typedef", + "description": " The kind of update to perform", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_TREE_UPDATE_UPSERT", + "comments": "

Update or insert an entry at the specified path

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_TREE_UPDATE_REMOVE", + "comments": "

Remove an entry from the specified path

\n", + "value": 1 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_treebuilder", + { + "decl": "git_treebuilder", + "type": "struct", + "value": "git_treebuilder", + "file": "git2/types.h", + "line": 150, + "lineto": 150, + "tdef": "typedef", + "description": " Constructor for in-memory trees ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_filter", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_new", + "git_treebuilder_remove", + "git_treebuilder_write", + "git_treebuilder_write_with_buffer" + ] + } + } + ], + [ + "git_treewalk_mode", + { + "decl": ["GIT_TREEWALK_PRE", "GIT_TREEWALK_POST"], + "type": "enum", + "file": "git2/tree.h", + "line": 398, + "lineto": 401, + "block": "GIT_TREEWALK_PRE\nGIT_TREEWALK_POST", + "tdef": "typedef", + "description": " Tree traversal modes ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_TREEWALK_PRE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_TREEWALK_POST", + "comments": "", + "value": 1 + } + ], + "used": { "returns": [], "needs": ["git_tree_walk"] } + } + ], + [ + "git_worktree", + { + "decl": "git_worktree", + "type": "struct", + "value": "git_worktree", + "file": "git2/types.h", + "line": 126, + "lineto": 126, + "tdef": "typedef", + "description": " Representation of a working tree ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_repository_open_from_worktree", + "git_worktree_add", + "git_worktree_add_options_init", + "git_worktree_free", + "git_worktree_is_locked", + "git_worktree_is_prunable", + "git_worktree_lock", + "git_worktree_lookup", + "git_worktree_name", + "git_worktree_open_from_repository", + "git_worktree_path", + "git_worktree_prune", + "git_worktree_prune_options_init", + "git_worktree_unlock", + "git_worktree_validate" + ] + } + } + ], + [ + "git_worktree_add_options", + { + "decl": [ + "unsigned int version", + "int lock", + "int checkout_existing", + "git_reference * ref", + "git_checkout_options checkout_options" + ], + "type": "struct", + "value": "git_worktree_add_options", + "file": "git2/worktree.h", + "line": 86, + "lineto": 97, + "block": "unsigned int version\nint lock\nint checkout_existing\ngit_reference * ref\ngit_checkout_options checkout_options", + "tdef": "typedef", + "description": " Worktree add options structure", + "comments": "

Initialize with GIT_WORKTREE_ADD_OPTIONS_INIT. Alternatively, you can use git_worktree_add_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "int", + "name": "lock", + "comments": " lock newly created worktree " + }, + { + "type": "int", + "name": "checkout_existing", + "comments": " allow checkout of existing branch matching worktree name " + }, + { + "type": "git_reference *", + "name": "ref", + "comments": " reference to use for the new worktree HEAD " + }, + { + "type": "git_checkout_options", + "name": "checkout_options", + "comments": " Options for the checkout." + } + ], + "used": { + "returns": [], + "needs": ["git_worktree_add", "git_worktree_add_options_init"] + } + } + ], + [ + "git_worktree_prune_options", + { + "decl": ["unsigned int version", "uint32_t flags"], + "type": "struct", + "value": "git_worktree_prune_options", + "file": "git2/worktree.h", + "line": 210, + "lineto": 215, + "block": "unsigned int version\nuint32_t flags", + "tdef": "typedef", + "description": " Worktree prune options structure", + "comments": "

Initialize with GIT_WORKTREE_PRUNE_OPTIONS_INIT. Alternatively, you can use git_worktree_prune_options_init.

\n", + "fields": [ + { "type": "unsigned int", "name": "version", "comments": "" }, + { + "type": "uint32_t", + "name": "flags", + "comments": " A combination of `git_worktree_prune_t` " + } + ], + "used": { + "returns": [], + "needs": [ + "git_worktree_is_prunable", + "git_worktree_prune", + "git_worktree_prune_options_init" + ] + } + } + ], + [ + "git_worktree_prune_t", + { + "decl": [ + "GIT_WORKTREE_PRUNE_VALID", + "GIT_WORKTREE_PRUNE_LOCKED", + "GIT_WORKTREE_PRUNE_WORKING_TREE" + ], + "type": "enum", + "file": "git2/worktree.h", + "line": 194, + "lineto": 201, + "block": "GIT_WORKTREE_PRUNE_VALID\nGIT_WORKTREE_PRUNE_LOCKED\nGIT_WORKTREE_PRUNE_WORKING_TREE", + "tdef": "typedef", + "description": " Flags which can be passed to git_worktree_prune to alter its\n behavior.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_WORKTREE_PRUNE_VALID", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_WORKTREE_PRUNE_LOCKED", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_WORKTREE_PRUNE_WORKING_TREE", + "comments": "", + "value": 4 + } + ], + "used": { "returns": [], "needs": [] } + } + ], + [ + "git_writestream", + { + "decl": [ + "int (*)(git_writestream *, const char *, size_t) write", + "int (*)(git_writestream *) close", + "void (*)(git_writestream *) free" + ], + "type": "struct", + "value": "git_writestream", + "file": "git2/types.h", + "line": 375, + "lineto": 379, + "tdef": null, + "description": " A type to write in a streaming fashion, for example, for filters. ", + "comments": "", + "fields": [ + { + "type": "int (*)(git_writestream *, const char *, size_t)", + "name": "write", + "comments": "" + }, + { + "type": "int (*)(git_writestream *)", + "name": "close", + "comments": "" + }, + { + "type": "void (*)(git_writestream *)", + "name": "free", + "comments": "" + } + ], + "block": "int (*)(git_writestream *, const char *, size_t) write\nint (*)(git_writestream *) close\nvoid (*)(git_writestream *) free", + "used": { + "returns": [], + "needs": [ + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", + "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + } + } + ] + ], + "prefix": "include", + "groups": [ + [ + "annotated", + [ + "git_annotated_commit_free", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_lookup", + "git_annotated_commit_ref" + ] + ], + ["apply", ["git_apply", "git_apply_options_init", "git_apply_to_tree"]], + [ + "attr", + [ + "git_attr_add_macro", + "git_attr_cache_flush", + "git_attr_foreach", + "git_attr_foreach_ext", + "git_attr_get", + "git_attr_get_ext", + "git_attr_get_many", + "git_attr_get_many_ext", + "git_attr_value" + ] + ], + [ + "blame", + [ + "git_blame_buffer", + "git_blame_free", + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_get_hunk_count", + "git_blame_hunk_byindex", + "git_blame_hunk_byline", + "git_blame_hunkcount", + "git_blame_init_options", + "git_blame_line_byindex", + "git_blame_linecount", + "git_blame_options_init" + ] + ], + [ + "blob", + [ + "git_blob_create_from_buffer", + "git_blob_create_from_disk", + "git_blob_create_from_stream", + "git_blob_create_from_stream_commit", + "git_blob_create_from_workdir", + "git_blob_data_is_binary", + "git_blob_dup", + "git_blob_filter", + "git_blob_filter_options_init", + "git_blob_filtered_content", + "git_blob_free", + "git_blob_id", + "git_blob_is_binary", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_blob_owner", + "git_blob_rawcontent", + "git_blob_rawsize" + ] + ], + [ + "branch", + [ + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_delete", + "git_branch_is_checked_out", + "git_branch_is_head", + "git_branch_iterator_free", + "git_branch_iterator_new", + "git_branch_lookup", + "git_branch_move", + "git_branch_name", + "git_branch_name_is_valid", + "git_branch_next", + "git_branch_remote_name", + "git_branch_set_upstream", + "git_branch_upstream", + "git_branch_upstream_merge", + "git_branch_upstream_name", + "git_branch_upstream_remote" + ] + ], + [ + "buf", + [ + "git_buf_contains_nul", + "git_buf_dispose", + "git_buf_free", + "git_buf_grow", + "git_buf_is_binary", + "git_buf_set" + ] + ], + [ + "checkout", + [ + "git_checkout_head", + "git_checkout_index", + "git_checkout_options_init", + "git_checkout_tree" + ] + ], + [ + "cherrypick", + ["git_cherrypick", "git_cherrypick_commit", "git_cherrypick_options_init"] + ], + ["clone", ["git_clone", "git_clone_options_init"]], + [ + "commit", + [ + "git_commit_amend", + "git_commit_author", + "git_commit_author_with_mailmap", + "git_commit_body", + "git_commit_committer", + "git_commit_committer_with_mailmap", + "git_commit_create", + "git_commit_create_buffer", + "git_commit_create_from_stage", + "git_commit_create_v", + "git_commit_create_with_signature", + "git_commit_dup", + "git_commit_extract_signature", + "git_commit_free", + "git_commit_header_field", + "git_commit_id", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_commit_message", + "git_commit_message_encoding", + "git_commit_message_raw", + "git_commit_nth_gen_ancestor", + "git_commit_owner", + "git_commit_parent", + "git_commit_parent_id", + "git_commit_parentcount", + "git_commit_raw_header", + "git_commit_summary", + "git_commit_time", + "git_commit_time_offset", + "git_commit_tree", + "git_commit_tree_id" + ] + ], + ["commitarray", ["git_commitarray_dispose"]], + [ + "config", + [ + "git_config_add_file_ondisk", + "git_config_backend_foreach_match", + "git_config_delete_entry", + "git_config_delete_multivar", + "git_config_entry_free", + "git_config_find_global", + "git_config_find_programdata", + "git_config_find_system", + "git_config_find_xdg", + "git_config_foreach", + "git_config_foreach_match", + "git_config_free", + "git_config_get_bool", + "git_config_get_entry", + "git_config_get_int32", + "git_config_get_int64", + "git_config_get_mapped", + "git_config_get_multivar_foreach", + "git_config_get_path", + "git_config_get_string", + "git_config_get_string_buf", + "git_config_iterator_free", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_lock", + "git_config_lookup_map_value", + "git_config_multivar_iterator_new", + "git_config_new", + "git_config_next", + "git_config_open_default", + "git_config_open_global", + "git_config_open_level", + "git_config_open_ondisk", + "git_config_parse_bool", + "git_config_parse_int32", + "git_config_parse_int64", + "git_config_parse_path", + "git_config_set_bool", + "git_config_set_int32", + "git_config_set_int64", + "git_config_set_multivar", + "git_config_set_string", + "git_config_set_writeorder", + "git_config_snapshot" + ] + ], + [ + "credential", + [ + "git_credential_default_new", + "git_credential_free", + "git_credential_get_username", + "git_credential_has_username", + "git_credential_ssh_custom_new", + "git_credential_ssh_interactive_new", + "git_credential_ssh_key_from_agent", + "git_credential_ssh_key_memory_new", + "git_credential_ssh_key_new", + "git_credential_username_new", + "git_credential_userpass", + "git_credential_userpass_plaintext_new" + ] + ], + [ + "describe", + [ + "git_describe_commit", + "git_describe_format", + "git_describe_format_options_init", + "git_describe_options_init", + "git_describe_result_free", + "git_describe_workdir" + ] + ], + [ + "diff", + [ + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_find_options_init", + "git_diff_find_similar", + "git_diff_foreach", + "git_diff_format_email", + "git_diff_format_email_options_init", + "git_diff_free", + "git_diff_from_buffer", + "git_diff_get_delta", + "git_diff_get_stats", + "git_diff_index_to_index", + "git_diff_index_to_workdir", + "git_diff_is_sorted_icase", + "git_diff_merge", + "git_diff_num_deltas", + "git_diff_num_deltas_of_type", + "git_diff_options_init", + "git_diff_patchid", + "git_diff_patchid_options_init", + "git_diff_print", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf", + "git_diff_status_char", + "git_diff_to_buf", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index" + ] + ], + ["email", ["git_email_create_from_commit"]], + ["error", ["git_error_last"]], + ["fetch", ["git_fetch_options_init"]], + [ + "filter", + [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_buffer", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_load", + "git_filter_list_load_ext", + "git_filter_list_stream_blob", + "git_filter_list_stream_buffer", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + ], + [ + "giterr", + ["giterr_clear", "giterr_last", "giterr_set_oom", "giterr_set_str"] + ], + [ + "graph", + [ + "git_graph_ahead_behind", + "git_graph_descendant_of", + "git_graph_reachable_from_any" + ] + ], + [ + "ignore", + [ + "git_ignore_add_rule", + "git_ignore_clear_internal_rules", + "git_ignore_path_is_ignored" + ] + ], + [ + "index", + [ + "git_index_add", + "git_index_add_all", + "git_index_add_bypath", + "git_index_add_from_buffer", + "git_index_caps", + "git_index_checksum", + "git_index_clear", + "git_index_conflict_add", + "git_index_conflict_cleanup", + "git_index_conflict_get", + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_conflict_remove", + "git_index_entry_is_conflict", + "git_index_entry_stage", + "git_index_entrycount", + "git_index_find", + "git_index_find_prefix", + "git_index_free", + "git_index_get_byindex", + "git_index_get_bypath", + "git_index_has_conflicts", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_new", + "git_index_open", + "git_index_owner", + "git_index_path", + "git_index_read", + "git_index_read_tree", + "git_index_remove", + "git_index_remove_all", + "git_index_remove_bypath", + "git_index_remove_directory", + "git_index_set_caps", + "git_index_set_version", + "git_index_update_all", + "git_index_version", + "git_index_write", + "git_index_write_tree", + "git_index_write_tree_to" + ] + ], + [ + "indexer", + [ + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_name", + "git_indexer_new", + "git_indexer_options_init" + ] + ], + [ + "libgit2", + [ + "git_libgit2_feature_backend", + "git_libgit2_features", + "git_libgit2_init", + "git_libgit2_opts", + "git_libgit2_prerelease", + "git_libgit2_shutdown", + "git_libgit2_version" + ] + ], + [ + "mailmap", + [ + "git_mailmap_add_entry", + "git_mailmap_free", + "git_mailmap_from_buffer", + "git_mailmap_from_repository", + "git_mailmap_new", + "git_mailmap_resolve", + "git_mailmap_resolve_signature" + ] + ], + [ + "merge", + [ + "git_merge", + "git_merge_analysis", + "git_merge_analysis_for_ref", + "git_merge_base", + "git_merge_base_many", + "git_merge_base_octopus", + "git_merge_bases", + "git_merge_bases_many", + "git_merge_commits", + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_input_init", + "git_merge_file_options_init", + "git_merge_file_result_free", + "git_merge_options_init", + "git_merge_trees" + ] + ], + [ + "message", + [ + "git_message_prettify", + "git_message_trailer_array_free", + "git_message_trailers" + ] + ], + ["note", ["git_note_iterator_free", "git_note_next"]], + [ + "object", + [ + "git_object__size", + "git_object_dup", + "git_object_free", + "git_object_id", + "git_object_lookup", + "git_object_lookup_bypath", + "git_object_lookup_prefix", + "git_object_owner", + "git_object_peel", + "git_object_rawcontent_is_valid", + "git_object_short_id", + "git_object_string2type", + "git_object_type", + "git_object_type2string", + "git_object_typeisloose" + ] + ], + [ + "odb", + [ + "git_odb_add_alternate", + "git_odb_add_backend", + "git_odb_add_disk_alternate", + "git_odb_backend_loose", + "git_odb_backend_one_pack", + "git_odb_backend_pack", + "git_odb_exists", + "git_odb_exists_ext", + "git_odb_exists_prefix", + "git_odb_expand_ids", + "git_odb_foreach", + "git_odb_free", + "git_odb_get_backend", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_new", + "git_odb_num_backends", + "git_odb_object_data", + "git_odb_object_dup", + "git_odb_object_free", + "git_odb_object_id", + "git_odb_object_size", + "git_odb_object_type", + "git_odb_open", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read", + "git_odb_read_header", + "git_odb_read_prefix", + "git_odb_refresh", + "git_odb_set_commit_graph", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write", + "git_odb_write", + "git_odb_write_multi_pack_index", + "git_odb_write_pack" + ] + ], + [ + "oid", + [ + "git_oid_cmp", + "git_oid_cpy", + "git_oid_equal", + "git_oid_fmt", + "git_oid_fromraw", + "git_oid_fromstr", + "git_oid_fromstrn", + "git_oid_fromstrp", + "git_oid_is_zero", + "git_oid_ncmp", + "git_oid_nfmt", + "git_oid_pathfmt", + "git_oid_shorten_add", + "git_oid_shorten_free", + "git_oid_shorten_new", + "git_oid_strcmp", + "git_oid_streq", + "git_oid_tostr", + "git_oid_tostr_s" + ] + ], + ["oidarray", ["git_oidarray_dispose", "git_oidarray_free"]], + [ + "packbuilder", + [ + "git_packbuilder_foreach", + "git_packbuilder_free", + "git_packbuilder_hash", + "git_packbuilder_insert", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_recur", + "git_packbuilder_insert_tree", + "git_packbuilder_insert_walk", + "git_packbuilder_name", + "git_packbuilder_new", + "git_packbuilder_object_count", + "git_packbuilder_set_callbacks", + "git_packbuilder_set_threads", + "git_packbuilder_write", + "git_packbuilder_write_buf", + "git_packbuilder_written" + ] + ], + [ + "patch", + [ + "git_patch_free", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers", + "git_patch_from_diff", + "git_patch_get_delta", + "git_patch_get_hunk", + "git_patch_get_line_in_hunk", + "git_patch_line_stats", + "git_patch_num_hunks", + "git_patch_num_lines_in_hunk", + "git_patch_owner", + "git_patch_print", + "git_patch_size", + "git_patch_to_buf" + ] + ], + [ + "pathspec", + [ + "git_pathspec_free", + "git_pathspec_match_diff", + "git_pathspec_match_index", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free", + "git_pathspec_match_tree", + "git_pathspec_match_workdir", + "git_pathspec_matches_path", + "git_pathspec_new" + ] + ], + ["proxy", ["git_proxy_options_init"]], + ["push", ["git_push_options_init"]], + [ + "rebase", + [ + "git_rebase_abort", + "git_rebase_commit", + "git_rebase_finish", + "git_rebase_free", + "git_rebase_init", + "git_rebase_inmemory_index", + "git_rebase_next", + "git_rebase_onto_id", + "git_rebase_onto_name", + "git_rebase_open", + "git_rebase_operation_byindex", + "git_rebase_operation_current", + "git_rebase_operation_entrycount", + "git_rebase_options_init", + "git_rebase_orig_head_id", + "git_rebase_orig_head_name" + ] + ], + [ + "refdb", + [ + "git_refdb_compress", + "git_refdb_free", + "git_refdb_new", + "git_refdb_open" + ] + ], + [ + "reference", + [ + "git_reference_cmp", + "git_reference_create", + "git_reference_create_matching", + "git_reference_delete", + "git_reference_dup", + "git_reference_dwim", + "git_reference_ensure_log", + "git_reference_foreach", + "git_reference_foreach_glob", + "git_reference_foreach_name", + "git_reference_free", + "git_reference_has_log", + "git_reference_is_branch", + "git_reference_is_note", + "git_reference_is_remote", + "git_reference_is_tag", + "git_reference_is_valid_name", + "git_reference_iterator_free", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", + "git_reference_list", + "git_reference_lookup", + "git_reference_name", + "git_reference_name_is_valid", + "git_reference_name_to_id", + "git_reference_next", + "git_reference_next_name", + "git_reference_normalize_name", + "git_reference_owner", + "git_reference_peel", + "git_reference_remove", + "git_reference_rename", + "git_reference_resolve", + "git_reference_set_target", + "git_reference_shorthand", + "git_reference_symbolic_create", + "git_reference_symbolic_create_matching", + "git_reference_symbolic_set_target", + "git_reference_symbolic_target", + "git_reference_target", + "git_reference_target_peel", + "git_reference_type" + ] + ], + [ + "reflog", + [ + "git_reflog_append", + "git_reflog_delete", + "git_reflog_drop", + "git_reflog_entry_byindex", + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message", + "git_reflog_entrycount", + "git_reflog_free", + "git_reflog_read", + "git_reflog_rename", + "git_reflog_write" + ] + ], + [ + "refspec", + [ + "git_refspec_direction", + "git_refspec_dst", + "git_refspec_dst_matches", + "git_refspec_force", + "git_refspec_free", + "git_refspec_parse", + "git_refspec_rtransform", + "git_refspec_src", + "git_refspec_src_matches", + "git_refspec_src_matches_negative", + "git_refspec_string", + "git_refspec_transform" + ] + ], + [ + "remote", + [ + "git_remote_add_fetch", + "git_remote_add_push", + "git_remote_autotag", + "git_remote_connect", + "git_remote_connect_ext", + "git_remote_connect_options_init", + "git_remote_connected", + "git_remote_create", + "git_remote_create_anonymous", + "git_remote_create_detached", + "git_remote_create_options_init", + "git_remote_create_with_fetchspec", + "git_remote_create_with_opts", + "git_remote_default_branch", + "git_remote_delete", + "git_remote_disconnect", + "git_remote_download", + "git_remote_dup", + "git_remote_fetch", + "git_remote_free", + "git_remote_get_fetch_refspecs", + "git_remote_get_push_refspecs", + "git_remote_get_refspec", + "git_remote_init_callbacks", + "git_remote_is_valid_name", + "git_remote_list", + "git_remote_lookup", + "git_remote_ls", + "git_remote_name", + "git_remote_name_is_valid", + "git_remote_owner", + "git_remote_prune", + "git_remote_prune_refs", + "git_remote_push", + "git_remote_pushurl", + "git_remote_refspec_count", + "git_remote_rename", + "git_remote_set_autotag", + "git_remote_set_instance_pushurl", + "git_remote_set_instance_url", + "git_remote_set_pushurl", + "git_remote_set_url", + "git_remote_stats", + "git_remote_stop", + "git_remote_update_tips", + "git_remote_upload", + "git_remote_url" + ] + ], + [ + "repository", + [ + "git_repository_commit_parents", + "git_repository_commondir", + "git_repository_config", + "git_repository_config_snapshot", + "git_repository_detach_head", + "git_repository_discover", + "git_repository_fetchhead_foreach", + "git_repository_free", + "git_repository_get_namespace", + "git_repository_hashfile", + "git_repository_head", + "git_repository_head_detached", + "git_repository_head_detached_for_worktree", + "git_repository_head_for_worktree", + "git_repository_head_unborn", + "git_repository_ident", + "git_repository_index", + "git_repository_init", + "git_repository_init_ext", + "git_repository_init_options_init", + "git_repository_is_bare", + "git_repository_is_empty", + "git_repository_is_shallow", + "git_repository_is_worktree", + "git_repository_item_path", + "git_repository_mergehead_foreach", + "git_repository_message", + "git_repository_message_remove", + "git_repository_odb", + "git_repository_oid_type", + "git_repository_open", + "git_repository_open_bare", + "git_repository_open_ext", + "git_repository_open_from_worktree", + "git_repository_path", + "git_repository_refdb", + "git_repository_set_head", + "git_repository_set_head_detached", + "git_repository_set_head_detached_from_annotated", + "git_repository_set_ident", + "git_repository_set_namespace", + "git_repository_set_workdir", + "git_repository_state", + "git_repository_state_cleanup", + "git_repository_workdir", + "git_repository_wrap_odb" + ] + ], + ["reset", ["git_reset", "git_reset_default", "git_reset_from_annotated"]], + ["revert", ["git_revert", "git_revert_commit", "git_revert_options_init"]], + ["revparse", ["git_revparse", "git_revparse_ext", "git_revparse_single"]], + [ + "revwalk", + [ + "git_revwalk_add_hide_cb", + "git_revwalk_free", + "git_revwalk_hide", + "git_revwalk_hide_glob", + "git_revwalk_hide_head", + "git_revwalk_hide_ref", + "git_revwalk_new", + "git_revwalk_next", + "git_revwalk_push", + "git_revwalk_push_glob", + "git_revwalk_push_head", + "git_revwalk_push_range", + "git_revwalk_push_ref", + "git_revwalk_repository", + "git_revwalk_reset", + "git_revwalk_simplify_first_parent", + "git_revwalk_sorting" + ] + ], + [ + "signature", + [ + "git_signature_default", + "git_signature_default_from_env", + "git_signature_dup", + "git_signature_free", + "git_signature_from_buffer", + "git_signature_new", + "git_signature_now" + ] + ], + [ + "stash", + [ + "git_stash_apply", + "git_stash_apply_options_init", + "git_stash_drop", + "git_stash_foreach", + "git_stash_pop", + "git_stash_save", + "git_stash_save_options_init", + "git_stash_save_with_opts" + ] + ], + [ + "status", + [ + "git_status_byindex", + "git_status_file", + "git_status_foreach", + "git_status_foreach_ext", + "git_status_list_entrycount", + "git_status_list_free", + "git_status_list_new", + "git_status_options_init", + "git_status_should_ignore" + ] + ], + [ + "strarray", + ["git_strarray_copy", "git_strarray_dispose", "git_strarray_free"] + ], + [ + "submodule", + [ + "git_submodule_add_finalize", + "git_submodule_add_setup", + "git_submodule_add_to_index", + "git_submodule_branch", + "git_submodule_clone", + "git_submodule_dup", + "git_submodule_fetch_recurse_submodules", + "git_submodule_foreach", + "git_submodule_free", + "git_submodule_head_id", + "git_submodule_ignore", + "git_submodule_index_id", + "git_submodule_init", + "git_submodule_location", + "git_submodule_lookup", + "git_submodule_name", + "git_submodule_open", + "git_submodule_owner", + "git_submodule_path", + "git_submodule_reload", + "git_submodule_repo_init", + "git_submodule_resolve_url", + "git_submodule_set_branch", + "git_submodule_set_fetch_recurse_submodules", + "git_submodule_set_ignore", + "git_submodule_set_update", + "git_submodule_set_url", + "git_submodule_status", + "git_submodule_sync", + "git_submodule_update", + "git_submodule_update_options_init", + "git_submodule_update_strategy", + "git_submodule_url", + "git_submodule_wd_id" + ] + ], + [ + "tag", + [ + "git_tag_annotation_create", + "git_tag_create", + "git_tag_create_from_buffer", + "git_tag_create_lightweight", + "git_tag_delete", + "git_tag_dup", + "git_tag_foreach", + "git_tag_free", + "git_tag_id", + "git_tag_list", + "git_tag_list_match", + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_tag_message", + "git_tag_name", + "git_tag_name_is_valid", + "git_tag_owner", + "git_tag_peel", + "git_tag_tagger", + "git_tag_target", + "git_tag_target_id", + "git_tag_target_type" + ] + ], + ["trace", ["git_trace_set"]], + [ + "transaction", + [ + "git_transaction_commit", + "git_transaction_free", + "git_transaction_lock_ref", + "git_transaction_new", + "git_transaction_remove", + "git_transaction_set_reflog", + "git_transaction_set_symbolic_target", + "git_transaction_set_target" + ] + ], + [ + "tree", + [ + "git_tree_create_updated", + "git_tree_dup", + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_tree_entry_bypath", + "git_tree_entry_cmp", + "git_tree_entry_dup", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type", + "git_tree_entrycount", + "git_tree_free", + "git_tree_id", + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_tree_owner", + "git_tree_walk" + ] + ], + [ + "treebuilder", + [ + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_filter", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_new", + "git_treebuilder_remove", + "git_treebuilder_write", + "git_treebuilder_write_with_buffer" + ] + ], + [ + "worktree", + [ + "git_worktree_add", + "git_worktree_add_options_init", + "git_worktree_free", + "git_worktree_is_locked", + "git_worktree_is_prunable", + "git_worktree_list", + "git_worktree_lock", + "git_worktree_lookup", + "git_worktree_name", + "git_worktree_open_from_repository", + "git_worktree_path", + "git_worktree_prune", + "git_worktree_prune_options_init", + "git_worktree_unlock", + "git_worktree_validate" + ] + ] + ], + "examples": [ + ["add.c", "ex/v1.9.1/add.html"], + ["args.c", "ex/v1.9.1/args.html"], + ["blame.c", "ex/v1.9.1/blame.html"], + ["cat-file.c", "ex/v1.9.1/cat-file.html"], + ["checkout.c", "ex/v1.9.1/checkout.html"], + ["clone.c", "ex/v1.9.1/clone.html"], + ["commit.c", "ex/v1.9.1/commit.html"], + ["common.c", "ex/v1.9.1/common.html"], + ["config.c", "ex/v1.9.1/config.html"], + ["describe.c", "ex/v1.9.1/describe.html"], + ["diff.c", "ex/v1.9.1/diff.html"], + ["fetch.c", "ex/v1.9.1/fetch.html"], + ["for-each-ref.c", "ex/v1.9.1/for-each-ref.html"], + ["general.c", "ex/v1.9.1/general.html"], + ["index-pack.c", "ex/v1.9.1/index-pack.html"], + ["init.c", "ex/v1.9.1/init.html"], + ["lg2.c", "ex/v1.9.1/lg2.html"], + ["log.c", "ex/v1.9.1/log.html"], + ["ls-files.c", "ex/v1.9.1/ls-files.html"], + ["ls-remote.c", "ex/v1.9.1/ls-remote.html"], + ["merge.c", "ex/v1.9.1/merge.html"], + ["push.c", "ex/v1.9.1/push.html"], + ["remote.c", "ex/v1.9.1/remote.html"], + ["rev-list.c", "ex/v1.9.1/rev-list.html"], + ["rev-parse.c", "ex/v1.9.1/rev-parse.html"], + ["show-index.c", "ex/v1.9.1/show-index.html"], + ["stash.c", "ex/v1.9.1/stash.html"], + ["status.c", "ex/v1.9.1/status.html"], + ["tag.c", "ex/v1.9.1/tag.html"] + ] +} diff --git a/generate/input/libgit2-supplement.json b/generate/input/libgit2-supplement.json index 3940797b11..12ee8945b6 100644 --- a/generate/input/libgit2-supplement.json +++ b/generate/input/libgit2-supplement.json @@ -1,7 +1,7 @@ { "types": { - "git_cred_default": { - "decl": "git_cred" + "git_credential_default": { + "decl": "git_credential" }, "git_diff_hunk": { "decl": [ @@ -83,191 +83,2112 @@ "git_note_iterator": { "decl": "git_iterator" }, - "git_tree_entry": { + "git_checkout_options": { + "decl": [ + "unsigned int version", + "unsigned int checkout_strategy", + "int disable_filters", + "unsigned int dir_mode", + "unsigned int file_mode", + "int file_open_flags", + "unsigned int notify_flags", + "git_checkout_notify_cb notify_cb", + "void * notify_payload", + "git_checkout_progress_cb progress_cb", + "void * progress_payload", + "git_strarray paths", + "git_tree * baseline", + "git_index * baseline_index", + "const char * target_directory", + "const char * ancestor_label", + "const char * our_label", + "const char * their_label", + "git_checkout_perfdata_cb perfdata_cb", + "void * perfdata_payload", + "git_strarray disabled_filters" + ], "fields": [ { - "name": "attr", - "type": "uint16_t" + "type": "unsigned int", + "name": "version", + "comments": " The version " }, { - "name": "oid", - "type": "git_oid" + "type": "unsigned int", + "name": "checkout_strategy", + "comments": " default will be a safe checkout " }, { - "name": "filename_len", - "type": "size_t" + "type": "int", + "name": "disable_filters", + "comments": " don't apply filters like CRLF conversion " }, { - "name": "filename", - "structType": "char", - "structName": "filename[1]", - "type": "char *" + "type": "unsigned int", + "name": "dir_mode", + "comments": " default is 0755 " + }, + { + "type": "unsigned int", + "name": "file_mode", + "comments": " default is 0644 or 0755 as dictated by blob " + }, + { + "type": "int", + "name": "file_open_flags", + "comments": " default is O_CREAT | O_TRUNC | O_WRONLY " + }, + { + "type": "unsigned int", + "name": "notify_flags", + "comments": " see `git_checkout_notify_t` above " + }, + { + "type": "git_checkout_notify_cb", + "name": "notify_cb", + "comments": " Optional callback to get notifications on specific file states.\n " + }, + { + "type": "void *", + "name": "notify_payload", + "comments": " Payload passed to notify_cb " + }, + { + "type": "git_checkout_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of checkout progress. " + }, + { + "type": "void *", + "name": "progress_payload", + "comments": " Payload passed to progress_cb " + }, + { + "type": "git_strarray", + "name": "paths", + "comments": " A list of wildmatch patterns or paths.\n\n By default, all paths are processed. If you pass an array of wildmatch\n patterns, those will be used to filter which paths should be taken into\n account.\n\n Use GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as a simple list." + }, + { + "type": "git_tree *", + "name": "baseline", + "comments": " The expected content of the working directory; defaults to HEAD.\n\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." + }, + { + "type": "git_index *", + "name": "baseline_index", + "comments": " Like `baseline` above, though expressed as an index. This\n option overrides `baseline`." + }, + { + "type": "const char *", + "name": "target_directory", + "comments": " alternative checkout path to workdir " + }, + { + "type": "const char *", + "name": "ancestor_label", + "comments": " the name of the common ancestor side of conflicts " + }, + { + "type": "const char *", + "name": "our_label", + "comments": " the name of the \"our\" side of conflicts " + }, + { + "type": "const char *", + "name": "their_label", + "comments": " the name of the \"their\" side of conflicts " + }, + { + "type": "git_checkout_perfdata_cb", + "name": "perfdata_cb", + "comments": " Optional callback to notify the consumer of performance data. " + }, + { + "type": "void *", + "name": "perfdata_payload", + "comments": " Payload passed to perfdata_cb " + }, + { + "type": "git_strarray", + "name": "disabled_filters", + "comments": " A list filters to disable during checkout." } ] } }, - "new" : { + "new": { "functions": { - "git_reset": { + "git_libgit2_opts": { + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/libgit2/opts.cc", + "isAsync": false, + "isPrototypeMethod": false, + "group": "libgit2" + }, + "git_blame_file": { "type": "function", - "file": "reset.h", + "file": "blame.h", "args": [ + { + "name": "out", + "type": "git_blame **" + }, { "name": "repo", "type": "git_repository *" }, { - "name": "target", - "type": "git_object *" + "name": "path", + "type": "const char *" + }, + { + "name": "options", + "type": "git_blame_options *" + } + ], + "group": "blame", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_clone": { + "isManual": true, + "cFile": "generate/templates/manual/clone/clone.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "clone" + }, + "git_commit_extract_signature": { + "args": [ + { + "name": "signature", + "type": "git_buf" + }, + { + "name": "signed_data", + "type": "git_buf" }, { - "name": "reset_type", - "type": "git_reset_t" + "name": "repo", + "type": "git_repository *" }, { - "name": "checkout_opts", - "type": "git_checkout_options *" + "name": "commit_id", + "type": "git_oid *" }, { - "name": "signature", + "name": "field", + "type": "char *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/commit/extract_signature.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "commit", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_email_create_from_diff": { + "file": "sys/email.h", + "type": "function", + "isAsync": true, + "group": "email", + "args": [ + { + "name": "out", + "type": "git_buf *" + }, + { + "name": "diff", + "type": "git_diff *" + }, + { + "name": "patch_idx", + "type": "size_t" + }, + { + "name": "patch_count", + "type": "size_t" + }, + { + "name": "commit_id", + "type": "const git_oid *" + }, + { + "name": "summary", + "type": "const char *" + }, + { + "name": "body", + "type": "const char *" + }, + { + "name": "author", "type": "const git_signature *" }, { - "name": "log_message", + "name": "opts", + "type": "git_email_create_options *" + } + ], + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_diff_get_perfdata": { + "file": "sys/diff.h", + "args": [ + { + "name": "out", + "type": "git_diff_perfdata *" + }, + { + "name": "diff", + "type": "const git_diff *" + } + ], + "return": { + "type": "int" + }, + "group": "diff" + }, + "git_filter_list_load": { + "isManual": true, + "cFile": "generate/templates/manual/filter_list/load.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "filter_list" + }, + "git_filter_source_filemode": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "uint16_t" + }, + "group": "filter_source" + }, + "git_filter_source_flags": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "uint32_t" + }, + "group": "filter_source" + }, + "git_filter_source_id": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "const git_oid *" + }, + "group": "filter_source" + }, + "git_filter_source_mode": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "git_filter_mode_t" + }, + "group": "filter_source" + }, + "git_filter_source_path": { + "type": "function", + "file": "sys/filter.h", + "args": [ + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "return": { + "type": "const char *" + }, + "group": "filter_source" + }, + "git_filter_source_repo": { + "args": [ + { + "name": "out", + "type": "git_repository **" + }, + { + "name": "src", + "type": "const git_filter_source *" + } + ], + "isManual": true, + "cFile": "generate/templates/manual/filter_source/repo.cc", + "isAsync": true, + "isPrototypeMethod": true, + "type": "function", + "group": "filter_source", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_hashsig_compare": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "a", + "type": "const git_hashsig *" + }, + { + "name": "b", + "type": "const git_hashsig *" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_hashsig_create": { + "type": "function", + "file": "sys/hashsig.h", + "args": [ + { + "name": "out", + "type": "git_hashsig **" + }, + { + "name": "buf", "type": "const char *" + }, + { + "name": "buflen", + "type": "size_t" + }, + { + "name": "opts", + "type": "git_hashsig_option_t" } ], "return": { "type": "int" }, - "group": "reset" + "group": "hashsig" }, - "git_stash_save": { + "git_hashsig_create_fromfile": { "type": "function", - "file": "stash.h", + "file": "sys/hashsig.h", "args": [ { "name": "out", - "type": "git_oid *" + "type": "git_hashsig **" }, { - "name": "repo", - "type": "git_repository *" + "name": "path", + "type": "const char *" }, { - "name": "stasher", - "type": "const git_signature *" + "name": "opts", + "type": "git_hashsig_option_t" + } + ], + "return": { + "type": "int" + }, + "group": "hashsig" + }, + "git_index_name_add": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" }, { - "name": "message", + "name": "ancestor", "type": "const char *" }, { - "name": "flags", - "type": "unsigned int" + "name": "ours", + "type": "const char *" + }, + { + "name": "theirs", + "type": "const char *" } ], "return": { "type": "int" }, - "group": "stash" - } - }, - "groups": [ - [ - "annotated", - [ - "git_annotated_commit_free", - "git_annotated_commit_from_fetchhead", - "git_annotated_commit_from_ref", - "git_annotated_commit_id", - "git_annotated_commit_lookup" - ] - ], - [ - "odb_object", - [ - "git_odb_object_data", - "git_odb_object_dup", - "git_odb_object_free", - "git_odb_object_id", - "git_odb_object_size", - "git_odb_object_type" - ] - ], - [ - "status_list", - [ - "git_status_list_entrycount", - "git_status_list_free", - "git_status_list_get_perfdata", - "git_status_list_new" - ] - ] - ], - "types": [ + "group": "index_name_entry" + }, + "git_index_name_clear": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "int" + }, + "group": "index_name_entry" + }, + "git_index_name_entrycount": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "size_t" + }, + "group": "index_name_entry" + }, + "git_index_name_get_byindex": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "const git_index_name_entry *" + }, + "group": "index_name_entry" + }, + "git_index_reuc_add": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + }, + { + "name": "ancestor_mode", + "type": "int" + }, + { + "name": "ancestor_id", + "type": "const git_oid *" + }, + { + "name": "our_mode", + "type": "int" + }, + { + "name": "our_id", + "type": "const git_oid *" + }, + { + "name": "their_mode", + "type": "int" + }, + { + "name": "their_id", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_clear": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_entrycount": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "size_t" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_find": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "at_pos", + "type": "size_t *" + }, + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_get_byindex": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "const git_index_reuc_entry *" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_get_bypath": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "path", + "type": "const char *" + } + ], + "return": { + "type": "const git_index_reuc_entry *" + }, + "group": "index_reuc_entry" + }, + "git_index_reuc_remove": { + "type": "function", + "file": "sys/index.h", + "args": [ + { + "name": "index", + "type": "git_index *" + }, + { + "name": "n", + "type": "size_t" + } + ], + "return": { + "type": "int" + }, + "group": "index_reuc_entry" + }, + "git_note_author": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const git_signature *" + }, + "group": "note" + }, + "git_note_commit_create": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "notes_commit_out", + "type": "git_oid *" + }, + { + "name": "notes_blob_out", + "type": "git_oid *" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "parent", + "type": "git_commit *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + }, + { + "name": "note", + "type": "const char *" + }, + { + "name": "allow_note_overwrite", + "type": "int" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_commit_iterator_new": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note_iterator **" + }, + { + "name": "notes_commit", + "type": "git_commit *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_commit_read": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note **" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_commit", + "type": "git_commit *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_commit_remove": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "notes_commit_out", + "type": "git_oid *" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_commit", + "type": "git_commit *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_committer": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const git_signature *" + }, + "group": "note" + }, + "git_note_create": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_oid *" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + }, + { + "name": "note", + "type": "const char *" + }, + { + "name": "force", + "type": "int" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_default_ref": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_buf *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_foreach": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "note_cb", + "type": "git_note_foreach_cb" + }, + { + "name": "payload", + "type": "void *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_free": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "git_note *" + } + ], + "return": { + "type": "void" + }, + "group": "note" + }, + "git_note_id": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const git_oid *" + }, + "group": "note" + }, + "git_note_iterator_free": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "it", + "type": "git_note_iterator *" + } + ], + "return": { + "type": "void" + }, + "group": "note" + }, + "git_note_iterator_new": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note_iterator **" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_message": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note", + "type": "const git_note *" + } + ], + "return": { + "type": "const char *" + }, + "group": "note" + }, + "git_note_next": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "note_id", + "type": "git_oid *" + }, + { + "name": "annotated_id", + "type": "git_oid *" + }, + { + "name": "it", + "type": "git_note_iterator *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_read": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "out", + "type": "git_note **" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_note_remove": { + "type": "function", + "file": "note.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "notes_ref", + "type": "const char *" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "oid", + "type": "const git_oid *" + } + ], + "return": { + "type": "int" + }, + "group": "note" + }, + "git_patch_convenient_from_diff": { + "args": [ + { + "name": "diff", + "type": "git_diff *" + }, + { + "name": "indexes", + "type": "std::vector" + }, + { + "name": "out", + "type": "std::vector *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/patches/convenient_patches.cc", + "isAsync": true, + "isPrototypeMethod": false, + "group": "patch", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_path_is_gitfile": { + "type": "function", + "file": "sys/path.h", + "args": [ + { + "name": "path", + "type": "const char *" + }, + { + "name": "pathlen", + "type": "size_t" + }, + { + "name": "gitfile", + "type": "git_path_gitfile" + }, + { + "name": "fs", + "type": "git_path_fs" + } + ], + "return": { + "type": "int" + }, + "group": "path" + }, + "git_remote_reference_list": { + "args": [ + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "remote", + "type": "git_remote *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/remote/ls.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "remote", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository__cleanup": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_repository_get_references": { + "args": [ + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/get_references.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_get_submodules": { + "args": [ + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/get_submodules.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_get_remotes": { + "args": [ + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/get_remotes.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_refresh_references": { + "args": [ + { + "name": "out", + "type": "void *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/refresh_references.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_set_index": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "index", + "type": "git_index *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_repository_statistics": { + "args": [ + { + "name": "out", + "type": "void *" + }, + { + "name": "repo", + "type": "git_repository *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/repository/statistics.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "repository", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_repository_submodule_cache_all": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_repository_submodule_cache_clear": { + "type": "function", + "file": "sys/repository.h", + "args": [ + { + "name": "repo", + "type": "git_repository *" + } + ], + "return": { + "type": "int" + }, + "group": "repository" + }, + "git_revwalk_commit_walk": { + "args": [ + { + "name": "max_count", + "type": "int" + }, + { + "name": "out", + "type": "void *" + }, + { + "name": "returnPlainObjects", + "type": "bool" + }, + { + "name": "walk", + "type": "git_revwalk *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/revwalk/commit_walk.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "revwalk", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_revwalk_fast_walk": { + "args": [ + { + "name": "max_count", + "type": "int" + }, + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "walk", + "type": "git_revwalk *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/revwalk/fast_walk.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "revwalk", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_revwalk_file_history_walk": { + "args": [ + { + "name": "file_path", + "type": "const char *" + }, + { + "name": "max_count", + "type": "unsigned int" + }, + { + "name": "out", + "type": "std::vector *" + }, + { + "name": "walk", + "type": "git_revwalk *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/revwalk/file_history_walk.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "revwalk", + "return": { + "type": "int", + "isErrorCode": true + } + }, + "git_status_list_get_perfdata": { + "file": "sys/diff.h", + "args": [ + { + "name": "out", + "type": "git_diff_perfdata *" + }, + { + "name": "status", + "type": "const git_status_list *" + } + ], + "return": { + "type": "int" + }, + "group": "status_list" + }, + "git_tree_get_all_filepaths": { + "args": [ + { + "name": "tree", + "type": "git_tree *" + }, + { + "name": "repo", + "type": "git_repository *" + }, + { + "name": "out", + "type": "std::vector *" + } + ], + "type": "function", + "isManual": true, + "cFile": "generate/templates/manual/tree/get_all_filepaths.cc", + "isAsync": true, + "isPrototypeMethod": true, + "group": "tree", + "return": { + "type": "int", + "isErrorCode": true + } + } + }, + "groups": [ + [ + "annotated_commit", + [ + "git_annotated_commit_free", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_lookup", + "git_annotated_commit_ref" + ] + ], + [ + "config_iterator", + [ + "git_config_iterator_free", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_multivar_iterator_new", + "git_config_next" + ] + ], + [ + "diff", + [ + "git_diff_get_perfdata" + ] + ], + [ + "diff_stats", + [ + "git_diff_stats_files_changed", + "git_diff_stats_insertions", + "git_diff_stats_deletions", + "git_diff_stats_to_buf", + "git_diff_stats_free" + ] + ], + [ + "filter_list", + [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_free", + "git_filter_list_load" + ] + ], + [ + "filter_source", + [ + "git_filter_source_repo", + "git_filter_source_path", + "git_filter_source_filemode", + "git_filter_source_id", + "git_filter_source_mode", + "git_filter_source_flags" + ] + ], + [ + "hashsig", + [ + "git_hashsig_compare", + "git_hashsig_create", + "git_hashsig_create_fromfile" + ] + ], + [ + "index_conflict_iterator", + [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next" + ] + ], + [ + "index_iterator", + [ + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next" + ] + ], + [ + "index_name_entry", + [ + "git_index_name_add", + "git_index_name_clear", + "git_index_name_entrycount", + "git_index_name_get_byindex" + ] + ], + [ + "index_reuc_entry", + [ + "git_index_reuc_add", + "git_index_reuc_clear", + "git_index_reuc_entrycount", + "git_index_reuc_find", + "git_index_reuc_get_byindex", + "git_index_reuc_get_bypath", + "git_index_reuc_remove" + ] + ], + [ + "merge_file_result", + [ + "git_merge_file_result_free" + ] + ], + [ + "odb_object", + [ + "git_odb_object_data", + "git_odb_object_dup", + "git_odb_object_free", + "git_odb_object_id", + "git_odb_object_size", + "git_odb_object_type" + ] + ], + [ + "odb_stream", + [ + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write" + ] + ], + [ + "oid_shorten", + [ + "git_oid_shorten_add", + "git_oid_shorten_free", + "git_oid_shorten_new" + ] + ], + [ + "patch", + [ + "git_patch_convenient_from_diff" + ] + ], + [ + "path", + [ + "git_path_is_gitfile" + ] + ], + [ + "pathspec_match_list", + [ + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free" + ] + ], + [ + "reflog_entry", + [ + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message" + ] + ], + [ + "remote", + [ + "git_remote_reference_list" + ] + ], + [ + "repository", + [ + "git_repository__cleanup", + "git_repository_get_references", + "git_repository_get_submodules", + "git_repository_get_remotes", + "git_repository_refresh_references", + "git_repository_set_index", + "git_repository_statistics", + "git_repository_submodule_cache_all", + "git_repository_submodule_cache_clear" + ] + ], + [ + "revwalk", + [ + "git_revwalk_commit_walk", + "git_revwalk_fast_walk", + "git_revwalk_file_history_walk" + ] + ], + [ + "status_list", + [ + "git_status_list_entrycount", + "git_status_list_free", + "git_status_list_get_perfdata", + "git_status_list_new" + ] + ], + [ + "tree", + [ + "git_tree_get_all_filepaths" + ] + ], + [ + "tree_entry", + [ + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type" + ] + ] + ], + "types": [ + [ + "git_apply_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "git_apply_delta_cb", + "name": "delta_cb" + }, + { + "type": "git_apply_hunk_cb", + "name": "hunk_cb" + }, + { + "type": "void *", + "name": "payload" + } + ], + "used": { + "needs": [ + "git_apply_init_options" + ] + } + } + ], + [ + "git_blame_hunk", + { + "type": "struct", + "fields": [ + { + "name": "lines_in_hunk", + "type": "int" + }, + { + "name": "final_commit_id", + "type": "git_oid" + }, + { + "name": "final_start_line_number", + "type": "size_t" + }, + { + "name": "final_signature", + "type": "git_signature *" + }, + { + "name": "final_committer", + "type": "git_signature *" + }, + { + "name": "orig_commit_id", + "type": "git_oid" + }, + { + "name": "orig_path", + "type": "const char *" + }, + { + "name": "orig_start_line_number", + "type": "size_t" + }, + { + "name": "orig_signature", + "type": "git_signature *" + }, + { + "name": "orig_committer", + "type": "git_signature *" + }, + { + "name": "summary", + "type": "const char *" + }, + { + "name": "boundary", + "type": "char" + } + ] + } + ], + [ + "git_blob_filter_options", + { + "type": "struct", + "fields": [ + { + "name": "version", + "type": "int" + }, + { + "name": "flags", + "type": "uint32_t" + } + ] + } + ], + [ + "git_cert_ssh_raw_type_t", + { + "type": "enum", + "fields": [ + { + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_UNKNOWN", + "value": 0 + }, + { + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_RSA", + "value": 1 + }, + { + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_DSS", + "value": 2 + }, + { + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_256", + "value": 3 + }, + { + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_384", + "value": 4 + }, + { + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_521", + "value": 5 + }, + { + "type": "uint32_t", + "name": "GIT_CERT_SSH_RAW_TYPE_KEY_ED25519", + "value": 6 + } + ] + } + ], + [ + "git_config_entry", + { + "fields": [ + { + "type": "const char *", + "name": "name" + }, + { + "type": "const char *", + "name": "value" + }, + { + "type": "git_config_level_t", + "name": "level" + }, + { + "type": "void (*)(struct git_config_entry *)", + "name": "free", + "ignore": true + } + ] + } + ], + [ + "git_commit_create_options", + { + "decl": [ + "unsigned int version", + "unsigned int allow_empty_commit : 1", + "const git_signature *author", + "const git_signature *committer", + "const char *message_encoding" + ], + "fields": [ + { + "name": "version", + "type": "unsigned int" + }, + { + "name": "allow_empty_commit", + "type": "unsigned int" + }, + { + "name": "author", + "type": "const git_signature *" + }, + { + "name": "committer", + "type": "const git_signature *" + }, + { + "name": "message_encoding", + "type": "const char *" + } + ] + } + ], + [ + "git_describe_format_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "unsigned int", + "name": "abbreviated_size" + }, + { + "type": "int", + "name": "always_use_long_format" + }, + { + "type": "const char *", + "name": "dirty_suffix" + } + ], + "used": { + "needs": [ + "git_describe_init_format_options" + ] + } + } + ], + [ + "git_describe_options", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "unsigned int", + "name": "max_candidates_tags" + }, + { + "type": "unsigned int", + "name": "describe_strategy" + }, + { + "type": "const char *", + "name": "pattern" + }, + { + "type": "int", + "name": "only_follow_first_parent" + }, + { + "type": "int", + "name": "show_commit_oid_as_fallback" + } + ], + "used": { + "needs": [ + "git_describe_init_options" + ] + } + } + ], + [ + "git_diff_perfdata", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "ignore": true + }, + { + "type": "size_t", + "name": "stat_calls" + }, + { + "type": "size_t", + "name": "oid_calculations" + } + ] + } + ], + [ + "git_filter", + { + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "const char *", + "name": "attributes" + }, + { + "type": "git_filter_init_fn", + "name": "initialize" + }, + { + "type": "git_filter_shutdown_fn", + "name": "shutdown" + }, + { + "type": "git_filter_check_fn", + "name": "check" + }, + { + "type": "git_filter_apply_fn", + "name": "apply" + }, + { + "type": "git_filter_cleanup_fn", + "name": "cleanup" + } + ] + } + ], + [ + "git_fetch_options", + { + "type": "struct", + "fields": [ + { + "name": "version", + "type": "int" + }, + { + "name": "callbacks", + "type": "git_remote_callbacks" + }, + { + "name": "prune", + "type": "git_fetch_prune_t" + }, + { + "name": "proxy_opts", + "type": "git_proxy_options" + }, + { + "name": "update_fetchhead", + "type": "int" + }, + { + "name": "download_tags", + "type": "git_remote_autotag_option_t" + }, + { + "name": "custom_headers", + "type": "git_strarray" + } + ], + "used": { + "needs": [ + "git_fetch_init_options", + "git_remote_init_callbacks" + ] + } + } + ], [ - "git_direction", + "git_fetch_prune_t", { "type": "enum", - "description": "Enum to indicate the direction that a remote connection is going to go", "fields": [ { "type": "int", - "name": "GIT_DIRECTION_FETCH", - "comments": "Fetching from the remote repository", + "name": "git_fetch_prune_unspecified", "value": 0 }, { "type": "int", - "name": "GIT_DIRECTION_PUSH", - "comments": "Pushing to a remote repository", + "name": "git_fetch_prune", "value": 1 + }, + { + "type": "int", + "name": "git_fetch_no_prune", + "value": 2 } ] } ], [ - "git_status_entry", + "git_hashsig", + { + "type": "struct", + "fields": [] + } + ], + [ + "git_index_name_entry", { + "type": "struct", "fields": [ { - "type": "git_status_t", - "name": "status" + "type": "char *", + "name": "ancestor" }, { - "type": "git_diff_delta *", - "name": "head_to_index" + "type": "char *", + "name": "ours" }, { - "type": "git_diff_delta *", - "name": "index_to_workdir" + "type": "char *", + "name": "theirs" } ] } ], [ - "git_diff_perfdata", + "git_index_reuc_entry", { "type": "struct", "fields": [ { - "type": "unsigned int", - "name": "version" + "type": "uint32_t [3]", + "name": "mode" }, { - "type": "size_t", - "name": "stat_calls" + "type": "git_oid [3]", + "name": "oid" }, { - "type": "size_t", - "name": "oid_calculations" + "type": "char *", + "name": "path" } ] } ], [ - "git_merge_options", + "git_off_t", + { + "type": "enum" + } + ], + [ + "git_remote_autotag_option_t", + { + "type": "enum" + } + ], + [ + "git_remote_callbacks", { "type": "struct", "fields": [ @@ -276,90 +2197,220 @@ "name": "version" }, { - "type": "git_merge_tree_flag_t", - "name": "flags" + "type": "git_transport_message_cb", + "name": "sideband_progress" }, { - "type": "unsigned int", - "name": "rename_threshold" + "type": "git_credential_acquire_cb", + "name": "credentials" }, { - "type": "unsigned int", - "name": "target_limit" + "type": "git_transport_certificate_check_cb", + "name": "certificate_check" + }, + { + "type": "git_indexer_progress_cb", + "name": "transfer_progress" }, { - "type": "git_diff_similarity_metric *", - "name": "metric", + "type": "git_push_transfer_progress_cb", + "name": "push_transfer_progress", + "isCallback": true + }, + { + "type": "git_transport_cb", + "name": "transport", "ignore": true }, { - "type": "git_merge_file_favor_t", - "name": "file_favor" + "type": "git_push_update_reference_cb", + "name": "push_update_reference" + }, + { + "type": "void *", + "name": "payload" + }, + { + "type": "git_url_resolve_cb", + "name": "resolve_url" } ], "used": { "needs": [ - "git_merge_init_options" + "git_remote_init_callbacks" ] } } ], [ - "git_off_t", + "git_remote_create_options", { - "type": "enum" + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "git_repository *", + "name": "repository" + }, + { + "type": "const char *", + "name": "name" + }, + { + "type": "const char *", + "name": "fetchspec" + }, + { + "type": "unsigned int", + "name": "flags" + } + ], + "used": { + "needs": [ + "git_remote_create_init_options" + ] + } } ], [ - "git_remote_autotag_option_t", + "git_remote_head", { - "type": "enum" + "types": "struct", + "fields": [ + { + "type": "int", + "name": "local" + }, + { + "type": "git_oid", + "name": "oid" + }, + { + "type": "git_oid", + "name": "loid" + }, + { + "type": "char *", + "name": "name" + }, + { + "type": "char *", + "name": "symref_target" + } + ], + "used": { + "needs": [ + "git_remote_reference_list" + ] + } + } + ], + [ + "git_path_gitfile", + { + "type": "enum", + "fields": [ + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITIGNORE", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITMODULES", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATH_GITFILE_GITATTRIBUTES", + "value": 1 + } + ] } ], [ - "git_sort_t", + "git_stash_apply_progress_t", { "type": "enum", - "description": "Flags to specify the sorting which a revwalk should perform.", "fields": [ { "type": "int", - "name": "GIT_SORT_NONE", - "comments": "Sort the repository contents in no particular ordering; this sorting is arbitrary, implementation-specific and subject to change at any time. This is the default sorting for new walkers.", + "name": "GIT_STASH_APPLY_PROGRESS_NONE", "value": 0 }, { "type": "int", - "name": "GIT_SORT_TOPOLOGICAL", - "comments": "Sort the repository contents in topological order (parents before children); this sorting mode can be combined with time sorting.", + "name": "GIT_STASH_APPLY_PROGRESS_LOADING_STASH", "value": 1 }, { "type": "int", - "name": "GIT_SORT_TIME", - "comments": "Sort the repository contents by commit time; this sorting mode can be combined with topological sorting.", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX", "value": 2 }, { "type": "int", - "name": "GIT_SORT_REVERSE", - "comments": "Iterate through the repository contents in reverse order; this sorting mode can be combined with any of the above.", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED", + "value": 3 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED", "value": 4 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED", + "value": 5 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED", + "value": 6 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_PROGRESS_DONE", + "value": 7 } - ], - "comments": "" - } - ], - [ - "git_time_t", - { - "type": "enum" + ] } ], [ - "git_trace_level_t", + "git_stash_apply_options", { - "type": "enum" + "type": "struct", + "fields": [ + { + "type": "unsigned int", + "name": "version" + }, + { + "type": "uint32_t", + "name": "flags" + }, + { + "type": "git_checkout_options", + "name": "checkout_options" + }, + { + "type": "git_stash_apply_progress_cb", + "name": "progress_cb" + }, + { + "type": "void *", + "name": "progress_payload" + } + ], + "used": { + "needs": [ + "git_stash_apply_init_options", + "git_checkout_init_options" + ] + } } ], [ @@ -394,7 +2445,13 @@ } ], [ - "git_diff_options", + "git_trace_level_t", + { + "type": "enum" + } + ], + [ + "git_worktree_add_options", { "type": "struct", "fields": [ @@ -403,59 +2460,60 @@ "name": "version" }, { - "type": "uint32_t", - "name": "flags" - }, - { - "type": "git_submodule_ignore_t", - "name": "ignore_submodules" - }, - { - "type": "git_strarray", - "name": "pathspec" - }, - { - "type": "git_diff_notify_cb", - "name": "notify_cb" - }, - { - "type": "void *", - "name": "notify_payload" - }, + "type": "int", + "name": "lock" + } + ], + "used": { + "needs": [ + "git_worktree_add_options_init" + ] + } + } + ], + [ + "git_worktree_prune_options", + { + "type": "struct", + "fields": [ { - "type": "uint32_t", - "name": "context_lines" + "type": "unsigned int", + "name": "version" }, { "type": "uint32_t", - "name": "interhunk_lines" - }, - { - "type": "uint16_t", - "name": "id_abbrev" - }, - { - "type": "git_off_t", - "name": "max_size" - }, - { - "type": "const char *", - "name": "old_prefix" - }, - { - "type": "const char *", - "name": "new_prefix" + "name": "flags" } ], "used": { "needs": [ - "git_diff_init_options", - "git_diff_tree_to_workdir", - "git_diff_tree_to_workdirext", - "git_diff_tree_to_tree" + "git_worktree_prune_options_init" ] } } + ], + [ + "git_worktree_prune_t", + { + "type": "enum", + "fields": [ + { + "type": "unsigned int", + "name": "git_worktree_prune_valid", + "value": 1 + }, + { + "type": "unsigned int", + "name": "git_worktree_prune_locked", + "value": 2 + }, + { + "type": "unsigned int", + "name": "git_worktree_prune_working_tree", + "value": 4 + } + ] + } ] ] }, @@ -465,22 +2523,62 @@ "git_annotated_commit_free", "git_annotated_commit_from_fetchhead", "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", "git_annotated_commit_id", - "git_annotated_commit_lookup" + "git_annotated_commit_lookup", + "git_annotated_commit_ref" ] }, - "odb": { + "config": { "functions": [ - "git_odb_object_data", - "git_odb_object_dup", - "git_odb_object_free", - "git_odb_object_id", - "git_odb_object_size", - "git_odb_object_type" + "git_config_iterator_free", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_multivar_iterator_new", + "git_config_next" + ] + }, + "diff": { + "functions": [ + "git_diff_stats_files_changed", + "git_diff_stats_insertions", + "git_diff_stats_deletions", + "git_diff_stats_to_buf", + "git_diff_stats_free" + ] + }, + "index": { + "functions": [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_iterator_free", + "git_index_iterator_new", + "git_index_iterator_next", + "git_index_name_add", + "git_index_name_clear", + "git_index_name_entrycount", + "git_index_name_get_byindex", + "git_index_reuc_add", + "git_index_reuc_clear", + "git_index_reuc_entrycount", + "git_index_reuc_find", + "git_index_reuc_get_byindex", + "git_index_reuc_get_bypath", + "git_index_reuc_remove" ] }, "merge": { "functions": [ + "git_merge_driver_lookup", + "git_merge_driver_register", + "git_merge_driver_source_ancestor", + "git_merge_driver_source_file_options", + "git_merge_driver_source_ours", + "git_merge_driver_source_repo", + "git_merge_driver_source_theirs", + "git_merge_driver_unregister", + "git_merge_file_result_free", "git_merge_head_free", "git_merge_head_from_fetchhead", "git_merge_head_from_id", @@ -488,6 +2586,56 @@ "git_merge_head_id" ] }, + "message": { + "functions": [ + "git_message_trailer_array_free" + ] + }, + "odb": { + "functions": [ + "git_odb_backend_loose", + "git_odb_backend_malloc", + "git_odb_backend_one_pack", + "git_odb_backend_pack", + "git_odb_object_data", + "git_odb_object_dup", + "git_odb_object_free", + "git_odb_object_id", + "git_odb_object_size", + "git_odb_object_type", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write" + ] + }, + "oid": { + "functions": [ + "git_oid_shorten_add", + "git_oid_shorten_free", + "git_oid_shorten_new" + ] + }, + "pathspec": { + "functions": [ + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free" + ] + }, + "reflog": { + "functions": [ + "git_reflog_entry__alloc", + "git_reflog_entry__free", + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message" + ] + }, "status": { "functions": [ "git_status_list_entrycount", @@ -495,14 +2643,45 @@ "git_status_list_get_perfdata", "git_status_list_new" ] + }, + "tree": { + "functions": [ + "git_tree_entry_dup", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type" + ] } }, "groups": { - "reset": [ - "git_reset" + "blame": [ + "git_blame_file" + ], + "email": [ + "git_email_create_from_diff" ], - "stash": [ - "git_stash_save" + "note": [ + "git_note_author", + "git_note_commit_create", + "git_note_commit_iterator_new", + "git_note_commit_read", + "git_note_commit_remove", + "git_note_committer", + "git_note_create", + "git_note_default_ref", + "git_note_foreach", + "git_note_free", + "git_note_id", + "git_note_iterator_free", + "git_note_iterator_new", + "git_note_message", + "git_note_next", + "git_note_read", + "git_note_remove" ] } -} +} \ No newline at end of file diff --git a/generate/input/v0.22.2.json b/generate/input/v0.22.2.json deleted file mode 100644 index 06fd08490f..0000000000 --- a/generate/input/v0.22.2.json +++ /dev/null @@ -1 +0,0 @@ -{"files":[{"file":"annotated_commit.h","functions":["git_annotated_commit_from_ref","git_annotated_commit_from_fetchhead","git_annotated_commit_lookup","git_annotated_commit_id","git_annotated_commit_free"],"meta":{},"lines":95},{"file":"attr.h","functions":["git_attr_value","git_attr_get","git_attr_get_many","git_attr_foreach","git_attr_cache_flush","git_attr_add_macro"],"meta":{},"lines":240},{"file":"blame.h","functions":["git_blame_init_options","git_blame_get_hunk_count","git_blame_get_hunk_byindex","git_blame_get_hunk_byline","git_blame_file","git_blame_buffer","git_blame_free"],"meta":{},"lines":207},{"file":"blob.h","functions":["git_blob_lookup","git_blob_lookup_prefix","git_blob_free","git_blob_id","git_blob_owner","git_blob_rawcontent","git_blob_rawsize","git_blob_filtered_content","git_blob_create_fromworkdir","git_blob_create_fromdisk","git_blob_create_fromchunks","git_blob_create_frombuffer","git_blob_is_binary"],"meta":{},"lines":219},{"file":"branch.h","functions":["git_branch_create","git_branch_delete","git_branch_iterator_new","git_branch_next","git_branch_iterator_free","git_branch_move","git_branch_lookup","git_branch_name","git_branch_upstream","git_branch_set_upstream","git_branch_is_head"],"meta":{},"lines":242},{"file":"buffer.h","functions":["git_buf_free","git_buf_grow","git_buf_set","git_buf_is_binary","git_buf_contains_nul"],"meta":{},"lines":122},{"file":"checkout.h","functions":["git_checkout_notify_cb","git_checkout_progress_cb","git_checkout_init_options","git_checkout_head","git_checkout_index","git_checkout_tree"],"meta":{},"lines":323},{"file":"cherrypick.h","functions":["git_cherrypick_init_options","git_cherrypick_commit","git_cherrypick"],"meta":{},"lines":84},{"file":"clone.h","functions":["git_remote_create_cb","git_repository_create_cb","git_clone_init_options","git_clone"],"meta":{},"lines":210},{"file":"commit.h","functions":["git_commit_lookup","git_commit_lookup_prefix","git_commit_free","git_commit_id","git_commit_owner","git_commit_message_encoding","git_commit_message","git_commit_message_raw","git_commit_summary","git_commit_time","git_commit_time_offset","git_commit_committer","git_commit_author","git_commit_raw_header","git_commit_tree","git_commit_tree_id","git_commit_parentcount","git_commit_parent","git_commit_parent_id","git_commit_nth_gen_ancestor","git_commit_create","git_commit_create_v","git_commit_amend"],"meta":{},"lines":353},{"file":"common.h","functions":["git_libgit2_version","git_libgit2_features","git_libgit2_opts"],"meta":{},"lines":245},{"file":"config.h","functions":["git_config_find_global","git_config_find_xdg","git_config_find_system","git_config_open_default","git_config_new","git_config_add_file_ondisk","git_config_open_ondisk","git_config_open_level","git_config_open_global","git_config_snapshot","git_config_free","git_config_get_entry","git_config_get_int32","git_config_get_int64","git_config_get_bool","git_config_get_string","git_config_get_multivar_foreach","git_config_multivar_iterator_new","git_config_next","git_config_iterator_free","git_config_set_int32","git_config_set_int64","git_config_set_bool","git_config_set_string","git_config_set_multivar","git_config_delete_entry","git_config_delete_multivar","git_config_foreach","git_config_iterator_new","git_config_iterator_glob_new","git_config_foreach_match","git_config_get_mapped","git_config_lookup_map_value","git_config_parse_bool","git_config_parse_int32","git_config_parse_int64","git_config_backend_foreach_match"],"meta":{},"lines":635},{"file":"cred_helpers.h","functions":["git_cred_userpass"],"meta":{},"lines":48},{"file":"describe.h","functions":["git_describe_commit","git_describe_workdir","git_describe_format","git_describe_result_free"],"meta":{},"lines":157},{"file":"diff.h","functions":["git_diff_notify_cb","git_diff_init_options","git_diff_file_cb","git_diff_hunk_cb","git_diff_line_cb","git_diff_find_init_options","git_diff_free","git_diff_tree_to_tree","git_diff_tree_to_index","git_diff_index_to_workdir","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_diff_merge","git_diff_find_similar","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_get_delta","git_diff_is_sorted_icase","git_diff_foreach","git_diff_status_char","git_diff_print","git_diff_blobs","git_diff_blob_to_buffer","git_diff_buffers","git_diff_get_stats","git_diff_stats_files_changed","git_diff_stats_insertions","git_diff_stats_deletions","git_diff_stats_to_buf","git_diff_stats_free","git_diff_format_email","git_diff_commit_as_email","git_diff_format_email_init_options"],"meta":{},"lines":1239},{"file":"errors.h","functions":["giterr_last","giterr_clear","giterr_detach","giterr_set_str","giterr_set_oom"],"meta":{},"lines":155},{"file":"filter.h","functions":["git_filter_list_load","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_filter_list_apply_to_blob","git_filter_list_free"],"meta":{},"lines":145},{"file":"global.h","functions":["git_libgit2_init","git_libgit2_shutdown"],"meta":{},"lines":39},{"file":"graph.h","functions":["git_graph_ahead_behind","git_graph_descendant_of"],"meta":{},"lines":51},{"file":"ignore.h","functions":["git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored"],"meta":{},"lines":74},{"file":"index.h","functions":["git_index_matched_path_cb","git_index_open","git_index_new","git_index_free","git_index_owner","git_index_caps","git_index_set_caps","git_index_read","git_index_write","git_index_path","git_index_read_tree","git_index_write_tree","git_index_write_tree_to","git_index_entrycount","git_index_clear","git_index_get_byindex","git_index_get_bypath","git_index_remove","git_index_remove_directory","git_index_add","git_index_entry_stage","git_index_add_bypath","git_index_remove_bypath","git_index_add_all","git_index_remove_all","git_index_update_all","git_index_find","git_index_conflict_add","git_index_conflict_get","git_index_conflict_remove","git_index_conflict_cleanup","git_index_has_conflicts","git_index_conflict_iterator_new","git_index_conflict_next","git_index_conflict_iterator_free"],"meta":{},"lines":696},{"file":"indexer.h","functions":["git_indexer_new","git_indexer_append","git_indexer_commit","git_indexer_hash","git_indexer_free"],"meta":{},"lines":72},{"file":"merge.h","functions":["git_merge_file_init_input","git_merge_file_init_options","git_merge_init_options","git_merge_analysis","git_merge_base","git_merge_bases","git_merge_base_many","git_merge_bases_many","git_merge_base_octopus","git_merge_file","git_merge_file_from_index","git_merge_file_result_free","git_merge_trees","git_merge_commits","git_merge"],"meta":{},"lines":529},{"file":"message.h","functions":["git_message_prettify"],"meta":{},"lines":39},{"file":"net.h","functions":["git_headlist_cb"],"meta":{},"lines":55},{"file":"notes.h","functions":["git_note_foreach_cb","git_note_iterator_new","git_note_iterator_free","git_note_next","git_note_read","git_note_author","git_note_committer","git_note_message","git_note_id","git_note_create","git_note_remove","git_note_free","git_note_default_ref","git_note_foreach"],"meta":{},"lines":213},{"file":"object.h","functions":["git_object_lookup","git_object_lookup_prefix","git_object_lookup_bypath","git_object_id","git_object_short_id","git_object_type","git_object_owner","git_object_free","git_object_type2string","git_object_string2type","git_object_typeisloose","git_object__size","git_object_peel","git_object_dup"],"meta":{},"lines":237},{"file":"odb.h","functions":["git_odb_foreach_cb","git_odb_new","git_odb_open","git_odb_add_disk_alternate","git_odb_free","git_odb_read","git_odb_read_prefix","git_odb_read_header","git_odb_exists","git_odb_exists_prefix","git_odb_refresh","git_odb_foreach","git_odb_write","git_odb_open_wstream","git_odb_stream_write","git_odb_stream_finalize_write","git_odb_stream_read","git_odb_stream_free","git_odb_open_rstream","git_odb_write_pack","git_odb_hash","git_odb_hashfile","git_odb_object_dup","git_odb_object_free","git_odb_object_id","git_odb_object_data","git_odb_object_size","git_odb_object_type","git_odb_add_backend","git_odb_add_alternate","git_odb_num_backends","git_odb_get_backend"],"meta":{},"lines":491},{"file":"odb_backend.h","functions":["git_odb_backend_pack","git_odb_backend_loose","git_odb_backend_one_pack"],"meta":{},"lines":130},{"file":"oid.h","functions":["git_oid_fromstr","git_oid_fromstrp","git_oid_fromstrn","git_oid_fromraw","git_oid_fmt","git_oid_nfmt","git_oid_pathfmt","git_oid_tostr_s","git_oid_tostr","git_oid_cpy","git_oid_cmp","git_oid_equal","git_oid_ncmp","git_oid_streq","git_oid_strcmp","git_oid_iszero","git_oid_shorten_new","git_oid_shorten_add","git_oid_shorten_free"],"meta":{},"lines":265},{"file":"oidarray.h","functions":["git_oidarray_free"],"meta":{},"lines":34},{"file":"pack.h","functions":["git_packbuilder_new","git_packbuilder_set_threads","git_packbuilder_insert","git_packbuilder_insert_tree","git_packbuilder_insert_commit","git_packbuilder_write","git_packbuilder_hash","git_packbuilder_foreach","git_packbuilder_object_count","git_packbuilder_written","git_packbuilder_progress","git_packbuilder_set_callbacks","git_packbuilder_free"],"meta":{},"lines":211},{"file":"patch.h","functions":["git_patch_from_diff","git_patch_from_blobs","git_patch_from_blob_and_buffer","git_patch_from_buffers","git_patch_free","git_patch_get_delta","git_patch_num_hunks","git_patch_line_stats","git_patch_get_hunk","git_patch_num_lines_in_hunk","git_patch_get_line_in_hunk","git_patch_size","git_patch_print","git_patch_to_buf"],"meta":{},"lines":271},{"file":"pathspec.h","functions":["git_pathspec_new","git_pathspec_free","git_pathspec_matches_path","git_pathspec_match_workdir","git_pathspec_match_index","git_pathspec_match_tree","git_pathspec_match_diff","git_pathspec_match_list_free","git_pathspec_match_list_entrycount","git_pathspec_match_list_entry","git_pathspec_match_list_diff_entry","git_pathspec_match_list_failed_entrycount","git_pathspec_match_list_failed_entry"],"meta":{},"lines":260},{"file":"push.h","functions":["git_push_init_options","git_push_transfer_progress"],"meta":{},"lines":60},{"file":"rebase.h","functions":["git_rebase_init_options","git_rebase_init","git_rebase_open","git_rebase_operation_entrycount","git_rebase_operation_current","git_rebase_operation_byindex","git_rebase_commit","git_rebase_abort","git_rebase_finish","git_rebase_free"],"meta":{},"lines":270},{"file":"refdb.h","functions":["git_refdb_new","git_refdb_open","git_refdb_compress","git_refdb_free"],"meta":{},"lines":63},{"file":"reflog.h","functions":["git_reflog_read","git_reflog_write","git_reflog_append","git_reflog_rename","git_reflog_delete","git_reflog_entrycount","git_reflog_entry_byindex","git_reflog_drop","git_reflog_entry_id_old","git_reflog_entry_id_new","git_reflog_entry_committer","git_reflog_entry_message","git_reflog_free"],"meta":{},"lines":166},{"file":"refs.h","functions":["git_reference_lookup","git_reference_name_to_id","git_reference_dwim","git_reference_symbolic_create_matching","git_reference_symbolic_create","git_reference_create","git_reference_create_matching","git_reference_target","git_reference_target_peel","git_reference_symbolic_target","git_reference_type","git_reference_name","git_reference_resolve","git_reference_owner","git_reference_symbolic_set_target","git_reference_set_target","git_reference_rename","git_reference_delete","git_reference_remove","git_reference_list","git_reference_foreach","git_reference_foreach_name","git_reference_free","git_reference_cmp","git_reference_iterator_new","git_reference_iterator_glob_new","git_reference_next","git_reference_next_name","git_reference_iterator_free","git_reference_foreach_glob","git_reference_has_log","git_reference_ensure_log","git_reference_is_branch","git_reference_is_remote","git_reference_is_tag","git_reference_is_note","git_reference_normalize_name","git_reference_peel","git_reference_is_valid_name","git_reference_shorthand"],"meta":{},"lines":740},{"file":"refspec.h","functions":["git_refspec_src","git_refspec_dst","git_refspec_string","git_refspec_force","git_refspec_direction","git_refspec_src_matches","git_refspec_dst_matches","git_refspec_transform","git_refspec_rtransform"],"meta":{},"lines":100},{"file":"remote.h","functions":["git_remote_rename_problem_cb","git_remote_create","git_remote_create_with_fetchspec","git_remote_create_anonymous","git_remote_lookup","git_remote_save","git_remote_dup","git_remote_owner","git_remote_name","git_remote_url","git_remote_pushurl","git_remote_set_url","git_remote_set_pushurl","git_remote_add_fetch","git_remote_get_fetch_refspecs","git_remote_set_fetch_refspecs","git_remote_add_push","git_remote_get_push_refspecs","git_remote_set_push_refspecs","git_remote_clear_refspecs","git_remote_refspec_count","git_remote_get_refspec","git_remote_connect","git_remote_ls","git_remote_download","git_remote_upload","git_remote_connected","git_remote_stop","git_remote_disconnect","git_remote_free","git_remote_update_tips","git_remote_prune","git_remote_fetch","git_remote_push","git_remote_list","git_remote_init_callbacks","git_remote_set_callbacks","git_remote_get_callbacks","git_remote_stats","git_remote_autotag","git_remote_set_autotag","git_remote_prune_refs","git_remote_rename","git_remote_update_fetchhead","git_remote_set_update_fetchhead","git_remote_is_valid_name","git_remote_delete","git_remote_default_branch"],"meta":{},"lines":695},{"file":"repository.h","functions":["git_repository_open","git_repository_wrap_odb","git_repository_discover","git_repository_open_ext","git_repository_open_bare","git_repository_free","git_repository_init","git_repository_init_init_options","git_repository_init_ext","git_repository_head","git_repository_head_detached","git_repository_head_unborn","git_repository_is_empty","git_repository_path","git_repository_workdir","git_repository_set_workdir","git_repository_is_bare","git_repository_config","git_repository_config_snapshot","git_repository_odb","git_repository_refdb","git_repository_index","git_repository_message","git_repository_message_remove","git_repository_state_cleanup","git_repository_fetchhead_foreach","git_repository_mergehead_foreach","git_repository_hashfile","git_repository_set_head","git_repository_set_head_detached","git_repository_detach_head","git_repository_state","git_repository_set_namespace","git_repository_get_namespace","git_repository_is_shallow"],"meta":{},"lines":721},{"file":"reset.h","functions":["git_reset_default"],"meta":{},"lines":97},{"file":"revert.h","functions":["git_revert_init_options","git_revert_commit","git_revert"],"meta":{},"lines":84},{"file":"revparse.h","functions":["git_revparse_single","git_revparse_ext","git_revparse"],"meta":{},"lines":108},{"file":"revwalk.h","functions":["git_revwalk_new","git_revwalk_reset","git_revwalk_push","git_revwalk_push_glob","git_revwalk_push_head","git_revwalk_hide","git_revwalk_hide_glob","git_revwalk_hide_head","git_revwalk_push_ref","git_revwalk_hide_ref","git_revwalk_next","git_revwalk_sorting","git_revwalk_push_range","git_revwalk_simplify_first_parent","git_revwalk_free","git_revwalk_repository","git_revwalk_hide_cb","git_revwalk_add_hide_cb"],"meta":{},"lines":291},{"file":"signature.h","functions":["git_signature_new","git_signature_now","git_signature_default","git_signature_dup","git_signature_free"],"meta":{},"lines":86},{"file":"stash.h","functions":["git_stash_cb","git_stash_foreach","git_stash_drop"],"meta":{},"lines":122},{"file":"status.h","functions":["git_status_cb","git_status_init_options","git_status_foreach","git_status_foreach_ext","git_status_file","git_status_list_new","git_status_list_entrycount","git_status_byindex","git_status_list_free","git_status_should_ignore"],"meta":{},"lines":365},{"file":"strarray.h","functions":["git_strarray_free","git_strarray_copy"],"meta":{},"lines":53},{"file":"submodule.h","functions":["git_submodule_update","git_submodule_lookup","git_submodule_free","git_submodule_foreach","git_submodule_add_setup","git_submodule_add_finalize","git_submodule_add_to_index","git_submodule_save","git_submodule_owner","git_submodule_name","git_submodule_path","git_submodule_url","git_submodule_resolve_url","git_submodule_branch","git_submodule_set_url","git_submodule_index_id","git_submodule_head_id","git_submodule_wd_id","git_submodule_ignore","git_submodule_set_ignore","git_submodule_update_strategy","git_submodule_set_update","git_submodule_fetch_recurse_submodules","git_submodule_set_fetch_recurse_submodules","git_submodule_init","git_submodule_repo_init","git_submodule_sync","git_submodule_open","git_submodule_reload","git_submodule_reload_all","git_submodule_status","git_submodule_location"],"meta":{},"lines":637},{"file":"sys/commit.h","functions":["git_commit_create_from_ids","git_commit_create_from_callback"],"meta":{},"lines":76},{"file":"sys/config.h","functions":["git_config_init_backend","git_config_add_backend"],"meta":{},"lines":107},{"file":"sys/diff.h","functions":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_diff_get_perfdata","git_status_list_get_perfdata"],"meta":{},"lines":90},{"file":"sys/filter.h","functions":["git_filter_lookup","git_filter_list_new","git_filter_list_push","git_filter_list_length","git_filter_source_repo","git_filter_source_path","git_filter_source_filemode","git_filter_source_id","git_filter_source_mode","git_filter_source_options","git_filter_init_fn","git_filter_shutdown_fn","git_filter_check_fn","git_filter_apply_fn","git_filter_cleanup_fn","git_filter_register","git_filter_unregister"],"meta":{},"lines":297},{"file":"sys/hashsig.h","functions":["git_hashsig_create","git_hashsig_create_fromfile","git_hashsig_free","git_hashsig_compare"],"meta":{},"lines":75},{"file":"sys/mempack.h","functions":["git_mempack_new","git_mempack_reset"],"meta":{},"lines":81},{"file":"sys/odb_backend.h","functions":["git_odb_init_backend"],"meta":{},"lines":102},{"file":"sys/openssl.h","functions":["git_openssl_set_locking"],"meta":{},"lines":34},{"file":"sys/refdb_backend.h","functions":["git_refdb_init_backend","git_refdb_backend_fs","git_refdb_set_backend"],"meta":{},"lines":213},{"file":"sys/refs.h","functions":["git_reference__alloc","git_reference__alloc_symbolic"],"meta":{},"lines":45},{"file":"sys/stream.h","functions":[],"meta":{},"lines":38},{"file":"sys/transport.h","functions":["git_transport_init","git_transport_new","git_transport_ssh_with_paths","git_transport_register","git_transport_unregister","git_transport_dummy","git_transport_local","git_transport_smart","git_smart_subtransport_http","git_smart_subtransport_git","git_smart_subtransport_ssh","git_remote_set_transport"],"meta":{},"lines":361},{"file":"tag.h","functions":["git_tag_lookup","git_tag_lookup_prefix","git_tag_free","git_tag_id","git_tag_owner","git_tag_target","git_tag_target_id","git_tag_target_type","git_tag_name","git_tag_tagger","git_tag_message","git_tag_create","git_tag_annotation_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_delete","git_tag_list","git_tag_list_match","git_tag_foreach","git_tag_peel"],"meta":{},"lines":348},{"file":"trace.h","functions":["git_trace_callback","git_trace_set"],"meta":{},"lines":63},{"file":"transport.h","functions":["git_cred_has_username","git_cred_userpass_plaintext_new","git_cred_ssh_key_new","git_cred_ssh_interactive_new","git_cred_ssh_key_from_agent","git_cred_ssh_custom_new","git_cred_default_new","git_cred_username_new","git_cred_acquire_cb"],"meta":{},"lines":307},{"file":"tree.h","functions":["git_tree_lookup","git_tree_lookup_prefix","git_tree_free","git_tree_id","git_tree_owner","git_tree_entrycount","git_tree_entry_byname","git_tree_entry_byindex","git_tree_entry_byid","git_tree_entry_bypath","git_tree_entry_dup","git_tree_entry_free","git_tree_entry_name","git_tree_entry_id","git_tree_entry_type","git_tree_entry_filemode","git_tree_entry_filemode_raw","git_tree_entry_cmp","git_tree_entry_to_object","git_treebuilder_new","git_treebuilder_clear","git_treebuilder_entrycount","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_remove","git_treebuilder_filter_cb","git_treebuilder_filter","git_treebuilder_write","git_treewalk_cb","git_tree_walk"],"meta":{},"lines":410},{"file":"types.h","functions":["git_transfer_progress_cb","git_transport_message_cb","git_transport_certificate_check_cb"],"meta":{},"lines":413}],"functions":{"git_annotated_commit_from_ref":{"type":"function","file":"annotated_commit.h","line":33,"lineto":36,"args":[{"name":"out","type":"git_annotated_commit **","comment":"pointer to store the git_annotated_commit result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given reference"},{"name":"ref","type":"const git_reference *","comment":"reference to use to lookup the git_annotated_commit"}],"argline":"git_annotated_commit **out, git_repository *repo, const git_reference *ref","sig":"git_annotated_commit **::git_repository *::const git_reference *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Creates a git_annotated_commit from the given reference.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n","comments":"","group":"annotated"},"git_annotated_commit_from_fetchhead":{"type":"function","file":"annotated_commit.h","line":50,"lineto":55,"args":[{"name":"out","type":"git_annotated_commit **","comment":"pointer to store the git_annotated_commit result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given commit"},{"name":"branch_name","type":"const char *","comment":"name of the (remote) branch"},{"name":"remote_url","type":"const char *","comment":"url of the remote"},{"name":"id","type":"const git_oid *","comment":null}],"argline":"git_annotated_commit **out, git_repository *repo, const char *branch_name, const char *remote_url, const git_oid *id","sig":"git_annotated_commit **::git_repository *::const char *::const char *::const git_oid *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Creates a git_annotated_commit from the given fetch head data.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n","comments":"","group":"annotated"},"git_annotated_commit_lookup":{"type":"function","file":"annotated_commit.h","line":75,"lineto":78,"args":[{"name":"out","type":"git_annotated_commit **","comment":"pointer to store the git_annotated_commit result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given commit"},{"name":"id","type":"const git_oid *","comment":"the commit object id to lookup"}],"argline":"git_annotated_commit **out, git_repository *repo, const git_oid *id","sig":"git_annotated_commit **::git_repository *::const git_oid *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Creates a git_annotated_commit from the given commit id.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n","comments":"

An annotated commit contains information about how it was\n looked up, which may be useful for functions like merge or\n rebase to provide context to the operation. For example,\n conflict files will include the name of the source or target\n branches being merged. It is therefore preferable to use the\n most specific function (eg git_annotated_commit_from_ref)\n instead of this one when that data is known.

\n","group":"annotated"},"git_annotated_commit_id":{"type":"function","file":"annotated_commit.h","line":86,"lineto":87,"args":[{"name":"commit","type":"const git_annotated_commit *","comment":null}],"argline":"const git_annotated_commit *commit","sig":"const git_annotated_commit *","return":{"type":"const git_oid *","comment":" commit id"},"description":"

Gets the commit ID that the given git_annotated_commit refers to.

\n","comments":"","group":"annotated"},"git_annotated_commit_free":{"type":"function","file":"annotated_commit.h","line":94,"lineto":95,"args":[{"name":"commit","type":"git_annotated_commit *","comment":null}],"argline":"git_annotated_commit *commit","sig":"git_annotated_commit *","return":{"type":"void","comment":null},"description":"

Frees a git_annotated_commit.

\n","comments":"","group":"annotated"},"git_attr_value":{"type":"function","file":"attr.h","line":102,"lineto":102,"args":[{"name":"attr","type":"const char *","comment":"The attribute"}],"argline":"const char *attr","sig":"const char *","return":{"type":"git_attr_t","comment":" the value type for the attribute"},"description":"

Return the value type for a given attribute.

\n","comments":"

This can be either TRUE, FALSE, UNSPECIFIED (if the attribute\n was not set at all), or VALUE, if the attribute was set to an\n actual string.

\n\n

If the attribute has a VALUE string, it can be accessed normally\n as a NULL-terminated C string.

\n","group":"attr"},"git_attr_get":{"type":"function","file":"attr.h","line":145,"lineto":150,"args":[{"name":"value_out","type":"const char **","comment":"Output of the value of the attribute. Use the GIT_ATTR_...\n macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just\n use the string value for attributes set to a value. You\n should NOT modify or free this value."},{"name":"repo","type":"git_repository *","comment":"The repository containing the path."},{"name":"flags","type":"uint32_t","comment":"A combination of GIT_ATTR_CHECK... flags."},{"name":"path","type":"const char *","comment":"The path to check for attributes. Relative paths are\n interpreted relative to the repo root. The file does\n not have to exist, but if it does not, then it will be\n treated as a plain file (not a directory)."},{"name":"name","type":"const char *","comment":"The name of the attribute to look up."}],"argline":"const char **value_out, git_repository *repo, uint32_t flags, const char *path, const char *name","sig":"const char **::git_repository *::uint32_t::const char *::const char *","return":{"type":"int","comment":null},"description":"

Look up the value of one git attribute for path.

\n","comments":"","group":"attr"},"git_attr_get_many":{"type":"function","file":"attr.h","line":181,"lineto":187,"args":[{"name":"values_out","type":"const char **","comment":"An array of num_attr entries that will have string\n pointers written into it for the values of the attributes.\n You should not modify or free the values that are written\n into this array (although of course, you should free the\n array itself if you allocated it)."},{"name":"repo","type":"git_repository *","comment":"The repository containing the path."},{"name":"flags","type":"uint32_t","comment":"A combination of GIT_ATTR_CHECK... flags."},{"name":"path","type":"const char *","comment":"The path inside the repo to check attributes. This\n does not have to exist, but if it does not, then\n it will be treated as a plain file (i.e. not a directory)."},{"name":"num_attr","type":"size_t","comment":"The number of attributes being looked up"},{"name":"names","type":"const char **","comment":"An array of num_attr strings containing attribute names."}],"argline":"const char **values_out, git_repository *repo, uint32_t flags, const char *path, size_t num_attr, const char **names","sig":"const char **::git_repository *::uint32_t::const char *::size_t::const char **","return":{"type":"int","comment":null},"description":"

Look up a list of git attributes for path.

\n","comments":"

Use this if you have a known list of attributes that you want to\n look up in a single call. This is somewhat more efficient than\n calling git_attr_get() multiple times.

\n\n

For example, you might write:

\n\n
 const char *attrs[] = { "crlf", "diff", "foo" };\n const char **values[3];\n git_attr_get_many(values, repo, 0, "my/fun/file.c", 3, attrs);\n
\n\n

Then you could loop through the 3 values to get the settings for\n the three attributes you asked about.

\n","group":"attr"},"git_attr_foreach":{"type":"function","file":"attr.h","line":209,"lineto":214,"args":[{"name":"repo","type":"git_repository *","comment":"The repository containing the path."},{"name":"flags","type":"uint32_t","comment":"A combination of GIT_ATTR_CHECK... flags."},{"name":"path","type":"const char *","comment":"Path inside the repo to check attributes. This does not have\n to exist, but if it does not, then it will be treated as a\n plain file (i.e. not a directory)."},{"name":"callback","type":"git_attr_foreach_cb","comment":"Function to invoke on each attribute name and value. The\n value may be NULL is the attribute is explicitly set to\n UNSPECIFIED using the '!' sign. Callback will be invoked\n only once per attribute name, even if there are multiple\n rules for a given file. The highest priority rule will be\n used. Return a non-zero value from this to stop looping.\n The value will be returned from `git_attr_foreach`."},{"name":"payload","type":"void *","comment":"Passed on as extra parameter to callback function."}],"argline":"git_repository *repo, uint32_t flags, const char *path, git_attr_foreach_cb callback, void *payload","sig":"git_repository *::uint32_t::const char *::git_attr_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Loop over all the git attributes for a path.

\n","comments":"","group":"attr"},"git_attr_cache_flush":{"type":"function","file":"attr.h","line":224,"lineto":225,"args":[{"name":"repo","type":"git_repository *","comment":null}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"void","comment":null},"description":"

Flush the gitattributes cache.

\n","comments":"

Call this if you have reason to believe that the attributes files on\n disk no longer match the cached contents of memory. This will cause\n the attributes files to be reloaded the next time that an attribute\n access function is called.

\n","group":"attr"},"git_attr_add_macro":{"type":"function","file":"attr.h","line":237,"lineto":240,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"name","type":"const char *","comment":null},{"name":"values","type":"const char *","comment":null}],"argline":"git_repository *repo, const char *name, const char *values","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":null},"description":"

Add a macro definition.

\n","comments":"

Macros will automatically be loaded from the top level .gitattributes\n file of the repository (plus the build-in "binary" macro). This\n function allows you to add others. For example, to add the default\n macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n","group":"attr"},"git_blame_init_options":{"type":"function","file":"blame.h","line":92,"lineto":94,"args":[{"name":"opts","type":"git_blame_options *","comment":"The `git_blame_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_BLAME_OPTIONS_VERSION`"}],"argline":"git_blame_options *opts, unsigned int version","sig":"git_blame_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_blame_options with default values. Equivalent to\n creating an instance with GIT_BLAME_OPTIONS_INIT.

\n","comments":"","group":"blame"},"git_blame_get_hunk_count":{"type":"function","file":"blame.h","line":137,"lineto":137,"args":[{"name":"blame","type":"git_blame *","comment":null}],"argline":"git_blame *blame","sig":"git_blame *","return":{"type":"uint32_t","comment":null},"description":"

Gets the number of hunks that exist in the blame structure.

\n","comments":"","group":"blame"},"git_blame_get_hunk_byindex":{"type":"function","file":"blame.h","line":146,"lineto":148,"args":[{"name":"blame","type":"git_blame *","comment":"the blame structure to query"},{"name":"index","type":"uint32_t","comment":"index of the hunk to retrieve"}],"argline":"git_blame *blame, uint32_t index","sig":"git_blame *::uint32_t","return":{"type":"const git_blame_hunk *","comment":" the hunk at the given index, or NULL on error"},"description":"

Gets the blame hunk at the given index.

\n","comments":"","group":"blame"},"git_blame_get_hunk_byline":{"type":"function","file":"blame.h","line":157,"lineto":159,"args":[{"name":"blame","type":"git_blame *","comment":"the blame structure to query"},{"name":"lineno","type":"uint32_t","comment":"the (1-based) line number to find a hunk for"}],"argline":"git_blame *blame, uint32_t lineno","sig":"git_blame *::uint32_t","return":{"type":"const git_blame_hunk *","comment":" the hunk that contains the given line, or NULL on error"},"description":"

Gets the hunk that relates to the given line number in the newest commit.

\n","comments":"","group":"blame","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_blame_get_hunk_byline-1"]}},"git_blame_file":{"type":"function","file":"blame.h","line":172,"lineto":176,"args":[{"name":"out","type":"git_blame **","comment":"pointer that will receive the blame object"},{"name":"repo","type":"git_repository *","comment":"repository whose history is to be walked"},{"name":"path","type":"const char *","comment":"path to file to consider"},{"name":"options","type":"git_blame_options *","comment":"options for the blame operation. If NULL, this is treated as\n though GIT_BLAME_OPTIONS_INIT were passed."}],"argline":"git_blame **out, git_repository *repo, const char *path, git_blame_options *options","sig":"git_blame **::git_repository *::const char *::git_blame_options *","return":{"type":"int","comment":" 0 on success, or an error code. (use giterr_last for information\n about the error.)"},"description":"

Get the blame for a single file.

\n","comments":"","group":"blame","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_blame_file-2"]}},"git_blame_buffer":{"type":"function","file":"blame.h","line":196,"lineto":200,"args":[{"name":"out","type":"git_blame **","comment":"pointer that will receive the resulting blame data"},{"name":"reference","type":"git_blame *","comment":"cached blame from the history of the file (usually the output\n from git_blame_file)"},{"name":"buffer","type":"const char *","comment":"the (possibly) modified contents of the file"},{"name":"buffer_len","type":"size_t","comment":"number of valid bytes in the buffer"}],"argline":"git_blame **out, git_blame *reference, const char *buffer, size_t buffer_len","sig":"git_blame **::git_blame *::const char *::size_t","return":{"type":"int","comment":" 0 on success, or an error code. (use giterr_last for information\n about the error)"},"description":"

Get blame data for a file that has been modified in memory. The reference\n parameter is a pre-calculated blame for the in-odb history of the file. This\n means that once a file blame is completed (which can be expensive), updating\n the buffer blame is very fast.

\n","comments":"

Lines that differ between the buffer and the committed version are marked as\n having a zero OID for their final_commit_id.

\n","group":"blame"},"git_blame_free":{"type":"function","file":"blame.h","line":207,"lineto":207,"args":[{"name":"blame","type":"git_blame *","comment":"the blame structure to free"}],"argline":"git_blame *blame","sig":"git_blame *","return":{"type":"void","comment":null},"description":"

Free memory allocated by git_blame_file or git_blame_buffer.

\n","comments":"","group":"blame","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_blame_free-3"]}},"git_blob_lookup":{"type":"function","file":"blob.h","line":33,"lineto":33,"args":[{"name":"blob","type":"git_blob **","comment":"pointer to the looked up blob"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the blob."},{"name":"id","type":"const git_oid *","comment":"identity of the blob to locate."}],"argline":"git_blob **blob, git_repository *repo, const git_oid *id","sig":"git_blob **::git_repository *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a blob object from a repository.

\n","comments":"","group":"blob","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_blob_lookup-4"],"general.c":["ex/v0.22.0-rc1/general.html#git_blob_lookup-1"]}},"git_blob_lookup_prefix":{"type":"function","file":"blob.h","line":47,"lineto":47,"args":[{"name":"blob","type":"git_blob **","comment":"pointer to the looked up blob"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the blob."},{"name":"id","type":"const git_oid *","comment":"identity of the blob to locate."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_blob **blob, git_repository *repo, const git_oid *id, size_t len","sig":"git_blob **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a blob object from a repository,\n given a prefix of its identifier (short id).

\n","comments":"","group":"blob"},"git_blob_free":{"type":"function","file":"blob.h","line":60,"lineto":60,"args":[{"name":"blob","type":"git_blob *","comment":"the blob to close"}],"argline":"git_blob *blob","sig":"git_blob *","return":{"type":"void","comment":null},"description":"

Close an open blob

\n","comments":"

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a blob. Failure to do so will cause a memory leak.

\n","group":"blob","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_blob_free-5"]}},"git_blob_id":{"type":"function","file":"blob.h","line":68,"lineto":68,"args":[{"name":"blob","type":"const git_blob *","comment":"a previously loaded blob."}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"const git_oid *","comment":" SHA1 hash for this blob."},"description":"

Get the id of a blob.

\n","comments":"","group":"blob"},"git_blob_owner":{"type":"function","file":"blob.h","line":76,"lineto":76,"args":[{"name":"blob","type":"const git_blob *","comment":"A previously loaded blob."}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"git_repository *","comment":" Repository that contains this blob."},"description":"

Get the repository that contains the blob.

\n","comments":"","group":"blob"},"git_blob_rawcontent":{"type":"function","file":"blob.h","line":89,"lineto":89,"args":[{"name":"blob","type":"const git_blob *","comment":"pointer to the blob"}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"const void *","comment":" the pointer"},"description":"

Get a read-only buffer with the raw content of a blob.

\n","comments":"

A pointer to the raw content of a blob is returned;\n this pointer is owned internally by the object and shall\n not be free'd. The pointer may be invalidated at a later\n time.

\n","group":"blob","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_blob_rawcontent-6"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_blob_rawcontent-1"],"general.c":["ex/v0.22.0-rc1/general.html#git_blob_rawcontent-2"]}},"git_blob_rawsize":{"type":"function","file":"blob.h","line":97,"lineto":97,"args":[{"name":"blob","type":"const git_blob *","comment":"pointer to the blob"}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"git_off_t","comment":" size on bytes"},"description":"

Get the size in bytes of the contents of a blob

\n","comments":"","group":"blob","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_blob_rawsize-7"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_blob_rawsize-2"],"general.c":["ex/v0.22.0-rc1/general.html#git_blob_rawsize-3","ex/v0.22.0-rc1/general.html#git_blob_rawsize-4"]}},"git_blob_filtered_content":{"type":"function","file":"blob.h","line":124,"lineto":128,"args":[{"name":"out","type":"git_buf *","comment":"The git_buf to be filled in"},{"name":"blob","type":"git_blob *","comment":"Pointer to the blob"},{"name":"as_path","type":"const char *","comment":"Path used for file attribute lookups, etc."},{"name":"check_for_binary_data","type":"int","comment":"Should this test if blob content contains\n NUL bytes / looks like binary data before applying filters?"}],"argline":"git_buf *out, git_blob *blob, const char *as_path, int check_for_binary_data","sig":"git_buf *::git_blob *::const char *::int","return":{"type":"int","comment":" 0 on success or an error code"},"description":"

Get a buffer with the filtered content of a blob.

\n","comments":"

This applies filters as if the blob was being checked out to the\n working directory under the specified filename. This may apply\n CRLF filtering or other types of changes depending on the file\n attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free\n when done (via git_buf_free).

\n\n

If no filters need to be applied, then the out buffer will just be\n populated with a pointer to the raw content of the blob. In that case,\n be careful to not free the blob until done with the buffer. To keep\n the data detached from the blob, call git_buf_grow on the buffer\n with a want_size of 0 and the buffer will be reallocated to be\n detached from the blob.

\n","group":"blob"},"git_blob_create_fromworkdir":{"type":"function","file":"blob.h","line":141,"lineto":141,"args":[{"name":"id","type":"git_oid *","comment":"return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where the blob will be written.\n\tthis repository cannot be bare"},{"name":"relative_path","type":"const char *","comment":"file from which the blob will be created,\n\trelative to the repository's working dir"}],"argline":"git_oid *id, git_repository *repo, const char *relative_path","sig":"git_oid *::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read a file from the working folder of a repository\n and write it to the Object Database as a loose blob

\n","comments":"","group":"blob"},"git_blob_create_fromdisk":{"type":"function","file":"blob.h","line":153,"lineto":153,"args":[{"name":"id","type":"git_oid *","comment":"return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where the blob will be written.\n\tthis repository can be bare or not"},{"name":"path","type":"const char *","comment":"file from which the blob will be created"}],"argline":"git_oid *id, git_repository *repo, const char *path","sig":"git_oid *::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read a file from the filesystem and write its content\n to the Object Database as a loose blob

\n","comments":"","group":"blob"},"git_blob_create_fromchunks":{"type":"function","file":"blob.h","line":189,"lineto":194,"args":[{"name":"id","type":"git_oid *","comment":"Return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"Repository where the blob will be written.\n This repository can be bare or not."},{"name":"hintpath","type":"const char *","comment":"If not NULL, will be used to select data filters\n to apply onto the content of the blob to be created."},{"name":"callback","type":"git_blob_chunk_cb","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *hintpath, git_blob_chunk_cb callback, void *payload","sig":"git_oid *::git_repository *::const char *::git_blob_chunk_cb::void *","return":{"type":"int","comment":" 0 or error code (from either libgit2 or callback function)"},"description":"

Write a loose blob to the Object Database from a\n provider of chunks of data.

\n","comments":"

If the hintpath parameter is filled, it will be used to determine\n what git filters should be applied to the object before it is written\n to the object database.

\n\n

The implementation of the callback MUST respect the following rules:

\n\n
    \n
  • content must be filled by the callback. The maximum number of\nbytes that the buffer can accept per call is defined by the\nmax_length parameter. Allocation and freeing of the buffer will\nbe taken care of by libgit2.

  • \n
  • The callback must return the number of bytes that have been\nwritten to the content buffer.

  • \n
  • When there is no more data to stream, callback should return

    \n\n
      \n
    1. This will prevent it from being invoked anymore.
    2. \n
  • \n
  • If an error occurs, the callback should return a negative value.\nThis value will be returned to the caller.

  • \n
\n","group":"blob"},"git_blob_create_frombuffer":{"type":"function","file":"blob.h","line":205,"lineto":206,"args":[{"name":"id","type":"git_oid *","comment":"return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where to blob will be written"},{"name":"buffer","type":"const void *","comment":"data to be written into the blob"},{"name":"len","type":"size_t","comment":"length of the data"}],"argline":"git_oid *id, git_repository *repo, const void *buffer, size_t len","sig":"git_oid *::git_repository *::const void *::size_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write an in-memory buffer to the ODB as a blob

\n","comments":"","group":"blob"},"git_blob_is_binary":{"type":"function","file":"blob.h","line":219,"lineto":219,"args":[{"name":"blob","type":"const git_blob *","comment":"The blob which content should be analyzed"}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"int","comment":" 1 if the content of the blob is detected\n as binary; 0 otherwise."},"description":"

Determine if the blob content is most certainly binary or not.

\n","comments":"

The heuristic used to guess if a file is binary is taken from core git:\n Searching for NUL bytes and looking for a reasonable ratio of printable\n to non-printable characters among the first 8000 bytes.

\n","group":"blob"},"git_branch_create":{"type":"function","file":"branch.h","line":56,"lineto":63,"args":[{"name":"out","type":"git_reference **","comment":"Pointer where to store the underlying reference."},{"name":"repo","type":"git_repository *","comment":null},{"name":"branch_name","type":"const char *","comment":"Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name."},{"name":"target","type":"const git_commit *","comment":"Commit to which this branch should point. This object\n must belong to the given `repo`."},{"name":"force","type":"int","comment":"Overwrite existing branch."},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog.\n If NULL, the default is \"Branch: created\"; if you want something more\n useful, provide a message."}],"argline":"git_reference **out, git_repository *repo, const char *branch_name, const git_commit *target, int force, const git_signature *signature, const char *log_message","sig":"git_reference **::git_repository *::const char *::const git_commit *::int::const git_signature *::const char *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC or an error code.\n A proper reference is written in the refs/heads namespace\n pointing to the provided target commit."},"description":"

Create a new branch pointing at a target commit

\n","comments":"

A new direct reference will be created pointing to\n this target commit. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The returned reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"branch"},"git_branch_delete":{"type":"function","file":"branch.h","line":75,"lineto":75,"args":[{"name":"branch","type":"git_reference *","comment":"A valid reference representing a branch"}],"argline":"git_reference *branch","sig":"git_reference *","return":{"type":"int","comment":" 0 on success, or an error code."},"description":"

Delete an existing branch reference.

\n","comments":"

If the branch is successfully deleted, the passed reference\n object will be invalidated. The reference must be freed manually\n by the user.

\n","group":"branch"},"git_branch_iterator_new":{"type":"function","file":"branch.h","line":91,"lineto":94,"args":[{"name":"out","type":"git_branch_iterator **","comment":"the iterator"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the branches."},{"name":"list_flags","type":"git_branch_t","comment":"Filtering flags for the branch\n listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE\n or GIT_BRANCH_ALL."}],"argline":"git_branch_iterator **out, git_repository *repo, git_branch_t list_flags","sig":"git_branch_iterator **::git_repository *::git_branch_t","return":{"type":"int","comment":" 0 on success or an error code"},"description":"

Create an iterator which loops over the requested branches.

\n","comments":"","group":"branch"},"git_branch_next":{"type":"function","file":"branch.h","line":104,"lineto":104,"args":[{"name":"out","type":"git_reference **","comment":"the reference"},{"name":"out_type","type":"git_branch_t *","comment":"the type of branch (local or remote-tracking)"},{"name":"iter","type":"git_branch_iterator *","comment":"the branch iterator"}],"argline":"git_reference **out, git_branch_t *out_type, git_branch_iterator *iter","sig":"git_reference **::git_branch_t *::git_branch_iterator *","return":{"type":"int","comment":" 0 on success, GIT_ITEROVER if there are no more branches or an error code."},"description":"

Retrieve the next branch from the iterator

\n","comments":"","group":"branch"},"git_branch_iterator_free":{"type":"function","file":"branch.h","line":111,"lineto":111,"args":[{"name":"iter","type":"git_branch_iterator *","comment":"the iterator to free"}],"argline":"git_branch_iterator *iter","sig":"git_branch_iterator *","return":{"type":"void","comment":null},"description":"

Free a branch iterator

\n","comments":"","group":"branch"},"git_branch_move":{"type":"function","file":"branch.h","line":132,"lineto":138,"args":[{"name":"out","type":"git_reference **","comment":null},{"name":"branch","type":"git_reference *","comment":"Current underlying reference of the branch."},{"name":"new_branch_name","type":"const char *","comment":"Target name of the branch once the move\n is performed; this name is validated for consistency."},{"name":"force","type":"int","comment":"Overwrite existing branch."},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_reference *branch, const char *new_branch_name, int force, const git_signature *signature, const char *log_message","sig":"git_reference **::git_reference *::const char *::int::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code."},"description":"

Move/rename an existing local branch reference.

\n","comments":"

The new branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"branch"},"git_branch_lookup":{"type":"function","file":"branch.h","line":161,"lineto":165,"args":[{"name":"out","type":"git_reference **","comment":"pointer to the looked-up branch reference"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the branch"},{"name":"branch_name","type":"const char *","comment":"Name of the branch to be looked-up;\n this name is validated for consistency."},{"name":"branch_type","type":"git_branch_t","comment":"Type of the considered branch. This should\n be valued with either GIT_BRANCH_LOCAL or GIT_BRANCH_REMOTE."}],"argline":"git_reference **out, git_repository *repo, const char *branch_name, git_branch_t branch_type","sig":"git_reference **::git_repository *::const char *::git_branch_t","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND when no matching branch\n exists, GIT_EINVALIDSPEC, otherwise an error code."},"description":"

Lookup a branch by its name in a repository.

\n","comments":"

The generated reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"branch"},"git_branch_name":{"type":"function","file":"branch.h","line":182,"lineto":184,"args":[{"name":"out","type":"const char **","comment":"where the pointer of branch name is stored;\n this is valid as long as the ref is not freed."},{"name":"ref","type":"const git_reference *","comment":"the reference ideally pointing to a branch"}],"argline":"const char **out, const git_reference *ref","sig":"const char **::const git_reference *","return":{"type":"int","comment":" 0 on success; otherwise an error code (e.g., if the\n ref is no local or remote branch)."},"description":"

Return the name of the given local or remote branch.

\n","comments":"

The name of the branch matches the definition of the name\n for git_branch_lookup. That is, if the returned name is given\n to git_branch_lookup() then the reference is returned that\n was given to this function.

\n","group":"branch"},"git_branch_upstream":{"type":"function","file":"branch.h","line":198,"lineto":200,"args":[{"name":"out","type":"git_reference **","comment":"Pointer where to store the retrieved\n reference."},{"name":"branch","type":"const git_reference *","comment":"Current underlying reference of the branch."}],"argline":"git_reference **out, const git_reference *branch","sig":"git_reference **::const git_reference *","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND when no remote tracking\n reference exists, otherwise an error code."},"description":"

Return the reference supporting the remote tracking branch,\n given a local branch reference.

\n","comments":"","group":"branch"},"git_branch_set_upstream":{"type":"function","file":"branch.h","line":212,"lineto":212,"args":[{"name":"branch","type":"git_reference *","comment":"the branch to configure"},{"name":"upstream_name","type":"const char *","comment":"remote-tracking or local branch to set as\n upstream. Pass NULL to unset."}],"argline":"git_reference *branch, const char *upstream_name","sig":"git_reference *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the upstream configuration for a given local branch

\n","comments":"","group":"branch"},"git_branch_is_head":{"type":"function","file":"branch.h","line":241,"lineto":242,"args":[{"name":"branch","type":"const git_reference *","comment":"Current underlying reference of the branch."}],"argline":"const git_reference *branch","sig":"const git_reference *","return":{"type":"int","comment":" 1 if HEAD points at the branch, 0 if it isn't,\n error code otherwise."},"description":"

Determine if the current local branch is pointed at by HEAD.

\n","comments":"","group":"branch"},"git_buf_free":{"type":"function","file":"buffer.h","line":72,"lineto":72,"args":[{"name":"buffer","type":"git_buf *","comment":"The buffer to deallocate"}],"argline":"git_buf *buffer","sig":"git_buf *","return":{"type":"void","comment":null},"description":"

Free the memory referred to by the git_buf.

\n","comments":"

Note that this does not free the git_buf itself, just the memory\n pointed to by buffer->ptr. This will not free the memory if it looks\n like it was not allocated internally, but it will clear the buffer back\n to the empty state.

\n","group":"buf","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_buf_free-1"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_buf_free-1"]}},"git_buf_grow":{"type":"function","file":"buffer.h","line":95,"lineto":95,"args":[{"name":"buffer","type":"git_buf *","comment":"The buffer to be resized; may or may not be allocated yet"},{"name":"target_size","type":"size_t","comment":"The desired available size"}],"argline":"git_buf *buffer, size_t target_size","sig":"git_buf *::size_t","return":{"type":"int","comment":" 0 on success, -1 on allocation failure"},"description":"

Resize the buffer allocation to make more space.

\n","comments":"

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e.\n the asize field is zero), then ptr will be replaced with a newly\n allocated block of data. Be careful so that memory allocated by the\n caller is not lost. As a special variant, if you pass target_size as\n 0 and the memory is not allocated by libgit2, this will allocate a new\n buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be\n marked as invalid for future operations, invaliding the contents.

\n","group":"buf"},"git_buf_set":{"type":"function","file":"buffer.h","line":105,"lineto":106,"args":[{"name":"buffer","type":"git_buf *","comment":"The buffer to set"},{"name":"data","type":"const void *","comment":"The data to copy into the buffer"},{"name":"datalen","type":"size_t","comment":"The length of the data to copy into the buffer"}],"argline":"git_buf *buffer, const void *data, size_t datalen","sig":"git_buf *::const void *::size_t","return":{"type":"int","comment":" 0 on success, -1 on allocation failure"},"description":"

Set buffer to a copy of some raw data.

\n","comments":"","group":"buf"},"git_buf_is_binary":{"type":"function","file":"buffer.h","line":114,"lineto":114,"args":[{"name":"buf","type":"const git_buf *","comment":"Buffer to check"}],"argline":"const git_buf *buf","sig":"const git_buf *","return":{"type":"int","comment":" 1 if buffer looks like non-text data"},"description":"

Check quickly if buffer looks like it contains binary data

\n","comments":"","group":"buf"},"git_buf_contains_nul":{"type":"function","file":"buffer.h","line":122,"lineto":122,"args":[{"name":"buf","type":"const git_buf *","comment":"Buffer to check"}],"argline":"const git_buf *buf","sig":"const git_buf *","return":{"type":"int","comment":" 1 if buffer contains a NUL byte"},"description":"

Check quickly if buffer contains a NUL byte

\n","comments":"","group":"buf"},"git_checkout_init_options":{"type":"function","file":"checkout.h","line":277,"lineto":279,"args":[{"name":"opts","type":"git_checkout_options *","comment":"the `git_checkout_options` struct to initialize."},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CHECKOUT_OPTIONS_VERSION`"}],"argline":"git_checkout_options *opts, unsigned int version","sig":"git_checkout_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_checkout_options with default values. Equivalent to\n creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n","comments":"","group":"checkout"},"git_checkout_head":{"type":"function","file":"checkout.h","line":291,"lineto":293,"args":[{"name":"repo","type":"git_repository *","comment":"repository to check out (must be non-bare)"},{"name":"opts","type":"const git_checkout_options *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo, const git_checkout_options *opts","sig":"git_repository *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use giterr_last for error details)"},"description":"

Updates files in the index and the working tree to match the content of\n the commit pointed at by HEAD.

\n","comments":"","group":"checkout"},"git_checkout_index":{"type":"function","file":"checkout.h","line":304,"lineto":307,"args":[{"name":"repo","type":"git_repository *","comment":"repository into which to check out (must be non-bare)"},{"name":"index","type":"git_index *","comment":"index to be checked out (or NULL to use repository index)"},{"name":"opts","type":"const git_checkout_options *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo, git_index *index, const git_checkout_options *opts","sig":"git_repository *::git_index *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)"},"description":"

Updates files in the working tree to match the content of the index.

\n","comments":"","group":"checkout"},"git_checkout_tree":{"type":"function","file":"checkout.h","line":320,"lineto":323,"args":[{"name":"repo","type":"git_repository *","comment":"repository to check out (must be non-bare)"},{"name":"treeish","type":"const git_object *","comment":"a commit, tag or tree which content will be used to update\n the working directory (or NULL to use HEAD)"},{"name":"opts","type":"const git_checkout_options *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo, const git_object *treeish, const git_checkout_options *opts","sig":"git_repository *::const git_object *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)"},"description":"

Updates files in the index and working tree to match the content of the\n tree pointed at by the treeish.

\n","comments":"","group":"checkout"},"git_cherrypick_init_options":{"type":"function","file":"cherrypick.h","line":47,"lineto":49,"args":[{"name":"opts","type":"git_cherrypick_options *","comment":"the `git_cherrypick_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CHERRYPICK_OPTIONS_VERSION`"}],"argline":"git_cherrypick_options *opts, unsigned int version","sig":"git_cherrypick_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_cherrypick_options with default values. Equivalent to\n creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n","comments":"","group":"cherrypick"},"git_cherrypick_commit":{"type":"function","file":"cherrypick.h","line":65,"lineto":71,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"the repository that contains the given commits"},{"name":"cherrypick_commit","type":"git_commit *","comment":"the commit to cherry-pick"},{"name":"our_commit","type":"git_commit *","comment":"the commit to revert against (eg, HEAD)"},{"name":"mainline","type":"unsigned int","comment":"the parent of the revert commit, if it is a merge"},{"name":"merge_options","type":"const git_merge_options *","comment":"the merge options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, git_commit *cherrypick_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options","sig":"git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Cherry-picks the given commit against the given "our" commit, producing an\n index that reflects the result of the cherry-pick.

\n","comments":"

The returned index must be freed explicitly with git_index_free.

\n","group":"cherrypick"},"git_cherrypick":{"type":"function","file":"cherrypick.h","line":81,"lineto":84,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to cherry-pick"},{"name":"commit","type":"git_commit *","comment":"the commit to cherry-pick"},{"name":"cherrypick_options","type":"const git_cherrypick_options *","comment":"the cherry-pick options (or null for defaults)"}],"argline":"git_repository *repo, git_commit *commit, const git_cherrypick_options *cherrypick_options","sig":"git_repository *::git_commit *::const git_cherrypick_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Cherry-pick the given commit, producing changes in the index and working directory.

\n","comments":"","group":"cherrypick"},"git_clone_init_options":{"type":"function","file":"clone.h","line":186,"lineto":188,"args":[{"name":"opts","type":"git_clone_options *","comment":"The `git_clone_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CLONE_OPTIONS_VERSION`"}],"argline":"git_clone_options *opts, unsigned int version","sig":"git_clone_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_clone_options with default values. Equivalent to\n creating an instance with GIT_CLONE_OPTIONS_INIT.

\n","comments":"","group":"clone"},"git_clone":{"type":"function","file":"clone.h","line":206,"lineto":210,"args":[{"name":"out","type":"git_repository **","comment":"pointer that will receive the resulting repository object"},{"name":"url","type":"const char *","comment":"the remote repository to clone"},{"name":"local_path","type":"const char *","comment":"local directory to clone to"},{"name":"options","type":"const git_clone_options *","comment":"configuration options for the clone. If NULL, the\n function works as though GIT_OPTIONS_INIT were passed."}],"argline":"git_repository **out, const char *url, const char *local_path, const git_clone_options *options","sig":"git_repository **::const char *::const char *::const git_clone_options *","return":{"type":"int","comment":" 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)"},"description":"

Clone a remote repository.

\n","comments":"

By default this creates its repository and initial remote to match\n git's defaults. You can use the options in the callback to\n customize how these are created.

\n","group":"clone","examples":{"network/clone.c":["ex/v0.22.0-rc1/network/clone.html#git_clone-1"]}},"git_commit_lookup":{"type":"function","file":"commit.h","line":36,"lineto":37,"args":[{"name":"commit","type":"git_commit **","comment":"pointer to the looked up commit"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the commit."},{"name":"id","type":"const git_oid *","comment":"identity of the commit to locate. If the object is\n\t\tan annotated tag it will be peeled back to the commit."}],"argline":"git_commit **commit, git_repository *repo, const git_oid *id","sig":"git_commit **::git_repository *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a commit object from a repository.

\n","comments":"

The returned object should be released with git_commit_free when no\n longer needed.

\n","group":"commit","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_commit_lookup-5","ex/v0.22.0-rc1/general.html#git_commit_lookup-6","ex/v0.22.0-rc1/general.html#git_commit_lookup-7"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_lookup-1"]}},"git_commit_lookup_prefix":{"type":"function","file":"commit.h","line":55,"lineto":56,"args":[{"name":"commit","type":"git_commit **","comment":"pointer to the looked up commit"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the commit."},{"name":"id","type":"const git_oid *","comment":"identity of the commit to locate. If the object is\n\t\tan annotated tag it will be peeled back to the commit."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_commit **commit, git_repository *repo, const git_oid *id, size_t len","sig":"git_commit **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a commit object from a repository, given a prefix of its\n identifier (short id).

\n","comments":"

The returned object should be released with git_commit_free when no\n longer needed.

\n","group":"commit"},"git_commit_free":{"type":"function","file":"commit.h","line":70,"lineto":70,"args":[{"name":"commit","type":"git_commit *","comment":"the commit to close"}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"void","comment":null},"description":"

Close an open commit

\n","comments":"

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a commit. Failure to do so will cause a memory leak.

\n","group":"commit","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_commit_free-8","ex/v0.22.0-rc1/general.html#git_commit_free-9","ex/v0.22.0-rc1/general.html#git_commit_free-10","ex/v0.22.0-rc1/general.html#git_commit_free-11"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_free-2","ex/v0.22.0-rc1/log.html#git_commit_free-3","ex/v0.22.0-rc1/log.html#git_commit_free-4","ex/v0.22.0-rc1/log.html#git_commit_free-5"]}},"git_commit_id":{"type":"function","file":"commit.h","line":78,"lineto":78,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const git_oid *","comment":" object identity for the commit."},"description":"

Get the id of a commit.

\n","comments":"","group":"commit","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_commit_id-12"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_id-6"]}},"git_commit_owner":{"type":"function","file":"commit.h","line":86,"lineto":86,"args":[{"name":"commit","type":"const git_commit *","comment":"A previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"git_repository *","comment":" Repository that contains this commit."},"description":"

Get the repository that contains the commit.

\n","comments":"","group":"commit","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_commit_owner-7","ex/v0.22.0-rc1/log.html#git_commit_owner-8"]}},"git_commit_message_encoding":{"type":"function","file":"commit.h","line":98,"lineto":98,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" NULL, or the encoding"},"description":"

Get the encoding for the message of a commit,\n as a string representing a standard encoding name.

\n","comments":"

The encoding may be NULL if the encoding header\n in the commit is missing; in that case UTF-8 is assumed.

\n","group":"commit"},"git_commit_message":{"type":"function","file":"commit.h","line":109,"lineto":109,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" the message of a commit"},"description":"

Get the full message of a commit.

\n","comments":"

The returned message will be slightly prettified by removing any\n potential leading newlines.

\n","group":"commit","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_commit_message-3","ex/v0.22.0-rc1/cat-file.html#git_commit_message-4"],"general.c":["ex/v0.22.0-rc1/general.html#git_commit_message-13","ex/v0.22.0-rc1/general.html#git_commit_message-14","ex/v0.22.0-rc1/general.html#git_commit_message-15"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_message-9","ex/v0.22.0-rc1/log.html#git_commit_message-10"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_commit_message-2"]}},"git_commit_message_raw":{"type":"function","file":"commit.h","line":117,"lineto":117,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" the raw message of a commit"},"description":"

Get the full raw message of a commit.

\n","comments":"","group":"commit"},"git_commit_summary":{"type":"function","file":"commit.h","line":128,"lineto":128,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const char *","comment":" the summary of a commit or NULL on error"},"description":"

Get the short "summary" of the git commit message.

\n","comments":"

The returned message is the summary of the commit, comprising the\n first paragraph of the message with whitespace trimmed and squashed.

\n","group":"commit"},"git_commit_time":{"type":"function","file":"commit.h","line":136,"lineto":136,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"git_time_t","comment":" the time of a commit"},"description":"

Get the commit time (i.e. committer time) of a commit.

\n","comments":"","group":"commit","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_commit_time-16","ex/v0.22.0-rc1/general.html#git_commit_time-17"]}},"git_commit_time_offset":{"type":"function","file":"commit.h","line":144,"lineto":144,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"int","comment":" positive or negative timezone offset, in minutes from UTC"},"description":"

Get the commit timezone offset (i.e. committer's preferred timezone) of a commit.

\n","comments":"","group":"commit"},"git_commit_committer":{"type":"function","file":"commit.h","line":152,"lineto":152,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const git_signature *","comment":" the committer of a commit"},"description":"

Get the committer of a commit.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_commit_committer-5"],"general.c":["ex/v0.22.0-rc1/general.html#git_commit_committer-18"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_committer-11"]}},"git_commit_author":{"type":"function","file":"commit.h","line":160,"lineto":160,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const git_signature *","comment":" the author of a commit"},"description":"

Get the author of a commit.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_commit_author-6"],"general.c":["ex/v0.22.0-rc1/general.html#git_commit_author-19","ex/v0.22.0-rc1/general.html#git_commit_author-20"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_author-12","ex/v0.22.0-rc1/log.html#git_commit_author-13"]}},"git_commit_raw_header":{"type":"function","file":"commit.h","line":168,"lineto":168,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit"}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" the header text of the commit"},"description":"

Get the full raw text of the commit header.

\n","comments":"","group":"commit"},"git_commit_tree":{"type":"function","file":"commit.h","line":177,"lineto":177,"args":[{"name":"tree_out","type":"git_tree **","comment":"pointer where to store the tree object"},{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"git_tree **tree_out, const git_commit *commit","sig":"git_tree **::const git_commit *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the tree pointed to by a commit.

\n","comments":"","group":"commit","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_commit_tree-14","ex/v0.22.0-rc1/log.html#git_commit_tree-15","ex/v0.22.0-rc1/log.html#git_commit_tree-16","ex/v0.22.0-rc1/log.html#git_commit_tree-17","ex/v0.22.0-rc1/log.html#git_commit_tree-18"]}},"git_commit_tree_id":{"type":"function","file":"commit.h","line":187,"lineto":187,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const git_oid *","comment":" the id of tree pointed to by commit."},"description":"

Get the id of the tree pointed to by a commit. This differs from\n git_commit_tree in that no attempts are made to fetch an object\n from the ODB.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_commit_tree_id-7"]}},"git_commit_parentcount":{"type":"function","file":"commit.h","line":195,"lineto":195,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"unsigned int","comment":" integer of count of parents"},"description":"

Get the number of parents of this commit

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_commit_parentcount-8"],"general.c":["ex/v0.22.0-rc1/general.html#git_commit_parentcount-21"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_parentcount-19","ex/v0.22.0-rc1/log.html#git_commit_parentcount-20"]}},"git_commit_parent":{"type":"function","file":"commit.h","line":205,"lineto":208,"args":[{"name":"out","type":"git_commit **","comment":"Pointer where to store the parent commit"},{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."},{"name":"n","type":"unsigned int","comment":"the position of the parent (from 0 to `parentcount`)"}],"argline":"git_commit **out, const git_commit *commit, unsigned int n","sig":"git_commit **::const git_commit *::unsigned int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the specified parent of the commit.

\n","comments":"","group":"commit","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_commit_parent-22"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_parent-21","ex/v0.22.0-rc1/log.html#git_commit_parent-22"]}},"git_commit_parent_id":{"type":"function","file":"commit.h","line":219,"lineto":221,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."},{"name":"n","type":"unsigned int","comment":"the position of the parent (from 0 to `parentcount`)"}],"argline":"const git_commit *commit, unsigned int n","sig":"const git_commit *::unsigned int","return":{"type":"const git_oid *","comment":" the id of the parent, NULL on error."},"description":"

Get the oid of a specified parent for a commit. This is different from\n git_commit_parent, which will attempt to load the parent commit from\n the ODB.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_commit_parent_id-9"],"log.c":["ex/v0.22.0-rc1/log.html#git_commit_parent_id-23"]}},"git_commit_nth_gen_ancestor":{"type":"function","file":"commit.h","line":237,"lineto":240,"args":[{"name":"ancestor","type":"git_commit **","comment":"Pointer where to store the ancestor commit"},{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."},{"name":"n","type":"unsigned int","comment":"the requested generation"}],"argline":"git_commit **ancestor, const git_commit *commit, unsigned int n","sig":"git_commit **::const git_commit *::unsigned int","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND if no matching ancestor exists\n or an error code"},"description":"

Get the commit object that is the \n<n

\n\n
\n

th generation ancestor\n of the named commit object, following only the first parents.\n The returned commit has to be freed by the caller.

\n
\n","comments":"

Passing 0 as the generation number returns another instance of the\n base commit itself.

\n","group":"commit"},"git_commit_create":{"type":"function","file":"commit.h","line":286,"lineto":296,"args":[{"name":"id","type":"git_oid *","comment":"Pointer in which to store the OID of the newly created commit"},{"name":"repo","type":"git_repository *","comment":"Repository where to store the commit"},{"name":"update_ref","type":"const char *","comment":"If not NULL, name of the reference that\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch."},{"name":"author","type":"const git_signature *","comment":"Signature with author and author time of commit"},{"name":"committer","type":"const git_signature *","comment":"Signature with committer and * commit time of commit"},{"name":"message_encoding","type":"const char *","comment":"The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed."},{"name":"message","type":"const char *","comment":"Full message for this commit"},{"name":"tree","type":"const git_tree *","comment":"An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`."},{"name":"parent_count","type":"size_t","comment":"Number of parents for this commit"},{"name":"parents","type":"const git_commit *[]","comment":"Array of `parent_count` pointers to `git_commit`\n objects that will be used as the parents for this commit. This\n array may be NULL if `parent_count` is 0 (root commit). All the\n given commits must be owned by the `repo`."}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]","return":{"type":"int","comment":" 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it"},"description":"

Create new commit in the repository from a list of git_object pointers

\n","comments":"

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n","group":"commit"},"git_commit_create_v":{"type":"function","file":"commit.h","line":312,"lineto":322,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_tree *","comment":null},{"name":"parent_count","type":"size_t","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t","return":{"type":"int","comment":null},"description":"

Create new commit in the repository using a variable argument list.

\n","comments":"

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n\n

The parents for the commit are specified as a variable list of pointers\n to const git_commit *. Note that this is a convenience method which may\n not be safe to export for certain languages or compilers

\n\n

All other parameters remain the same as git_commit_create().

\n","group":"commit","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_commit_create_v-23"],"init.c":["ex/v0.22.0-rc1/init.html#git_commit_create_v-1"]}},"git_commit_amend":{"type":"function","file":"commit.h","line":345,"lineto":353,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"commit_to_amend","type":"const git_commit *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_tree *","comment":null}],"argline":"git_oid *id, const git_commit *commit_to_amend, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree","sig":"git_oid *::const git_commit *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *","return":{"type":"int","comment":null},"description":"

Amend an existing commit by replacing only non-NULL values.

\n","comments":"

This creates a new commit that is exactly the same as the old commit,\n except that any non-NULL values will be updated. The new commit has\n the same parents as the old commit.

\n\n

The update_ref value works as in the regular git_commit_create(),\n updating the ref to point to the newly rewritten commit. If you want\n to amend a commit that is not currently the tip of the branch and then\n rewrite the following commits to reach a ref, pass this as NULL and\n update the rest of the commit chain and ref separately.

\n\n

Unlike git_commit_create(), the author, committer, message,\n message_encoding, and tree parameters can be NULL in which case this\n will use the values from the original commit_to_amend.

\n\n

All parameters have the same meanings as in git_commit_create().

\n","group":"commit"},"git_libgit2_version":{"type":"function","file":"common.h","line":94,"lineto":94,"args":[{"name":"major","type":"int *","comment":"Store the major version number"},{"name":"minor","type":"int *","comment":"Store the minor version number"},{"name":"rev","type":"int *","comment":"Store the revision (patch) number"}],"argline":"int *major, int *minor, int *rev","sig":"int *::int *::int *","return":{"type":"void","comment":null},"description":"

Return the version of the libgit2 library\n being currently used.

\n","comments":"","group":"libgit2"},"git_libgit2_features":{"type":"function","file":"common.h","line":124,"lineto":124,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" A combination of GIT_FEATURE_* values."},"description":"

Query compile time options for libgit2.

\n","comments":"
    \n
  • GIT_FEATURE_THREADS\nLibgit2 was compiled with thread support. Note that thread support is\nstill to be seen as a 'work in progress' - basic object lookups are\nbelieved to be threadsafe, but other operations may not be.

  • \n
  • GIT_FEATURE_HTTPS\nLibgit2 supports the https:// protocol. This requires the openssl\nlibrary to be found when compiling libgit2.

  • \n
  • GIT_FEATURE_SSH\nLibgit2 supports the SSH protocol for network operations. This requires\nthe libssh2 library to be found when compiling libgit2

  • \n
\n","group":"libgit2"},"git_libgit2_opts":{"type":"function","file":"common.h","line":245,"lineto":245,"args":[{"name":"option","type":"int","comment":"Option key"}],"argline":"int option","sig":"int","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Set or query a library global option

\n","comments":"

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time\n    by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must\n    > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`, or\n    > `GIT_CONFIG_LEVEL_XDG`.  The search path is written to the `out`\n    > buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path\n    > applied to shared attributes and ignore files, too.\n    >\n    > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.\n    >   Pass NULL to reset to the default (generally based on environment\n    >   variables).  Use magic path `$PATH` to include the old value\n    >   of the path (if you want to prepend or append, for instance).\n    >\n    > - `level` must be GIT_CONFIG_LEVEL_SYSTEM, GIT_CONFIG_LEVEL_GLOBAL,\n    >   or GIT_CONFIG_LEVEL_XDG.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be\n    > considered eligible for caching in memory.  Setting to value to\n    > zero means that that type of object will not be cached.\n    > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k\n    > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory\n    > across all repositories before libgit2 starts evicting objects\n    > from the cache.  This is a soft limit, in that the library might\n    > briefly exceed it, but will start aggressively evicting objects\n    > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.\n    >\n    > Because caches are repository-specific, disabling the cache\n    > cannot immediately clear all cached objects, but each cache will\n    > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be\n    > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.\n    > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.\n    >\n    > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.\n    >\n    > - `file` is the location of a file containing several\n    >   certificates concatenated together.\n    > - `path` is the location of a directory holding several\n    >   certificates, one per file.\n    >\n    > Either parameter may be `NULL`, but not both.\n
\n","group":"libgit2"},"git_config_find_global":{"type":"function","file":"config.h","line":106,"lineto":106,"args":[{"name":"out","type":"git_buf *","comment":"Pointer to a user-allocated git_buf in which to store the path"}],"argline":"git_buf *out","sig":"git_buf *","return":{"type":"int","comment":" 0 if a global configuration file has been found. Its path will be stored in `out`."},"description":"

Locate the path to the global configuration file

\n","comments":"

The user or global configuration file is usually\n located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n global configuration file.

\n\n

This method will not guess the path to the xdg compatible\n config file (.config/git/config).

\n","group":"config"},"git_config_find_xdg":{"type":"function","file":"config.h","line":123,"lineto":123,"args":[{"name":"out","type":"git_buf *","comment":"Pointer to a user-allocated git_buf in which to store the path"}],"argline":"git_buf *out","sig":"git_buf *","return":{"type":"int","comment":" 0 if a xdg compatible configuration file has been\n\tfound. Its path will be stored in `out`."},"description":"

Locate the path to the global xdg compatible configuration file

\n","comments":"

The xdg compatible configuration file is usually\n located in $HOME/.config/git/config.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n xdg compatible configuration file.

\n","group":"config"},"git_config_find_system":{"type":"function","file":"config.h","line":135,"lineto":135,"args":[{"name":"out","type":"git_buf *","comment":"Pointer to a user-allocated git_buf in which to store the path"}],"argline":"git_buf *out","sig":"git_buf *","return":{"type":"int","comment":" 0 if a system configuration file has been\n\tfound. Its path will be stored in `out`."},"description":"

Locate the path to the system configuration file

\n","comments":"

If /etc/gitconfig doesn't exist, it will look for\n %PROGRAMFILES%

\n\n

.

\n","group":"config"},"git_config_open_default":{"type":"function","file":"config.h","line":147,"lineto":147,"args":[{"name":"out","type":"git_config **","comment":"Pointer to store the config instance"}],"argline":"git_config **out","sig":"git_config **","return":{"type":"int","comment":" 0 or an error code"},"description":"

Open the global, XDG and system configuration files

\n","comments":"

Utility wrapper that finds the global, XDG and system configuration files\n and opens them into a single prioritized config object that can be\n used when accessing default config data outside a repository.

\n","group":"config"},"git_config_new":{"type":"function","file":"config.h","line":158,"lineto":158,"args":[{"name":"out","type":"git_config **","comment":"pointer to the new configuration"}],"argline":"git_config **out","sig":"git_config **","return":{"type":"int","comment":" 0 or an error code"},"description":"

Allocate a new configuration object

\n","comments":"

This object is empty, so you have to add a file to it before you\n can do anything with it.

\n","group":"config"},"git_config_add_file_ondisk":{"type":"function","file":"config.h","line":182,"lineto":186,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to add the file to"},{"name":"path","type":"const char *","comment":"path to the configuration file to add"},{"name":"level","type":"git_config_level_t","comment":"the priority level of the backend"},{"name":"force","type":"int","comment":"replace config file at the given priority level"}],"argline":"git_config *cfg, const char *path, git_config_level_t level, int force","sig":"git_config *::const char *::git_config_level_t::int","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0),\n GIT_ENOTFOUND when the file doesn't exist or error code"},"description":"

Add an on-disk config file instance to an existing config

\n","comments":"

The on-disk file pointed at by path will be opened and\n parsed; it's expected to be a native Git config file following\n the default Git config syntax (see man git-config).

\n\n

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n","group":"config"},"git_config_open_ondisk":{"type":"function","file":"config.h","line":201,"lineto":201,"args":[{"name":"out","type":"git_config **","comment":"The configuration instance to create"},{"name":"path","type":"const char *","comment":"Path to the on-disk file to open"}],"argline":"git_config **out, const char *path","sig":"git_config **::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND when the file doesn't exist\n or an error code"},"description":"

Create a new config instance containing a single on-disk file

\n","comments":"

This method is a simple utility wrapper for the following sequence\n of calls:\n - git_config_new\n - git_config_add_file_ondisk

\n","group":"config","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_config_open_ondisk-24"]}},"git_config_open_level":{"type":"function","file":"config.h","line":219,"lineto":222,"args":[{"name":"out","type":"git_config **","comment":"The configuration instance to create"},{"name":"parent","type":"const git_config *","comment":"Multi-level config to search for the given level"},{"name":"level","type":"git_config_level_t","comment":"Configuration level to search for"}],"argline":"git_config **out, const git_config *parent, git_config_level_t level","sig":"git_config **::const git_config *::git_config_level_t","return":{"type":"int","comment":" 0, GIT_ENOTFOUND if the passed level cannot be found in the\n multi-level parent config, or an error code"},"description":"

Build a single-level focused config object from a multi-level one.

\n","comments":"

The returned config object can be used to perform get/set/delete operations\n on a single specific level.

\n\n

Getting several times the same level from the same parent multi-level config\n will return different config instances, but containing the same config_file\n instance.

\n","group":"config"},"git_config_open_global":{"type":"function","file":"config.h","line":236,"lineto":236,"args":[{"name":"out","type":"git_config **","comment":"pointer in which to store the config object"},{"name":"config","type":"git_config *","comment":"the config object in which to look"}],"argline":"git_config **out, git_config *config","sig":"git_config **::git_config *","return":{"type":"int","comment":null},"description":"

Open the global/XDG configuration file according to git's rules

\n","comments":"

Git allows you to store your global configuration at\n $HOME/.config or $XDG_CONFIG_HOME/git/config. For backwards\n compatability, the XDG file shouldn't be used unless the use has\n created it explicitly. With this function you'll open the correct\n one to write to.

\n","group":"config"},"git_config_snapshot":{"type":"function","file":"config.h","line":252,"lineto":252,"args":[{"name":"out","type":"git_config **","comment":"pointer in which to store the snapshot config object"},{"name":"config","type":"git_config *","comment":"configuration to snapshot"}],"argline":"git_config **out, git_config *config","sig":"git_config **::git_config *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a snapshot of the configuration

\n","comments":"

Create a snapshot of the current state of a configuration, which\n allows you to look into a consistent view of the configuration for\n looking up complex values (e.g. a remote, submodule).

\n\n

The string returned when querying such a config object is valid\n until it is freed.

\n","group":"config"},"git_config_free":{"type":"function","file":"config.h","line":259,"lineto":259,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to free"}],"argline":"git_config *cfg","sig":"git_config *","return":{"type":"void","comment":null},"description":"

Free the configuration and its associated memory and files

\n","comments":"","group":"config"},"git_config_get_entry":{"type":"function","file":"config.h","line":272,"lineto":275,"args":[{"name":"out","type":"const git_config_entry **","comment":"pointer to the variable git_config_entry"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"const git_config_entry **out, const git_config *cfg, const char *name","sig":"const git_config_entry **::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the git_config_entry of a config variable.

\n","comments":"

The git_config_entry is owned by the config and should not be freed by the\n user.

\n","group":"config"},"git_config_get_int32":{"type":"function","file":"config.h","line":289,"lineto":289,"args":[{"name":"out","type":"int32_t *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int32_t *out, const git_config *cfg, const char *name","sig":"int32_t *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of an integer config variable.

\n","comments":"

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_config_get_int32-25"]}},"git_config_get_int64":{"type":"function","file":"config.h","line":303,"lineto":303,"args":[{"name":"out","type":"int64_t *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int64_t *out, const git_config *cfg, const char *name","sig":"int64_t *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a long integer config variable.

\n","comments":"

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config"},"git_config_get_bool":{"type":"function","file":"config.h","line":320,"lineto":320,"args":[{"name":"out","type":"int *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int *out, const git_config *cfg, const char *name","sig":"int *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a boolean config variable.

\n","comments":"

This function uses the usual C convention of 0 being false and\n anything else true.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config"},"git_config_get_string":{"type":"function","file":"config.h","line":338,"lineto":338,"args":[{"name":"out","type":"const char **","comment":"pointer to the variable's value"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"const char **out, const git_config *cfg, const char *name","sig":"const char **::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a string config variable.

\n","comments":"

The string is owned by the variable and should not be freed by the\n user. The pointer will be valid until the next operation on this\n config object.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_config_get_string-26"]}},"git_config_get_multivar_foreach":{"type":"function","file":"config.h","line":352,"lineto":352,"args":[{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"regexp","type":"const char *","comment":"regular expression to filter which variables we're\n interested in. Use NULL to indicate all"},{"name":"callback","type":"git_config_foreach_cb","comment":"the function to be called on each value of the variable"},{"name":"payload","type":"void *","comment":"opaque pointer to pass to the callback"}],"argline":"const git_config *cfg, const char *name, const char *regexp, git_config_foreach_cb callback, void *payload","sig":"const git_config *::const char *::const char *::git_config_foreach_cb::void *","return":{"type":"int","comment":null},"description":"

Get each value of a multivar in a foreach callback

\n","comments":"

The callback will be called on each variable found

\n","group":"config"},"git_config_multivar_iterator_new":{"type":"function","file":"config.h","line":363,"lineto":363,"args":[{"name":"out","type":"git_config_iterator **","comment":"pointer to store the iterator"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"regexp","type":"const char *","comment":"regular expression to filter which variables we're\n interested in. Use NULL to indicate all"}],"argline":"git_config_iterator **out, const git_config *cfg, const char *name, const char *regexp","sig":"git_config_iterator **::const git_config *::const char *::const char *","return":{"type":"int","comment":null},"description":"

Get each value of a multivar

\n","comments":"","group":"config"},"git_config_next":{"type":"function","file":"config.h","line":375,"lineto":375,"args":[{"name":"entry","type":"git_config_entry **","comment":"pointer to store the entry"},{"name":"iter","type":"git_config_iterator *","comment":"the iterator"}],"argline":"git_config_entry **entry, git_config_iterator *iter","sig":"git_config_entry **::git_config_iterator *","return":{"type":"int","comment":" 0 or an error code. GIT_ITEROVER if the iteration has completed"},"description":"

Return the current entry and advance the iterator

\n","comments":"

The pointers returned by this function are valid until the iterator\n is freed.

\n","group":"config"},"git_config_iterator_free":{"type":"function","file":"config.h","line":382,"lineto":382,"args":[{"name":"iter","type":"git_config_iterator *","comment":"the iterator to free"}],"argline":"git_config_iterator *iter","sig":"git_config_iterator *","return":{"type":"void","comment":null},"description":"

Free a config iterator

\n","comments":"","group":"config"},"git_config_set_int32":{"type":"function","file":"config.h","line":393,"lineto":393,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"int32_t","comment":"Integer value for the variable"}],"argline":"git_config *cfg, const char *name, int32_t value","sig":"git_config *::const char *::int32_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the value of an integer config variable in the config file\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_set_int64":{"type":"function","file":"config.h","line":404,"lineto":404,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"int64_t","comment":"Long integer value for the variable"}],"argline":"git_config *cfg, const char *name, int64_t value","sig":"git_config *::const char *::int64_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the value of a long integer config variable in the config file\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_set_bool":{"type":"function","file":"config.h","line":415,"lineto":415,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"int","comment":"the value to store"}],"argline":"git_config *cfg, const char *name, int value","sig":"git_config *::const char *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the value of a boolean config variable in the config file\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_set_string":{"type":"function","file":"config.h","line":429,"lineto":429,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"const char *","comment":"the string to store."}],"argline":"git_config *cfg, const char *name, const char *value","sig":"git_config *::const char *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the value of a string config variable in the config file\n with the highest level (usually the local one).

\n","comments":"

A copy of the string is made and the user is free to use it\n afterwards.

\n","group":"config"},"git_config_set_multivar":{"type":"function","file":"config.h","line":439,"lineto":439,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"regexp","type":"const char *","comment":"a regular expression to indicate which values to replace"},{"name":"value","type":"const char *","comment":"the new value."}],"argline":"git_config *cfg, const char *name, const char *regexp, const char *value","sig":"git_config *::const char *::const char *::const char *","return":{"type":"int","comment":null},"description":"

Set a multivar in the local config file.

\n","comments":"","group":"config"},"git_config_delete_entry":{"type":"function","file":"config.h","line":448,"lineto":448,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration"},{"name":"name","type":"const char *","comment":"the variable to delete"}],"argline":"git_config *cfg, const char *name","sig":"git_config *::const char *","return":{"type":"int","comment":null},"description":"

Delete a config variable from the config file\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_delete_multivar":{"type":"function","file":"config.h","line":459,"lineto":459,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variables"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"regexp","type":"const char *","comment":"a regular expression to indicate which values to delete"}],"argline":"git_config *cfg, const char *name, const char *regexp","sig":"git_config *::const char *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Deletes one or several entries from a multivar in the local config file.

\n","comments":"","group":"config"},"git_config_foreach":{"type":"function","file":"config.h","line":477,"lineto":480,"args":[{"name":"cfg","type":"const git_config *","comment":"where to get the variables from"},{"name":"callback","type":"git_config_foreach_cb","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"const git_config *cfg, git_config_foreach_cb callback, void *payload","sig":"const git_config *::git_config_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Perform an operation on each config variable.

\n","comments":"

The callback receives the normalized name and value of each variable\n in the config backend, and the data pointer passed to this function.\n If the callback returns a non-zero value, the function stops iterating\n and returns that value to the caller.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n","group":"config"},"git_config_iterator_new":{"type":"function","file":"config.h","line":491,"lineto":491,"args":[{"name":"out","type":"git_config_iterator **","comment":"pointer to store the iterator"},{"name":"cfg","type":"const git_config *","comment":"where to ge the variables from"}],"argline":"git_config_iterator **out, const git_config *cfg","sig":"git_config_iterator **::const git_config *","return":{"type":"int","comment":null},"description":"

Iterate over all the config variables

\n","comments":"

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n","group":"config"},"git_config_iterator_glob_new":{"type":"function","file":"config.h","line":503,"lineto":503,"args":[{"name":"out","type":"git_config_iterator **","comment":"pointer to store the iterator"},{"name":"cfg","type":"const git_config *","comment":"where to ge the variables from"},{"name":"regexp","type":"const char *","comment":"regular expression to match the names"}],"argline":"git_config_iterator **out, const git_config *cfg, const char *regexp","sig":"git_config_iterator **::const git_config *::const char *","return":{"type":"int","comment":null},"description":"

Iterate over all the config variables whose name matches a pattern

\n","comments":"

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n","group":"config"},"git_config_foreach_match":{"type":"function","file":"config.h","line":521,"lineto":525,"args":[{"name":"cfg","type":"const git_config *","comment":"where to get the variables from"},{"name":"regexp","type":"const char *","comment":"regular expression to match against config names"},{"name":"callback","type":"git_config_foreach_cb","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"const git_config *cfg, const char *regexp, git_config_foreach_cb callback, void *payload","sig":"const git_config *::const char *::git_config_foreach_cb::void *","return":{"type":"int","comment":" 0 or the return value of the callback which didn't return 0"},"description":"

Perform an operation on each config variable matching a regular expression.

\n","comments":"

This behaviors like git_config_foreach with an additional filter of a\n regular expression that filters which config keys are passed to the\n callback.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n","group":"config"},"git_config_get_mapped":{"type":"function","file":"config.h","line":561,"lineto":566,"args":[{"name":"out","type":"int *","comment":"place to store the result of the mapping"},{"name":"cfg","type":"const git_config *","comment":"config file to get the variables from"},{"name":"name","type":"const char *","comment":"name of the config variable to lookup"},{"name":"maps","type":"const git_cvar_map *","comment":"array of `git_cvar_map` objects specifying the possible mappings"},{"name":"map_n","type":"size_t","comment":"number of mapping objects in `maps`"}],"argline":"int *out, const git_config *cfg, const char *name, const git_cvar_map *maps, size_t map_n","sig":"int *::const git_config *::const char *::const git_cvar_map *::size_t","return":{"type":"int","comment":" 0 on success, error code otherwise"},"description":"

Query the value of a config variable and return it mapped to\n an integer constant.

\n","comments":"

This is a helper method to easily map different possible values\n to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_cvar_map autocrlf_mapping[] = {\n    {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},\n    {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},\n    {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},\n    {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the\n mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing\n the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison),\n the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be\n returned.

\n","group":"config"},"git_config_lookup_map_value":{"type":"function","file":"config.h","line":576,"lineto":580,"args":[{"name":"out","type":"int *","comment":"place to store the result of the parsing"},{"name":"maps","type":"const git_cvar_map *","comment":"array of `git_cvar_map` objects specifying the possible mappings"},{"name":"map_n","type":"size_t","comment":"number of mapping objects in `maps`"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int *out, const git_cvar_map *maps, size_t map_n, const char *value","sig":"int *::const git_cvar_map *::size_t::const char *","return":{"type":"int","comment":null},"description":"

Maps a string value to an integer constant

\n","comments":"","group":"config"},"git_config_parse_bool":{"type":"function","file":"config.h","line":592,"lineto":592,"args":[{"name":"out","type":"int *","comment":"place to store the result of the parsing"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int *out, const char *value","sig":"int *::const char *","return":{"type":"int","comment":null},"description":"

Parse a string value as a bool.

\n","comments":"

Valid values for true are: 'true', 'yes', 'on', 1 or any\n number different from 0\n Valid values for false are: 'false', 'no', 'off', 0

\n","group":"config"},"git_config_parse_int32":{"type":"function","file":"config.h","line":604,"lineto":604,"args":[{"name":"out","type":"int32_t *","comment":"place to store the result of the parsing"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int32_t *out, const char *value","sig":"int32_t *::const char *","return":{"type":"int","comment":null},"description":"

Parse a string value as an int32.

\n","comments":"

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n","group":"config"},"git_config_parse_int64":{"type":"function","file":"config.h","line":616,"lineto":616,"args":[{"name":"out","type":"int64_t *","comment":"place to store the result of the parsing"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int64_t *out, const char *value","sig":"int64_t *::const char *","return":{"type":"int","comment":null},"description":"

Parse a string value as an int64.

\n","comments":"

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n","group":"config"},"git_config_backend_foreach_match":{"type":"function","file":"config.h","line":631,"lineto":635,"args":[{"name":"backend","type":"git_config_backend *","comment":"where to get the variables from"},{"name":"regexp","type":"const char *","comment":"regular expression to match against config names (can be NULL)"},{"name":"callback","type":"git_config_foreach_cb","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"git_config_backend *backend, const char *regexp, git_config_foreach_cb callback, void *payload","sig":"git_config_backend *::const char *::git_config_foreach_cb::void *","return":{"type":"int","comment":null},"description":"

Perform an operation on each config variable in given config backend\n matching a regular expression.

\n","comments":"

This behaviors like git_config_foreach_match except instead of all config\n entries it just enumerates through the given backend entry.

\n","group":"config"},"git_cred_userpass":{"type":"function","file":"cred_helpers.h","line":43,"lineto":48,"args":[{"name":"cred","type":"git_cred **","comment":"The newly created credential object."},{"name":"url","type":"const char *","comment":"The resource for which we are demanding a credential."},{"name":"user_from_url","type":"const char *","comment":"The username that was embedded in a \"user"},{"name":"allowed_types","type":"unsigned int","comment":"A bitmask stating which cred types are OK to return."},{"name":"payload","type":"void *","comment":"The payload provided when specifying this callback. (This is\n interpreted as a `git_cred_userpass_payload*`.)"}],"argline":"git_cred **cred, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload","sig":"git_cred **::const char *::const char *::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Stock callback usable as a git_cred_acquire_cb. This calls\n git_cred_userpass_plaintext_new unless the protocol has not specified\n GIT_CREDTYPE_USERPASS_PLAINTEXT as an allowed type.

\n","comments":"","group":"cred"},"git_describe_commit":{"type":"function","file":"describe.h","line":120,"lineto":123,"args":[{"name":"result","type":"git_describe_result **","comment":"pointer to store the result. You must free this once\n you're done with it."},{"name":"committish","type":"git_object *","comment":"a committish to describe"},{"name":"opts","type":"git_describe_options *","comment":"the lookup options"}],"argline":"git_describe_result **result, git_object *committish, git_describe_options *opts","sig":"git_describe_result **::git_object *::git_describe_options *","return":{"type":"int","comment":null},"description":"

Describe a commit

\n","comments":"

Perform the describe operation on the given committish object.

\n","group":"describe","examples":{"describe.c":["ex/v0.22.0-rc1/describe.html#git_describe_commit-1"]}},"git_describe_workdir":{"type":"function","file":"describe.h","line":137,"lineto":140,"args":[{"name":"out","type":"git_describe_result **","comment":null},{"name":"repo","type":"git_repository *","comment":"the repository in which to perform the describe"},{"name":"opts","type":"git_describe_options *","comment":"the lookup options"}],"argline":"git_describe_result **out, git_repository *repo, git_describe_options *opts","sig":"git_describe_result **::git_repository *::git_describe_options *","return":{"type":"int","comment":null},"description":"

Describe a commit

\n","comments":"

Perform the describe operation on the current commit and the\n worktree. After peforming describe on HEAD, a status is run and the\n description is considered to be dirty if there are.

\n","group":"describe","examples":{"describe.c":["ex/v0.22.0-rc1/describe.html#git_describe_workdir-2"]}},"git_describe_format":{"type":"function","file":"describe.h","line":149,"lineto":152,"args":[{"name":"out","type":"git_buf *","comment":null},{"name":"result","type":"const git_describe_result *","comment":"the result from `git_describe_commit()` or\n `git_describe_workdir()`."},{"name":"opts","type":"const git_describe_format_options *","comment":null}],"argline":"git_buf *out, const git_describe_result *result, const git_describe_format_options *opts","sig":"git_buf *::const git_describe_result *::const git_describe_format_options *","return":{"type":"int","comment":null},"description":"

Print the describe result to a buffer

\n","comments":"","group":"describe","examples":{"describe.c":["ex/v0.22.0-rc1/describe.html#git_describe_format-3"]}},"git_describe_result_free":{"type":"function","file":"describe.h","line":157,"lineto":157,"args":[{"name":"result","type":"git_describe_result *","comment":null}],"argline":"git_describe_result *result","sig":"git_describe_result *","return":{"type":"void","comment":null},"description":"

Free the describe result.

\n","comments":"","group":"describe"},"git_diff_init_options":{"type":"function","file":"diff.h","line":405,"lineto":407,"args":[{"name":"opts","type":"git_diff_options *","comment":"The `git_diff_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_DIFF_OPTIONS_VERSION`"}],"argline":"git_diff_options *opts, unsigned int version","sig":"git_diff_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_diff_options with default values. Equivalent to\n creating an instance with GIT_DIFF_OPTIONS_INIT.

\n","comments":"","group":"diff"},"git_diff_find_init_options":{"type":"function","file":"diff.h","line":643,"lineto":645,"args":[{"name":"opts","type":"git_diff_find_options *","comment":"The `git_diff_find_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_DIFF_FIND_OPTIONS_VERSION`"}],"argline":"git_diff_find_options *opts, unsigned int version","sig":"git_diff_find_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_diff_find_options with default values. Equivalent to\n creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n","comments":"","group":"diff"},"git_diff_free":{"type":"function","file":"diff.h","line":659,"lineto":659,"args":[{"name":"diff","type":"git_diff *","comment":"The previously created diff; cannot be used after free."}],"argline":"git_diff *diff","sig":"git_diff *","return":{"type":"void","comment":null},"description":"

Deallocate a diff.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_free-2"],"log.c":["ex/v0.22.0-rc1/log.html#git_diff_free-24","ex/v0.22.0-rc1/log.html#git_diff_free-25"]}},"git_diff_tree_to_tree":{"type":"function","file":"diff.h","line":677,"lineto":682,"args":[{"name":"diff","type":"git_diff **","comment":"Output pointer to a git_diff pointer to be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the trees."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"new_tree","type":"git_tree *","comment":"A git_tree object to diff to, or NULL for empty tree."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, git_tree *new_tree, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::git_tree *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff with the difference between two tree objects.

\n","comments":"

This is equivalent to git diff \n<old\n-tree> \n<new\n-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the\n second tree will be used for the "new_file" side of the delta. You can\n pass NULL to indicate an empty tree, although it is an error to pass\n NULL for both the old_tree and new_tree.

\n","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_tree_to_tree-3"],"log.c":["ex/v0.22.0-rc1/log.html#git_diff_tree_to_tree-26","ex/v0.22.0-rc1/log.html#git_diff_tree_to_tree-27"]}},"git_diff_tree_to_index":{"type":"function","file":"diff.h","line":703,"lineto":708,"args":[{"name":"diff","type":"git_diff **","comment":"Output pointer to a git_diff pointer to be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the tree and index."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"index","type":"git_index *","comment":"The index to diff with; repo index used if NULL."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, git_index *index, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::git_index *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between a tree and repository index.

\n","comments":"

This is equivalent to `git diff --cached \n<treeish

\n\n
\n

or if you pass\n the HEAD tree, then likegit diff --cached`.

\n
\n\n

The tree you pass will be used for the "old_file" side of the delta, and\n the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_tree_to_index-4"]}},"git_diff_index_to_workdir":{"type":"function","file":"diff.h","line":730,"lineto":734,"args":[{"name":"diff","type":"git_diff **","comment":"Output pointer to a git_diff pointer to be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository."},{"name":"index","type":"git_index *","comment":"The index to diff from; repo index used if NULL."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_index *index, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_index *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between the repository index and the workdir directory.

\n","comments":"

This matches the git diff command. See the note below on\n git_diff_tree_to_workdir for a discussion of the difference between\n git diff and git diff HEAD and how to emulate a `git diff \n<treeish

\n\n
\n

`\n using libgit2.

\n
\n\n

The index will be used for the "old_file" side of the delta, and the\n working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_index_to_workdir-5"]}},"git_diff_tree_to_workdir":{"type":"function","file":"diff.h","line":759,"lineto":763,"args":[{"name":"diff","type":"git_diff **","comment":"A pointer to a git_diff pointer that will be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the tree."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between a tree and the working directory.

\n","comments":"

The tree you provide will be used for the "old_file" side of the delta,\n and the working directory will be used for the "new_file" side.

\n\n

This is not the same as `git diff \n<treeish

\n\n
\n

orgit diff-index

\n
\n\n

<treeish

\n\n
\n

. Those commands use information from the index, whereas this\n function strictly returns the differences between the tree and the files\n in the working directory, regardless of the state of the index. Use\ngit_diff_tree_to_workdir_with_index` to emulate those commands.

\n
\n\n

To see difference between this and git_diff_tree_to_workdir_with_index,\n consider the example of a staged file deletion where the file has then\n been put back into the working dir and further modified. The\n tree-to-workdir diff for that file is 'modified', but git diff would\n show status 'deleted' since there is a staged delete.

\n","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_tree_to_workdir-6"]}},"git_diff_tree_to_workdir_with_index":{"type":"function","file":"diff.h","line":778,"lineto":782,"args":[{"name":"diff","type":"git_diff **","comment":"A pointer to a git_diff pointer that will be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the tree."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between a tree and the working directory using index data\n to account for staged deletes, tracked files, etc.

\n","comments":"

This emulates `git diff \n<tree

\n\n
\n

` by diffing the tree to the index and\n the index to the working directory and blending the results into a\n single diff that includes staged deleted, etc.

\n
\n","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_tree_to_workdir_with_index-7"]}},"git_diff_merge":{"type":"function","file":"diff.h","line":797,"lineto":799,"args":[{"name":"onto","type":"git_diff *","comment":"Diff to merge into."},{"name":"from","type":"const git_diff *","comment":"Diff to merge."}],"argline":"git_diff *onto, const git_diff *from","sig":"git_diff *::const git_diff *","return":{"type":"int","comment":null},"description":"

Merge one diff into another.

\n","comments":"

This merges items from the "from" list into the "onto" list. The\n resulting diff will have all items that appear in either list.\n If an item appears in both lists, then it will be "merged" to appear\n as if the old version was from the "onto" list and the new version\n is from the "from" list (with the exception that if the item has a\n pending DELETE in the middle, then it will show as deleted).

\n","group":"diff"},"git_diff_find_similar":{"type":"function","file":"diff.h","line":813,"lineto":815,"args":[{"name":"diff","type":"git_diff *","comment":"diff to run detection algorithms on"},{"name":"options","type":"const git_diff_find_options *","comment":"Control how detection should be run, NULL for defaults"}],"argline":"git_diff *diff, const git_diff_find_options *options","sig":"git_diff *::const git_diff_find_options *","return":{"type":"int","comment":" 0 on success, -1 on failure"},"description":"

Transform a diff marking file renames, copies, etc.

\n","comments":"

This modifies a diff in place, replacing old entries that look\n like renames or copies with new entries reflecting those changes.\n This also will, if requested, break modified files into add/remove\n pairs if the amount of change is above a threshold.

\n","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_find_similar-8"]}},"git_diff_num_deltas":{"type":"function","file":"diff.h","line":833,"lineto":833,"args":[{"name":"diff","type":"const git_diff *","comment":"A git_diff generated by one of the above functions"}],"argline":"const git_diff *diff","sig":"const git_diff *","return":{"type":"size_t","comment":" Count of number of deltas in the list"},"description":"

Query how many diff records are there in a diff.

\n","comments":"","group":"diff","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_diff_num_deltas-28"]}},"git_diff_num_deltas_of_type":{"type":"function","file":"diff.h","line":846,"lineto":847,"args":[{"name":"diff","type":"const git_diff *","comment":"A git_diff generated by one of the above functions"},{"name":"type","type":"git_delta_t","comment":"A git_delta_t value to filter the count"}],"argline":"const git_diff *diff, git_delta_t type","sig":"const git_diff *::git_delta_t","return":{"type":"size_t","comment":" Count of number of deltas matching delta_t type"},"description":"

Query how many diff deltas are there in a diff filtered by type.

\n","comments":"

This works just like git_diff_entrycount() with an extra parameter\n that is a git_delta_t and returns just the count of how many deltas\n match that particular type.

\n","group":"diff"},"git_diff_get_delta":{"type":"function","file":"diff.h","line":866,"lineto":867,"args":[{"name":"diff","type":"const git_diff *","comment":"Diff list object"},{"name":"idx","type":"size_t","comment":"Index into diff list"}],"argline":"const git_diff *diff, size_t idx","sig":"const git_diff *::size_t","return":{"type":"const git_diff_delta *","comment":" Pointer to git_diff_delta (or NULL if `idx` out of range)"},"description":"

Return the diff delta for an entry in the diff list.

\n","comments":"

The git_delta pointer points to internal data and you do not have\n to release it when you are done with it. It will go away when the\n git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary\n content or not may not be set if there are no attributes set for the\n file and there has been no reason to load the file data at this point.\n For now, if you need those flags to be up to date, your only option is\n to either use git_diff_foreach or create a git_patch.

\n","group":"diff"},"git_diff_is_sorted_icase":{"type":"function","file":"diff.h","line":875,"lineto":875,"args":[{"name":"diff","type":"const git_diff *","comment":"diff to check"}],"argline":"const git_diff *diff","sig":"const git_diff *","return":{"type":"int","comment":" 0 if case sensitive, 1 if case is ignored"},"description":"

Check if deltas are sorted case sensitively or insensitively.

\n","comments":"","group":"diff"},"git_diff_foreach":{"type":"function","file":"diff.h","line":902,"lineto":907,"args":[{"name":"diff","type":"git_diff *","comment":"A git_diff generated by one of the above functions."},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback function to make per file in the diff."},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Optional callback to make per hunk of text diff. This\n callback is called to describe a range of lines in the\n diff. It will not be issued for binary files."},{"name":"line_cb","type":"git_diff_line_cb","comment":"Optional callback to make per line of diff text. This\n same callback will be made for context lines, added, and\n removed lines, and even for a deleted trailing newline."},{"name":"payload","type":"void *","comment":"Reference pointer that will be passed to your callbacks."}],"argline":"git_diff *diff, git_diff_file_cb file_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"git_diff *::git_diff_file_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Loop over all deltas in a diff issuing callbacks.

\n","comments":"

This will iterate through all of the files described in a diff. You\n should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the\n files will only be calculated if they are not NULL. Of course, these\n callbacks will not be invoked for binary files on the diff or for\n files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate\n the iteration and return the value to the user.

\n","group":"diff"},"git_diff_status_char":{"type":"function","file":"diff.h","line":920,"lineto":920,"args":[{"name":"status","type":"git_delta_t","comment":"The git_delta_t value to look up"}],"argline":"git_delta_t status","sig":"git_delta_t","return":{"type":"char","comment":" The single character label for that code"},"description":"

Look up the single character abbreviation for a delta status code.

\n","comments":"

When you run git diff --name-status it uses single letter codes in\n the output such as 'A' for added, 'D' for deleted, 'M' for modified,\n etc. This function converts a git_delta_t value into these letters for\n your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n","group":"diff"},"git_diff_print":{"type":"function","file":"diff.h","line":945,"lineto":949,"args":[{"name":"diff","type":"git_diff *","comment":"A git_diff generated by one of the above functions."},{"name":"format","type":"git_diff_format_t","comment":"A git_diff_format_t value to pick the text format."},{"name":"print_cb","type":"git_diff_line_cb","comment":"Callback to make per line of diff text."},{"name":"payload","type":"void *","comment":"Reference pointer that will be passed to your callback."}],"argline":"git_diff *diff, git_diff_format_t format, git_diff_line_cb print_cb, void *payload","sig":"git_diff *::git_diff_format_t::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Iterate over a diff generating formatted text output.

\n","comments":"

Returning a non-zero value from the callbacks will terminate the\n iteration and return the non-zero value to the caller.

\n","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_print-9"],"log.c":["ex/v0.22.0-rc1/log.html#git_diff_print-29"]}},"git_diff_blobs":{"type":"function","file":"diff.h","line":985,"lineto":994,"args":[{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"new_blob","type":"const git_blob *","comment":"Blob for new side of diff, or NULL for empty blob"},{"name":"new_as_path","type":"const char *","comment":"Treat new blob as if it had this filename; can be NULL"},{"name":"options","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback for \"file\"; made once if there is a diff; can be NULL"},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Callback for each hunk in diff; can be NULL"},{"name":"line_cb","type":"git_diff_line_cb","comment":"Callback for each line in diff; can be NULL"},{"name":"payload","type":"void *","comment":"Payload passed to each callback function"}],"argline":"const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *::git_diff_file_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Directly run a diff on two blobs.

\n","comments":"

Compared to a file, a blob lacks some contextual information. As such,\n the git_diff_file given to the callback will have some fake data; i.e.\n mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated\n as an empty blob, with the oid set to NULL in the git_diff_file data.\n Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob\n looks like binary data, the git_diff_delta binary attribute will be set\n to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass\n GIT_DIFF_FORCE_TEXT of course).

\n","group":"diff"},"git_diff_blob_to_buffer":{"type":"function","file":"diff.h","line":1020,"lineto":1030,"args":[{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"buffer","type":"const char *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"buffer_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"buffer_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"options","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback for \"file\"; made once if there is a diff; can be NULL"},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Callback for each hunk in diff; can be NULL"},{"name":"line_cb","type":"git_diff_line_cb","comment":"Callback for each line in diff; can be NULL"},{"name":"payload","type":"void *","comment":"Payload passed to each callback function"}],"argline":"const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Directly run a diff between a blob and a buffer.

\n","comments":"

As with git_diff_blobs, comparing a blob and buffer lacks some context,\n so the git_diff_file parameters to the callbacks will be faked a la the\n rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the\n file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the\n entire content of the buffer added). Passing NULL to the buffer will do\n the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n","group":"diff"},"git_diff_buffers":{"type":"function","file":"diff.h","line":1052,"lineto":1063,"args":[{"name":"old_buffer","type":"const void *","comment":"Raw data for old side of diff, or NULL for empty"},{"name":"old_len","type":"size_t","comment":"Length of the raw data for old side of the diff"},{"name":"old_as_path","type":"const char *","comment":"Treat old buffer as if it had this filename; can be NULL"},{"name":"new_buffer","type":"const void *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"new_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"new_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"options","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback for \"file\"; made once if there is a diff; can be NULL"},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Callback for each hunk in diff; can be NULL"},{"name":"line_cb","type":"git_diff_line_cb","comment":"Callback for each line in diff; can be NULL"},{"name":"payload","type":"void *","comment":"Payload passed to each callback function"}],"argline":"const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Directly run a diff between two buffers.

\n","comments":"

Even more than with git_diff_blobs, comparing two buffer lacks\n context, so the git_diff_file parameters to the callbacks will be\n faked a la the rules for git_diff_blobs().

\n","group":"diff"},"git_diff_get_stats":{"type":"function","file":"diff.h","line":1099,"lineto":1101,"args":[{"name":"out","type":"git_diff_stats **","comment":"Structure containg the diff statistics."},{"name":"diff","type":"git_diff *","comment":"A git_diff generated by one of the above functions."}],"argline":"git_diff_stats **out, git_diff *diff","sig":"git_diff_stats **::git_diff *","return":{"type":"int","comment":" 0 on success; non-zero on error"},"description":"

Accumlate diff statistics for all patches.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_get_stats-10"]}},"git_diff_stats_files_changed":{"type":"function","file":"diff.h","line":1109,"lineto":1110,"args":[{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."}],"argline":"const git_diff_stats *stats","sig":"const git_diff_stats *","return":{"type":"size_t","comment":" total number of files changed in the diff"},"description":"

Get the total number of files changed in a diff

\n","comments":"","group":"diff"},"git_diff_stats_insertions":{"type":"function","file":"diff.h","line":1118,"lineto":1119,"args":[{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."}],"argline":"const git_diff_stats *stats","sig":"const git_diff_stats *","return":{"type":"size_t","comment":" total number of insertions in the diff"},"description":"

Get the total number of insertions in a diff

\n","comments":"","group":"diff"},"git_diff_stats_deletions":{"type":"function","file":"diff.h","line":1127,"lineto":1128,"args":[{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."}],"argline":"const git_diff_stats *stats","sig":"const git_diff_stats *","return":{"type":"size_t","comment":" total number of deletions in the diff"},"description":"

Get the total number of deletions in a diff

\n","comments":"","group":"diff"},"git_diff_stats_to_buf":{"type":"function","file":"diff.h","line":1139,"lineto":1143,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the formatted diff statistics in."},{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."},{"name":"format","type":"git_diff_stats_format_t","comment":"Formatting option."},{"name":"width","type":"size_t","comment":"Target width for output (only affects GIT_DIFF_STATS_FULL)"}],"argline":"git_buf *out, const git_diff_stats *stats, git_diff_stats_format_t format, size_t width","sig":"git_buf *::const git_diff_stats *::git_diff_stats_format_t::size_t","return":{"type":"int","comment":" 0 on success; non-zero on error"},"description":"

Print diff statistics to a git_buf.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_stats_to_buf-11"]}},"git_diff_stats_free":{"type":"function","file":"diff.h","line":1151,"lineto":1151,"args":[{"name":"stats","type":"git_diff_stats *","comment":"The previously created statistics object;\n cannot be used after free."}],"argline":"git_diff_stats *stats","sig":"git_diff_stats *","return":{"type":"void","comment":null},"description":"

Deallocate a git_diff_stats.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_diff_stats_free-12"]}},"git_diff_format_email":{"type":"function","file":"diff.h","line":1200,"lineto":1203,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the e-mail patch in"},{"name":"diff","type":"git_diff *","comment":"containing the commit"},{"name":"opts","type":"const git_diff_format_email_options *","comment":"structure with options to influence content and formatting."}],"argline":"git_buf *out, git_diff *diff, const git_diff_format_email_options *opts","sig":"git_buf *::git_diff *::const git_diff_format_email_options *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an e-mail ready patch from a diff.

\n","comments":"","group":"diff"},"git_diff_commit_as_email":{"type":"function","file":"diff.h","line":1219,"lineto":1226,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the e-mail patch in"},{"name":"repo","type":"git_repository *","comment":"containing the commit"},{"name":"commit","type":"git_commit *","comment":"pointer to up commit"},{"name":"patch_no","type":"size_t","comment":"patch number of the commit"},{"name":"total_patches","type":"size_t","comment":"total number of patches in the patch set"},{"name":"flags","type":"git_diff_format_email_flags_t","comment":"determines the formatting of the e-mail"},{"name":"diff_opts","type":"const git_diff_options *","comment":"structure with options to influence diff or NULL for defaults."}],"argline":"git_buf *out, git_repository *repo, git_commit *commit, size_t patch_no, size_t total_patches, git_diff_format_email_flags_t flags, const git_diff_options *diff_opts","sig":"git_buf *::git_repository *::git_commit *::size_t::size_t::git_diff_format_email_flags_t::const git_diff_options *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an e-mail ready patch for a commit.

\n","comments":"

Does not support creating patches for merge commits (yet).

\n","group":"diff"},"git_diff_format_email_init_options":{"type":"function","file":"diff.h","line":1237,"lineto":1239,"args":[{"name":"opts","type":"git_diff_format_email_options *","comment":"The `git_diff_format_email_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`"}],"argline":"git_diff_format_email_options *opts, unsigned int version","sig":"git_diff_format_email_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_diff_format_email_options with default values.

\n","comments":"

Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n","group":"diff"},"giterr_last":{"type":"function","file":"errors.h","line":104,"lineto":104,"args":[],"argline":"","sig":"","return":{"type":"const git_error *","comment":" A git_error object."},"description":"

Return the last git_error object that was generated for the\n current thread or NULL if no error has occurred.

\n","comments":"","group":"giterr","examples":{"general.c":["ex/v0.22.0-rc1/general.html#giterr_last-27"],"network/clone.c":["ex/v0.22.0-rc1/network/clone.html#giterr_last-2"],"network/git2.c":["ex/v0.22.0-rc1/network/git2.html#giterr_last-1","ex/v0.22.0-rc1/network/git2.html#giterr_last-2"]}},"giterr_clear":{"type":"function","file":"errors.h","line":109,"lineto":109,"args":[],"argline":"","sig":"","return":{"type":"void","comment":null},"description":"

Clear the last library error that occurred for this thread.

\n","comments":"","group":"giterr"},"giterr_detach":{"type":"function","file":"errors.h","line":121,"lineto":121,"args":[{"name":"cpy","type":"git_error *","comment":null}],"argline":"git_error *cpy","sig":"git_error *","return":{"type":"int","comment":null},"description":"

Get the last error data and clear it.

\n","comments":"

This copies the last error into the given git_error struct\n and returns 0 if the copy was successful, leaving the error\n cleared as if giterr_clear had been called.

\n\n

If there was no existing error in the library, -1 will be returned\n and the contents of cpy will be left unmodified.

\n","group":"giterr"},"giterr_set_str":{"type":"function","file":"errors.h","line":144,"lineto":144,"args":[{"name":"error_class","type":"int","comment":"One of the `git_error_t` enum above describing the\n general subsystem that is responsible for the error."},{"name":"string","type":"const char *","comment":"The formatted error message to keep"}],"argline":"int error_class, const char *string","sig":"int::const char *","return":{"type":"void","comment":null},"description":"

Set the error message string for this thread.

\n","comments":"

This function is public so that custom ODB backends and the like can\n relay an error message through libgit2. Most regular users of libgit2\n will never need to call this function -- actually, calling it in most\n circumstances (for example, calling from within a callback function)\n will just end up having the value overwritten by libgit2 internals.

\n\n

This error message is stored in thread-local storage and only applies\n to the particular thread that this libgit2 call is made from.

\n\n

NOTE: Passing the error_class as GITERR_OS has a special behavior: we\n attempt to append the system default error message for the last OS error\n that occurred and then clear the last error. The specific implementation\n of looking up and clearing this last OS error will vary by platform.

\n","group":"giterr"},"giterr_set_oom":{"type":"function","file":"errors.h","line":155,"lineto":155,"args":[],"argline":"","sig":"","return":{"type":"void","comment":null},"description":"

Set the error message to a special value for memory allocation failure.

\n","comments":"

The normal giterr_set_str() function attempts to strdup() the string\n that is passed in. This is not a good idea when the error in question\n is a memory allocation failure. That circumstance has a special setter\n function that sets the error string to a known and statically allocated\n internal value.

\n","group":"giterr"},"git_filter_list_load":{"type":"function","file":"filter.h","line":90,"lineto":96,"args":[{"name":"filters","type":"git_filter_list **","comment":"Output newly created git_filter_list (or NULL)"},{"name":"repo","type":"git_repository *","comment":"Repository object that contains `path`"},{"name":"blob","type":"git_blob *","comment":"The blob to which the filter will be applied (if known)"},{"name":"path","type":"const char *","comment":"Relative path of the file to be filtered"},{"name":"mode","type":"git_filter_mode_t","comment":"Filtering direction (WT->ODB or ODB->WT)"},{"name":"options","type":"uint32_t","comment":"Combination of `git_filter_opt_t` flags"}],"argline":"git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, uint32_t options","sig":"git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::uint32_t","return":{"type":"int","comment":" 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error"},"description":"

Load the filter list for a given path.

\n","comments":"

This will return 0 (success) but set the output git_filter_list to NULL\n if no filters are requested for the given file.

\n","group":"filter"},"git_filter_list_apply_to_data":{"type":"function","file":"filter.h","line":118,"lineto":121,"args":[{"name":"out","type":"git_buf *","comment":"Buffer to store the result of the filtering"},{"name":"filters","type":"git_filter_list *","comment":"A loaded git_filter_list (or NULL)"},{"name":"in","type":"git_buf *","comment":"Buffer containing the data to filter"}],"argline":"git_buf *out, git_filter_list *filters, git_buf *in","sig":"git_buf *::git_filter_list *::git_buf *","return":{"type":"int","comment":" 0 on success, an error code otherwise"},"description":"

Apply filter list to a data buffer.

\n","comments":"

See git2/buffer.h for background on git_buf objects.

\n\n

If the in buffer holds data allocated by libgit2 (i.e. in->asize is\n not zero), then it will be overwritten when applying the filters. If\n not, then it will be left untouched.

\n\n

If there are no filters to apply (or filters is NULL), then the out\n buffer will reference the in buffer data (with asize set to zero)\n instead of allocating data. This keeps allocations to a minimum, but\n it means you have to be careful about freeing the in data since out\n may be pointing to it!

\n","group":"filter"},"git_filter_list_apply_to_file":{"type":"function","file":"filter.h","line":126,"lineto":130,"args":[{"name":"out","type":"git_buf *","comment":null},{"name":"filters","type":"git_filter_list *","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"path","type":"const char *","comment":null}],"argline":"git_buf *out, git_filter_list *filters, git_repository *repo, const char *path","sig":"git_buf *::git_filter_list *::git_repository *::const char *","return":{"type":"int","comment":null},"description":"

Apply filter list to the contents of a file on disk

\n","comments":"","group":"filter"},"git_filter_list_apply_to_blob":{"type":"function","file":"filter.h","line":135,"lineto":138,"args":[{"name":"out","type":"git_buf *","comment":null},{"name":"filters","type":"git_filter_list *","comment":null},{"name":"blob","type":"git_blob *","comment":null}],"argline":"git_buf *out, git_filter_list *filters, git_blob *blob","sig":"git_buf *::git_filter_list *::git_blob *","return":{"type":"int","comment":null},"description":"

Apply filter list to the contents of a blob

\n","comments":"","group":"filter"},"git_filter_list_free":{"type":"function","file":"filter.h","line":145,"lineto":145,"args":[{"name":"filters","type":"git_filter_list *","comment":"A git_filter_list created by `git_filter_list_load`"}],"argline":"git_filter_list *filters","sig":"git_filter_list *","return":{"type":"void","comment":null},"description":"

Free a git_filter_list

\n","comments":"","group":"filter"},"git_libgit2_init":{"type":"function","file":"global.h","line":26,"lineto":26,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" the number of initializations of the library, or an error code."},"description":"

Init the global state

\n","comments":"

This function must the called before any other libgit2 function in\n order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number\n of times the initialization has been called (including this one) that have\n not subsequently been shutdown.

\n","group":"libgit2","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_libgit2_init-8"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_libgit2_init-10"],"describe.c":["ex/v0.22.0-rc1/describe.html#git_libgit2_init-4"],"diff.c":["ex/v0.22.0-rc1/diff.html#git_libgit2_init-13"],"general.c":["ex/v0.22.0-rc1/general.html#git_libgit2_init-28"],"init.c":["ex/v0.22.0-rc1/init.html#git_libgit2_init-2"],"log.c":["ex/v0.22.0-rc1/log.html#git_libgit2_init-30"],"network/git2.c":["ex/v0.22.0-rc1/network/git2.html#git_libgit2_init-3"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_libgit2_init-1"],"status.c":["ex/v0.22.0-rc1/status.html#git_libgit2_init-1"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_libgit2_init-3"]}},"git_libgit2_shutdown":{"type":"function","file":"global.h","line":39,"lineto":39,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" the number of remaining initializations of the library, or an\n error code."},"description":"

Shutdown the global state

\n","comments":"

Clean up the global state and threading context after calling it as\n many times as git_libgit2_init() was called - it will return the\n number of remainining initializations that have not been shutdown\n (after this one).

\n","group":"libgit2","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_libgit2_shutdown-9"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_libgit2_shutdown-11"],"describe.c":["ex/v0.22.0-rc1/describe.html#git_libgit2_shutdown-5"],"diff.c":["ex/v0.22.0-rc1/diff.html#git_libgit2_shutdown-14"],"init.c":["ex/v0.22.0-rc1/init.html#git_libgit2_shutdown-3"],"log.c":["ex/v0.22.0-rc1/log.html#git_libgit2_shutdown-31"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_libgit2_shutdown-2"],"status.c":["ex/v0.22.0-rc1/status.html#git_libgit2_shutdown-2"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_libgit2_shutdown-4"]}},"git_graph_ahead_behind":{"type":"function","file":"graph.h","line":37,"lineto":37,"args":[{"name":"ahead","type":"size_t *","comment":"number of unique from commits in `upstream`"},{"name":"behind","type":"size_t *","comment":"number of unique from commits in `local`"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"local","type":"const git_oid *","comment":"the commit for local"},{"name":"upstream","type":"const git_oid *","comment":"the commit for upstream"}],"argline":"size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream","sig":"size_t *::size_t *::git_repository *::const git_oid *::const git_oid *","return":{"type":"int","comment":null},"description":"

Count the number of unique commits between two commit objects

\n","comments":"

There is no need for branches containing the commits to have any\n upstream relationship, but it helps to think of one as a branch and\n the other as its upstream, the ahead and behind values will be\n what git would report for the branches.

\n","group":"graph"},"git_graph_descendant_of":{"type":"function","file":"graph.h","line":48,"lineto":51,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"commit","type":"const git_oid *","comment":"a previously loaded commit."},{"name":"ancestor","type":"const git_oid *","comment":"a potential ancestor commit."}],"argline":"git_repository *repo, const git_oid *commit, const git_oid *ancestor","sig":"git_repository *::const git_oid *::const git_oid *","return":{"type":"int","comment":" 1 if the given commit is a descendant of the potential ancestor,\n 0 if not, error code otherwise."},"description":"

Determine if a commit is the descendant of another commit.

\n","comments":"","group":"graph"},"git_ignore_add_rule":{"type":"function","file":"ignore.h","line":37,"lineto":39,"args":[{"name":"repo","type":"git_repository *","comment":"The repository to add ignore rules to."},{"name":"rules","type":"const char *","comment":"Text of rules, a la the contents of a .gitignore file.\n It is okay to have multiple rules in the text; if so,\n each rule should be terminated with a newline."}],"argline":"git_repository *repo, const char *rules","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success"},"description":"

Add ignore rules for a repository.

\n","comments":"

Excludesfile rules (i.e. .gitignore rules) are generally read from\n .gitignore files in the repository tree or from a shared system file\n only if a "core.excludesfile" config value is set. The library also\n keeps a set of per-repository internal ignores that can be configured\n in-memory and will not persist. This function allows you to add to\n that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c\n
\n\n

/

\n\n

with space

\n\n

");

\n\n

This would add three rules to the ignores.

\n","group":"ignore"},"git_ignore_clear_internal_rules":{"type":"function","file":"ignore.h","line":52,"lineto":53,"args":[{"name":"repo","type":"git_repository *","comment":"The repository to remove ignore rules from."}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 0 on success"},"description":"

Clear ignore rules that were explicitly added.

\n","comments":"

Resets to the default internal ignore rules. This will not turn off\n rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n","group":"ignore"},"git_ignore_path_is_ignored":{"type":"function","file":"ignore.h","line":71,"lineto":74,"args":[{"name":"ignored","type":"int *","comment":"boolean returning 0 if the file is not ignored, 1 if it is"},{"name":"repo","type":"git_repository *","comment":"a repository object"},{"name":"path","type":"const char *","comment":"the file to check ignores for, relative to the repo's workdir."}],"argline":"int *ignored, git_repository *repo, const char *path","sig":"int *::git_repository *::const char *","return":{"type":"int","comment":" 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not."},"description":"

Test if the ignore rules apply to a given path.

\n","comments":"

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n","group":"ignore"},"git_index_open":{"type":"function","file":"index.h","line":184,"lineto":184,"args":[{"name":"out","type":"git_index **","comment":"the pointer for the new index"},{"name":"index_path","type":"const char *","comment":"the path to the index file in disk"}],"argline":"git_index **out, const char *index_path","sig":"git_index **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new bare Git index object as a memory representation\n of the Git index file in 'index_path', without a repository\n to back it.

\n","comments":"

Since there is no ODB or working directory behind this index,\n any Index methods which rely on these (e.g. index_add_bypath)\n will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository,\n use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n","group":"index"},"git_index_new":{"type":"function","file":"index.h","line":197,"lineto":197,"args":[{"name":"out","type":"git_index **","comment":"the pointer for the new index"}],"argline":"git_index **out","sig":"git_index **","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an in-memory index object.

\n","comments":"

This index object cannot be read/written to the filesystem,\n but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n","group":"index"},"git_index_free":{"type":"function","file":"index.h","line":204,"lineto":204,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"void","comment":null},"description":"

Free an existing index object.

\n","comments":"","group":"index","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_index_free-29"],"init.c":["ex/v0.22.0-rc1/init.html#git_index_free-4"]}},"git_index_owner":{"type":"function","file":"index.h","line":212,"lineto":212,"args":[{"name":"index","type":"const git_index *","comment":"The index"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"git_repository *","comment":" A pointer to the repository"},"description":"

Get the repository this index relates to

\n","comments":"","group":"index"},"git_index_caps":{"type":"function","file":"index.h","line":220,"lineto":220,"args":[{"name":"index","type":"const git_index *","comment":"An existing index object"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"int","comment":" A combination of GIT_INDEXCAP values"},"description":"

Read index capabilities flags.

\n","comments":"","group":"index"},"git_index_set_caps":{"type":"function","file":"index.h","line":233,"lineto":233,"args":[{"name":"index","type":"git_index *","comment":"An existing index object"},{"name":"caps","type":"int","comment":"A combination of GIT_INDEXCAP values"}],"argline":"git_index *index, int caps","sig":"git_index *::int","return":{"type":"int","comment":" 0 on success, -1 on failure"},"description":"

Set index capabilities flags.

\n","comments":"

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the\n capabilities will be read from the config of the owner object,\n looking at core.ignorecase, core.filemode, core.symlinks.

\n","group":"index"},"git_index_read":{"type":"function","file":"index.h","line":252,"lineto":252,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"force","type":"int","comment":"if true, always reload, vs. only read if file has changed"}],"argline":"git_index *index, int force","sig":"git_index *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Update the contents of an existing index object in memory by reading\n from the hard disk.

\n","comments":"

If force is true, this performs a "hard" read that discards in-memory\n changes and always reloads the on-disk index data. If there is no\n on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index\n data from disk only if it has changed since the last time it was\n loaded. Purely in-memory index data will be untouched. Be aware: if\n there are changes on disk, unwritten in-memory changes are discarded.

\n","group":"index"},"git_index_write":{"type":"function","file":"index.h","line":261,"lineto":261,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write an existing index object from memory back to disk\n using an atomic file lock.

\n","comments":"","group":"index"},"git_index_path":{"type":"function","file":"index.h","line":269,"lineto":269,"args":[{"name":"index","type":"const git_index *","comment":"an existing index object"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"const char *","comment":" path to index file or NULL for in-memory index"},"description":"

Get the full path to the index file on disk.

\n","comments":"","group":"index"},"git_index_read_tree":{"type":"function","file":"index.h","line":280,"lineto":280,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"tree","type":"const git_tree *","comment":"tree to read"}],"argline":"git_index *index, const git_tree *tree","sig":"git_index *::const git_tree *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read a tree into the index file with stats

\n","comments":"

The current index contents will be replaced by the specified tree.

\n","group":"index"},"git_index_write_tree":{"type":"function","file":"index.h","line":301,"lineto":301,"args":[{"name":"out","type":"git_oid *","comment":"Pointer where to store the OID of the written tree"},{"name":"index","type":"git_index *","comment":"Index to write"}],"argline":"git_oid *out, git_index *index","sig":"git_oid *::git_index *","return":{"type":"int","comment":" 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code"},"description":"

Write the index as a tree

\n","comments":"

This method will scan the index and write a representation\n of its current state back to disk; it recursively creates\n tree objects for each of the subtrees stored in the index,\n but only returns the OID of the root tree. This is the OID\n that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated\n to an existing repository.

\n\n

The index must not contain any file in conflict.

\n","group":"index","examples":{"init.c":["ex/v0.22.0-rc1/init.html#git_index_write_tree-5"]}},"git_index_write_tree_to":{"type":"function","file":"index.h","line":318,"lineto":318,"args":[{"name":"out","type":"git_oid *","comment":"Pointer where to store OID of the the written tree"},{"name":"index","type":"git_index *","comment":"Index to write"},{"name":"repo","type":"git_repository *","comment":"Repository where to write the tree"}],"argline":"git_oid *out, git_index *index, git_repository *repo","sig":"git_oid *::git_index *::git_repository *","return":{"type":"int","comment":" 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code"},"description":"

Write the index as a tree to the given repository

\n","comments":"

This method will do the same as git_index_write_tree, but\n letting the user choose the repository where the tree will\n be written.

\n\n

The index must not contain any file in conflict.

\n","group":"index"},"git_index_entrycount":{"type":"function","file":"index.h","line":337,"lineto":337,"args":[{"name":"index","type":"const git_index *","comment":"an existing index object"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"size_t","comment":" integer of count of current entries"},"description":"

Get the count of entries currently in the index

\n","comments":"","group":"index","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_index_entrycount-30"]}},"git_index_clear":{"type":"function","file":"index.h","line":348,"lineto":348,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"int","comment":" 0 on success, error code \n<\n 0 on failure"},"description":"

Clear the contents (all the entries) of an index object.

\n","comments":"

This clears the index object in memory; changes must be explicitly\n written to disk for them to take effect persistently.

\n","group":"index"},"git_index_get_byindex":{"type":"function","file":"index.h","line":361,"lineto":362,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"n","type":"size_t","comment":"the position of the entry"}],"argline":"git_index *index, size_t n","sig":"git_index *::size_t","return":{"type":"const git_index_entry *","comment":" a pointer to the entry; NULL if out of bounds"},"description":"

Get a pointer to one of the entries in the index

\n","comments":"

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n","group":"index","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_index_get_byindex-31"]}},"git_index_get_bypath":{"type":"function","file":"index.h","line":376,"lineto":377,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"},{"name":"stage","type":"int","comment":"stage to search"}],"argline":"git_index *index, const char *path, int stage","sig":"git_index *::const char *::int","return":{"type":"const git_index_entry *","comment":" a pointer to the entry; NULL if it was not found"},"description":"

Get a pointer to one of the entries in the index

\n","comments":"

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n","group":"index"},"git_index_remove":{"type":"function","file":"index.h","line":387,"lineto":387,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"},{"name":"stage","type":"int","comment":"stage to search"}],"argline":"git_index *index, const char *path, int stage","sig":"git_index *::const char *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove an entry from the index

\n","comments":"","group":"index"},"git_index_remove_directory":{"type":"function","file":"index.h","line":397,"lineto":398,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"dir","type":"const char *","comment":"container directory path"},{"name":"stage","type":"int","comment":"stage to search"}],"argline":"git_index *index, const char *dir, int stage","sig":"git_index *::const char *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove all entries from the index under a given directory

\n","comments":"","group":"index"},"git_index_add":{"type":"function","file":"index.h","line":414,"lineto":414,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"source_entry","type":"const git_index_entry *","comment":"new entry object"}],"argline":"git_index *index, const git_index_entry *source_entry","sig":"git_index *::const git_index_entry *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add or update an index entry from an in-memory struct

\n","comments":"

If a previous index entry exists that has the same path and stage\n as the given 'source_entry', it will be replaced. Otherwise, the\n 'source_entry' will be added.

\n\n

A full copy (including the 'path' string) of the given\n 'source_entry' will be inserted on the index.

\n","group":"index"},"git_index_entry_stage":{"type":"function","file":"index.h","line":426,"lineto":426,"args":[{"name":"entry","type":"const git_index_entry *","comment":"The entry"}],"argline":"const git_index_entry *entry","sig":"const git_index_entry *","return":{"type":"int","comment":" the stage number"},"description":"

Return the stage number from a git index entry

\n","comments":"

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags \n
\n\n

&\n GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT

\n","group":"index"},"git_index_add_bypath":{"type":"function","file":"index.h","line":457,"lineto":457,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"filename to add"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add or update an index entry from a file on disk

\n","comments":"

The file path must be relative to the repository's\n working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking\n at gitignore rules. Those rules can be evaluated through\n the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n","group":"index"},"git_index_remove_bypath":{"type":"function","file":"index.h","line":473,"lineto":473,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"filename to remove"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove an index entry corresponding to a file on disk

\n","comments":"

The file path must be relative to the repository's\n working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n","group":"index"},"git_index_add_all":{"type":"function","file":"index.h","line":520,"lineto":525,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"pathspec","type":"const git_strarray *","comment":"array of path patterns"},{"name":"flags","type":"unsigned int","comment":"combination of git_index_add_option_t flags"},{"name":"callback","type":"git_index_matched_path_cb","comment":"notification callback for each added/updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan."},{"name":"payload","type":"void *","comment":"payload passed through to callback function"}],"argline":"git_index *index, const git_strarray *pathspec, unsigned int flags, git_index_matched_path_cb callback, void *payload","sig":"git_index *::const git_strarray *::unsigned int::git_index_matched_path_cb::void *","return":{"type":"int","comment":" 0 on success, negative callback return value, or error code"},"description":"

Add or update index entries matching files in the working directory.

\n","comments":"

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will\n matched against files in the repository's working directory. Each file\n that matches will be added to the index (either updating an existing\n entry or adding a new entry). You can disable glob expansion and force\n exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath).\n If a file is already tracked in the index, then it will be updated\n even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to\n skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains\n the exact path of an ignored file (when not using FORCE), add the\n GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry\n in the pathspec that is an exact match to a filename on disk is\n either not ignored or already in the index. If this check fails, the\n function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback\n function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files\n will no longer be marked as conflicting. The data about the conflicts\n will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the working directory immediately before it is added to /\n updated in the index. Returning zero will add the item to the index,\n greater than zero will skip the item, and less than zero will abort the\n scan and return that value to the caller.

\n","group":"index"},"git_index_remove_all":{"type":"function","file":"index.h","line":542,"lineto":546,"args":[{"name":"index","type":"git_index *","comment":"An existing index object"},{"name":"pathspec","type":"const git_strarray *","comment":"array of path patterns"},{"name":"callback","type":"git_index_matched_path_cb","comment":"notification callback for each removed path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan."},{"name":"payload","type":"void *","comment":"payload passed through to callback function"}],"argline":"git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload","sig":"git_index *::const git_strarray *::git_index_matched_path_cb::void *","return":{"type":"int","comment":" 0 on success, negative callback return value, or error code"},"description":"

Remove all matching index entries.

\n","comments":"

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is removed. Return 0 to\n remove the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n","group":"index"},"git_index_update_all":{"type":"function","file":"index.h","line":571,"lineto":575,"args":[{"name":"index","type":"git_index *","comment":"An existing index object"},{"name":"pathspec","type":"const git_strarray *","comment":"array of path patterns"},{"name":"callback","type":"git_index_matched_path_cb","comment":"notification callback for each updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan."},{"name":"payload","type":"void *","comment":"payload passed through to callback function"}],"argline":"git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload","sig":"git_index *::const git_strarray *::git_index_matched_path_cb::void *","return":{"type":"int","comment":" 0 on success, negative callback return value, or error code"},"description":"

Update all index entries to match the working directory

\n","comments":"

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the\n working directory, deleting them if the corresponding working directory\n file no longer exists otherwise updating the information (including\n adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is updated (either refreshed\n or removed depending on working directory state). Return 0 to proceed\n with updating the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n","group":"index"},"git_index_find":{"type":"function","file":"index.h","line":586,"lineto":586,"args":[{"name":"at_pos","type":"size_t *","comment":"the address to which the position of the index entry is written (optional)"},{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"}],"argline":"size_t *at_pos, git_index *index, const char *path","sig":"size_t *::git_index *::const char *","return":{"type":"int","comment":" a zero-based position in the index if found; GIT_ENOTFOUND otherwise"},"description":"

Find the first position of any entries which point to given\n path in the Git index.

\n","comments":"","group":"index"},"git_index_conflict_add":{"type":"function","file":"index.h","line":610,"lineto":614,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"ancestor_entry","type":"const git_index_entry *","comment":"the entry data for the ancestor of the conflict"},{"name":"our_entry","type":"const git_index_entry *","comment":"the entry data for our side of the merge conflict"},{"name":"their_entry","type":"const git_index_entry *","comment":"the entry data for their side of the merge conflict"}],"argline":"git_index *index, const git_index_entry *ancestor_entry, const git_index_entry *our_entry, const git_index_entry *their_entry","sig":"git_index *::const git_index_entry *::const git_index_entry *::const git_index_entry *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add or update index entries to represent a conflict

\n","comments":"

The entries are the entries from the tree included in the merge. Any\n entry may be null to indicate that that file was not present in the\n trees during the merge. For example, ancestor_entry may be NULL to\n indicate that a file was added in both branches and must be resolved.

\n","group":"index"},"git_index_conflict_get":{"type":"function","file":"index.h","line":630,"lineto":635,"args":[{"name":"ancestor_out","type":"const git_index_entry **","comment":"Pointer to store the ancestor entry"},{"name":"our_out","type":"const git_index_entry **","comment":"Pointer to store the our entry"},{"name":"their_out","type":"const git_index_entry **","comment":"Pointer to store the their entry"},{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"}],"argline":"const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index *index, const char *path","sig":"const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the index entries that represent a conflict of a single file.

\n","comments":"

The entries are not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n","group":"index"},"git_index_conflict_remove":{"type":"function","file":"index.h","line":644,"lineto":644,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to remove conflicts for"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Removes the index entries that represent a conflict of a single file.

\n","comments":"","group":"index"},"git_index_conflict_cleanup":{"type":"function","file":"index.h","line":652,"lineto":652,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove all conflicts in the index (entries with a stage greater than 0).

\n","comments":"","group":"index"},"git_index_has_conflicts":{"type":"function","file":"index.h","line":659,"lineto":659,"args":[{"name":"index","type":"const git_index *","comment":null}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"int","comment":" 1 if at least one conflict is found, 0 otherwise."},"description":"

Determine if the index contains entries representing file conflicts.

\n","comments":"","group":"index"},"git_index_conflict_iterator_new":{"type":"function","file":"index.h","line":670,"lineto":672,"args":[{"name":"iterator_out","type":"git_index_conflict_iterator **","comment":"The newly created conflict iterator"},{"name":"index","type":"git_index *","comment":"The index to scan"}],"argline":"git_index_conflict_iterator **iterator_out, git_index *index","sig":"git_index_conflict_iterator **::git_index *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an iterator for the conflicts in the index.

\n","comments":"

The index must not be modified while iterating; the results are undefined.

\n","group":"index"},"git_index_conflict_next":{"type":"function","file":"index.h","line":684,"lineto":688,"args":[{"name":"ancestor_out","type":"const git_index_entry **","comment":"Pointer to store the ancestor side of the conflict"},{"name":"our_out","type":"const git_index_entry **","comment":"Pointer to store our side of the conflict"},{"name":"their_out","type":"const git_index_entry **","comment":"Pointer to store their side of the conflict"},{"name":"iterator","type":"git_index_conflict_iterator *","comment":null}],"argline":"const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index_conflict_iterator *iterator","sig":"const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index_conflict_iterator *","return":{"type":"int","comment":" 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)"},"description":"

Returns the current conflict (ancestor, ours and theirs entry) and\n advance the iterator internally to the next value.

\n","comments":"","group":"index"},"git_index_conflict_iterator_free":{"type":"function","file":"index.h","line":695,"lineto":696,"args":[{"name":"iterator","type":"git_index_conflict_iterator *","comment":"pointer to the iterator"}],"argline":"git_index_conflict_iterator *iterator","sig":"git_index_conflict_iterator *","return":{"type":"void","comment":null},"description":"

Frees a git_index_conflict_iterator.

\n","comments":"","group":"index"},"git_indexer_new":{"type":"function","file":"indexer.h","line":30,"lineto":36,"args":[{"name":"out","type":"git_indexer **","comment":"where to store the indexer instance"},{"name":"path","type":"const char *","comment":"to the directory where the packfile should be stored"},{"name":"mode","type":"unsigned int","comment":"permissions to use creating packfile or 0 for defaults"},{"name":"odb","type":"git_odb *","comment":"object database from which to read base objects when\n fixing thin packs. Pass NULL if no thin pack is expected (an error\n will be returned if there are bases missing)"},{"name":"progress_cb","type":"git_transfer_progress_cb","comment":"function to call with progress information"},{"name":"progress_cb_payload","type":"void *","comment":"payload for the progress callback"}],"argline":"git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_transfer_progress_cb progress_cb, void *progress_cb_payload","sig":"git_indexer **::const char *::unsigned int::git_odb *::git_transfer_progress_cb::void *","return":{"type":"int","comment":null},"description":"

Create a new indexer instance

\n","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/v0.22.0-rc1/network/index-pack.html#git_indexer_new-1"]}},"git_indexer_append":{"type":"function","file":"indexer.h","line":46,"lineto":46,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer"},{"name":"data","type":"const void *","comment":"the data to add"},{"name":"size","type":"size_t","comment":"the size of the data in bytes"},{"name":"stats","type":"git_transfer_progress *","comment":"stat storage"}],"argline":"git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats","sig":"git_indexer *::const void *::size_t::git_transfer_progress *","return":{"type":"int","comment":null},"description":"

Add data to the indexer

\n","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/v0.22.0-rc1/network/index-pack.html#git_indexer_append-2"]}},"git_indexer_commit":{"type":"function","file":"indexer.h","line":55,"lineto":55,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer"},{"name":"stats","type":"git_transfer_progress *","comment":null}],"argline":"git_indexer *idx, git_transfer_progress *stats","sig":"git_indexer *::git_transfer_progress *","return":{"type":"int","comment":null},"description":"

Finalize the pack and index

\n","comments":"

Resolve any pending deltas and write out the index file

\n","group":"indexer","examples":{"network/index-pack.c":["ex/v0.22.0-rc1/network/index-pack.html#git_indexer_commit-3"]}},"git_indexer_hash":{"type":"function","file":"indexer.h","line":65,"lineto":65,"args":[{"name":"idx","type":"const git_indexer *","comment":"the indexer instance"}],"argline":"const git_indexer *idx","sig":"const git_indexer *","return":{"type":"const git_oid *","comment":null},"description":"

Get the packfile's hash

\n","comments":"

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the index has been finalized.

\n","group":"indexer","examples":{"network/index-pack.c":["ex/v0.22.0-rc1/network/index-pack.html#git_indexer_hash-4"]}},"git_indexer_free":{"type":"function","file":"indexer.h","line":72,"lineto":72,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer to free"}],"argline":"git_indexer *idx","sig":"git_indexer *","return":{"type":"void","comment":null},"description":"

Free the indexer and its resources

\n","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/v0.22.0-rc1/network/index-pack.html#git_indexer_free-5"]}},"git_merge_file_init_input":{"type":"function","file":"merge.h","line":60,"lineto":62,"args":[{"name":"opts","type":"git_merge_file_input *","comment":"the `git_merge_file_input` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_MERGE_FILE_INPUT_VERSION` here."}],"argline":"git_merge_file_input *opts, unsigned int version","sig":"git_merge_file_input *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_merge_file_input with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_INPUT_INIT.

\n","comments":"","group":"merge"},"git_merge_file_init_options":{"type":"function","file":"merge.h","line":173,"lineto":175,"args":[{"name":"opts","type":"git_merge_file_options *","comment":"the `git_merge_file_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_MERGE_FILE_OPTIONS_VERSION` here."}],"argline":"git_merge_file_options *opts, unsigned int version","sig":"git_merge_file_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_merge_file_options with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n","comments":"","group":"merge"},"git_merge_init_options":{"type":"function","file":"merge.h","line":247,"lineto":249,"args":[{"name":"opts","type":"git_merge_options *","comment":"the `git_merge_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_MERGE_OPTIONS_VERSION` here."}],"argline":"git_merge_options *opts, unsigned int version","sig":"git_merge_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_merge_options with default values. Equivalent to\n creating an instance with GIT_MERGE_OPTIONS_INIT.

\n","comments":"","group":"merge"},"git_merge_analysis":{"type":"function","file":"merge.h","line":318,"lineto":323,"args":[{"name":"analysis_out","type":"git_merge_analysis_t *","comment":"analysis enumeration that the result is written into"},{"name":"preference_out","type":"git_merge_preference_t *","comment":null},{"name":"repo","type":"git_repository *","comment":"the repository to merge"},{"name":"their_heads","type":"const git_annotated_commit **","comment":"the heads to merge into"},{"name":"their_heads_len","type":"size_t","comment":"the number of heads to merge"}],"argline":"git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len","sig":"git_merge_analysis_t *::git_merge_preference_t *::git_repository *::const git_annotated_commit **::size_t","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Analyzes the given branch(es) and determines the opportunities for\n merging them into the HEAD of the repository.

\n","comments":"","group":"merge"},"git_merge_base":{"type":"function","file":"merge.h","line":334,"lineto":338,"args":[{"name":"out","type":"git_oid *","comment":"the OID of a merge base between 'one' and 'two'"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"one","type":"const git_oid *","comment":"one of the commits"},{"name":"two","type":"const git_oid *","comment":"the other commit"}],"argline":"git_oid *out, git_repository *repo, const git_oid *one, const git_oid *two","sig":"git_oid *::git_repository *::const git_oid *::const git_oid *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if not found or error code"},"description":"

Find a merge base between two commits

\n","comments":"","group":"merge","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_merge_base-32"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_merge_base-3"]}},"git_merge_bases":{"type":"function","file":"merge.h","line":349,"lineto":353,"args":[{"name":"out","type":"git_oidarray *","comment":"array in which to store the resulting ids"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"one","type":"const git_oid *","comment":"one of the commits"},{"name":"two","type":"const git_oid *","comment":"the other commit"}],"argline":"git_oidarray *out, git_repository *repo, const git_oid *one, const git_oid *two","sig":"git_oidarray *::git_repository *::const git_oid *::const git_oid *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if not found or error code"},"description":"

Find merge bases between two commits

\n","comments":"","group":"merge"},"git_merge_base_many":{"type":"function","file":"merge.h","line":364,"lineto":368,"args":[{"name":"out","type":"git_oid *","comment":"the OID of a merge base considering all the commits"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"length","type":"size_t","comment":"The number of commits in the provided `input_array`"},{"name":"input_array","type":"const git_oid []","comment":"oids of the commits"}],"argline":"git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array","sig":"git_oid *::git_repository *::size_t::const git_oid []","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND or -1 on failure."},"description":"

Find a merge base given a list of commits

\n","comments":"","group":"merge"},"git_merge_bases_many":{"type":"function","file":"merge.h","line":379,"lineto":383,"args":[{"name":"out","type":"git_oidarray *","comment":"array in which to store the resulting ids"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"length","type":"size_t","comment":"The number of commits in the provided `input_array`"},{"name":"input_array","type":"const git_oid []","comment":"oids of the commits"}],"argline":"git_oidarray *out, git_repository *repo, size_t length, const git_oid [] input_array","sig":"git_oidarray *::git_repository *::size_t::const git_oid []","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND or -1 on failure."},"description":"

Find all merge bases given a list of commits

\n","comments":"","group":"merge"},"git_merge_base_octopus":{"type":"function","file":"merge.h","line":394,"lineto":398,"args":[{"name":"out","type":"git_oid *","comment":"the OID of a merge base considering all the commits"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"length","type":"size_t","comment":"The number of commits in the provided `input_array`"},{"name":"input_array","type":"const git_oid []","comment":"oids of the commits"}],"argline":"git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array","sig":"git_oid *::git_repository *::size_t::const git_oid []","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND or -1 on failure."},"description":"

Find a merge base in preparation for an octopus merge

\n","comments":"","group":"merge"},"git_merge_file":{"type":"function","file":"merge.h","line":416,"lineto":421,"args":[{"name":"out","type":"git_merge_file_result *","comment":"The git_merge_file_result to be filled in"},{"name":"ancestor","type":"const git_merge_file_input *","comment":"The contents of the ancestor file"},{"name":"ours","type":"const git_merge_file_input *","comment":"The contents of the file in \"our\" side"},{"name":"theirs","type":"const git_merge_file_input *","comment":"The contents of the file in \"their\" side"},{"name":"opts","type":"const git_merge_file_options *","comment":"The merge file options or `NULL` for defaults"}],"argline":"git_merge_file_result *out, const git_merge_file_input *ancestor, const git_merge_file_input *ours, const git_merge_file_input *theirs, const git_merge_file_options *opts","sig":"git_merge_file_result *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two files as they exist in the in-memory data structures, using\n the given common ancestor as the baseline, producing a\n git_merge_file_result that reflects the merge result. The\n git_merge_file_result must be freed with git_merge_file_result_free.

\n","comments":"

Note that this function does not reference a repository and any\n configuration must be passed as git_merge_file_options.

\n","group":"merge"},"git_merge_file_from_index":{"type":"function","file":"merge.h","line":437,"lineto":443,"args":[{"name":"out","type":"git_merge_file_result *","comment":"The git_merge_file_result to be filled in"},{"name":"repo","type":"git_repository *","comment":"The repository"},{"name":"ancestor","type":"const git_index_entry *","comment":"The index entry for the ancestor file (stage level 1)"},{"name":"ours","type":"const git_index_entry *","comment":"The index entry for our file (stage level 2)"},{"name":"theirs","type":"const git_index_entry *","comment":"The index entry for their file (stage level 3)"},{"name":"opts","type":"const git_merge_file_options *","comment":"The merge file options or NULL"}],"argline":"git_merge_file_result *out, git_repository *repo, const git_index_entry *ancestor, const git_index_entry *ours, const git_index_entry *theirs, const git_merge_file_options *opts","sig":"git_merge_file_result *::git_repository *::const git_index_entry *::const git_index_entry *::const git_index_entry *::const git_merge_file_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two files as they exist in the index, using the given common\n ancestor as the baseline, producing a git_merge_file_result that\n reflects the merge result. The git_merge_file_result must be freed with\n git_merge_file_result_free.

\n","comments":"","group":"merge"},"git_merge_file_result_free":{"type":"function","file":"merge.h","line":450,"lineto":450,"args":[{"name":"result","type":"git_merge_file_result *","comment":"The result to free or `NULL`"}],"argline":"git_merge_file_result *result","sig":"git_merge_file_result *","return":{"type":"void","comment":null},"description":"

Frees a git_merge_file_result.

\n","comments":"","group":"merge"},"git_merge_trees":{"type":"function","file":"merge.h","line":468,"lineto":474,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given trees"},{"name":"ancestor_tree","type":"const git_tree *","comment":"the common ancestor between the trees (or null if none)"},{"name":"our_tree","type":"const git_tree *","comment":"the tree that reflects the destination tree"},{"name":"their_tree","type":"const git_tree *","comment":"the tree to merge in to `our_tree`"},{"name":"opts","type":"const git_merge_options *","comment":"the merge tree options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, const git_tree *ancestor_tree, const git_tree *our_tree, const git_tree *their_tree, const git_merge_options *opts","sig":"git_index **::git_repository *::const git_tree *::const git_tree *::const git_tree *::const git_merge_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two trees, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n","comments":"

The returned index must be freed explicitly with git_index_free.

\n","group":"merge"},"git_merge_commits":{"type":"function","file":"merge.h","line":495,"lineto":500,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given trees"},{"name":"our_commit","type":"const git_commit *","comment":"the commit that reflects the destination tree"},{"name":"their_commit","type":"const git_commit *","comment":"the commit to merge in to `our_commit`"},{"name":"opts","type":"const git_merge_options *","comment":"the merge tree options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, const git_commit *our_commit, const git_commit *their_commit, const git_merge_options *opts","sig":"git_index **::git_repository *::const git_commit *::const git_commit *::const git_merge_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two commits, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n","comments":"

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

The returned index must be freed explicitly with git_index_free.

\n","group":"merge"},"git_merge":{"type":"function","file":"merge.h","line":524,"lineto":529,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to merge"},{"name":"their_heads","type":"const git_annotated_commit **","comment":"the heads to merge into"},{"name":"their_heads_len","type":"size_t","comment":"the number of heads to merge"},{"name":"merge_opts","type":"const git_merge_options *","comment":"merge options"},{"name":"checkout_opts","type":"const git_checkout_options *","comment":"checkout options"}],"argline":"git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len, const git_merge_options *merge_opts, const git_checkout_options *checkout_opts","sig":"git_repository *::const git_annotated_commit **::size_t::const git_merge_options *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merges the given commit(s) into HEAD, writing the results into the working\n directory. Any changes are staged for commit and any conflicts are written\n to the index. Callers should inspect the repository's index after this\n completes, resolve any conflicts and prepare a commit.

\n","comments":"

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

For compatibility with git, the repository is put into a merging\n state. Once the commit is done (or if the uses wishes to abort),\n you should clear this state by calling\n git_repository_state_cleanup().

\n","group":"merge"},"git_message_prettify":{"type":"function","file":"message.h","line":39,"lineto":39,"args":[{"name":"out","type":"git_buf *","comment":"The user-allocated git_buf which will be filled with the\n cleaned up message."},{"name":"message","type":"const char *","comment":"The message to be prettified."},{"name":"strip_comments","type":"int","comment":"Non-zero to remove comment lines, 0 to leave them in."},{"name":"comment_char","type":"char","comment":"Comment character. Lines starting with this character\n are considered to be comments and removed if `strip_comments` is non-zero."}],"argline":"git_buf *out, const char *message, int strip_comments, char comment_char","sig":"git_buf *::const char *::int::char","return":{"type":"int","comment":" 0 or an error code."},"description":"

Clean up message from excess whitespace and make sure that the last line\n ends with a '

\n\n

'.

\n","comments":"

Optionally, can remove lines starting with a "#".

\n","group":"message"},"git_note_iterator_new":{"type":"function","file":"notes.h","line":49,"lineto":52,"args":[{"name":"out","type":"git_note_iterator **","comment":"pointer to the iterator"},{"name":"repo","type":"git_repository *","comment":"repository where to look up the note"},{"name":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional); defaults to\n \"refs/notes/commits\""}],"argline":"git_note_iterator **out, git_repository *repo, const char *notes_ref","sig":"git_note_iterator **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Creates a new iterator for notes

\n","comments":"

The iterator must be freed manually by the user.

\n","group":"note"},"git_note_iterator_free":{"type":"function","file":"notes.h","line":59,"lineto":59,"args":[{"name":"it","type":"git_note_iterator *","comment":"pointer to the iterator"}],"argline":"git_note_iterator *it","sig":"git_note_iterator *","return":{"type":"void","comment":null},"description":"

Frees an git_note_iterator

\n","comments":"","group":"note"},"git_note_next":{"type":"function","file":"notes.h","line":72,"lineto":75,"args":[{"name":"note_id","type":"git_oid *","comment":"id of blob containing the message"},{"name":"annotated_id","type":"git_oid *","comment":"id of the git object being annotated"},{"name":"it","type":"git_note_iterator *","comment":"pointer to the iterator"}],"argline":"git_oid *note_id, git_oid *annotated_id, git_note_iterator *it","sig":"git_oid *::git_oid *::git_note_iterator *","return":{"type":"int","comment":" 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)"},"description":"

Return the current item (note_id and annotated_id) and advance the iterator\n internally to the next value

\n","comments":"","group":"note"},"git_note_read":{"type":"function","file":"notes.h","line":91,"lineto":95,"args":[{"name":"out","type":"git_note **","comment":"pointer to the read note; NULL in case of error"},{"name":"repo","type":"git_repository *","comment":"repository where to look up the note"},{"name":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional); defaults to\n \"refs/notes/commits\""},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to read the note from"}],"argline":"git_note **out, git_repository *repo, const char *notes_ref, const git_oid *oid","sig":"git_note **::git_repository *::const char *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read the note for an object

\n","comments":"

The note must be freed manually by the user.

\n","group":"note"},"git_note_author":{"type":"function","file":"notes.h","line":103,"lineto":103,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const git_signature *","comment":" the author"},"description":"

Get the note author

\n","comments":"","group":"note"},"git_note_committer":{"type":"function","file":"notes.h","line":111,"lineto":111,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const git_signature *","comment":" the committer"},"description":"

Get the note committer

\n","comments":"","group":"note"},"git_note_message":{"type":"function","file":"notes.h","line":120,"lineto":120,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const char *","comment":" the note message"},"description":"

Get the note message

\n","comments":"","group":"note"},"git_note_id":{"type":"function","file":"notes.h","line":129,"lineto":129,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const git_oid *","comment":" the note object's id"},"description":"

Get the note object's id

\n","comments":"","group":"note"},"git_note_create":{"type":"function","file":"notes.h","line":146,"lineto":154,"args":[{"name":"out","type":"git_oid *","comment":"pointer to store the OID (optional); NULL in case of error"},{"name":"repo","type":"git_repository *","comment":"repository where to store the note"},{"name":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional);\n\t\t\t\t\tdefaults to \"refs/notes/commits\""},{"name":"author","type":"const git_signature *","comment":"signature of the notes commit author"},{"name":"committer","type":"const git_signature *","comment":"signature of the notes commit committer"},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to decorate"},{"name":"note","type":"const char *","comment":"Content of the note to add for object oid"},{"name":"force","type":"int","comment":"Overwrite existing note"}],"argline":"git_oid *out, git_repository *repo, const char *notes_ref, const git_signature *author, const git_signature *committer, const git_oid *oid, const char *note, int force","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *::const char *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add a note for an object

\n","comments":"","group":"note"},"git_note_remove":{"type":"function","file":"notes.h","line":169,"lineto":174,"args":[{"name":"repo","type":"git_repository *","comment":"repository where the note lives"},{"name":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional);\n\t\t\t\t\tdefaults to \"refs/notes/commits\""},{"name":"author","type":"const git_signature *","comment":"signature of the notes commit author"},{"name":"committer","type":"const git_signature *","comment":"signature of the notes commit committer"},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to remove the note from"}],"argline":"git_repository *repo, const char *notes_ref, const git_signature *author, const git_signature *committer, const git_oid *oid","sig":"git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove the note for an object

\n","comments":"","group":"note"},"git_note_free":{"type":"function","file":"notes.h","line":181,"lineto":181,"args":[{"name":"note","type":"git_note *","comment":"git_note object"}],"argline":"git_note *note","sig":"git_note *","return":{"type":"void","comment":null},"description":"

Free a git_note object

\n","comments":"","group":"note"},"git_note_default_ref":{"type":"function","file":"notes.h","line":191,"lineto":191,"args":[{"name":"out","type":"const char **","comment":"Pointer to the default notes reference"},{"name":"repo","type":"git_repository *","comment":"The Git repository"}],"argline":"const char **out, git_repository *repo","sig":"const char **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the default notes reference for a repository

\n","comments":"","group":"note"},"git_note_foreach":{"type":"function","file":"notes.h","line":209,"lineto":213,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the notes."},{"name":"notes_ref","type":"const char *","comment":"Reference to read from (optional); defaults to\n \"refs/notes/commits\"."},{"name":"note_cb","type":"git_note_foreach_cb","comment":"Callback to invoke per found annotation. Return non-zero\n to stop looping."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"git_repository *repo, const char *notes_ref, git_note_foreach_cb note_cb, void *payload","sig":"git_repository *::const char *::git_note_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Loop over all the notes within a specified namespace\n and issue a callback for each one.

\n","comments":"","group":"note"},"git_object_lookup":{"type":"function","file":"object.h","line":42,"lineto":46,"args":[{"name":"object","type":"git_object **","comment":"pointer to the looked-up object"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the object"},{"name":"id","type":"const git_oid *","comment":"the unique identifier for the object"},{"name":"type","type":"git_otype","comment":"the type of the object"}],"argline":"git_object **object, git_repository *repo, const git_oid *id, git_otype type","sig":"git_object **::git_repository *::const git_oid *::git_otype","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a reference to one of the objects in a repository.

\n","comments":"

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n","group":"object","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_object_lookup-33"]}},"git_object_lookup_prefix":{"type":"function","file":"object.h","line":75,"lineto":80,"args":[{"name":"object_out","type":"git_object **","comment":"pointer where to store the looked-up object"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the object"},{"name":"id","type":"const git_oid *","comment":"a short identifier for the object"},{"name":"len","type":"size_t","comment":"the length of the short identifier"},{"name":"type","type":"git_otype","comment":"the type of the object"}],"argline":"git_object **object_out, git_repository *repo, const git_oid *id, size_t len, git_otype type","sig":"git_object **::git_repository *::const git_oid *::size_t::git_otype","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a reference to one of the objects in a repository,\n given a prefix of its identifier (short id).

\n","comments":"

The object obtained will be so that its identifier\n matches the first 'len' hexadecimal characters\n (packets of 4 bits) of the given 'id'.\n 'len' must be at least GIT_OID_MINPREFIXLEN, and\n long enough to identify a unique object matching\n the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n","group":"object"},"git_object_lookup_bypath":{"type":"function","file":"object.h","line":93,"lineto":97,"args":[{"name":"out","type":"git_object **","comment":"buffer that receives a pointer to the object (which must be freed\n by the caller)"},{"name":"treeish","type":"const git_object *","comment":"root object that can be peeled to a tree"},{"name":"path","type":"const char *","comment":"relative path from the root object to the desired object"},{"name":"type","type":"git_otype","comment":"type of object desired"}],"argline":"git_object **out, const git_object *treeish, const char *path, git_otype type","sig":"git_object **::const git_object *::const char *::git_otype","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Lookup an object that represents a tree entry.

\n","comments":"","group":"object"},"git_object_id":{"type":"function","file":"object.h","line":105,"lineto":105,"args":[{"name":"obj","type":"const git_object *","comment":"the repository object"}],"argline":"const git_object *obj","sig":"const git_object *","return":{"type":"const git_oid *","comment":" the SHA1 id"},"description":"

Get the id (SHA1) of a repository object

\n","comments":"","group":"object","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_object_id-10","ex/v0.22.0-rc1/blame.html#git_object_id-11","ex/v0.22.0-rc1/blame.html#git_object_id-12","ex/v0.22.0-rc1/blame.html#git_object_id-13"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_object_id-12","ex/v0.22.0-rc1/cat-file.html#git_object_id-13"],"log.c":["ex/v0.22.0-rc1/log.html#git_object_id-34","ex/v0.22.0-rc1/log.html#git_object_id-35","ex/v0.22.0-rc1/log.html#git_object_id-36","ex/v0.22.0-rc1/log.html#git_object_id-37"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_object_id-4","ex/v0.22.0-rc1/rev-parse.html#git_object_id-5","ex/v0.22.0-rc1/rev-parse.html#git_object_id-6","ex/v0.22.0-rc1/rev-parse.html#git_object_id-7","ex/v0.22.0-rc1/rev-parse.html#git_object_id-8"]}},"git_object_short_id":{"type":"function","file":"object.h","line":119,"lineto":119,"args":[{"name":"out","type":"git_buf *","comment":"Buffer to write string into"},{"name":"obj","type":"const git_object *","comment":"The object to get an ID for"}],"argline":"git_buf *out, const git_object *obj","sig":"git_buf *::const git_object *","return":{"type":"int","comment":" 0 on success, \n<\n0 for error"},"description":"

Get a short abbreviated OID string for the object

\n","comments":"

This starts at the "core.abbrev" length (default 7 characters) and\n iteratively extends to a longer string if that length is ambiguous.\n The result will be unambiguous (at least until new objects are added to\n the repository).

\n","group":"object","examples":{"tag.c":["ex/v0.22.0-rc1/tag.html#git_object_short_id-5"]}},"git_object_type":{"type":"function","file":"object.h","line":127,"lineto":127,"args":[{"name":"obj","type":"const git_object *","comment":"the repository object"}],"argline":"const git_object *obj","sig":"const git_object *","return":{"type":"git_otype","comment":" the object's type"},"description":"

Get the object type of an object

\n","comments":"","group":"object","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_object_type-14","ex/v0.22.0-rc1/cat-file.html#git_object_type-15","ex/v0.22.0-rc1/cat-file.html#git_object_type-16"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_object_type-6"]}},"git_object_owner":{"type":"function","file":"object.h","line":141,"lineto":141,"args":[{"name":"obj","type":"const git_object *","comment":"the object"}],"argline":"const git_object *obj","sig":"const git_object *","return":{"type":"git_repository *","comment":" the repository who owns this object"},"description":"

Get the repository that owns this object

\n","comments":"

Freeing or calling git_repository_close on the\n returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without\n affecting the object.

\n","group":"object"},"git_object_free":{"type":"function","file":"object.h","line":158,"lineto":158,"args":[{"name":"object","type":"git_object *","comment":"the object to close"}],"argline":"git_object *object","sig":"git_object *","return":{"type":"void","comment":null},"description":"

Close an open object

\n","comments":"

This method instructs the library to close an existing\n object; note that git_objects are owned and cached by the repository\n so the object may or may not be freed after this library call,\n depending on how aggressive is the caching mechanism used\n by the repository.

\n\n

IMPORTANT:\n It is necessary to call this method when you stop using\n an object. Failure to do so will cause a memory leak.

\n","group":"object","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_object_free-14","ex/v0.22.0-rc1/blame.html#git_object_free-15","ex/v0.22.0-rc1/blame.html#git_object_free-16","ex/v0.22.0-rc1/blame.html#git_object_free-17"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_object_free-17"],"general.c":["ex/v0.22.0-rc1/general.html#git_object_free-32"],"log.c":["ex/v0.22.0-rc1/log.html#git_object_free-38"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_object_free-9","ex/v0.22.0-rc1/rev-parse.html#git_object_free-10","ex/v0.22.0-rc1/rev-parse.html#git_object_free-11"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_object_free-7","ex/v0.22.0-rc1/tag.html#git_object_free-8","ex/v0.22.0-rc1/tag.html#git_object_free-9","ex/v0.22.0-rc1/tag.html#git_object_free-10"]}},"git_object_type2string":{"type":"function","file":"object.h","line":169,"lineto":169,"args":[{"name":"type","type":"git_otype","comment":"object type to convert."}],"argline":"git_otype type","sig":"git_otype","return":{"type":"const char *","comment":" the corresponding string representation."},"description":"

Convert an object type to its string representation.

\n","comments":"

The result is a pointer to a string in static memory and\n should not be free()'ed.

\n","group":"object","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_object_type2string-18","ex/v0.22.0-rc1/cat-file.html#git_object_type2string-19","ex/v0.22.0-rc1/cat-file.html#git_object_type2string-20","ex/v0.22.0-rc1/cat-file.html#git_object_type2string-21"],"general.c":["ex/v0.22.0-rc1/general.html#git_object_type2string-33"]}},"git_object_string2type":{"type":"function","file":"object.h","line":177,"lineto":177,"args":[{"name":"str","type":"const char *","comment":"the string to convert."}],"argline":"const char *str","sig":"const char *","return":{"type":"git_otype","comment":" the corresponding git_otype."},"description":"

Convert a string object type representation to it's git_otype.

\n","comments":"","group":"object"},"git_object_typeisloose":{"type":"function","file":"object.h","line":186,"lineto":186,"args":[{"name":"type","type":"git_otype","comment":"object type to test."}],"argline":"git_otype type","sig":"git_otype","return":{"type":"int","comment":" true if the type represents a valid loose object type,\n false otherwise."},"description":"

Determine if the given git_otype is a valid loose object type.

\n","comments":"","group":"object"},"git_object__size":{"type":"function","file":"object.h","line":200,"lineto":200,"args":[{"name":"type","type":"git_otype","comment":"object type to get its size"}],"argline":"git_otype type","sig":"git_otype","return":{"type":"size_t","comment":" size in bytes of the object"},"description":"

Get the size in bytes for the structure which\n acts as an in-memory representation of any given\n object type.

\n","comments":"

For all the core types, this would the equivalent\n of calling sizeof(git_commit) if the core types\n were not opaque on the external API.

\n","group":"object"},"git_object_peel":{"type":"function","file":"object.h","line":225,"lineto":228,"args":[{"name":"peeled","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"object","type":"const git_object *","comment":"The object to be processed"},{"name":"target_type","type":"git_otype","comment":"The type of the requested object (a GIT_OBJ_ value)"}],"argline":"git_object **peeled, const git_object *object, git_otype target_type","sig":"git_object **::const git_object *::git_otype","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code"},"description":"

Recursively peel an object until an object of the specified type is met.

\n","comments":"

If the query cannot be satisfied due to the object model,\n GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a\n tree).

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will\n be peeled until the type changes. A tag will be peeled until the\n referenced object is no longer a tag, and a commit will be peeled\n to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to\n the target type due to the object model, GIT_EPEEL will be\n returned.

\n\n

You must free the returned object.

\n","group":"object"},"git_object_dup":{"type":"function","file":"object.h","line":237,"lineto":237,"args":[{"name":"dest","type":"git_object **","comment":"Pointer to store the copy of the object"},{"name":"source","type":"git_object *","comment":"Original object to copy"}],"argline":"git_object **dest, git_object *source","sig":"git_object **::git_object *","return":{"type":"int","comment":null},"description":"

Create an in-memory copy of a Git object. The copy must be\n explicitly free'd or it will leak.

\n","comments":"","group":"object"},"git_odb_new":{"type":"function","file":"odb.h","line":38,"lineto":38,"args":[{"name":"out","type":"git_odb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed."}],"argline":"git_odb **out","sig":"git_odb **","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new object database with no backends.

\n","comments":"

Before the ODB can be used for read/writing, a custom database\n backend must be manually added using git_odb_add_backend()

\n","group":"odb"},"git_odb_open":{"type":"function","file":"odb.h","line":56,"lineto":56,"args":[{"name":"out","type":"git_odb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed."},{"name":"objects_dir","type":"const char *","comment":"path of the backends' \"objects\" directory."}],"argline":"git_odb **out, const char *objects_dir","sig":"git_odb **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new object database and automatically add\n the two default backends:

\n","comments":"
- git_odb_backend_loose: read and write loose object files\n    from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,\n    assuming `objects_dir` as the Objects folder which\n    contains a 'pack/' folder with the corresponding data\n
\n","group":"odb"},"git_odb_add_disk_alternate":{"type":"function","file":"odb.h","line":73,"lineto":73,"args":[{"name":"odb","type":"git_odb *","comment":"database to add the backend to"},{"name":"path","type":"const char *","comment":"path to the objects folder for the alternate"}],"argline":"git_odb *odb, const char *path","sig":"git_odb *::const char *","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Add an on-disk alternate to an existing Object DB.

\n","comments":"

Note that the added path must point to an objects, not\n to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n","group":"odb"},"git_odb_free":{"type":"function","file":"odb.h","line":80,"lineto":80,"args":[{"name":"db","type":"git_odb *","comment":"database pointer to close. If NULL no action is taken."}],"argline":"git_odb *db","sig":"git_odb *","return":{"type":"void","comment":null},"description":"

Close an open object database.

\n","comments":"","group":"odb","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_odb_free-22"]}},"git_odb_read":{"type":"function","file":"odb.h","line":99,"lineto":99,"args":[{"name":"out","type":"git_odb_object **","comment":"pointer where to store the read object"},{"name":"db","type":"git_odb *","comment":"database to search for the object in."},{"name":"id","type":"const git_oid *","comment":"identity of the object to read."}],"argline":"git_odb_object **out, git_odb *db, const git_oid *id","sig":"git_odb_object **::git_odb *::const git_oid *","return":{"type":"int","comment":" - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database."},"description":"

Read an object from the database.

\n","comments":"

This method queries all available ODB backends\n trying to read the given OID.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n","group":"odb","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_odb_read-23"],"general.c":["ex/v0.22.0-rc1/general.html#git_odb_read-34"]}},"git_odb_read_prefix":{"type":"function","file":"odb.h","line":128,"lineto":128,"args":[{"name":"out","type":"git_odb_object **","comment":"pointer where to store the read object"},{"name":"db","type":"git_odb *","comment":"database to search for the object in."},{"name":"short_id","type":"const git_oid *","comment":"a prefix of the id of the object to read."},{"name":"len","type":"size_t","comment":"the length of the prefix"}],"argline":"git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len","sig":"git_odb_object **::git_odb *::const git_oid *::size_t","return":{"type":"int","comment":" - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database.\n - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)"},"description":"

Read an object from the database, given a prefix\n of its identifier.

\n","comments":"

This method queries all available ODB backends\n trying to match the 'len' first hexadecimal\n characters of the 'short_id'.\n The remaining (GIT_OID_HEXSZ-len)*4 bits of\n 'short_id' must be 0s.\n 'len' must be at least GIT_OID_MINPREFIXLEN,\n and the prefix must be long enough to identify\n a unique object in all the backends; the\n method will fail otherwise.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n","group":"odb"},"git_odb_read_header":{"type":"function","file":"odb.h","line":148,"lineto":148,"args":[{"name":"len_out","type":"size_t *","comment":"pointer where to store the length"},{"name":"type_out","type":"git_otype *","comment":"pointer where to store the type"},{"name":"db","type":"git_odb *","comment":"database to search for the object in."},{"name":"id","type":"const git_oid *","comment":"identity of the object to read."}],"argline":"size_t *len_out, git_otype *type_out, git_odb *db, const git_oid *id","sig":"size_t *::git_otype *::git_odb *::const git_oid *","return":{"type":"int","comment":" - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database."},"description":"

Read the header of an object from the database, without\n reading its full contents.

\n","comments":"

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header\n of an object, so the whole object will be read and then the\n header will be returned.

\n","group":"odb"},"git_odb_exists":{"type":"function","file":"odb.h","line":159,"lineto":159,"args":[{"name":"db","type":"git_odb *","comment":"database to be searched for the given object."},{"name":"id","type":"const git_oid *","comment":"the object to search for."}],"argline":"git_odb *db, const git_oid *id","sig":"git_odb *::const git_oid *","return":{"type":"int","comment":" - 1, if the object was found\n - 0, otherwise"},"description":"

Determine if the given object can be found in the object database.

\n","comments":"","group":"odb"},"git_odb_exists_prefix":{"type":"function","file":"odb.h","line":171,"lineto":172,"args":[{"name":"out","type":"git_oid *","comment":"The full OID of the found object if just one is found."},{"name":"db","type":"git_odb *","comment":"The database to be searched for the given object."},{"name":"short_id","type":"const git_oid *","comment":"A prefix of the id of the object to read."},{"name":"len","type":"size_t","comment":"The length of the prefix."}],"argline":"git_oid *out, git_odb *db, const git_oid *short_id, size_t len","sig":"git_oid *::git_odb *::const git_oid *::size_t","return":{"type":"int","comment":" 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple\n matches were found, other value \n<\n 0 if there was a read error."},"description":"

Determine if objects can be found in the object database from a short OID.

\n","comments":"","group":"odb"},"git_odb_refresh":{"type":"function","file":"odb.h","line":192,"lineto":192,"args":[{"name":"db","type":"struct git_odb *","comment":"database to refresh"}],"argline":"struct git_odb *db","sig":"struct git_odb *","return":{"type":"int","comment":" 0 on success, error code otherwise"},"description":"

Refresh the object database to load newly added files.

\n","comments":"

If the object databases have changed on disk while the library\n is running, this function will force a reload of the underlying\n indexes.

\n\n

Use this function when you're confident that an external\n application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The\n library will automatically attempt to refresh the ODB\n when a lookup fails, to see if the looked up object exists\n on disk but hasn't been loaded yet.

\n","group":"odb"},"git_odb_foreach":{"type":"function","file":"odb.h","line":207,"lineto":207,"args":[{"name":"db","type":"git_odb *","comment":"database to use"},{"name":"cb","type":"git_odb_foreach_cb","comment":"the callback to call for each object"},{"name":"payload","type":"void *","comment":"data to pass to the callback"}],"argline":"git_odb *db, git_odb_foreach_cb cb, void *payload","sig":"git_odb *::git_odb_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

List all objects available in the database

\n","comments":"

The callback will be called for each object available in the\n database. Note that the objects are likely to be returned in the index\n order, which would make accessing the objects in that order inefficient.\n Return a non-zero value from the callback to stop looping.

\n","group":"odb"},"git_odb_write":{"type":"function","file":"odb.h","line":227,"lineto":227,"args":[{"name":"out","type":"git_oid *","comment":"pointer to store the OID result of the write"},{"name":"odb","type":"git_odb *","comment":"object database where to store the object"},{"name":"data","type":"const void *","comment":"buffer with the data to store"},{"name":"len","type":"size_t","comment":"size of the buffer"},{"name":"type","type":"git_otype","comment":"type of the data to store"}],"argline":"git_oid *out, git_odb *odb, const void *data, size_t len, git_otype type","sig":"git_oid *::git_odb *::const void *::size_t::git_otype","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write an object directly into the ODB

\n","comments":"

This method writes a full object straight into the ODB.\n For most cases, it is preferred to write objects through a write\n stream, which is both faster and less memory intensive, specially\n for big objects.

\n\n

This method is provided for compatibility with custom backends\n which are not able to support streaming writes

\n","group":"odb","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_odb_write-35"]}},"git_odb_open_wstream":{"type":"function","file":"odb.h","line":250,"lineto":250,"args":[{"name":"out","type":"git_odb_stream **","comment":"pointer where to store the stream"},{"name":"db","type":"git_odb *","comment":"object database where the stream will write"},{"name":"size","type":"size_t","comment":"final size of the object that will be written"},{"name":"type","type":"git_otype","comment":"type of the object that will be written"}],"argline":"git_odb_stream **out, git_odb *db, size_t size, git_otype type","sig":"git_odb_stream **::git_odb *::size_t::git_otype","return":{"type":"int","comment":" 0 if the stream was created; error code otherwise"},"description":"

Open a stream to write an object into the ODB

\n","comments":"

The type and final length of the object must be specified\n when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it\n won't be effective until git_odb_stream_finalize_write is called\n and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or\n will leak memory.

\n","group":"odb"},"git_odb_stream_write":{"type":"function","file":"odb.h","line":263,"lineto":263,"args":[{"name":"stream","type":"git_odb_stream *","comment":"the stream"},{"name":"buffer","type":"const char *","comment":"the data to write"},{"name":"len","type":"size_t","comment":"the buffer's length"}],"argline":"git_odb_stream *stream, const char *buffer, size_t len","sig":"git_odb_stream *::const char *::size_t","return":{"type":"int","comment":" 0 if the write succeeded; error code otherwise"},"description":"

Write to an odb stream

\n","comments":"

This method will fail if the total number of received bytes exceeds the\n size declared with git_odb_open_wstream()

\n","group":"odb"},"git_odb_stream_finalize_write":{"type":"function","file":"odb.h","line":278,"lineto":278,"args":[{"name":"out","type":"git_oid *","comment":"pointer to store the resulting object's id"},{"name":"stream","type":"git_odb_stream *","comment":"the stream"}],"argline":"git_oid *out, git_odb_stream *stream","sig":"git_oid *::git_odb_stream *","return":{"type":"int","comment":" 0 on success; an error code otherwise"},"description":"

Finish writing to an odb stream

\n","comments":"

The object will take its final name and will be available to the\n odb.

\n\n

This method will fail if the total number of received bytes\n differs from the size declared with git_odb_open_wstream()

\n","group":"odb"},"git_odb_stream_read":{"type":"function","file":"odb.h","line":285,"lineto":285,"args":[{"name":"stream","type":"git_odb_stream *","comment":null},{"name":"buffer","type":"char *","comment":null},{"name":"len","type":"size_t","comment":null}],"argline":"git_odb_stream *stream, char *buffer, size_t len","sig":"git_odb_stream *::char *::size_t","return":{"type":"int","comment":null},"description":"

Read from an odb stream

\n","comments":"

Most backends don't implement streaming reads

\n","group":"odb"},"git_odb_stream_free":{"type":"function","file":"odb.h","line":292,"lineto":292,"args":[{"name":"stream","type":"git_odb_stream *","comment":"the stream to free"}],"argline":"git_odb_stream *stream","sig":"git_odb_stream *","return":{"type":"void","comment":null},"description":"

Free an odb stream

\n","comments":"","group":"odb"},"git_odb_open_rstream":{"type":"function","file":"odb.h","line":318,"lineto":318,"args":[{"name":"out","type":"git_odb_stream **","comment":"pointer where to store the stream"},{"name":"db","type":"git_odb *","comment":"object database where the stream will read from"},{"name":"oid","type":"const git_oid *","comment":"oid of the object the stream will read from"}],"argline":"git_odb_stream **out, git_odb *db, const git_oid *oid","sig":"git_odb_stream **::git_odb *::const git_oid *","return":{"type":"int","comment":" 0 if the stream was created; error code otherwise"},"description":"

Open a stream to read an object from the ODB

\n","comments":"

Note that most backends do not support streaming reads\n because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is\n assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and\n will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream\n    - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n","group":"odb"},"git_odb_write_pack":{"type":"function","file":"odb.h","line":338,"lineto":342,"args":[{"name":"out","type":"git_odb_writepack **","comment":"pointer to the writepack functions"},{"name":"db","type":"git_odb *","comment":"object database where the stream will read from"},{"name":"progress_cb","type":"git_transfer_progress_cb","comment":"function to call with progress information.\n Be aware that this is called inline with network and indexing operations,\n so performance may be affected."},{"name":"progress_payload","type":"void *","comment":"payload for the progress callback"}],"argline":"git_odb_writepack **out, git_odb *db, git_transfer_progress_cb progress_cb, void *progress_payload","sig":"git_odb_writepack **::git_odb *::git_transfer_progress_cb::void *","return":{"type":"int","comment":null},"description":"

Open a stream for writing a pack file to the ODB.

\n","comments":"

If the ODB layer understands pack files, then the given\n packfile will likely be streamed directly to disk (and a\n corresponding index created). If the ODB layer does not\n understand pack files, the objects will be stored in whatever\n format the ODB layer uses.

\n","group":"odb"},"git_odb_hash":{"type":"function","file":"odb.h","line":356,"lineto":356,"args":[{"name":"out","type":"git_oid *","comment":"the resulting object-ID."},{"name":"data","type":"const void *","comment":"data to hash"},{"name":"len","type":"size_t","comment":"size of the data"},{"name":"type","type":"git_otype","comment":"of the data to hash"}],"argline":"git_oid *out, const void *data, size_t len, git_otype type","sig":"git_oid *::const void *::size_t::git_otype","return":{"type":"int","comment":" 0 or an error code"},"description":"

Determine the object-ID (sha1 hash) of a data buffer

\n","comments":"

The resulting SHA-1 OID will be the identifier for the data\n buffer as if the data buffer it were to written to the ODB.

\n","group":"odb"},"git_odb_hashfile":{"type":"function","file":"odb.h","line":371,"lineto":371,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"path","type":"const char *","comment":"file to read and determine object id for"},{"name":"type","type":"git_otype","comment":"the type of the object that will be hashed"}],"argline":"git_oid *out, const char *path, git_otype type","sig":"git_oid *::const char *::git_otype","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read a file from disk and fill a git_oid with the object id\n that the file would have if it were written to the Object\n Database as an object of the given type (w/o applying filters).\n Similar functionality to git.git's git hash-object without\n the -w flag, however, with the --no-filters flag.\n If you need filters, see git_repository_hashfile.

\n","comments":"","group":"odb"},"git_odb_object_dup":{"type":"function","file":"odb.h","line":385,"lineto":385,"args":[{"name":"dest","type":"git_odb_object **","comment":"pointer where to store the copy"},{"name":"source","type":"git_odb_object *","comment":"object to copy"}],"argline":"git_odb_object **dest, git_odb_object *source","sig":"git_odb_object **::git_odb_object *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a copy of an odb_object

\n","comments":"

The returned copy must be manually freed with git_odb_object_free.\n Note that because of an implementation detail, the returned copy will be\n the same pointer as source: the object is internally refcounted, so the\n copy still needs to be freed twice.

\n","group":"odb"},"git_odb_object_free":{"type":"function","file":"odb.h","line":395,"lineto":395,"args":[{"name":"object","type":"git_odb_object *","comment":"object to close"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"void","comment":null},"description":"

Close an ODB object

\n","comments":"

This method must always be called once a git_odb_object is no\n longer needed, otherwise memory will leak.

\n","group":"odb","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_odb_object_free-24"],"general.c":["ex/v0.22.0-rc1/general.html#git_odb_object_free-36"]}},"git_odb_object_id":{"type":"function","file":"odb.h","line":405,"lineto":405,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"const git_oid *","comment":" a pointer to the OID"},"description":"

Return the OID of an ODB object

\n","comments":"

This is the OID from which the object was read from

\n","group":"odb"},"git_odb_object_data":{"type":"function","file":"odb.h","line":418,"lineto":418,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"const void *","comment":" a pointer to the data"},"description":"

Return the data of an ODB object

\n","comments":"

This is the uncompressed, raw data as read from the ODB,\n without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n","group":"odb","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_odb_object_data-37"]}},"git_odb_object_size":{"type":"function","file":"odb.h","line":429,"lineto":429,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"size_t","comment":" the size"},"description":"

Return the size of an ODB object

\n","comments":"

This is the real size of the data buffer, not the\n actual size of the object.

\n","group":"odb","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_odb_object_size-25"],"general.c":["ex/v0.22.0-rc1/general.html#git_odb_object_size-38"]}},"git_odb_object_type":{"type":"function","file":"odb.h","line":437,"lineto":437,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"git_otype","comment":" the type"},"description":"

Return the type of an ODB object

\n","comments":"","group":"odb","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_odb_object_type-39"]}},"git_odb_add_backend":{"type":"function","file":"odb.h","line":452,"lineto":452,"args":[{"name":"odb","type":"git_odb *","comment":"database to add the backend to"},{"name":"backend","type":"git_odb_backend *","comment":"pointer to a git_odb_backend instance"},{"name":"priority","type":"int","comment":"Value for ordering the backends queue"}],"argline":"git_odb *odb, git_odb_backend *backend, int priority","sig":"git_odb *::git_odb_backend *::int","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Add a custom backend to an existing Object DB

\n","comments":"

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Read \n for more information.

\n","group":"odb"},"git_odb_add_alternate":{"type":"function","file":"odb.h","line":473,"lineto":473,"args":[{"name":"odb","type":"git_odb *","comment":"database to add the backend to"},{"name":"backend","type":"git_odb_backend *","comment":"pointer to a git_odb_backend instance"},{"name":"priority","type":"int","comment":"Value for ordering the backends queue"}],"argline":"git_odb *odb, git_odb_backend *backend, int priority","sig":"git_odb *::git_odb_backend *::int","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Add a custom backend to an existing Object DB; this\n backend will work as an alternate.

\n","comments":"

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read \n for more information.

\n","group":"odb"},"git_odb_num_backends":{"type":"function","file":"odb.h","line":481,"lineto":481,"args":[{"name":"odb","type":"git_odb *","comment":"object database"}],"argline":"git_odb *odb","sig":"git_odb *","return":{"type":"size_t","comment":" number of backends in the ODB"},"description":"

Get the number of ODB backend objects

\n","comments":"","group":"odb"},"git_odb_get_backend":{"type":"function","file":"odb.h","line":491,"lineto":491,"args":[{"name":"out","type":"git_odb_backend **","comment":"output pointer to ODB backend at pos"},{"name":"odb","type":"git_odb *","comment":"object database"},{"name":"pos","type":"size_t","comment":"index into object database backend list"}],"argline":"git_odb_backend **out, git_odb *odb, size_t pos","sig":"git_odb_backend **::git_odb *::size_t","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND if pos is invalid; other errors \n<\n 0"},"description":"

Lookup an ODB backend object by index

\n","comments":"","group":"odb"},"git_odb_backend_pack":{"type":"function","file":"odb_backend.h","line":34,"lineto":34,"args":[{"name":"out","type":"git_odb_backend **","comment":"location to store the odb backend pointer"},{"name":"objects_dir","type":"const char *","comment":"the Git repository's objects directory"}],"argline":"git_odb_backend **out, const char *objects_dir","sig":"git_odb_backend **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a backend for the packfiles.

\n","comments":"","group":"odb"},"git_odb_backend_loose":{"type":"function","file":"odb_backend.h","line":48,"lineto":54,"args":[{"name":"out","type":"git_odb_backend **","comment":"location to store the odb backend pointer"},{"name":"objects_dir","type":"const char *","comment":"the Git repository's objects directory"},{"name":"compression_level","type":"int","comment":"zlib compression level to use"},{"name":"do_fsync","type":"int","comment":"whether to do an fsync() after writing (currently ignored)"},{"name":"dir_mode","type":"unsigned int","comment":"permissions to use creating a directory or 0 for defaults"},{"name":"file_mode","type":"unsigned int","comment":"permissions to use creating a file or 0 for defaults"}],"argline":"git_odb_backend **out, const char *objects_dir, int compression_level, int do_fsync, unsigned int dir_mode, unsigned int file_mode","sig":"git_odb_backend **::const char *::int::int::unsigned int::unsigned int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a backend for loose objects

\n","comments":"","group":"odb"},"git_odb_backend_one_pack":{"type":"function","file":"odb_backend.h","line":67,"lineto":67,"args":[{"name":"out","type":"git_odb_backend **","comment":"location to store the odb backend pointer"},{"name":"index_file","type":"const char *","comment":"path to the packfile's .idx file"}],"argline":"git_odb_backend **out, const char *index_file","sig":"git_odb_backend **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a backend out of a single packfile

\n","comments":"

This can be useful for inspecting the contents of a single\n packfile.

\n","group":"odb"},"git_oid_fromstr":{"type":"function","file":"oid.h","line":47,"lineto":47,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"str","type":"const char *","comment":"input hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes)."}],"argline":"git_oid *out, const char *str","sig":"git_oid *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Parse a hex formatted object id into a git_oid.

\n","comments":"","group":"oid","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_oid_fromstr-40","ex/v0.22.0-rc1/general.html#git_oid_fromstr-41","ex/v0.22.0-rc1/general.html#git_oid_fromstr-42","ex/v0.22.0-rc1/general.html#git_oid_fromstr-43","ex/v0.22.0-rc1/general.html#git_oid_fromstr-44","ex/v0.22.0-rc1/general.html#git_oid_fromstr-45","ex/v0.22.0-rc1/general.html#git_oid_fromstr-46","ex/v0.22.0-rc1/general.html#git_oid_fromstr-47"]}},"git_oid_fromstrp":{"type":"function","file":"oid.h","line":57,"lineto":57,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"str","type":"const char *","comment":"input hex string; must be at least 4 characters\n long and null-terminated."}],"argline":"git_oid *out, const char *str","sig":"git_oid *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Parse a hex formatted null-terminated string into a git_oid.

\n","comments":"","group":"oid"},"git_oid_fromstrn":{"type":"function","file":"oid.h","line":70,"lineto":70,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"str","type":"const char *","comment":"input hex string of at least size `length`"},{"name":"length","type":"size_t","comment":"length of the input string"}],"argline":"git_oid *out, const char *str, size_t length","sig":"git_oid *::const char *::size_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Parse N characters of a hex formatted object id into a git_oid

\n","comments":"

If N is odd, N-1 characters will be parsed instead.\n The remaining space in the git_oid will be set to zero.

\n","group":"oid"},"git_oid_fromraw":{"type":"function","file":"oid.h","line":78,"lineto":78,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"raw","type":"const unsigned char *","comment":"the raw input bytes to be copied."}],"argline":"git_oid *out, const unsigned char *raw","sig":"git_oid *::const unsigned char *","return":{"type":"void","comment":null},"description":"

Copy an already raw oid into a git_oid structure.

\n","comments":"","group":"oid"},"git_oid_fmt":{"type":"function","file":"oid.h","line":90,"lineto":90,"args":[{"name":"out","type":"char *","comment":"output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required."},{"name":"id","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *out, const git_oid *id","sig":"char *::const git_oid *","return":{"type":"void","comment":null},"description":"

Format a git_oid into a hex string.

\n","comments":"","group":"oid","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_oid_fmt-48","ex/v0.22.0-rc1/general.html#git_oid_fmt-49","ex/v0.22.0-rc1/general.html#git_oid_fmt-50","ex/v0.22.0-rc1/general.html#git_oid_fmt-51","ex/v0.22.0-rc1/general.html#git_oid_fmt-52"],"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_oid_fmt-1","ex/v0.22.0-rc1/network/fetch.html#git_oid_fmt-2"],"network/index-pack.c":["ex/v0.22.0-rc1/network/index-pack.html#git_oid_fmt-6"],"network/ls-remote.c":["ex/v0.22.0-rc1/network/ls-remote.html#git_oid_fmt-1"]}},"git_oid_nfmt":{"type":"function","file":"oid.h","line":101,"lineto":101,"args":[{"name":"out","type":"char *","comment":"output hex string; you say how many bytes to write.\n\t\tIf the number of bytes is > GIT_OID_HEXSZ, extra bytes\n\t\twill be zeroed; if not, a '\n\\\n0' terminator is NOT added."},{"name":"n","type":"size_t","comment":"number of characters to write into out string"},{"name":"id","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *out, size_t n, const git_oid *id","sig":"char *::size_t::const git_oid *","return":{"type":"void","comment":null},"description":"

Format a git_oid into a partial hex string.

\n","comments":"","group":"oid"},"git_oid_pathfmt":{"type":"function","file":"oid.h","line":116,"lineto":116,"args":[{"name":"out","type":"char *","comment":"output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (41 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required."},{"name":"id","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *out, const git_oid *id","sig":"char *::const git_oid *","return":{"type":"void","comment":null},"description":"

Format a git_oid into a loose-object path string.

\n","comments":"

The resulting string is "aa/...", where "aa" is the first two\n hex digits of the oid and "..." is the remaining 38 digits.

\n","group":"oid"},"git_oid_tostr_s":{"type":"function","file":"oid.h","line":129,"lineto":129,"args":[{"name":"oid","type":"const git_oid *","comment":null}],"argline":"const git_oid *oid","sig":"const git_oid *","return":{"type":"char *","comment":" the c-string"},"description":"

Format a git_oid into a statically allocated c-string.

\n","comments":"

The c-string is owned by the library and should not be freed\n by the user. If libgit2 is built with thread support, the string\n will be stored in TLS (i.e. one buffer per thread) to allow for\n concurrent calls of the function.

\n","group":"oid"},"git_oid_tostr":{"type":"function","file":"oid.h","line":148,"lineto":148,"args":[{"name":"out","type":"char *","comment":"the buffer into which the oid string is output."},{"name":"n","type":"size_t","comment":"the size of the out buffer."},{"name":"id","type":"const git_oid *","comment":"the oid structure to format."}],"argline":"char *out, size_t n, const git_oid *id","sig":"char *::size_t::const git_oid *","return":{"type":"char *","comment":" the out buffer pointer, assuming no input parameter\n\t\t\terrors, otherwise a pointer to an empty string."},"description":"

Format a git_oid into a buffer as a hex format c-string.

\n","comments":"

If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting\n oid c-string will be truncated to n-1 characters (but will still be\n NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid ==\n NULL), then a pointer to an empty string is returned, so that the\n return value can always be printed.

\n","group":"oid","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_oid_tostr-18","ex/v0.22.0-rc1/blame.html#git_oid_tostr-19"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_oid_tostr-26","ex/v0.22.0-rc1/cat-file.html#git_oid_tostr-27","ex/v0.22.0-rc1/cat-file.html#git_oid_tostr-28","ex/v0.22.0-rc1/cat-file.html#git_oid_tostr-29","ex/v0.22.0-rc1/cat-file.html#git_oid_tostr-30"],"log.c":["ex/v0.22.0-rc1/log.html#git_oid_tostr-39","ex/v0.22.0-rc1/log.html#git_oid_tostr-40"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_oid_tostr-12","ex/v0.22.0-rc1/rev-parse.html#git_oid_tostr-13","ex/v0.22.0-rc1/rev-parse.html#git_oid_tostr-14","ex/v0.22.0-rc1/rev-parse.html#git_oid_tostr-15"]}},"git_oid_cpy":{"type":"function","file":"oid.h","line":156,"lineto":156,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"src","type":"const git_oid *","comment":"oid structure to copy from."}],"argline":"git_oid *out, const git_oid *src","sig":"git_oid *::const git_oid *","return":{"type":"void","comment":null},"description":"

Copy an oid from one structure to another.

\n","comments":"","group":"oid","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_oid_cpy-20","ex/v0.22.0-rc1/blame.html#git_oid_cpy-21","ex/v0.22.0-rc1/blame.html#git_oid_cpy-22"]}},"git_oid_cmp":{"type":"function","file":"oid.h","line":165,"lineto":165,"args":[{"name":"a","type":"const git_oid *","comment":"first oid structure."},{"name":"b","type":"const git_oid *","comment":"second oid structure."}],"argline":"const git_oid *a, const git_oid *b","sig":"const git_oid *::const git_oid *","return":{"type":"int","comment":" \n<\n0, 0, >0 if a \n<\n b, a == b, a > b."},"description":"

Compare two oid structures.

\n","comments":"","group":"oid"},"git_oid_equal":{"type":"function","file":"oid.h","line":174,"lineto":174,"args":[{"name":"a","type":"const git_oid *","comment":"first oid structure."},{"name":"b","type":"const git_oid *","comment":"second oid structure."}],"argline":"const git_oid *a, const git_oid *b","sig":"const git_oid *::const git_oid *","return":{"type":"int","comment":" true if equal, false otherwise"},"description":"

Compare two oid structures for equality

\n","comments":"","group":"oid"},"git_oid_ncmp":{"type":"function","file":"oid.h","line":185,"lineto":185,"args":[{"name":"a","type":"const git_oid *","comment":"first oid structure."},{"name":"b","type":"const git_oid *","comment":"second oid structure."},{"name":"len","type":"size_t","comment":"the number of hex chars to compare"}],"argline":"const git_oid *a, const git_oid *b, size_t len","sig":"const git_oid *::const git_oid *::size_t","return":{"type":"int","comment":" 0 in case of a match"},"description":"

Compare the first 'len' hexadecimal characters (packets of 4 bits)\n of two oid structures.

\n","comments":"","group":"oid"},"git_oid_streq":{"type":"function","file":"oid.h","line":194,"lineto":194,"args":[{"name":"id","type":"const git_oid *","comment":"oid structure."},{"name":"str","type":"const char *","comment":"input hex string of an object id."}],"argline":"const git_oid *id, const char *str","sig":"const git_oid *::const char *","return":{"type":"int","comment":" 0 in case of a match, -1 otherwise."},"description":"

Check if an oid equals an hex formatted object id.

\n","comments":"","group":"oid"},"git_oid_strcmp":{"type":"function","file":"oid.h","line":204,"lineto":204,"args":[{"name":"id","type":"const git_oid *","comment":"oid structure."},{"name":"str","type":"const char *","comment":"input hex string of an object id."}],"argline":"const git_oid *id, const char *str","sig":"const git_oid *::const char *","return":{"type":"int","comment":" -1 if str is not valid, \n<\n0 if id sorts before str,\n 0 if id matches str, >0 if id sorts after str."},"description":"

Compare an oid to an hex formatted object id.

\n","comments":"","group":"oid"},"git_oid_iszero":{"type":"function","file":"oid.h","line":211,"lineto":211,"args":[{"name":"id","type":"const git_oid *","comment":null}],"argline":"const git_oid *id","sig":"const git_oid *","return":{"type":"int","comment":" 1 if all zeros, 0 otherwise."},"description":"

Check is an oid is all zeros.

\n","comments":"","group":"oid","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_oid_iszero-23"],"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_oid_iszero-3"]}},"git_oid_shorten_new":{"type":"function","file":"oid.h","line":232,"lineto":232,"args":[{"name":"min_length","type":"size_t","comment":"The minimal length for all identifiers,\n\t\twhich will be used even if shorter OIDs would still\n\t\tbe unique."}],"argline":"size_t min_length","sig":"size_t","return":{"type":"git_oid_shorten *","comment":" a `git_oid_shorten` instance, NULL if OOM"},"description":"

Create a new OID shortener.

\n","comments":"

The OID shortener is used to process a list of OIDs\n in text form and return the shortest length that would\n uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n","group":"oid"},"git_oid_shorten_add":{"type":"function","file":"oid.h","line":258,"lineto":258,"args":[{"name":"os","type":"git_oid_shorten *","comment":"a `git_oid_shorten` instance"},{"name":"text_id","type":"const char *","comment":"an OID in text form"}],"argline":"git_oid_shorten *os, const char *text_id","sig":"git_oid_shorten *::const char *","return":{"type":"int","comment":" the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs."},"description":"

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n","comments":"

The OID is expected to be a 40-char hexadecimal string.\n The OID is owned by the user and will not be modified\n or freed.

\n\n

For performance reasons, there is a hard-limit of how many\n OIDs can be added to a single set (around ~32000, assuming\n a mostly randomized distribution), which should be enough\n for any kind of program, and keeps the algorithm fast and\n memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a\n GITERR_INVALID error

\n","group":"oid"},"git_oid_shorten_free":{"type":"function","file":"oid.h","line":265,"lineto":265,"args":[{"name":"os","type":"git_oid_shorten *","comment":"a `git_oid_shorten` instance"}],"argline":"git_oid_shorten *os","sig":"git_oid_shorten *","return":{"type":"void","comment":null},"description":"

Free an OID shortener instance

\n","comments":"","group":"oid"},"git_oidarray_free":{"type":"function","file":"oidarray.h","line":34,"lineto":34,"args":[{"name":"array","type":"git_oidarray *","comment":"git_oidarray from which to free oid data"}],"argline":"git_oidarray *array","sig":"git_oidarray *","return":{"type":"void","comment":null},"description":"

Free the OID array

\n","comments":"

This method must (and must only) be called on git_oidarray\n objects where the array is allocated by the library. Not doing so,\n will result in a memory leak.

\n\n

This does not free the git_oidarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n","group":"oidarray"},"git_packbuilder_new":{"type":"function","file":"pack.h","line":64,"lineto":64,"args":[{"name":"out","type":"git_packbuilder **","comment":"The new packbuilder object"},{"name":"repo","type":"git_repository *","comment":"The repository"}],"argline":"git_packbuilder **out, git_repository *repo","sig":"git_packbuilder **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Initialize a new packbuilder

\n","comments":"","group":"packbuilder"},"git_packbuilder_set_threads":{"type":"function","file":"pack.h","line":77,"lineto":77,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"n","type":"unsigned int","comment":"Number of threads to spawn"}],"argline":"git_packbuilder *pb, unsigned int n","sig":"git_packbuilder *::unsigned int","return":{"type":"unsigned int","comment":" number of actual threads to be used"},"description":"

Set number of threads to spawn

\n","comments":"

By default, libgit2 won't spawn any threads at all;\n when set to 0, libgit2 will autodetect the number of\n CPUs.

\n","group":"packbuilder"},"git_packbuilder_insert":{"type":"function","file":"pack.h","line":91,"lineto":91,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"id","type":"const git_oid *","comment":"The oid of the commit"},{"name":"name","type":"const char *","comment":"The name; might be NULL"}],"argline":"git_packbuilder *pb, const git_oid *id, const char *name","sig":"git_packbuilder *::const git_oid *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Insert a single object

\n","comments":"

For an optimal pack it's mandatory to insert objects in recency order,\n commits followed by trees and blobs.

\n","group":"packbuilder"},"git_packbuilder_insert_tree":{"type":"function","file":"pack.h","line":103,"lineto":103,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"id","type":"const git_oid *","comment":"The oid of the root tree"}],"argline":"git_packbuilder *pb, const git_oid *id","sig":"git_packbuilder *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Insert a root tree object

\n","comments":"

This will add the tree as well as all referenced trees and blobs.

\n","group":"packbuilder"},"git_packbuilder_insert_commit":{"type":"function","file":"pack.h","line":115,"lineto":115,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"id","type":"const git_oid *","comment":"The oid of the commit"}],"argline":"git_packbuilder *pb, const git_oid *id","sig":"git_packbuilder *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Insert a commit object

\n","comments":"

This will add a commit as well as the completed referenced tree.

\n","group":"packbuilder"},"git_packbuilder_write":{"type":"function","file":"pack.h","line":139,"lineto":144,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"path","type":"const char *","comment":"to the directory where the packfile and index should be stored"},{"name":"mode","type":"unsigned int","comment":"permissions to use creating a packfile or 0 for defaults"},{"name":"progress_cb","type":"git_transfer_progress_cb","comment":"function to call with progress information from the indexer (optional)"},{"name":"progress_cb_payload","type":"void *","comment":"payload for the progress callback (optional)"}],"argline":"git_packbuilder *pb, const char *path, unsigned int mode, git_transfer_progress_cb progress_cb, void *progress_cb_payload","sig":"git_packbuilder *::const char *::unsigned int::git_transfer_progress_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write the new pack and corresponding index file to path.

\n","comments":"","group":"packbuilder"},"git_packbuilder_hash":{"type":"function","file":"pack.h","line":154,"lineto":154,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder object"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"const git_oid *","comment":null},"description":"

Get the packfile's hash

\n","comments":"

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the packfile has been written.

\n","group":"packbuilder"},"git_packbuilder_foreach":{"type":"function","file":"pack.h","line":166,"lineto":166,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"},{"name":"cb","type":"git_packbuilder_foreach_cb","comment":"the callback to call with each packed object's buffer"},{"name":"payload","type":"void *","comment":"the callback's data"}],"argline":"git_packbuilder *pb, git_packbuilder_foreach_cb cb, void *payload","sig":"git_packbuilder *::git_packbuilder_foreach_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create the new pack and pass each object to the callback

\n","comments":"","group":"packbuilder"},"git_packbuilder_object_count":{"type":"function","file":"pack.h","line":174,"lineto":174,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"uint32_t","comment":" the number of objects in the packfile"},"description":"

Get the total number of objects the packbuilder will write out

\n","comments":"","group":"packbuilder"},"git_packbuilder_written":{"type":"function","file":"pack.h","line":182,"lineto":182,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"uint32_t","comment":" the number of objects which have already been written"},"description":"

Get the number of objects the packbuilder has already written out

\n","comments":"","group":"packbuilder"},"git_packbuilder_set_callbacks":{"type":"function","file":"pack.h","line":201,"lineto":204,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder object"},{"name":"progress_cb","type":"git_packbuilder_progress","comment":"Function to call with progress information during\n pack building. Be aware that this is called inline with pack building\n operations, so performance may be affected."},{"name":"progress_cb_payload","type":"void *","comment":"Payload for progress callback."}],"argline":"git_packbuilder *pb, git_packbuilder_progress progress_cb, void *progress_cb_payload","sig":"git_packbuilder *::git_packbuilder_progress::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the callbacks for a packbuilder

\n","comments":"","group":"packbuilder"},"git_packbuilder_free":{"type":"function","file":"pack.h","line":211,"lineto":211,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"void","comment":null},"description":"

Free the packbuilder and all associated data

\n","comments":"","group":"packbuilder"},"git_patch_from_diff":{"type":"function","file":"patch.h","line":55,"lineto":56,"args":[{"name":"out","type":"git_patch **","comment":"Output parameter for the delta patch object"},{"name":"diff","type":"git_diff *","comment":"Diff list object"},{"name":"idx","type":"size_t","comment":"Index into diff list"}],"argline":"git_patch **out, git_diff *diff, size_t idx","sig":"git_patch **::git_diff *::size_t","return":{"type":"int","comment":" 0 on success, other value \n<\n 0 on error"},"description":"

Return the diff delta and patch for an entry in the diff list.

\n","comments":"

The git_patch is a newly created object contains the text diffs\n for the delta. You have to call git_patch_free() when you are\n done with it. You can use the patch object to loop over all the hunks\n and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be\n created, the output will be set to NULL, and the binary flag will be\n set true in the git_diff_delta structure.

\n\n

The git_diff_delta pointer points to internal data and you do not have\n to release it when you are done with it. It will go away when the\n git_diff and git_patch go away.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass\n NULL for the git_patch, then the text diff will not be calculated.

\n","group":"patch"},"git_patch_from_blobs":{"type":"function","file":"patch.h","line":74,"lineto":80,"args":[{"name":"out","type":"git_patch **","comment":"The generated patch; NULL on error"},{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"new_blob","type":"const git_blob *","comment":"Blob for new side of diff, or NULL for empty blob"},{"name":"new_as_path","type":"const char *","comment":"Treat new blob as if it had this filename; can be NULL"},{"name":"opts","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"}],"argline":"git_patch **out, const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *opts","sig":"git_patch **::const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *","return":{"type":"int","comment":" 0 on success or error code \n<\n 0"},"description":"

Directly generate a patch from the difference between two blobs.

\n","comments":"

This is just like git_diff_blobs() except it generates a patch object\n for the difference instead of directly making callbacks. You can use the\n standard git_patch accessor functions to read the patch data, and\n you must call git_patch_free() on the patch when done.

\n","group":"patch"},"git_patch_from_blob_and_buffer":{"type":"function","file":"patch.h","line":99,"lineto":106,"args":[{"name":"out","type":"git_patch **","comment":"The generated patch; NULL on error"},{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"buffer","type":"const char *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"buffer_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"buffer_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"opts","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"}],"argline":"git_patch **out, const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *opts","sig":"git_patch **::const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *","return":{"type":"int","comment":" 0 on success or error code \n<\n 0"},"description":"

Directly generate a patch from the difference between a blob and a buffer.

\n","comments":"

This is just like git_diff_blob_to_buffer() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n","group":"patch"},"git_patch_from_buffers":{"type":"function","file":"patch.h","line":126,"lineto":134,"args":[{"name":"out","type":"git_patch **","comment":"The generated patch; NULL on error"},{"name":"old_buffer","type":"const void *","comment":"Raw data for old side of diff, or NULL for empty"},{"name":"old_len","type":"size_t","comment":"Length of the raw data for old side of the diff"},{"name":"old_as_path","type":"const char *","comment":"Treat old buffer as if it had this filename; can be NULL"},{"name":"new_buffer","type":"const char *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"new_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"new_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"opts","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"}],"argline":"git_patch **out, const void *old_buffer, size_t old_len, const char *old_as_path, const char *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *opts","sig":"git_patch **::const void *::size_t::const char *::const char *::size_t::const char *::const git_diff_options *","return":{"type":"int","comment":" 0 on success or error code \n<\n 0"},"description":"

Directly generate a patch from the difference between two buffers.

\n","comments":"

This is just like git_diff_buffers() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n","group":"patch"},"git_patch_free":{"type":"function","file":"patch.h","line":139,"lineto":139,"args":[{"name":"patch","type":"git_patch *","comment":null}],"argline":"git_patch *patch","sig":"git_patch *","return":{"type":"void","comment":null},"description":"

Free a git_patch object.

\n","comments":"","group":"patch"},"git_patch_get_delta":{"type":"function","file":"patch.h","line":144,"lineto":144,"args":[{"name":"patch","type":"const git_patch *","comment":null}],"argline":"const git_patch *patch","sig":"const git_patch *","return":{"type":"const git_diff_delta *","comment":null},"description":"

Get the delta associated with a patch

\n","comments":"","group":"patch"},"git_patch_num_hunks":{"type":"function","file":"patch.h","line":149,"lineto":149,"args":[{"name":"patch","type":"const git_patch *","comment":null}],"argline":"const git_patch *patch","sig":"const git_patch *","return":{"type":"size_t","comment":null},"description":"

Get the number of hunks in a patch

\n","comments":"","group":"patch"},"git_patch_line_stats":{"type":"function","file":"patch.h","line":167,"lineto":171,"args":[{"name":"total_context","type":"size_t *","comment":"Count of context lines in output, can be NULL."},{"name":"total_additions","type":"size_t *","comment":"Count of addition lines in output, can be NULL."},{"name":"total_deletions","type":"size_t *","comment":"Count of deletion lines in output, can be NULL."},{"name":"patch","type":"const git_patch *","comment":"The git_patch object"}],"argline":"size_t *total_context, size_t *total_additions, size_t *total_deletions, const git_patch *patch","sig":"size_t *::size_t *::size_t *::const git_patch *","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Get line counts of each type in a patch.

\n","comments":"

This helps imitate a diff --numstat type of output. For that purpose,\n you only need the total_additions and total_deletions values, but we\n include the total_context line count in case you want the total number\n of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n","group":"patch"},"git_patch_get_hunk":{"type":"function","file":"patch.h","line":186,"lineto":190,"args":[{"name":"out","type":"const git_diff_hunk **","comment":"Output pointer to git_diff_hunk of hunk"},{"name":"lines_in_hunk","type":"size_t *","comment":"Output count of total lines in this hunk"},{"name":"patch","type":"git_patch *","comment":"Input pointer to patch object"},{"name":"hunk_idx","type":"size_t","comment":"Input index of hunk to get information about"}],"argline":"const git_diff_hunk **out, size_t *lines_in_hunk, git_patch *patch, size_t hunk_idx","sig":"const git_diff_hunk **::size_t *::git_patch *::size_t","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if hunk_idx out of range, \n<\n0 on error"},"description":"

Get the information about a hunk in a patch

\n","comments":"

Given a patch and a hunk index into the patch, this returns detailed\n information about that hunk. Any of the output pointers can be passed\n as NULL if you don't care about that particular piece of information.

\n","group":"patch"},"git_patch_num_lines_in_hunk":{"type":"function","file":"patch.h","line":199,"lineto":201,"args":[{"name":"patch","type":"const git_patch *","comment":"The git_patch object"},{"name":"hunk_idx","type":"size_t","comment":"Index of the hunk"}],"argline":"const git_patch *patch, size_t hunk_idx","sig":"const git_patch *::size_t","return":{"type":"int","comment":" Number of lines in hunk or -1 if invalid hunk index"},"description":"

Get the number of lines in a hunk.

\n","comments":"","group":"patch"},"git_patch_get_line_in_hunk":{"type":"function","file":"patch.h","line":217,"lineto":221,"args":[{"name":"out","type":"const git_diff_line **","comment":"The git_diff_line data for this line"},{"name":"patch","type":"git_patch *","comment":"The patch to look in"},{"name":"hunk_idx","type":"size_t","comment":"The index of the hunk"},{"name":"line_of_hunk","type":"size_t","comment":"The index of the line in the hunk"}],"argline":"const git_diff_line **out, git_patch *patch, size_t hunk_idx, size_t line_of_hunk","sig":"const git_diff_line **::git_patch *::size_t::size_t","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Get data about a line in a hunk of a patch.

\n","comments":"

Given a patch, a hunk index, and a line index in the hunk, this\n will return a lot of details about that line. If you pass a hunk\n index larger than the number of hunks or a line index larger than\n the number of lines in the hunk, this will return -1.

\n","group":"patch"},"git_patch_size":{"type":"function","file":"patch.h","line":239,"lineto":243,"args":[{"name":"patch","type":"git_patch *","comment":"A git_patch representing changes to one file"},{"name":"include_context","type":"int","comment":"Include context lines in size if non-zero"},{"name":"include_hunk_headers","type":"int","comment":"Include hunk header lines if non-zero"},{"name":"include_file_headers","type":"int","comment":"Include file header lines if non-zero"}],"argline":"git_patch *patch, int include_context, int include_hunk_headers, int include_file_headers","sig":"git_patch *::int::int::int","return":{"type":"size_t","comment":" The number of bytes of data"},"description":"

Look up size of patch diff data in bytes

\n","comments":"

This returns the raw size of the patch data. This only includes the\n actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size\n of all of the diff output; if you pass it as false (zero), this will\n only include the actual changed lines (as if context_lines was 0).

\n","group":"patch"},"git_patch_print":{"type":"function","file":"patch.h","line":257,"lineto":260,"args":[{"name":"patch","type":"git_patch *","comment":"A git_patch representing changes to one file"},{"name":"print_cb","type":"git_diff_line_cb","comment":"Callback function to output lines of the patch. Will be\n called for file headers, hunk headers, and diff lines."},{"name":"payload","type":"void *","comment":"Reference pointer that will be passed to your callbacks."}],"argline":"git_patch *patch, git_diff_line_cb print_cb, void *payload","sig":"git_patch *::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Serialize the patch to text via callback.

\n","comments":"

Returning a non-zero value from the callback will terminate the iteration\n and return that value to the caller.

\n","group":"patch"},"git_patch_to_buf":{"type":"function","file":"patch.h","line":269,"lineto":271,"args":[{"name":"out","type":"git_buf *","comment":"The git_buf to be filled in"},{"name":"patch","type":"git_patch *","comment":"A git_patch representing changes to one file"}],"argline":"git_buf *out, git_patch *patch","sig":"git_buf *::git_patch *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure."},"description":"

Get the content of a patch as a single diff text.

\n","comments":"","group":"patch"},"git_pathspec_new":{"type":"function","file":"pathspec.h","line":65,"lineto":66,"args":[{"name":"out","type":"git_pathspec **","comment":"Output of the compiled pathspec"},{"name":"pathspec","type":"const git_strarray *","comment":"A git_strarray of the paths to match"}],"argline":"git_pathspec **out, const git_strarray *pathspec","sig":"git_pathspec **::const git_strarray *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Compile a pathspec

\n","comments":"","group":"pathspec","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_pathspec_new-41"]}},"git_pathspec_free":{"type":"function","file":"pathspec.h","line":73,"lineto":73,"args":[{"name":"ps","type":"git_pathspec *","comment":"The compiled pathspec"}],"argline":"git_pathspec *ps","sig":"git_pathspec *","return":{"type":"void","comment":null},"description":"

Free a pathspec

\n","comments":"","group":"pathspec","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_pathspec_free-42"]}},"git_pathspec_matches_path":{"type":"function","file":"pathspec.h","line":88,"lineto":89,"args":[{"name":"ps","type":"const git_pathspec *","comment":"The compiled pathspec"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"path","type":"const char *","comment":"The pathname to attempt to match"}],"argline":"const git_pathspec *ps, uint32_t flags, const char *path","sig":"const git_pathspec *::uint32_t::const char *","return":{"type":"int","comment":" 1 is path matches spec, 0 if it does not"},"description":"

Try to match a path against a pathspec

\n","comments":"

Unlike most of the other pathspec matching functions, this will not\n fall back on the native case-sensitivity for your platform. You must\n explicitly pass flags to control case sensitivity or else this will\n fall back on being case sensitive.

\n","group":"pathspec"},"git_pathspec_match_workdir":{"type":"function","file":"pathspec.h","line":113,"lineto":117,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"repo","type":"git_repository *","comment":"The repository in which to match; bare repo is an error"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_repository *repo, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_repository *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag was given"},"description":"

Match a pathspec against the working directory of a repository.

\n","comments":"

This matches the pathspec against the current files in the working\n directory of the repository. It is an error to invoke this on a bare\n repo. This handles git ignores (i.e. ignored files will not be\n considered to match the pathspec unless the file is tracked in the\n index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec"},"git_pathspec_match_index":{"type":"function","file":"pathspec.h","line":142,"lineto":146,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"index","type":"git_index *","comment":"The index to match against"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_index *index, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_index *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used"},"description":"

Match a pathspec against entries in an index.

\n","comments":"

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled\n by the current case-sensitivity of the index object itself and the\n USE_CASE and IGNORE_CASE flags will have no effect. This behavior will\n be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec"},"git_pathspec_match_tree":{"type":"function","file":"pathspec.h","line":166,"lineto":170,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"tree","type":"git_tree *","comment":"The root-level tree to match against"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_tree *tree, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_tree *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used"},"description":"

Match a pathspec against files in a tree.

\n","comments":"

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_pathspec_match_tree-43"]}},"git_pathspec_match_diff":{"type":"function","file":"pathspec.h","line":190,"lineto":194,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"diff","type":"git_diff *","comment":"A generated diff list"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_diff *diff, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_diff *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used"},"description":"

Match a pathspec against files in a diff list.

\n","comments":"

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec"},"git_pathspec_match_list_free":{"type":"function","file":"pathspec.h","line":201,"lineto":201,"args":[{"name":"m","type":"git_pathspec_match_list *","comment":"The git_pathspec_match_list to be freed"}],"argline":"git_pathspec_match_list *m","sig":"git_pathspec_match_list *","return":{"type":"void","comment":null},"description":"

Free memory associates with a git_pathspec_match_list

\n","comments":"","group":"pathspec"},"git_pathspec_match_list_entrycount":{"type":"function","file":"pathspec.h","line":209,"lineto":210,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"}],"argline":"const git_pathspec_match_list *m","sig":"const git_pathspec_match_list *","return":{"type":"size_t","comment":" Number of items in match list"},"description":"

Get the number of items in a match list.

\n","comments":"","group":"pathspec"},"git_pathspec_match_list_entry":{"type":"function","file":"pathspec.h","line":222,"lineto":223,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"},{"name":"pos","type":"size_t","comment":"The index into the list"}],"argline":"const git_pathspec_match_list *m, size_t pos","sig":"const git_pathspec_match_list *::size_t","return":{"type":"const char *","comment":" The filename of the match"},"description":"

Get a matching filename by position.

\n","comments":"

This routine cannot be used if the match list was generated by\n git_pathspec_match_diff. If so, it will always return NULL.

\n","group":"pathspec"},"git_pathspec_match_list_diff_entry":{"type":"function","file":"pathspec.h","line":235,"lineto":236,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"},{"name":"pos","type":"size_t","comment":"The index into the list"}],"argline":"const git_pathspec_match_list *m, size_t pos","sig":"const git_pathspec_match_list *::size_t","return":{"type":"const git_diff_delta *","comment":" The filename of the match"},"description":"

Get a matching diff delta by position.

\n","comments":"

This routine can only be used if the match list was generated by\n git_pathspec_match_diff. Otherwise it will always return NULL.

\n","group":"pathspec"},"git_pathspec_match_list_failed_entrycount":{"type":"function","file":"pathspec.h","line":247,"lineto":248,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"}],"argline":"const git_pathspec_match_list *m","sig":"const git_pathspec_match_list *","return":{"type":"size_t","comment":" Number of items in original pathspec that had no matches"},"description":"

Get the number of pathspec items that did not match.

\n","comments":"

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when\n generating the git_pathspec_match_list.

\n","group":"pathspec"},"git_pathspec_match_list_failed_entry":{"type":"function","file":"pathspec.h","line":259,"lineto":260,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"},{"name":"pos","type":"size_t","comment":"The index into the failed items"}],"argline":"const git_pathspec_match_list *m, size_t pos","sig":"const git_pathspec_match_list *::size_t","return":{"type":"const char *","comment":" The pathspec pattern that didn't match anything"},"description":"

Get an original pathspec string that had no matches.

\n","comments":"

This will be return NULL for positions out of range.

\n","group":"pathspec"},"git_push_init_options":{"type":"function","file":"push.h","line":51,"lineto":53,"args":[{"name":"opts","type":"git_push_options *","comment":"the `git_push_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_PUSH_OPTIONS_VERSION` here."}],"argline":"git_push_options *opts, unsigned int version","sig":"git_push_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_push_options with default values. Equivalent to\n creating an instance with GIT_PUSH_OPTIONS_INIT.

\n","comments":"","group":"push"},"git_rebase_init_options":{"type":"function","file":"rebase.h","line":124,"lineto":126,"args":[{"name":"opts","type":"git_rebase_options *","comment":"the `git_rebase_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_REBASE_OPTIONS_VERSION` here."}],"argline":"git_rebase_options *opts, unsigned int version","sig":"git_rebase_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_rebase_options with default values. Equivalent to\n creating an instance with GIT_REBASE_OPTIONS_INIT.

\n","comments":"","group":"rebase"},"git_rebase_init":{"type":"function","file":"rebase.h","line":145,"lineto":152,"args":[{"name":"out","type":"git_rebase **","comment":"Pointer to store the rebase object"},{"name":"repo","type":"git_repository *","comment":"The repository to perform the rebase"},{"name":"branch","type":"const git_annotated_commit *","comment":"The terminal commit to rebase"},{"name":"upstream","type":"const git_annotated_commit *","comment":"The commit to begin rebasing from, or NULL to rebase all\n reachable commits"},{"name":"onto","type":"const git_annotated_commit *","comment":"The branch to rebase onto, or NULL to rebase onto the given\n upstream"},{"name":"signature","type":"const git_signature *","comment":"The signature of the rebaser (optional)"},{"name":"opts","type":"const git_rebase_options *","comment":"Options to specify how rebase is performed"}],"argline":"git_rebase **out, git_repository *repo, const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, const git_signature *signature, const git_rebase_options *opts","sig":"git_rebase **::git_repository *::const git_annotated_commit *::const git_annotated_commit *::const git_annotated_commit *::const git_signature *::const git_rebase_options *","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a rebase operation to rebase the changes in branch\n relative to upstream onto another branch. To begin the rebase\n process, call git_rebase_next. When you have finished with this\n object, call git_rebase_free.

\n","comments":"","group":"rebase"},"git_rebase_open":{"type":"function","file":"rebase.h","line":162,"lineto":162,"args":[{"name":"out","type":"git_rebase **","comment":"Pointer to store the rebase object"},{"name":"repo","type":"git_repository *","comment":null}],"argline":"git_rebase **out, git_repository *repo","sig":"git_rebase **::git_repository *","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Opens an existing rebase that was previously started by either an\n invocation of git_rebase_init or by another client.

\n","comments":"","group":"rebase"},"git_rebase_operation_entrycount":{"type":"function","file":"rebase.h","line":170,"lineto":170,"args":[{"name":"rebase","type":"git_rebase *","comment":"The in-progress rebase"}],"argline":"git_rebase *rebase","sig":"git_rebase *","return":{"type":"size_t","comment":" The number of rebase operations in total"},"description":"

Gets the count of rebase operations that are to be applied.

\n","comments":"","group":"rebase"},"git_rebase_operation_current":{"type":"function","file":"rebase.h","line":178,"lineto":178,"args":[{"name":"rebase","type":"git_rebase *","comment":"The in-progress rebase"}],"argline":"git_rebase *rebase","sig":"git_rebase *","return":{"type":"size_t","comment":" The index of the rebase operation currently being applied."},"description":"

Gets the index of the rebase operation that is currently being applied.

\n","comments":"","group":"rebase"},"git_rebase_operation_byindex":{"type":"function","file":"rebase.h","line":187,"lineto":189,"args":[{"name":"rebase","type":"git_rebase *","comment":"The in-progress rebase"},{"name":"idx","type":"size_t","comment":"The index of the rebase operation to retrieve"}],"argline":"git_rebase *rebase, size_t idx","sig":"git_rebase *::size_t","return":{"type":"git_rebase_operation *","comment":" The rebase operation or NULL if `idx` was out of bounds"},"description":"

Gets the rebase operation specified by the given index.

\n","comments":"","group":"rebase"},"git_rebase_commit":{"type":"function","file":"rebase.h","line":230,"lineto":236,"args":[{"name":"id","type":"git_oid *","comment":"Pointer in which to store the OID of the newly created commit"},{"name":"rebase","type":"git_rebase *","comment":null},{"name":"author","type":"const git_signature *","comment":"The author of the updated commit, or NULL to keep the\n author from the original commit"},{"name":"committer","type":"const git_signature *","comment":"The committer of the rebase"},{"name":"message_encoding","type":"const char *","comment":"The encoding for the message in the commit,\n represented with a standard encoding name. If message is NULL,\n this should also be NULL, and the encoding from the original\n commit will be maintained. If message is specified, this may be\n NULL to indicate that \"UTF-8\" is to be used."},{"name":"message","type":"const char *","comment":"The message for this commit, or NULL to use the message\n from the original commit."}],"argline":"git_oid *id, git_rebase *rebase, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message","sig":"git_oid *::git_rebase *::const git_signature *::const git_signature *::const char *::const char *","return":{"type":"int","comment":" Zero on success, GIT_EUNMERGED if there are unmerged changes in\n the index, GIT_EAPPLIED if the current commit has already\n been applied to the upstream and there is nothing to commit,\n -1 on failure."},"description":"

Commits the current patch. You must have resolved any conflicts that\n were introduced during the patch application from the git_rebase_next\n invocation.

\n","comments":"","group":"rebase"},"git_rebase_abort":{"type":"function","file":"rebase.h","line":247,"lineto":249,"args":[{"name":"rebase","type":"git_rebase *","comment":"The rebase that is in-progress"},{"name":"signature","type":"const git_signature *","comment":"The identity that is aborting the rebase"}],"argline":"git_rebase *rebase, const git_signature *signature","sig":"git_rebase *::const git_signature *","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND if a rebase is not in progress,\n -1 on other errors."},"description":"

Aborts a rebase that is currently in progress, resetting the repository\n and working directory to their state before rebase began.

\n","comments":"","group":"rebase"},"git_rebase_finish":{"type":"function","file":"rebase.h","line":260,"lineto":263,"args":[{"name":"rebase","type":"git_rebase *","comment":"The rebase that is in-progress"},{"name":"signature","type":"const git_signature *","comment":"The identity that is finishing the rebase (optional)"},{"name":"opts","type":"const git_rebase_options *","comment":"Options to specify how rebase is finished"}],"argline":"git_rebase *rebase, const git_signature *signature, const git_rebase_options *opts","sig":"git_rebase *::const git_signature *::const git_rebase_options *","return":{"type":"int","comment":null},"description":"

Finishes a rebase that is currently in progress once all patches have\n been applied.

\n","comments":"","group":"rebase"},"git_rebase_free":{"type":"function","file":"rebase.h","line":270,"lineto":270,"args":[{"name":"rebase","type":"git_rebase *","comment":"The rebase object"}],"argline":"git_rebase *rebase","sig":"git_rebase *","return":{"type":"void","comment":null},"description":"

Frees the git_rebase object.

\n","comments":"","group":"rebase"},"git_refdb_new":{"type":"function","file":"refdb.h","line":35,"lineto":35,"args":[{"name":"out","type":"git_refdb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed."},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_refdb **out, git_repository *repo","sig":"git_refdb **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new reference database with no backends.

\n","comments":"

Before the Ref DB can be used for read/writing, a custom database\n backend must be manually set using git_refdb_set_backend()

\n","group":"refdb"},"git_refdb_open":{"type":"function","file":"refdb.h","line":49,"lineto":49,"args":[{"name":"out","type":"git_refdb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed."},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_refdb **out, git_repository *repo","sig":"git_refdb **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new reference database and automatically add\n the default backends:

\n","comments":"
    \n
  • git_refdb_dir: read and write loose and packed refs\n from disk, assuming the repository dir as the folder
  • \n
\n","group":"refdb"},"git_refdb_compress":{"type":"function","file":"refdb.h","line":56,"lineto":56,"args":[{"name":"refdb","type":"git_refdb *","comment":null}],"argline":"git_refdb *refdb","sig":"git_refdb *","return":{"type":"int","comment":null},"description":"

Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. For on-disk reference\n databases, for example, this may pack all loose references.

\n","comments":"","group":"refdb"},"git_refdb_free":{"type":"function","file":"refdb.h","line":63,"lineto":63,"args":[{"name":"refdb","type":"git_refdb *","comment":"reference database pointer or NULL"}],"argline":"git_refdb *refdb","sig":"git_refdb *","return":{"type":"void","comment":null},"description":"

Close an open reference database.

\n","comments":"","group":"refdb"},"git_reflog_read":{"type":"function","file":"reflog.h","line":38,"lineto":38,"args":[{"name":"out","type":"git_reflog **","comment":"pointer to reflog"},{"name":"repo","type":"git_repository *","comment":"the repostiory"},{"name":"name","type":"const char *","comment":"reference to look up"}],"argline":"git_reflog **out, git_repository *repo, const char *name","sig":"git_reflog **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read the reflog for the given reference

\n","comments":"

If there is no reflog file for the given\n reference yet, an empty reflog object will\n be returned.

\n\n

The reflog must be freed manually by using\n git_reflog_free().

\n","group":"reflog"},"git_reflog_write":{"type":"function","file":"reflog.h","line":47,"lineto":47,"args":[{"name":"reflog","type":"git_reflog *","comment":"an existing reflog object"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write an existing in-memory reflog object back to disk\n using an atomic file lock.

\n","comments":"","group":"reflog"},"git_reflog_append":{"type":"function","file":"reflog.h","line":60,"lineto":60,"args":[{"name":"reflog","type":"git_reflog *","comment":"an existing reflog object"},{"name":"id","type":"const git_oid *","comment":"the OID the reference is now pointing to"},{"name":"committer","type":"const git_signature *","comment":"the signature of the committer"},{"name":"msg","type":"const char *","comment":"the reflog message"}],"argline":"git_reflog *reflog, const git_oid *id, const git_signature *committer, const char *msg","sig":"git_reflog *::const git_oid *::const git_signature *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add a new entry to the in-memory reflog.

\n","comments":"

msg is optional and can be NULL.

\n","group":"reflog"},"git_reflog_rename":{"type":"function","file":"reflog.h","line":75,"lineto":75,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"old_name","type":"const char *","comment":"the old name of the reference"},{"name":"name","type":"const char *","comment":"the new name of the reference"}],"argline":"git_repository *repo, const char *old_name, const char *name","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code"},"description":"

Rename a reflog

\n","comments":"

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity.\n See git_reference_create_symbolic() for rules about valid names.

\n","group":"reflog"},"git_reflog_delete":{"type":"function","file":"reflog.h","line":84,"lineto":84,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"name","type":"const char *","comment":"the reflog to delete"}],"argline":"git_repository *repo, const char *name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Delete the reflog for the given reference

\n","comments":"","group":"reflog"},"git_reflog_entrycount":{"type":"function","file":"reflog.h","line":92,"lineto":92,"args":[{"name":"reflog","type":"git_reflog *","comment":"the previously loaded reflog"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"size_t","comment":" the number of log entries"},"description":"

Get the number of log entries in a reflog

\n","comments":"","group":"reflog"},"git_reflog_entry_byindex":{"type":"function","file":"reflog.h","line":105,"lineto":105,"args":[{"name":"reflog","type":"const git_reflog *","comment":"a previously loaded reflog"},{"name":"idx","type":"size_t","comment":"the position of the entry to lookup. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`."}],"argline":"const git_reflog *reflog, size_t idx","sig":"const git_reflog *::size_t","return":{"type":"const git_reflog_entry *","comment":" the entry; NULL if not found"},"description":"

Lookup an entry by its index

\n","comments":"

Requesting the reflog entry with an index of 0 (zero) will\n return the most recently created entry.

\n","group":"reflog"},"git_reflog_drop":{"type":"function","file":"reflog.h","line":124,"lineto":127,"args":[{"name":"reflog","type":"git_reflog *","comment":"a previously loaded reflog."},{"name":"idx","type":"size_t","comment":"the position of the entry to remove. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`."},{"name":"rewrite_previous_entry","type":"int","comment":"1 to rewrite the history; 0 otherwise."}],"argline":"git_reflog *reflog, size_t idx, int rewrite_previous_entry","sig":"git_reflog *::size_t::int","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if the entry doesn't exist\n or an error code."},"description":"

Remove an entry from the reflog by its index

\n","comments":"

To ensure there's no gap in the log history, set rewrite_previous_entry\n param value to 1. When deleting entry n, member old_oid of entry n-1\n (if any) will be updated with the value of member new_oid of entry n+1.

\n","group":"reflog"},"git_reflog_entry_id_old":{"type":"function","file":"reflog.h","line":135,"lineto":135,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"const git_oid *","comment":" the old oid"},"description":"

Get the old oid

\n","comments":"","group":"reflog"},"git_reflog_entry_id_new":{"type":"function","file":"reflog.h","line":143,"lineto":143,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"const git_oid *","comment":" the new oid at this time"},"description":"

Get the new oid

\n","comments":"","group":"reflog"},"git_reflog_entry_committer":{"type":"function","file":"reflog.h","line":151,"lineto":151,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"const git_signature *","comment":" the committer"},"description":"

Get the committer of this entry

\n","comments":"","group":"reflog"},"git_reflog_entry_message":{"type":"function","file":"reflog.h","line":159,"lineto":159,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"const char *","comment":" the log msg"},"description":"

Get the log message

\n","comments":"","group":"reflog"},"git_reflog_free":{"type":"function","file":"reflog.h","line":166,"lineto":166,"args":[{"name":"reflog","type":"git_reflog *","comment":"reflog to free"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"void","comment":null},"description":"

Free the reflog

\n","comments":"","group":"reflog"},"git_reference_lookup":{"type":"function","file":"refs.h","line":37,"lineto":37,"args":[{"name":"out","type":"git_reference **","comment":"pointer to the looked-up reference"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the reference"},{"name":"name","type":"const char *","comment":"the long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)"}],"argline":"git_reference **out, git_repository *repo, const char *name","sig":"git_reference **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code."},"description":"

Lookup a reference by name in a repository.

\n","comments":"

The returned reference must be freed by the user.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_reference_lookup-53"]}},"git_reference_name_to_id":{"type":"function","file":"refs.h","line":54,"lineto":55,"args":[{"name":"out","type":"git_oid *","comment":"Pointer to oid to be filled in"},{"name":"repo","type":"git_repository *","comment":"The repository in which to look up the reference"},{"name":"name","type":"const char *","comment":"The long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)"}],"argline":"git_oid *out, git_repository *repo, const char *name","sig":"git_oid *::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code."},"description":"

Lookup a reference by name and resolve immediately to OID.

\n","comments":"

This function provides a quick way to resolve a reference name straight\n through to the object id that it refers to. This avoids having to\n allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference"},"git_reference_dwim":{"type":"function","file":"refs.h","line":68,"lineto":68,"args":[{"name":"out","type":"git_reference **","comment":"pointer in which to store the reference"},{"name":"repo","type":"git_repository *","comment":"the repository in which to look"},{"name":"shorthand","type":"const char *","comment":"the short name for the reference"}],"argline":"git_reference **out, git_repository *repo, const char *shorthand","sig":"git_reference **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a reference by DWIMing its short name

\n","comments":"

Apply the git precendence rules to the given shorthand to determine\n which reference the user is referring to.

\n","group":"reference"},"git_reference_symbolic_create_matching":{"type":"function","file":"refs.h","line":110,"lineto":110,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"repo","type":"git_repository *","comment":"Repository where that reference will live"},{"name":"name","type":"const char *","comment":"The name of the reference"},{"name":"target","type":"const char *","comment":"The target of the reference"},{"name":"force","type":"int","comment":"Overwrite existing references"},{"name":"current_value","type":"const char *","comment":"The expected value of the reference when updating"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const git_signature *signature, const char *log_message","sig":"git_reference **::git_repository *::const char *::const char *::int::const char *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code"},"description":"

Conditionally create a new symbolic reference.

\n","comments":"

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The signature and message for the reflog will be ignored if the\n reference does not belong in the standard set (HEAD, branches and\n remote-tracking branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_value\n (i.e. if the ref has changed since the user read it).

\n","group":"reference"},"git_reference_symbolic_create":{"type":"function","file":"refs.h","line":147,"lineto":147,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"repo","type":"git_repository *","comment":"Repository where that reference will live"},{"name":"name","type":"const char *","comment":"The name of the reference"},{"name":"target","type":"const char *","comment":"The target of the reference"},{"name":"force","type":"int","comment":"Overwrite existing references"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const char *target, int force, const git_signature *signature, const char *log_message","sig":"git_reference **::git_repository *::const char *::const char *::int::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code"},"description":"

Create a new symbolic reference.

\n","comments":"

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The signature and message for the reflog will be ignored if the\n reference does not belong in the standard set (HEAD, branches and\n remote-tracking branches) and it does not have a reflog.

\n","group":"reference"},"git_reference_create":{"type":"function","file":"refs.h","line":185,"lineto":185,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"repo","type":"git_repository *","comment":"Repository where that reference will live"},{"name":"name","type":"const char *","comment":"The name of the reference"},{"name":"id","type":"const git_oid *","comment":"The object id pointed to by the reference."},{"name":"force","type":"int","comment":"Overwrite existing references"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_signature *signature, const char *log_message","sig":"git_reference **::git_repository *::const char *::const git_oid *::int::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code"},"description":"

Create a new direct reference.

\n","comments":"

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The signature and message for the reflog will be ignored if the\n reference does not belong in the standard set (HEAD, branches and\n remote-tracking branches) and and it does not have a reflog.

\n","group":"reference"},"git_reference_create_matching":{"type":"function","file":"refs.h","line":229,"lineto":229,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"repo","type":"git_repository *","comment":"Repository where that reference will live"},{"name":"name","type":"const char *","comment":"The name of the reference"},{"name":"id","type":"const git_oid *","comment":"The object id pointed to by the reference."},{"name":"force","type":"int","comment":"Overwrite existing references"},{"name":"current_id","type":"const git_oid *","comment":"The expected value of the reference at the time of update"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const git_signature *signature, const char *log_message","sig":"git_reference **::git_repository *::const char *::const git_oid *::int::const git_oid *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EMODIFIED if the value of the reference\n has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code"},"description":"

Conditionally create new direct reference

\n","comments":"

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The signature and message for the reflog will be ignored if the\n reference does not belong in the standard set (HEAD, branches and\n remote-tracking branches) and and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_id\n (i.e. if the ref has changed since the user read it).

\n","group":"reference"},"git_reference_target":{"type":"function","file":"refs.h","line":244,"lineto":244,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const git_oid *","comment":" a pointer to the oid if available, NULL otherwise"},"description":"

Get the OID pointed to by a direct reference.

\n","comments":"

Only available if the reference is direct (i.e. an object id reference,\n not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and\n then this function (or maybe use git_reference_name_to_id() to\n directly resolve a reference name all the way through to an OID).

\n","group":"reference","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_reference_target-54"]}},"git_reference_target_peel":{"type":"function","file":"refs.h","line":255,"lineto":255,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const git_oid *","comment":" a pointer to the oid if available, NULL otherwise"},"description":"

Return the peeled OID target of this reference.

\n","comments":"

This peeled OID only applies to direct references that point to\n a hard Tag object: it is the result of peeling such Tag.

\n","group":"reference"},"git_reference_symbolic_target":{"type":"function","file":"refs.h","line":265,"lineto":265,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const char *","comment":" a pointer to the name if available, NULL otherwise"},"description":"

Get full name to the reference pointed to by a symbolic reference.

\n","comments":"

Only available if the reference is symbolic.

\n","group":"reference","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_reference_symbolic_target-55"]}},"git_reference_type":{"type":"function","file":"refs.h","line":275,"lineto":275,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"git_ref_t","comment":" the type"},"description":"

Get the type of a reference.

\n","comments":"

Either direct (GIT_REF_OID) or symbolic (GIT_REF_SYMBOLIC)

\n","group":"reference","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_reference_type-56"]}},"git_reference_name":{"type":"function","file":"refs.h","line":285,"lineto":285,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const char *","comment":" the full name for the ref"},"description":"

Get the full name of a reference.

\n","comments":"

See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference"},"git_reference_resolve":{"type":"function","file":"refs.h","line":303,"lineto":303,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the peeled reference"},{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"git_reference **out, const git_reference *ref","sig":"git_reference **::const git_reference *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Resolve a symbolic reference to a direct reference.

\n","comments":"

This method iteratively peels a symbolic reference until it resolves to\n a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and\n must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that\n reference is returned. This copy must be manually freed too.

\n","group":"reference"},"git_reference_owner":{"type":"function","file":"refs.h","line":311,"lineto":311,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"git_repository *","comment":" a pointer to the repo"},"description":"

Get the repository where a reference resides.

\n","comments":"","group":"reference"},"git_reference_symbolic_set_target":{"type":"function","file":"refs.h","line":334,"lineto":339,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"ref","type":"git_reference *","comment":"The reference"},{"name":"target","type":"const char *","comment":"The new target for the reference"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_reference *ref, const char *target, const git_signature *signature, const char *log_message","sig":"git_reference **::git_reference *::const char *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code"},"description":"

Create a new reference with the same name as the given reference but a\n different symbolic target. The reference must be a symbolic reference,\n otherwise this will fail.

\n","comments":"

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

The signature and message for the reflog will be ignored if the\n reference does not belong in the standard set (HEAD, branches and\n remote-tracking branches) and and it does not have a reflog.

\n","group":"reference"},"git_reference_set_target":{"type":"function","file":"refs.h","line":356,"lineto":361,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"ref","type":"git_reference *","comment":"The reference"},{"name":"id","type":"const git_oid *","comment":"The new target OID for the reference"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_reference *ref, const git_oid *id, const git_signature *signature, const char *log_message","sig":"git_reference **::git_reference *::const git_oid *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EMODIFIED if the value of the reference\n has changed since it was read, or an error code"},"description":"

Conditionally create a new reference with the same name as the given reference but a\n different OID target. The reference must be a direct reference, otherwise\n this will fail.

\n","comments":"

The new reference will be written to disk, overwriting the given reference.

\n","group":"reference"},"git_reference_rename":{"type":"function","file":"refs.h","line":387,"lineto":393,"args":[{"name":"new_ref","type":"git_reference **","comment":null},{"name":"ref","type":"git_reference *","comment":"The reference to rename"},{"name":"new_name","type":"const char *","comment":"The new name for the reference"},{"name":"force","type":"int","comment":"Overwrite an existing reference"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **new_ref, git_reference *ref, const char *new_name, int force, const git_signature *signature, const char *log_message","sig":"git_reference **::git_reference *::const char *::int::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Rename an existing reference.

\n","comments":"

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already\n a reference with the given name, the renaming will fail.

\n\n

IMPORTANT:\n The user needs to write a proper reflog entry if the\n reflog is enabled for the repository. We only rename\n the reflog if it exists.

\n","group":"reference"},"git_reference_delete":{"type":"function","file":"refs.h","line":408,"lineto":408,"args":[{"name":"ref","type":"git_reference *","comment":"The reference to remove"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":" 0, GIT_EMODIFIED or an error code"},"description":"

Delete an existing reference.

\n","comments":"

This method works for both direct and symbolic references. The reference\n will be immediately removed on disk but the memory will not be freed.\n Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed\n from the time it was looked up.

\n","group":"reference"},"git_reference_remove":{"type":"function","file":"refs.h","line":419,"lineto":419,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"name","type":"const char *","comment":"The reference to remove"}],"argline":"git_repository *repo, const char *name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Delete an existing reference by name

\n","comments":"

This method removes the named reference from the repository without\n looking at its old value.

\n","group":"reference"},"git_reference_list":{"type":"function","file":"refs.h","line":433,"lineto":433,"args":[{"name":"array","type":"git_strarray *","comment":"Pointer to a git_strarray structure where\n\t\tthe reference names will be stored"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"}],"argline":"git_strarray *array, git_repository *repo","sig":"git_strarray *::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Fill a list with all the references that can be found in a repository.

\n","comments":"

The string array will be filled with the names of all references; these\n values are owned by the user and should be free'd manually when no\n longer needed, using git_strarray_free().

\n","group":"reference","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_reference_list-57"]}},"git_reference_foreach":{"type":"function","file":"refs.h","line":451,"lineto":454,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"callback","type":"git_reference_foreach_cb","comment":"Function which will be called for every listed ref"},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback"}],"argline":"git_repository *repo, git_reference_foreach_cb callback, void *payload","sig":"git_repository *::git_reference_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Perform a callback on each reference in the repository.

\n","comments":"

The callback function will be called for each reference in the\n repository, receiving the reference object and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n","group":"reference"},"git_reference_foreach_name":{"type":"function","file":"refs.h","line":469,"lineto":472,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"callback","type":"git_reference_foreach_name_cb","comment":"Function which will be called for every listed ref name"},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback"}],"argline":"git_repository *repo, git_reference_foreach_name_cb callback, void *payload","sig":"git_repository *::git_reference_foreach_name_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Perform a callback on the fully-qualified name of each reference.

\n","comments":"

The callback function will be called for each reference in the\n repository, receiving the name of the reference and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n","group":"reference"},"git_reference_free":{"type":"function","file":"refs.h","line":479,"lineto":479,"args":[{"name":"ref","type":"git_reference *","comment":"git_reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"void","comment":null},"description":"

Free the given reference.

\n","comments":"","group":"reference","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_reference_free-3"]}},"git_reference_cmp":{"type":"function","file":"refs.h","line":488,"lineto":490,"args":[{"name":"ref1","type":"const git_reference *","comment":"The first git_reference"},{"name":"ref2","type":"const git_reference *","comment":"The second git_reference"}],"argline":"const git_reference *ref1, const git_reference *ref2","sig":"const git_reference *::const git_reference *","return":{"type":"int","comment":" 0 if the same, else a stable but meaningless ordering."},"description":"

Compare two references.

\n","comments":"","group":"reference"},"git_reference_iterator_new":{"type":"function","file":"refs.h","line":499,"lineto":501,"args":[{"name":"out","type":"git_reference_iterator **","comment":"pointer in which to store the iterator"},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_reference_iterator **out, git_repository *repo","sig":"git_reference_iterator **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an iterator for the repo's references

\n","comments":"","group":"reference"},"git_reference_iterator_glob_new":{"type":"function","file":"refs.h","line":512,"lineto":515,"args":[{"name":"out","type":"git_reference_iterator **","comment":"pointer in which to store the iterator"},{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"glob","type":"const char *","comment":"the glob to match against the reference names"}],"argline":"git_reference_iterator **out, git_repository *repo, const char *glob","sig":"git_reference_iterator **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an iterator for the repo's references that match the\n specified glob

\n","comments":"","group":"reference"},"git_reference_next":{"type":"function","file":"refs.h","line":524,"lineto":524,"args":[{"name":"out","type":"git_reference **","comment":"pointer in which to store the reference"},{"name":"iter","type":"git_reference_iterator *","comment":"the iterator"}],"argline":"git_reference **out, git_reference_iterator *iter","sig":"git_reference **::git_reference_iterator *","return":{"type":"int","comment":" 0, GIT_ITEROVER if there are no more; or an error code"},"description":"

Get the next reference

\n","comments":"","group":"reference"},"git_reference_next_name":{"type":"function","file":"refs.h","line":537,"lineto":537,"args":[{"name":"out","type":"const char **","comment":"pointer in which to store the string"},{"name":"iter","type":"git_reference_iterator *","comment":"the iterator"}],"argline":"const char **out, git_reference_iterator *iter","sig":"const char **::git_reference_iterator *","return":{"type":"int","comment":" 0, GIT_ITEROVER if there are no more; or an error code"},"description":"

Get the next reference's name

\n","comments":"

This function is provided for convenience in case only the names\n are interesting as it avoids the allocation of the git_reference\n object which git_reference_next() needs.

\n","group":"reference"},"git_reference_iterator_free":{"type":"function","file":"refs.h","line":544,"lineto":544,"args":[{"name":"iter","type":"git_reference_iterator *","comment":"the iterator to free"}],"argline":"git_reference_iterator *iter","sig":"git_reference_iterator *","return":{"type":"void","comment":null},"description":"

Free the iterator and its associated resources

\n","comments":"","group":"reference"},"git_reference_foreach_glob":{"type":"function","file":"refs.h","line":564,"lineto":568,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"glob","type":"const char *","comment":"Pattern to match (fnmatch-style) against reference name."},{"name":"callback","type":"git_reference_foreach_name_cb","comment":"Function which will be called for every listed ref"},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback"}],"argline":"git_repository *repo, const char *glob, git_reference_foreach_name_cb callback, void *payload","sig":"git_repository *::const char *::git_reference_foreach_name_cb::void *","return":{"type":"int","comment":" 0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"

Perform a callback on each reference in the repository whose name\n matches the given pattern.

\n","comments":"

This function acts like git_reference_foreach() with an additional\n pattern match being applied to the reference name before issuing the\n callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches\n any sequence of letters, a '?' matches any letter, and square brackets\n can be used to define character ranges (such as "[0-9]" for digits).

\n","group":"reference"},"git_reference_has_log":{"type":"function","file":"refs.h","line":578,"lineto":578,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"refname","type":"const char *","comment":"the reference's name"}],"argline":"git_repository *repo, const char *refname","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 when no reflog can be found, 1 when it exists;\n otherwise an error code."},"description":"

Check if a reflog exists for the specified reference.

\n","comments":"","group":"reference"},"git_reference_ensure_log":{"type":"function","file":"refs.h","line":590,"lineto":590,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"refname","type":"const char *","comment":"the reference's name"}],"argline":"git_repository *repo, const char *refname","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code."},"description":"

Ensure there is a reflog for a particular reference.

\n","comments":"

Make sure that successive updates to the reference will append to\n its log.

\n","group":"reference"},"git_reference_is_branch":{"type":"function","file":"refs.h","line":600,"lineto":600,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/heads\n namespace; 0 otherwise."},"description":"

Check if a reference is a local branch.

\n","comments":"","group":"reference"},"git_reference_is_remote":{"type":"function","file":"refs.h","line":610,"lineto":610,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/remotes\n namespace; 0 otherwise."},"description":"

Check if a reference is a remote tracking branch

\n","comments":"","group":"reference"},"git_reference_is_tag":{"type":"function","file":"refs.h","line":620,"lineto":620,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/tags\n namespace; 0 otherwise."},"description":"

Check if a reference is a tag

\n","comments":"","group":"reference"},"git_reference_is_note":{"type":"function","file":"refs.h","line":630,"lineto":630,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/notes\n namespace; 0 otherwise."},"description":"

Check if a reference is a note

\n","comments":"","group":"reference"},"git_reference_normalize_name":{"type":"function","file":"refs.h","line":686,"lineto":690,"args":[{"name":"buffer_out","type":"char *","comment":"User allocated buffer to store normalized name"},{"name":"buffer_size","type":"size_t","comment":"Size of buffer_out"},{"name":"name","type":"const char *","comment":"Reference name to be checked."},{"name":"flags","type":"unsigned int","comment":"Flags to constrain name validation rules - see the\n GIT_REF_FORMAT constants above."}],"argline":"char *buffer_out, size_t buffer_size, const char *name, unsigned int flags","sig":"char *::size_t::const char *::unsigned int","return":{"type":"int","comment":" 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC\n or an error code."},"description":"

Normalize reference name and check validity.

\n","comments":"

This will normalize the reference name by removing any leading slash\n '/' characters and collapsing runs of adjacent slashes between name\n components into a single slash.

\n\n

Once normalized, if the reference name is valid, it will be returned in\n the user allocated buffer.

\n\n

See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference"},"git_reference_peel":{"type":"function","file":"refs.h","line":707,"lineto":710,"args":[{"name":"out","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"ref","type":"git_reference *","comment":"The reference to be processed"},{"name":"type","type":"git_otype","comment":"The type of the requested object (GIT_OBJ_COMMIT,\n GIT_OBJ_TAG, GIT_OBJ_TREE, GIT_OBJ_BLOB or GIT_OBJ_ANY)."}],"argline":"git_object **out, git_reference *ref, git_otype type","sig":"git_object **::git_reference *::git_otype","return":{"type":"int","comment":" 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code"},"description":"

Recursively peel reference until object of the specified type is found.

\n","comments":"

The retrieved peeled object is owned by the repository\n and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object\n will be peeled until a non-tag object is met.

\n","group":"reference"},"git_reference_is_valid_name":{"type":"function","file":"refs.h","line":726,"lineto":726,"args":[{"name":"refname","type":"const char *","comment":"name to be checked."}],"argline":"const char *refname","sig":"const char *","return":{"type":"int","comment":" 1 if the reference name is acceptable; 0 if it isn't"},"description":"

Ensure the reference name is well-formed.

\n","comments":"

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n","group":"reference"},"git_reference_shorthand":{"type":"function","file":"refs.h","line":740,"lineto":740,"args":[{"name":"ref","type":"const git_reference *","comment":"a reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const char *","comment":" the human-readable version of the name"},"description":"

Get the reference's short name

\n","comments":"

This will transform the reference name into a name "human-readable"\n version. If no shortname is appropriate, it will return the full\n name.

\n\n

The memory is owned by the reference and must not be freed.

\n","group":"reference","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_reference_shorthand-4"]}},"git_refspec_src":{"type":"function","file":"refspec.h","line":30,"lineto":30,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"const char *","comment":" the refspec's source specifier"},"description":"

Get the source specifier

\n","comments":"","group":"refspec"},"git_refspec_dst":{"type":"function","file":"refspec.h","line":38,"lineto":38,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"const char *","comment":" the refspec's destination specifier"},"description":"

Get the destination specifier

\n","comments":"","group":"refspec"},"git_refspec_string":{"type":"function","file":"refspec.h","line":46,"lineto":46,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"const char *","comment":null},"description":"

Get the refspec's string

\n","comments":"","group":"refspec"},"git_refspec_force":{"type":"function","file":"refspec.h","line":54,"lineto":54,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"int","comment":" 1 if force update has been set, 0 otherwise"},"description":"

Get the force update setting

\n","comments":"","group":"refspec"},"git_refspec_direction":{"type":"function","file":"refspec.h","line":62,"lineto":62,"args":[{"name":"spec","type":"const git_refspec *","comment":"refspec"}],"argline":"const git_refspec *spec","sig":"const git_refspec *","return":{"type":"git_direction","comment":" GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH"},"description":"

Get the refspec's direction.

\n","comments":"","group":"refspec"},"git_refspec_src_matches":{"type":"function","file":"refspec.h","line":71,"lineto":71,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"},{"name":"refname","type":"const char *","comment":"the name of the reference to check"}],"argline":"const git_refspec *refspec, const char *refname","sig":"const git_refspec *::const char *","return":{"type":"int","comment":" 1 if the refspec matches, 0 otherwise"},"description":"

Check if a refspec's source descriptor matches a reference

\n","comments":"","group":"refspec"},"git_refspec_dst_matches":{"type":"function","file":"refspec.h","line":80,"lineto":80,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"},{"name":"refname","type":"const char *","comment":"the name of the reference to check"}],"argline":"const git_refspec *refspec, const char *refname","sig":"const git_refspec *::const char *","return":{"type":"int","comment":" 1 if the refspec matches, 0 otherwise"},"description":"

Check if a refspec's destination descriptor matches a reference

\n","comments":"","group":"refspec"},"git_refspec_transform":{"type":"function","file":"refspec.h","line":90,"lineto":90,"args":[{"name":"out","type":"git_buf *","comment":"where to store the target name"},{"name":"spec","type":"const git_refspec *","comment":"the refspec"},{"name":"name","type":"const char *","comment":"the name of the reference to transform"}],"argline":"git_buf *out, const git_refspec *spec, const char *name","sig":"git_buf *::const git_refspec *::const char *","return":{"type":"int","comment":" 0, GIT_EBUFS or another error"},"description":"

Transform a reference to its target following the refspec's rules

\n","comments":"","group":"refspec"},"git_refspec_rtransform":{"type":"function","file":"refspec.h","line":100,"lineto":100,"args":[{"name":"out","type":"git_buf *","comment":"where to store the source reference name"},{"name":"spec","type":"const git_refspec *","comment":"the refspec"},{"name":"name","type":"const char *","comment":"the name of the reference to transform"}],"argline":"git_buf *out, const git_refspec *spec, const char *name","sig":"git_buf *::const git_refspec *::const char *","return":{"type":"int","comment":" 0, GIT_EBUFS or another error"},"description":"

Transform a target reference to its source reference following the refspec's rules

\n","comments":"","group":"refspec"},"git_remote_create":{"type":"function","file":"remote.h","line":40,"lineto":44,"args":[{"name":"out","type":"git_remote **","comment":"the resulting remote"},{"name":"repo","type":"git_repository *","comment":"the repository in which to create the remote"},{"name":"name","type":"const char *","comment":"the remote's name"},{"name":"url","type":"const char *","comment":"the remote's url"}],"argline":"git_remote **out, git_repository *repo, const char *name, const char *url","sig":"git_remote **::git_repository *::const char *::const char *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Add a remote with the default fetch refspec to the repository's configuration. This\n calls git_remote_save before returning.

\n","comments":"","group":"remote"},"git_remote_create_with_fetchspec":{"type":"function","file":"remote.h","line":58,"lineto":63,"args":[{"name":"out","type":"git_remote **","comment":"the resulting remote"},{"name":"repo","type":"git_repository *","comment":"the repository in which to create the remote"},{"name":"name","type":"const char *","comment":"the remote's name"},{"name":"url","type":"const char *","comment":"the remote's url"},{"name":"fetch","type":"const char *","comment":"the remote fetch value"}],"argline":"git_remote **out, git_repository *repo, const char *name, const char *url, const char *fetch","sig":"git_remote **::git_repository *::const char *::const char *::const char *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Add a remote with the provided fetch refspec (or default if NULL) to the repository's\n configuration. This\n calls git_remote_save before returning.

\n","comments":"","group":"remote"},"git_remote_create_anonymous":{"type":"function","file":"remote.h","line":81,"lineto":85,"args":[{"name":"out","type":"git_remote **","comment":"pointer to the new remote object"},{"name":"repo","type":"git_repository *","comment":"the associated repository"},{"name":"url","type":"const char *","comment":"the remote repository's URL"},{"name":"fetch","type":"const char *","comment":"the fetch refspec to use for this remote."}],"argline":"git_remote **out, git_repository *repo, const char *url, const char *fetch","sig":"git_remote **::git_repository *::const char *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an anonymous remote

\n","comments":"

Create a remote with the given url and refspec in memory. You can use\n this when you have a URL instead of a remote's name. Note that anonymous\n remotes cannot be converted to persisted remotes.

\n\n

The name, when provided, will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_create_anonymous-4"],"network/ls-remote.c":["ex/v0.22.0-rc1/network/ls-remote.html#git_remote_create_anonymous-2"]}},"git_remote_lookup":{"type":"function","file":"remote.h","line":98,"lineto":98,"args":[{"name":"out","type":"git_remote **","comment":"pointer to the new remote object"},{"name":"repo","type":"git_repository *","comment":"the associated repository"},{"name":"name","type":"const char *","comment":"the remote's name"}],"argline":"git_remote **out, git_repository *repo, const char *name","sig":"git_remote **::git_repository *::const char *","return":{"type":"int","comment":" 0, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code"},"description":"

Get the information for a particular remote

\n","comments":"

The name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_lookup-5"],"network/ls-remote.c":["ex/v0.22.0-rc1/network/ls-remote.html#git_remote_lookup-3"]}},"git_remote_save":{"type":"function","file":"remote.h","line":109,"lineto":109,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to save to config"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC or an error code"},"description":"

Save a remote to its repository's configuration

\n","comments":"

One can't save a in-memory remote. Doing so will\n result in a GIT_EINVALIDSPEC being returned.

\n","group":"remote"},"git_remote_dup":{"type":"function","file":"remote.h","line":121,"lineto":121,"args":[{"name":"dest","type":"git_remote **","comment":"pointer where to store the copy"},{"name":"source","type":"git_remote *","comment":"object to copy"}],"argline":"git_remote **dest, git_remote *source","sig":"git_remote **::git_remote *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a copy of an existing remote. All internal strings are also\n duplicated. Callbacks are not duplicated.

\n","comments":"

Call git_remote_free to free the data.

\n","group":"remote"},"git_remote_owner":{"type":"function","file":"remote.h","line":129,"lineto":129,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"git_repository *","comment":" a pointer to the repository"},"description":"

Get the remote's repository

\n","comments":"","group":"remote"},"git_remote_name":{"type":"function","file":"remote.h","line":137,"lineto":137,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"const char *","comment":" a pointer to the name or NULL for in-memory remotes"},"description":"

Get the remote's name

\n","comments":"","group":"remote"},"git_remote_url":{"type":"function","file":"remote.h","line":145,"lineto":145,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"const char *","comment":" a pointer to the url"},"description":"

Get the remote's url

\n","comments":"","group":"remote"},"git_remote_pushurl":{"type":"function","file":"remote.h","line":153,"lineto":153,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"const char *","comment":" a pointer to the url or NULL if no special url for pushing is set"},"description":"

Get the remote's url for pushing

\n","comments":"","group":"remote"},"git_remote_set_url":{"type":"function","file":"remote.h","line":164,"lineto":164,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"url","type":"const char *","comment":"the url to set"}],"argline":"git_remote *remote, const char *url","sig":"git_remote *::const char *","return":{"type":"int","comment":" 0 or an error value"},"description":"

Set the remote's url

\n","comments":"

Existing connections will not be updated.

\n","group":"remote"},"git_remote_set_pushurl":{"type":"function","file":"remote.h","line":175,"lineto":175,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"url","type":"const char *","comment":"the url to set or NULL to clear the pushurl"}],"argline":"git_remote *remote, const char *url","sig":"git_remote *::const char *","return":{"type":"int","comment":" 0 or an error value"},"description":"

Set the remote's url for pushing

\n","comments":"

Existing connections will not be updated.

\n","group":"remote"},"git_remote_add_fetch":{"type":"function","file":"remote.h","line":187,"lineto":187,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"refspec","type":"const char *","comment":"the new fetch refspec"}],"argline":"git_remote *remote, const char *refspec","sig":"git_remote *::const char *","return":{"type":"int","comment":" 0 or an error value"},"description":"

Add a fetch refspec to the remote

\n","comments":"

Convenience function for adding a single fetch refspec to the\n current list in the remote.

\n","group":"remote"},"git_remote_get_fetch_refspecs":{"type":"function","file":"remote.h","line":198,"lineto":198,"args":[{"name":"array","type":"git_strarray *","comment":"pointer to the array in which to store the strings"},{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"git_strarray *array, const git_remote *remote","sig":"git_strarray *::const git_remote *","return":{"type":"int","comment":null},"description":"

Get the remote's list of fetch refspecs

\n","comments":"

The memory is owned by the user and should be freed with\n git_strarray_free.

\n","group":"remote"},"git_remote_set_fetch_refspecs":{"type":"function","file":"remote.h","line":208,"lineto":208,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to modify"},{"name":"array","type":"git_strarray *","comment":"the new list of fetch resfpecs"}],"argline":"git_remote *remote, git_strarray *array","sig":"git_remote *::git_strarray *","return":{"type":"int","comment":null},"description":"

Set the remote's list of fetch refspecs

\n","comments":"

The contents of the string array are copied.

\n","group":"remote"},"git_remote_add_push":{"type":"function","file":"remote.h","line":220,"lineto":220,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"refspec","type":"const char *","comment":"the new push refspec"}],"argline":"git_remote *remote, const char *refspec","sig":"git_remote *::const char *","return":{"type":"int","comment":" 0 or an error value"},"description":"

Add a push refspec to the remote

\n","comments":"

Convenience function for adding a single push refspec to the\n current list in the remote.

\n","group":"remote"},"git_remote_get_push_refspecs":{"type":"function","file":"remote.h","line":231,"lineto":231,"args":[{"name":"array","type":"git_strarray *","comment":"pointer to the array in which to store the strings"},{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"git_strarray *array, const git_remote *remote","sig":"git_strarray *::const git_remote *","return":{"type":"int","comment":null},"description":"

Get the remote's list of push refspecs

\n","comments":"

The memory is owned by the user and should be freed with\n git_strarray_free.

\n","group":"remote"},"git_remote_set_push_refspecs":{"type":"function","file":"remote.h","line":241,"lineto":241,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to modify"},{"name":"array","type":"git_strarray *","comment":"the new list of push resfpecs"}],"argline":"git_remote *remote, git_strarray *array","sig":"git_remote *::git_strarray *","return":{"type":"int","comment":null},"description":"

Set the remote's list of push refspecs

\n","comments":"

The contents of the string array are copied.

\n","group":"remote"},"git_remote_clear_refspecs":{"type":"function","file":"remote.h","line":250,"lineto":250,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void","comment":null},"description":"

Clear the refspecs

\n","comments":"

Remove all configured fetch and push refspecs from the remote.

\n","group":"remote"},"git_remote_refspec_count":{"type":"function","file":"remote.h","line":258,"lineto":258,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"size_t","comment":" the amount of refspecs configured in this remote"},"description":"

Get the number of refspecs for a remote

\n","comments":"","group":"remote"},"git_remote_get_refspec":{"type":"function","file":"remote.h","line":267,"lineto":267,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to query"},{"name":"n","type":"size_t","comment":"the refspec to get"}],"argline":"const git_remote *remote, size_t n","sig":"const git_remote *::size_t","return":{"type":"const git_refspec *","comment":" the nth refspec"},"description":"

Get a refspec from the remote

\n","comments":"","group":"remote"},"git_remote_connect":{"type":"function","file":"remote.h","line":281,"lineto":281,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to connect to"},{"name":"direction","type":"git_direction","comment":"GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push"}],"argline":"git_remote *remote, git_direction direction","sig":"git_remote *::git_direction","return":{"type":"int","comment":" 0 or an error code"},"description":"

Open a connection to a remote

\n","comments":"

The transport is selected based on the URL. The direction argument\n is due to a limitation of the git protocol (over TCP or SSH) which\n starts up a specific binary which can only do the one or the other.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_connect-6"],"network/ls-remote.c":["ex/v0.22.0-rc1/network/ls-remote.html#git_remote_connect-4"]}},"git_remote_ls":{"type":"function","file":"remote.h","line":303,"lineto":303,"args":[{"name":"out","type":"const git_remote_head ***","comment":"pointer to the array"},{"name":"size","type":"size_t *","comment":"the number of remote heads"},{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"const git_remote_head ***out, size_t *size, git_remote *remote","sig":"const git_remote_head ***::size_t *::git_remote *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Get the remote repository's reference advertisement list

\n","comments":"

Get the list of references with which the server responds to a new\n connection.

\n\n

The remote (or more exactly its transport) must have connected to\n the remote repository. This list is available as soon as the\n connection to the remote is initiated and it remains available\n after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long\n as a new connection is not initiated, but it is recommended that\n you make a copy in order to make use of the data.

\n","group":"remote","examples":{"network/ls-remote.c":["ex/v0.22.0-rc1/network/ls-remote.html#git_remote_ls-5"]}},"git_remote_download":{"type":"function","file":"remote.h","line":320,"lineto":320,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for this negotiation and\n download. Use NULL or an empty array to use the base refspecs"}],"argline":"git_remote *remote, const git_strarray *refspecs","sig":"git_remote *::const git_strarray *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Download and index the packfile

\n","comments":"

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, download and index the\n packfile.

\n\n

The .idx file will be created and both it and the packfile with be\n renamed to their final name.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_download-7"]}},"git_remote_upload":{"type":"function","file":"remote.h","line":333,"lineto":333,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for this negotiation and\n upload. Use NULL or an empty array to use the base refspecs"},{"name":"opts","type":"const git_push_options *","comment":null}],"argline":"git_remote *remote, const git_strarray *refspecs, const git_push_options *opts","sig":"git_remote *::const git_strarray *::const git_push_options *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a packfile and send it to the server

\n","comments":"

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, create a packfile with the missing objects and send it.

\n","group":"remote"},"git_remote_connected":{"type":"function","file":"remote.h","line":344,"lineto":344,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"int","comment":" 1 if it's connected, 0 otherwise."},"description":"

Check whether the remote is connected

\n","comments":"

Check whether the remote's underlying transport is connected to the\n remote host.

\n","group":"remote"},"git_remote_stop":{"type":"function","file":"remote.h","line":354,"lineto":354,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void","comment":null},"description":"

Cancel the operation

\n","comments":"

At certain points in its operation, the network code checks whether\n the operation has been cancelled and if so stops the operation.

\n","group":"remote"},"git_remote_disconnect":{"type":"function","file":"remote.h","line":363,"lineto":363,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to disconnect from"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void","comment":null},"description":"

Disconnect from the remote

\n","comments":"

Close the connection to the remote.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_disconnect-8"]}},"git_remote_free":{"type":"function","file":"remote.h","line":373,"lineto":373,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to free"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void","comment":null},"description":"

Free the memory associated with a remote

\n","comments":"

This also disconnects from the remote, if the connection\n has not been closed yet (using git_remote_disconnect).

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_free-9","ex/v0.22.0-rc1/network/fetch.html#git_remote_free-10"],"network/ls-remote.c":["ex/v0.22.0-rc1/network/ls-remote.html#git_remote_free-6"]}},"git_remote_update_tips":{"type":"function","file":"remote.h","line":385,"lineto":388,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to update"},{"name":"signature","type":"const git_signature *","comment":"The identity to use when updating reflogs"},{"name":"reflog_message","type":"const char *","comment":"The message to insert into the reflogs. If NULL, the\n default is \"fetch \n\", where \n is the name of\n the remote (or its url, for in-memory remotes)."}],"argline":"git_remote *remote, const git_signature *signature, const char *reflog_message","sig":"git_remote *::const git_signature *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Update the tips to the new state

\n","comments":"","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_update_tips-11"]}},"git_remote_prune":{"type":"function","file":"remote.h","line":396,"lineto":396,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to prune"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Prune tracking refs that are no longer present on remote

\n","comments":"","group":"remote"},"git_remote_fetch":{"type":"function","file":"remote.h","line":412,"lineto":416,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to fetch from"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for this fetch. Pass NULL or an\n empty array to use the base refspecs."},{"name":"signature","type":"const git_signature *","comment":"The identity to use when updating reflogs"},{"name":"reflog_message","type":"const char *","comment":"The message to insert into the reflogs. If NULL, the\n\t\t\t\t\t\t\t\t default is \"fetch\""}],"argline":"git_remote *remote, const git_strarray *refspecs, const git_signature *signature, const char *reflog_message","sig":"git_remote *::const git_strarray *::const git_signature *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Download new data and update tips

\n","comments":"

Convenience function to connect to a remote, download the data,\n disconnect and update the remote-tracking branches.

\n","group":"remote"},"git_remote_push":{"type":"function","file":"remote.h","line":430,"lineto":433,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to push to"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for pushing. If none are\n passed, the configured refspecs will be used"},{"name":"opts","type":"const git_push_options *","comment":"the options"},{"name":"signature","type":"const git_signature *","comment":"signature to use for the reflog of updated references"},{"name":"reflog_message","type":"const char *","comment":"message to use for the reflog of upated references"}],"argline":"git_remote *remote, const git_strarray *refspecs, const git_push_options *opts, const git_signature *signature, const char *reflog_message","sig":"git_remote *::const git_strarray *::const git_push_options *::const git_signature *::const char *","return":{"type":"int","comment":null},"description":"

Perform a push

\n","comments":"

Peform all the steps from a push.

\n","group":"remote"},"git_remote_list":{"type":"function","file":"remote.h","line":444,"lineto":444,"args":[{"name":"out","type":"git_strarray *","comment":"a string array which receives the names of the remotes"},{"name":"repo","type":"git_repository *","comment":"the repository to query"}],"argline":"git_strarray *out, git_repository *repo","sig":"git_strarray *::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get a list of the configured remotes for a repo

\n","comments":"

The string array must be freed by the user.

\n","group":"remote"},"git_remote_init_callbacks":{"type":"function","file":"remote.h","line":547,"lineto":549,"args":[{"name":"opts","type":"git_remote_callbacks *","comment":"the `git_remote_callbacks` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REMOTE_CALLBACKS_VERSION`"}],"argline":"git_remote_callbacks *opts, unsigned int version","sig":"git_remote_callbacks *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_remote_callbacks with default values. Equivalent to\n creating an instance with GIT_REMOTE_CALLBACKS_INIT.

\n","comments":"","group":"remote"},"git_remote_set_callbacks":{"type":"function","file":"remote.h","line":561,"lineto":561,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"callbacks","type":"const git_remote_callbacks *","comment":"a pointer to the user's callback settings"}],"argline":"git_remote *remote, const git_remote_callbacks *callbacks","sig":"git_remote *::const git_remote_callbacks *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the callbacks for a remote

\n","comments":"

Note that the remote keeps its own copy of the data and you need to\n call this function again if you want to change the callbacks.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_set_callbacks-12"],"network/ls-remote.c":["ex/v0.22.0-rc1/network/ls-remote.html#git_remote_set_callbacks-7"]}},"git_remote_get_callbacks":{"type":"function","file":"remote.h","line":572,"lineto":572,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to query"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const git_remote_callbacks *","comment":" a pointer to the callbacks structure"},"description":"

Retrieve the current callback structure

\n","comments":"

This provides read access to the callbacks structure as the remote\n sees it.

\n","group":"remote"},"git_remote_stats":{"type":"function","file":"remote.h","line":577,"lineto":577,"args":[{"name":"remote","type":"git_remote *","comment":null}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const git_transfer_progress *","comment":null},"description":"

Get the statistics structure that is filled in by the fetch operation.

\n","comments":"","group":"remote","examples":{"network/fetch.c":["ex/v0.22.0-rc1/network/fetch.html#git_remote_stats-13"]}},"git_remote_autotag":{"type":"function","file":"remote.h","line":596,"lineto":596,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"git_remote_autotag_option_t","comment":" the auto-follow setting"},"description":"

Retrieve the tag auto-follow setting

\n","comments":"","group":"remote"},"git_remote_set_autotag":{"type":"function","file":"remote.h","line":604,"lineto":606,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"value","type":"git_remote_autotag_option_t","comment":"a GIT_REMOTE_DOWNLOAD_TAGS value"}],"argline":"git_remote *remote, git_remote_autotag_option_t value","sig":"git_remote *::git_remote_autotag_option_t","return":{"type":"void","comment":null},"description":"

Set the tag auto-follow setting

\n","comments":"","group":"remote"},"git_remote_prune_refs":{"type":"function","file":"remote.h","line":614,"lineto":614,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"int","comment":" the ref-prune setting"},"description":"

Retrieve the ref-prune setting

\n","comments":"","group":"remote"},"git_remote_rename":{"type":"function","file":"remote.h","line":636,"lineto":640,"args":[{"name":"problems","type":"git_strarray *","comment":"non-default refspecs cannot be renamed and will be\n stored here for further processing by the caller. Always free this\n strarray on successful return."},{"name":"repo","type":"git_repository *","comment":"the repository in which to rename"},{"name":"name","type":"const char *","comment":"the current name of the reamote"},{"name":"new_name","type":"const char *","comment":"the new name the remote should bear"}],"argline":"git_strarray *problems, git_repository *repo, const char *name, const char *new_name","sig":"git_strarray *::git_repository *::const char *::const char *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Give the remote a new name

\n","comments":"

All remote-tracking branches and configuration settings\n for the remote are updated.

\n\n

The new name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n\n

No loaded instances of a the remote with the old name will change\n their name or their list of refspecs.

\n","group":"remote"},"git_remote_update_fetchhead":{"type":"function","file":"remote.h","line":648,"lineto":648,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to query"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"int","comment":" the update FETCH_HEAD setting"},"description":"

Retrieve the update FETCH_HEAD setting.

\n","comments":"","group":"remote"},"git_remote_set_update_fetchhead":{"type":"function","file":"remote.h","line":657,"lineto":657,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"value","type":"int","comment":"0 to disable updating FETCH_HEAD"}],"argline":"git_remote *remote, int value","sig":"git_remote *::int","return":{"type":"void","comment":null},"description":"

Sets the update FETCH_HEAD setting. By default, FETCH_HEAD will be\n updated on every fetch. Set to 0 to disable.

\n","comments":"","group":"remote"},"git_remote_is_valid_name":{"type":"function","file":"remote.h","line":665,"lineto":665,"args":[{"name":"remote_name","type":"const char *","comment":"name to be checked."}],"argline":"const char *remote_name","sig":"const char *","return":{"type":"int","comment":" 1 if the reference name is acceptable; 0 if it isn't"},"description":"

Ensure the remote name is well-formed.

\n","comments":"","group":"remote"},"git_remote_delete":{"type":"function","file":"remote.h","line":677,"lineto":677,"args":[{"name":"repo","type":"git_repository *","comment":"the repository in which to act"},{"name":"name","type":"const char *","comment":"the name of the remove to delete"}],"argline":"git_repository *repo, const char *name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success, or an error code."},"description":"

Delete an existing persisted remote.

\n","comments":"

All remote-tracking branches and configuration settings\n for the remote will be removed.

\n","group":"remote"},"git_remote_default_branch":{"type":"function","file":"remote.h","line":695,"lineto":695,"args":[{"name":"out","type":"git_buf *","comment":"the buffern in which to store the reference name"},{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_buf *out, git_remote *remote","sig":"git_buf *::git_remote *","return":{"type":"int","comment":" 0, GIT_ENOTFOUND if the remote does not have any references\n or none of them point to HEAD's commit, or an error message."},"description":"

Retrieve the name of the remote's default branch

\n","comments":"

The default branch of a repository is the branch which HEAD points\n to. If the remote does not support reporting this information\n directly, it performs the guess as git does; that is, if there are\n multiple branches which point to the same commit, the first one is\n chosen. If the master branch is a candidate, it wins.

\n\n

This function must only be called after connecting.

\n","group":"remote"},"git_repository_open":{"type":"function","file":"repository.h","line":37,"lineto":37,"args":[{"name":"out","type":"git_repository **","comment":"pointer to the repo which will be opened"},{"name":"path","type":"const char *","comment":"the path to the repository"}],"argline":"git_repository **out, const char *path","sig":"git_repository **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Open a git repository.

\n","comments":"

The 'path' argument must point to either a git repository\n folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal\n or bare repository or fail is 'path' is neither.

\n","group":"repository","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_repository_open-58"],"network/git2.c":["ex/v0.22.0-rc1/network/git2.html#git_repository_open-4"]}},"git_repository_wrap_odb":{"type":"function","file":"repository.h","line":50,"lineto":50,"args":[{"name":"out","type":"git_repository **","comment":"pointer to the repo"},{"name":"odb","type":"git_odb *","comment":"the object database to wrap"}],"argline":"git_repository **out, git_odb *odb","sig":"git_repository **::git_odb *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a "fake" repository to wrap an object database

\n","comments":"

Create a repository object to wrap an object database to be used\n with the API when all you have is an object database. This doesn't\n have any paths associated with it, so use with care.

\n","group":"repository"},"git_repository_discover":{"type":"function","file":"repository.h","line":78,"lineto":82,"args":[{"name":"out","type":"git_buf *","comment":"A pointer to a user-allocated git_buf which will contain\n the found path."},{"name":"start_path","type":"const char *","comment":"The base path where the lookup starts."},{"name":"across_fs","type":"int","comment":"If true, then the lookup will not stop when a\n filesystem device change is detected while exploring parent directories."},{"name":"ceiling_dirs","type":"const char *","comment":"A GIT_PATH_LIST_SEPARATOR separated list of\n absolute symbolic link free paths. The lookup will stop when any\n of this paths is reached. Note that the lookup always performs on\n start_path no matter start_path appears in ceiling_dirs ceiling_dirs\n might be NULL (which is equivalent to an empty string)"}],"argline":"git_buf *out, const char *start_path, int across_fs, const char *ceiling_dirs","sig":"git_buf *::const char *::int::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Look for a git repository and copy its path in the given buffer.\n The lookup start from base_path and walk across parent directories\n if nothing has been found. The lookup ends when the first repository\n is found, or when reaching a directory referenced in ceiling_dirs\n or when the filesystem changes (in case across_fs is true).

\n","comments":"

The method will automatically detect if the repository is bare\n (if there is a repository).

\n","group":"repository"},"git_repository_open_ext":{"type":"function","file":"repository.h","line":122,"lineto":126,"args":[{"name":"out","type":"git_repository **","comment":"Pointer to the repo which will be opened. This can\n actually be NULL if you only want to use the error code to\n see if a repo at this path could be opened."},{"name":"path","type":"const char *","comment":"Path to open as git repository. If the flags\n permit \"searching\", then this can be a path to a subdirectory\n inside the working directory of the repository."},{"name":"flags","type":"unsigned int","comment":"A combination of the GIT_REPOSITORY_OPEN flags above."},{"name":"ceiling_dirs","type":"const char *","comment":"A GIT_PATH_LIST_SEPARATOR delimited list of path\n prefixes at which the search for a containing repository should\n terminate."}],"argline":"git_repository **out, const char *path, unsigned int flags, const char *ceiling_dirs","sig":"git_repository **::const char *::unsigned int::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if no repository could be found,\n or -1 if there was a repository but open failed for some reason\n (such as repo corruption or system errors)."},"description":"

Find and open a repository with extended controls.

\n","comments":"","group":"repository","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_repository_open_ext-24"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_repository_open_ext-31"],"describe.c":["ex/v0.22.0-rc1/describe.html#git_repository_open_ext-6"],"diff.c":["ex/v0.22.0-rc1/diff.html#git_repository_open_ext-15"],"log.c":["ex/v0.22.0-rc1/log.html#git_repository_open_ext-44","ex/v0.22.0-rc1/log.html#git_repository_open_ext-45"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_repository_open_ext-16"],"status.c":["ex/v0.22.0-rc1/status.html#git_repository_open_ext-5"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_repository_open_ext-11"]}},"git_repository_open_bare":{"type":"function","file":"repository.h","line":139,"lineto":139,"args":[{"name":"out","type":"git_repository **","comment":"Pointer to the repo which will be opened."},{"name":"bare_path","type":"const char *","comment":"Direct path to the bare repository"}],"argline":"git_repository **out, const char *bare_path","sig":"git_repository **::const char *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Open a bare repository on the serverside.

\n","comments":"

This is a fast open for bare repositories that will come in handy\n if you're e.g. hosting git repositories and need to access them\n efficiently

\n","group":"repository"},"git_repository_free":{"type":"function","file":"repository.h","line":152,"lineto":152,"args":[{"name":"repo","type":"git_repository *","comment":"repository handle to close. If NULL nothing occurs."}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"void","comment":null},"description":"

Free a previously allocated repository

\n","comments":"

Note that after a repository is free'd, all the objects it has spawned\n will still exist until they are manually closed by the user\n with git_object_free, but accessing any of the attributes of\n an object without a backing repository will result in undefined\n behavior

\n","group":"repository","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_repository_free-25"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_repository_free-32"],"describe.c":["ex/v0.22.0-rc1/describe.html#git_repository_free-7"],"diff.c":["ex/v0.22.0-rc1/diff.html#git_repository_free-16"],"general.c":["ex/v0.22.0-rc1/general.html#git_repository_free-59"],"init.c":["ex/v0.22.0-rc1/init.html#git_repository_free-6"],"log.c":["ex/v0.22.0-rc1/log.html#git_repository_free-46"],"network/clone.c":["ex/v0.22.0-rc1/network/clone.html#git_repository_free-3"],"network/git2.c":["ex/v0.22.0-rc1/network/git2.html#git_repository_free-5"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_repository_free-17"],"status.c":["ex/v0.22.0-rc1/status.html#git_repository_free-6"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_repository_free-12"]}},"git_repository_init":{"type":"function","file":"repository.h","line":169,"lineto":172,"args":[{"name":"out","type":"git_repository **","comment":"pointer to the repo which will be created or reinitialized"},{"name":"path","type":"const char *","comment":"the path to the repository"},{"name":"is_bare","type":"unsigned int","comment":"if true, a Git repository without a working directory is\n\t\tcreated at the pointed path. If false, provided path will be\n\t\tconsidered as the working directory into which the .git directory\n\t\twill be created."}],"argline":"git_repository **out, const char *path, unsigned int is_bare","sig":"git_repository **::const char *::unsigned int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Creates a new Git repository in the given folder.

\n","comments":"

TODO:\n - Reinit the repository

\n","group":"repository","examples":{"init.c":["ex/v0.22.0-rc1/init.html#git_repository_init-7"]}},"git_repository_init_init_options":{"type":"function","file":"repository.h","line":281,"lineto":283,"args":[{"name":"opts","type":"git_repository_init_options *","comment":"the `git_repository_init_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`"}],"argline":"git_repository_init_options *opts, unsigned int version","sig":"git_repository_init_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_repository_init_options with default values. Equivalent\n to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n","comments":"","group":"repository"},"git_repository_init_ext":{"type":"function","file":"repository.h","line":298,"lineto":301,"args":[{"name":"out","type":"git_repository **","comment":"Pointer to the repo which will be created or reinitialized."},{"name":"repo_path","type":"const char *","comment":"The path to the repository."},{"name":"opts","type":"git_repository_init_options *","comment":"Pointer to git_repository_init_options struct."}],"argline":"git_repository **out, const char *repo_path, git_repository_init_options *opts","sig":"git_repository **::const char *::git_repository_init_options *","return":{"type":"int","comment":" 0 or an error code on failure."},"description":"

Create a new Git repository in the given folder with extended controls.

\n","comments":"

This will initialize a new git repository (creating the repo_path\n if requested by flags) and working directory as needed. It will\n auto-detect the case sensitivity of the file system and if the\n file system supports file mode bits correctly.

\n","group":"repository","examples":{"init.c":["ex/v0.22.0-rc1/init.html#git_repository_init_ext-8"]}},"git_repository_head":{"type":"function","file":"repository.h","line":316,"lineto":316,"args":[{"name":"out","type":"git_reference **","comment":"pointer to the reference which will be retrieved"},{"name":"repo","type":"git_repository *","comment":"a repository object"}],"argline":"git_reference **out, git_repository *repo","sig":"git_reference **::git_repository *","return":{"type":"int","comment":" 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch, GIT_ENOTFOUND when HEAD is missing; an error code otherwise"},"description":"

Retrieve and resolve the reference pointed at by HEAD.

\n","comments":"

The returned git_reference will be owned by caller and\n git_reference_free() must be called when done with it to release the\n allocated memory and prevent a leak.

\n","group":"repository","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_repository_head-7"]}},"git_repository_head_detached":{"type":"function","file":"repository.h","line":328,"lineto":328,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 1 if HEAD is detached, 0 if it's not; error code if there\n was an error."},"description":"

Check if a repository's HEAD is detached

\n","comments":"

A repository's HEAD is detached when it points directly to a commit\n instead of a branch.

\n","group":"repository"},"git_repository_head_unborn":{"type":"function","file":"repository.h","line":340,"lineto":340,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 1 if the current branch is unborn, 0 if it's not; error\n code if there was an error"},"description":"

Check if the current branch is unborn

\n","comments":"

An unborn branch is one named from HEAD but which doesn't exist in\n the refs namespace, because it doesn't have any commit to point to.

\n","group":"repository"},"git_repository_is_empty":{"type":"function","file":"repository.h","line":352,"lineto":352,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 1 if the repository is empty, 0 if it isn't, error code\n if the repository is corrupted"},"description":"

Check if a repository is empty

\n","comments":"

An empty repository has just been initialized and contains\n no references.

\n","group":"repository"},"git_repository_path":{"type":"function","file":"repository.h","line":363,"lineto":363,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"const char *","comment":" the path to the repository"},"description":"

Get the path of this repository

\n","comments":"

This is the path of the .git folder for normal repositories,\n or of the repository itself for bare repositories.

\n","group":"repository","examples":{"init.c":["ex/v0.22.0-rc1/init.html#git_repository_path-9"],"status.c":["ex/v0.22.0-rc1/status.html#git_repository_path-8"]}},"git_repository_workdir":{"type":"function","file":"repository.h","line":374,"lineto":374,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"const char *","comment":" the path to the working dir, if it exists"},"description":"

Get the path of the working directory for this repository

\n","comments":"

If the repository is bare, this function will always return\n NULL.

\n","group":"repository","examples":{"init.c":["ex/v0.22.0-rc1/init.html#git_repository_workdir-10"]}},"git_repository_set_workdir":{"type":"function","file":"repository.h","line":393,"lineto":394,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"workdir","type":"const char *","comment":"The path to a working directory"},{"name":"update_gitlink","type":"int","comment":"Create/update gitlink in workdir and set config\n \"core.worktree\" (if workdir is not the parent of the .git directory)"}],"argline":"git_repository *repo, const char *workdir, int update_gitlink","sig":"git_repository *::const char *::int","return":{"type":"int","comment":" 0, or an error code"},"description":"

Set the path to the working directory for this repository

\n","comments":"

The working directory doesn't need to be the same one\n that contains the .git folder for this repository.

\n\n

If this repository is bare, setting its working directory\n will turn it into a normal repository, capable of performing\n all the common workdir operations (checkout, status, index\n manipulation, etc).

\n","group":"repository"},"git_repository_is_bare":{"type":"function","file":"repository.h","line":402,"lineto":402,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 1 if the repository is bare, 0 otherwise."},"description":"

Check if a repository is bare

\n","comments":"","group":"repository","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_repository_is_bare-9"]}},"git_repository_config":{"type":"function","file":"repository.h","line":418,"lineto":418,"args":[{"name":"out","type":"git_config **","comment":"Pointer to store the loaded configuration"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_config **out, git_repository *repo","sig":"git_config **::git_repository *","return":{"type":"int","comment":" 0, or an error code"},"description":"

Get the configuration file for this repository.

\n","comments":"

If a configuration file has not been set, the default\n config set for the repository will be returned, including\n global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n","group":"repository"},"git_repository_config_snapshot":{"type":"function","file":"repository.h","line":434,"lineto":434,"args":[{"name":"out","type":"git_config **","comment":"Pointer to store the loaded configuration"},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_config **out, git_repository *repo","sig":"git_config **::git_repository *","return":{"type":"int","comment":" 0, or an error code"},"description":"

Get a snapshot of the repository's configuration

\n","comments":"

Convenience function to take a snapshot from the repository's\n configuration. The contents of this snapshot will not change,\n even if the underlying config files are modified.

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n","group":"repository"},"git_repository_odb":{"type":"function","file":"repository.h","line":450,"lineto":450,"args":[{"name":"out","type":"git_odb **","comment":"Pointer to store the loaded ODB"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_odb **out, git_repository *repo","sig":"git_odb **::git_repository *","return":{"type":"int","comment":" 0, or an error code"},"description":"

Get the Object Database for this repository.

\n","comments":"

If a custom ODB has not been set, the default\n database for the repository will be returned (the one\n located in .git/objects).

\n\n

The ODB must be freed once it's no longer being used by\n the user.

\n","group":"repository","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_repository_odb-33"],"general.c":["ex/v0.22.0-rc1/general.html#git_repository_odb-60"]}},"git_repository_refdb":{"type":"function","file":"repository.h","line":466,"lineto":466,"args":[{"name":"out","type":"git_refdb **","comment":"Pointer to store the loaded refdb"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_refdb **out, git_repository *repo","sig":"git_refdb **::git_repository *","return":{"type":"int","comment":" 0, or an error code"},"description":"

Get the Reference Database Backend for this repository.

\n","comments":"

If a custom refsdb has not been set, the default database for\n the repository will be returned (the one that manipulates loose\n and packed references in the .git directory).

\n\n

The refdb must be freed once it's no longer being used by\n the user.

\n","group":"repository"},"git_repository_index":{"type":"function","file":"repository.h","line":482,"lineto":482,"args":[{"name":"out","type":"git_index **","comment":"Pointer to store the loaded index"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_index **out, git_repository *repo","sig":"git_index **::git_repository *","return":{"type":"int","comment":" 0, or an error code"},"description":"

Get the Index file for this repository.

\n","comments":"

If a custom index has not been set, the default\n index for the repository will be returned (the one\n located in .git/index).

\n\n

The index must be freed once it's no longer being used by\n the user.

\n","group":"repository","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_repository_index-61"],"init.c":["ex/v0.22.0-rc1/init.html#git_repository_index-11"]}},"git_repository_message":{"type":"function","file":"repository.h","line":500,"lineto":500,"args":[{"name":"out","type":"git_buf *","comment":"git_buf to write data into"},{"name":"repo","type":"git_repository *","comment":"Repository to read prepared message from"}],"argline":"git_buf *out, git_repository *repo","sig":"git_buf *::git_repository *","return":{"type":"int","comment":" 0, GIT_ENOTFOUND if no message exists or an error code"},"description":"

Retrieve git's prepared message

\n","comments":"

Operations such as git revert/cherry-pick/merge with the -n option\n stop just short of creating a commit with the changes and save\n their prepared message in .git/MERGE_MSG so the next git-commit\n execution can present it to the user for them to amend if they\n wish.

\n\n

Use this function to get the contents of this file. Don't forget to\n remove the file after you create the commit.

\n","group":"repository"},"git_repository_message_remove":{"type":"function","file":"repository.h","line":507,"lineto":507,"args":[{"name":"repo","type":"git_repository *","comment":null}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":null},"description":"

Remove git's prepared message.

\n","comments":"

Remove the message that git_repository_message retrieves.

\n","group":"repository"},"git_repository_state_cleanup":{"type":"function","file":"repository.h","line":516,"lineto":516,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 0 on success, or error"},"description":"

Remove all the metadata associated with an ongoing command like merge,\n revert, cherry-pick, etc. For example: MERGE_HEAD, MERGE_MSG, etc.

\n","comments":"","group":"repository"},"git_repository_fetchhead_foreach":{"type":"function","file":"repository.h","line":535,"lineto":538,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"callback","type":"git_repository_fetchhead_foreach_cb","comment":"Callback function"},{"name":"payload","type":"void *","comment":"Pointer to callback data (optional)"}],"argline":"git_repository *repo, git_repository_fetchhead_foreach_cb callback, void *payload","sig":"git_repository *::git_repository_fetchhead_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no FETCH_HEAD file, or other error code."},"description":"

Invoke 'callback' for each entry in the given FETCH_HEAD file.

\n","comments":"

Return a non-zero value from the callback to stop the loop.

\n","group":"repository"},"git_repository_mergehead_foreach":{"type":"function","file":"repository.h","line":555,"lineto":558,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"callback","type":"git_repository_mergehead_foreach_cb","comment":"Callback function"},{"name":"payload","type":"void *","comment":"Pointer to callback data (optional)"}],"argline":"git_repository *repo, git_repository_mergehead_foreach_cb callback, void *payload","sig":"git_repository *::git_repository_mergehead_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no MERGE_HEAD file, or other error code."},"description":"

If a merge is in progress, invoke 'callback' for each commit ID in the\n MERGE_HEAD file.

\n","comments":"

Return a non-zero value from the callback to stop the loop.

\n","group":"repository"},"git_repository_hashfile":{"type":"function","file":"repository.h","line":583,"lineto":588,"args":[{"name":"out","type":"git_oid *","comment":"Output value of calculated SHA"},{"name":"repo","type":"git_repository *","comment":"Repository pointer"},{"name":"path","type":"const char *","comment":"Path to file on disk whose contents should be hashed. If the\n repository is not NULL, this can be a relative path."},{"name":"type","type":"git_otype","comment":"The object type to hash as (e.g. GIT_OBJ_BLOB)"},{"name":"as_path","type":"const char *","comment":"The path to use to look up filtering rules. If this is\n NULL, then the `path` parameter will be used instead. If\n this is passed as the empty string, then no filters will be\n applied when calculating the hash."}],"argline":"git_oid *out, git_repository *repo, const char *path, git_otype type, const char *as_path","sig":"git_oid *::git_repository *::const char *::git_otype::const char *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Calculate hash of file using repository filtering rules.

\n","comments":"

If you simply want to calculate the hash of a file on disk with no filters,\n you can just use the git_odb_hashfile() API. However, if you want to\n hash a file in the repository and you want to apply filtering rules (e.g.\n crlf filters) before generating the SHA, then use this function.

\n\n

Note: if the repository has core.safecrlf set to fail and the\n filtering triggers that failure, then this function will return an\n error and not calculate the hash of the file.

\n","group":"repository"},"git_repository_set_head":{"type":"function","file":"repository.h","line":610,"lineto":614,"args":[{"name":"repo","type":"git_repository *","comment":"Repository pointer"},{"name":"refname","type":"const char *","comment":"Canonical name of the reference the HEAD should point at"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_repository *repo, const char *refname, const git_signature *signature, const char *log_message","sig":"git_repository *::const char *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Make the repository HEAD point to the specified reference.

\n","comments":"

If the provided reference points to a Tree or a Blob, the HEAD is\n unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point\n to that branch, staying attached, or become attached if it isn't yet.\n If the branch doesn't exist yet, no error will be return. The HEAD\n will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to\n the Commit.

\n","group":"repository"},"git_repository_set_head_detached":{"type":"function","file":"repository.h","line":634,"lineto":638,"args":[{"name":"repo","type":"git_repository *","comment":"Repository pointer"},{"name":"commitish","type":"const git_oid *","comment":"Object id of the Commit the HEAD should point to"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_repository *repo, const git_oid *commitish, const git_signature *signature, const char *log_message","sig":"git_repository *::const git_oid *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Make the repository HEAD directly point to the Commit.

\n","comments":"

If the provided committish cannot be found in the repository, the HEAD\n is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided commitish cannot be peeled into a commit, the HEAD\n is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to\n the peeled Commit.

\n","group":"repository"},"git_repository_detach_head":{"type":"function","file":"repository.h","line":659,"lineto":662,"args":[{"name":"repo","type":"git_repository *","comment":"Repository pointer"},{"name":"signature","type":"const git_signature *","comment":"The identity that will used to populate the reflog entry"},{"name":"reflog_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_repository *repo, const git_signature *signature, const char *reflog_message","sig":"git_repository *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch or an error code"},"description":"

Detach the HEAD.

\n","comments":"

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is\n updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non commitish, the HEAD is\n unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n","group":"repository"},"git_repository_state":{"type":"function","file":"repository.h","line":690,"lineto":690,"args":[{"name":"repo","type":"git_repository *","comment":"Repository pointer"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" The state of the repository"},"description":"

Determines the status of a git repository - ie, whether an operation\n (merge, cherry-pick, etc) is in progress.

\n","comments":"","group":"repository"},"git_repository_set_namespace":{"type":"function","file":"repository.h","line":704,"lineto":704,"args":[{"name":"repo","type":"git_repository *","comment":"The repo"},{"name":"nmspace","type":"const char *","comment":"The namespace. This should not include the refs\n\tfolder, e.g. to namespace all references under `refs/namespaces/foo/`,\n\tuse `foo` as the namespace."}],"argline":"git_repository *repo, const char *nmspace","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success, -1 on error"},"description":"

Sets the active namespace for this Git Repository

\n","comments":"

This namespace affects all reference operations for the repo.\n See man gitnamespaces

\n","group":"repository"},"git_repository_get_namespace":{"type":"function","file":"repository.h","line":712,"lineto":712,"args":[{"name":"repo","type":"git_repository *","comment":"The repo"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"const char *","comment":" the active namespace, or NULL if there isn't one"},"description":"

Get the currently active namespace for this repository

\n","comments":"","group":"repository"},"git_repository_is_shallow":{"type":"function","file":"repository.h","line":721,"lineto":721,"args":[{"name":"repo","type":"git_repository *","comment":"The repository"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 1 if shallow, zero if not"},"description":"

Determine if the repository was a shallow clone

\n","comments":"","group":"repository"},"git_reset_default":{"type":"function","file":"reset.h","line":94,"lineto":97,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to perform the reset operation."},{"name":"target","type":"git_object *","comment":"The committish which content will be used to reset the content\n of the index."},{"name":"pathspecs","type":"git_strarray *","comment":"List of pathspecs to operate on."}],"argline":"git_repository *repo, git_object *target, git_strarray *pathspecs","sig":"git_repository *::git_object *::git_strarray *","return":{"type":"int","comment":" 0 on success or an error code \n<\n 0"},"description":"

Updates some entries in the index from the target commit tree.

\n","comments":"

The scope of the updated entries is determined by the paths\n being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing\n entries in the index matching the provided pathspecs.

\n","group":"reset"},"git_revert_init_options":{"type":"function","file":"revert.h","line":47,"lineto":49,"args":[{"name":"opts","type":"git_revert_options *","comment":"the `git_revert_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REVERT_OPTIONS_VERSION`"}],"argline":"git_revert_options *opts, unsigned int version","sig":"git_revert_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_revert_options with default values. Equivalent to\n creating an instance with GIT_REVERT_OPTIONS_INIT.

\n","comments":"","group":"revert"},"git_revert_commit":{"type":"function","file":"revert.h","line":65,"lineto":71,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"the repository that contains the given commits"},{"name":"revert_commit","type":"git_commit *","comment":"the commit to revert"},{"name":"our_commit","type":"git_commit *","comment":"the commit to revert against (eg, HEAD)"},{"name":"mainline","type":"unsigned int","comment":"the parent of the revert commit, if it is a merge"},{"name":"merge_options","type":"const git_merge_options *","comment":"the merge options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, git_commit *revert_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options","sig":"git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Reverts the given commit against the given "our" commit, producing an\n index that reflects the result of the revert.

\n","comments":"

The returned index must be freed explicitly with git_index_free.

\n","group":"revert"},"git_revert":{"type":"function","file":"revert.h","line":81,"lineto":84,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to revert"},{"name":"commit","type":"git_commit *","comment":"the commit to revert"},{"name":"given_opts","type":"const git_revert_options *","comment":"merge flags"}],"argline":"git_repository *repo, git_commit *commit, const git_revert_options *given_opts","sig":"git_repository *::git_commit *::const git_revert_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Reverts the given commit, producing changes in the index and working directory.

\n","comments":"","group":"revert"},"git_revparse_single":{"type":"function","file":"revparse.h","line":37,"lineto":38,"args":[{"name":"out","type":"git_object **","comment":"pointer to output object"},{"name":"repo","type":"git_repository *","comment":"the repository to search in"},{"name":"spec","type":"const char *","comment":"the textual specification for an object"}],"argline":"git_object **out, git_repository *repo, const char *spec","sig":"git_object **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC or an error code"},"description":"

Find a single object, as specified by a revision string.

\n","comments":"

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

The returned object should be released with git_object_free when no\n longer needed.

\n","group":"revparse","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_revparse_single-26"],"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_revparse_single-34"],"describe.c":["ex/v0.22.0-rc1/describe.html#git_revparse_single-8"],"log.c":["ex/v0.22.0-rc1/log.html#git_revparse_single-47"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_revparse_single-13","ex/v0.22.0-rc1/tag.html#git_revparse_single-14","ex/v0.22.0-rc1/tag.html#git_revparse_single-15","ex/v0.22.0-rc1/tag.html#git_revparse_single-16"]}},"git_revparse_ext":{"type":"function","file":"revparse.h","line":61,"lineto":65,"args":[{"name":"object_out","type":"git_object **","comment":"pointer to output object"},{"name":"reference_out","type":"git_reference **","comment":"pointer to output reference or NULL"},{"name":"repo","type":"git_repository *","comment":"the repository to search in"},{"name":"spec","type":"const char *","comment":"the textual specification for an object"}],"argline":"git_object **object_out, git_reference **reference_out, git_repository *repo, const char *spec","sig":"git_object **::git_reference **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC\n or an error code"},"description":"

Find a single object and intermediate reference by a revision string.

\n","comments":"

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

In some cases (\n@\n{\n<\n-n>} or `\n<branchname

\n\n
\n

@\n{upstream}), the expression may\n point to an intermediate reference. When such expressions are being passed\n in,reference_out` will be valued as well.

\n
\n\n

The returned object should be released with git_object_free and the\n returned reference with git_reference_free when no longer needed.

\n","group":"revparse"},"git_revparse":{"type":"function","file":"revparse.h","line":105,"lineto":108,"args":[{"name":"revspec","type":"git_revspec *","comment":"Pointer to an user-allocated git_revspec struct where\n\t the result of the rev-parse will be stored"},{"name":"repo","type":"git_repository *","comment":"the repository to search in"},{"name":"spec","type":"const char *","comment":"the rev-parse spec to parse"}],"argline":"git_revspec *revspec, git_repository *repo, const char *spec","sig":"git_revspec *::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_INVALIDSPEC, GIT_ENOTFOUND, GIT_EAMBIGUOUS or an error code"},"description":"

Parse a revision string for from, to, and intent.

\n","comments":"

See man gitrevisions or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n","group":"revparse","examples":{"blame.c":["ex/v0.22.0-rc1/blame.html#git_revparse-27"],"log.c":["ex/v0.22.0-rc1/log.html#git_revparse-48"],"rev-parse.c":["ex/v0.22.0-rc1/rev-parse.html#git_revparse-18","ex/v0.22.0-rc1/rev-parse.html#git_revparse-19"]}},"git_revwalk_new":{"type":"function","file":"revwalk.h","line":75,"lineto":75,"args":[{"name":"out","type":"git_revwalk **","comment":"pointer to the new revision walker"},{"name":"repo","type":"git_repository *","comment":"the repo to walk through"}],"argline":"git_revwalk **out, git_repository *repo","sig":"git_revwalk **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Allocate a new revision walker to iterate through a repo.

\n","comments":"

This revision walker uses a custom memory pool and an internal\n commit cache, so it is relatively expensive to allocate.

\n\n

For maximum performance, this revision walker should be\n reused for different walks.

\n\n

This revision walker is not thread safe: it may only be\n used to walk a repository on a single thread; however,\n it is possible to have several revision walkers in\n several different threads walking the same repository.

\n","group":"revwalk","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_revwalk_new-62"],"log.c":["ex/v0.22.0-rc1/log.html#git_revwalk_new-49","ex/v0.22.0-rc1/log.html#git_revwalk_new-50"]}},"git_revwalk_reset":{"type":"function","file":"revwalk.h","line":90,"lineto":90,"args":[{"name":"walker","type":"git_revwalk *","comment":"handle to reset."}],"argline":"git_revwalk *walker","sig":"git_revwalk *","return":{"type":"void","comment":null},"description":"

Reset the revision walker for reuse.

\n","comments":"

This will clear all the pushed and hidden commits, and\n leave the walker in a blank state (just like at\n creation) ready to receive new commit pushes and\n start a new walk.

\n\n

The revision walk is automatically reset when a walk\n is over.

\n","group":"revwalk"},"git_revwalk_push":{"type":"function","file":"revwalk.h","line":107,"lineto":107,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"id","type":"const git_oid *","comment":"the oid of the commit to start from."}],"argline":"git_revwalk *walk, const git_oid *id","sig":"git_revwalk *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Mark a commit to start traversal from.

\n","comments":"

The given OID must belong to a committish on the walked\n repository.

\n\n

The given commit will be used as one of the roots\n when starting the revision walk. At least one commit\n must be pushed onto the walker before a walk can\n be started.

\n","group":"revwalk","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_revwalk_push-63"],"log.c":["ex/v0.22.0-rc1/log.html#git_revwalk_push-51"]}},"git_revwalk_push_glob":{"type":"function","file":"revwalk.h","line":125,"lineto":125,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"glob","type":"const char *","comment":"the glob pattern references should match"}],"argline":"git_revwalk *walk, const char *glob","sig":"git_revwalk *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Push matching references

\n","comments":"

The OIDs pointed to by the references that match the given glob\n pattern will be pushed to the revision walker.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n","group":"revwalk"},"git_revwalk_push_head":{"type":"function","file":"revwalk.h","line":133,"lineto":133,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Push the repository's HEAD

\n","comments":"","group":"revwalk","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_revwalk_push_head-52"]}},"git_revwalk_hide":{"type":"function","file":"revwalk.h","line":148,"lineto":148,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"commit_id","type":"const git_oid *","comment":"the oid of commit that will be ignored during the traversal"}],"argline":"git_revwalk *walk, const git_oid *commit_id","sig":"git_revwalk *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Mark a commit (and its ancestors) uninteresting for the output.

\n","comments":"

The given OID must belong to a committish on the walked\n repository.

\n\n

The resolved commit and all its parents will be hidden from the\n output on the revision walk.

\n","group":"revwalk","examples":{"log.c":["ex/v0.22.0-rc1/log.html#git_revwalk_hide-53"]}},"git_revwalk_hide_glob":{"type":"function","file":"revwalk.h","line":167,"lineto":167,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"glob","type":"const char *","comment":"the glob pattern references should match"}],"argline":"git_revwalk *walk, const char *glob","sig":"git_revwalk *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Hide matching references.

\n","comments":"

The OIDs pointed to by the references that match the given glob\n pattern and their ancestors will be hidden from the output on the\n revision walk.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n","group":"revwalk"},"git_revwalk_hide_head":{"type":"function","file":"revwalk.h","line":175,"lineto":175,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Hide the repository's HEAD

\n","comments":"","group":"revwalk"},"git_revwalk_push_ref":{"type":"function","file":"revwalk.h","line":186,"lineto":186,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"refname","type":"const char *","comment":"the reference to push"}],"argline":"git_revwalk *walk, const char *refname","sig":"git_revwalk *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Push the OID pointed to by a reference

\n","comments":"

The reference must point to a committish.

\n","group":"revwalk"},"git_revwalk_hide_ref":{"type":"function","file":"revwalk.h","line":197,"lineto":197,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"refname","type":"const char *","comment":"the reference to hide"}],"argline":"git_revwalk *walk, const char *refname","sig":"git_revwalk *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Hide the OID pointed to by a reference

\n","comments":"

The reference must point to a committish.

\n","group":"revwalk"},"git_revwalk_next":{"type":"function","file":"revwalk.h","line":217,"lineto":217,"args":[{"name":"out","type":"git_oid *","comment":"Pointer where to store the oid of the next commit"},{"name":"walk","type":"git_revwalk *","comment":"the walker to pop the commit from."}],"argline":"git_oid *out, git_revwalk *walk","sig":"git_oid *::git_revwalk *","return":{"type":"int","comment":" 0 if the next commit was found;\n\tGIT_ITEROVER if there are no commits left to iterate"},"description":"

Get the next commit from the revision walk.

\n","comments":"

The initial call to this method is not blocking when\n iterating through a repo with a time-sorting mode.

\n\n

Iterating with Topological or inverted modes makes the initial\n call blocking to preprocess the commit list, but this block should be\n mostly unnoticeable on most repositories (topological preprocessing\n times at 0.3s on the git.git repo).

\n\n

The revision walker is reset when the walk is over.

\n","group":"revwalk","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_revwalk_next-64"],"log.c":["ex/v0.22.0-rc1/log.html#git_revwalk_next-54"]}},"git_revwalk_sorting":{"type":"function","file":"revwalk.h","line":228,"lineto":228,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"sort_mode","type":"unsigned int","comment":"combination of GIT_SORT_XXX flags"}],"argline":"git_revwalk *walk, unsigned int sort_mode","sig":"git_revwalk *::unsigned int","return":{"type":"void","comment":null},"description":"

Change the sorting mode when iterating through the\n repository's contents.

\n","comments":"

Changing the sorting mode resets the walker.

\n","group":"revwalk","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_revwalk_sorting-65"],"log.c":["ex/v0.22.0-rc1/log.html#git_revwalk_sorting-55","ex/v0.22.0-rc1/log.html#git_revwalk_sorting-56"]}},"git_revwalk_push_range":{"type":"function","file":"revwalk.h","line":243,"lineto":243,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"range","type":"const char *","comment":"the range"}],"argline":"git_revwalk *walk, const char *range","sig":"git_revwalk *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Push and hide the respective endpoints of the given range.

\n","comments":"

The range should be of the form

\n\n

<commit

\n\n
\n

..\n<commit

\n\n

where each \n<commit\nis in the form accepted by 'git_revparse_single'.\n The left-hand commit will be hidden and the right-hand commit pushed.

\n
\n","group":"revwalk"},"git_revwalk_simplify_first_parent":{"type":"function","file":"revwalk.h","line":250,"lineto":250,"args":[{"name":"walk","type":"git_revwalk *","comment":null}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"void","comment":null},"description":"

Simplify the history by first-parent

\n","comments":"

No parents other than the first for each commit will be enqueued.

\n","group":"revwalk"},"git_revwalk_free":{"type":"function","file":"revwalk.h","line":258,"lineto":258,"args":[{"name":"walk","type":"git_revwalk *","comment":"traversal handle to close. If NULL nothing occurs."}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"void","comment":null},"description":"

Free a revision walker previously allocated.

\n","comments":"","group":"revwalk","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_revwalk_free-66"],"log.c":["ex/v0.22.0-rc1/log.html#git_revwalk_free-57"]}},"git_revwalk_repository":{"type":"function","file":"revwalk.h","line":267,"lineto":267,"args":[{"name":"walk","type":"git_revwalk *","comment":"the revision walker"}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"git_repository *","comment":" the repository being walked"},"description":"

Return the repository on which this walker\n is operating.

\n","comments":"","group":"revwalk"},"git_revwalk_add_hide_cb":{"type":"function","file":"revwalk.h","line":288,"lineto":291,"args":[{"name":"walk","type":"git_revwalk *","comment":"the revision walker"},{"name":"hide_cb","type":"git_revwalk_hide_cb","comment":"callback function to hide a commit and its parents"},{"name":"payload","type":"void *","comment":"data payload to be passed to callback function"}],"argline":"git_revwalk *walk, git_revwalk_hide_cb hide_cb, void *payload","sig":"git_revwalk *::git_revwalk_hide_cb::void *","return":{"type":"int","comment":null},"description":"

Adds a callback function to hide a commit and its parents

\n","comments":"","group":"revwalk"},"git_signature_new":{"type":"function","file":"signature.h","line":37,"lineto":37,"args":[{"name":"out","type":"git_signature **","comment":"new signature, in case of error NULL"},{"name":"name","type":"const char *","comment":"name of the person"},{"name":"email","type":"const char *","comment":"email of the person"},{"name":"time","type":"git_time_t","comment":"time when the action happened"},{"name":"offset","type":"int","comment":"timezone offset in minutes for the time"}],"argline":"git_signature **out, const char *name, const char *email, git_time_t time, int offset","sig":"git_signature **::const char *::const char *::git_time_t::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new action signature.

\n","comments":"

Call git_signature_free() to free the data.

\n\n

Note: angle brackets ('\n<\n' and '>') characters are not allowed\n to be used in either the name or the email parameter.

\n","group":"signature","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_signature_new-67","ex/v0.22.0-rc1/general.html#git_signature_new-68"]}},"git_signature_now":{"type":"function","file":"signature.h","line":49,"lineto":49,"args":[{"name":"out","type":"git_signature **","comment":"new signature, in case of error NULL"},{"name":"name","type":"const char *","comment":"name of the person"},{"name":"email","type":"const char *","comment":"email of the person"}],"argline":"git_signature **out, const char *name, const char *email","sig":"git_signature **::const char *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new action signature with a timestamp of 'now'.

\n","comments":"

Call git_signature_free() to free the data.

\n","group":"signature"},"git_signature_default":{"type":"function","file":"signature.h","line":63,"lineto":63,"args":[{"name":"out","type":"git_signature **","comment":"new signature"},{"name":"repo","type":"git_repository *","comment":"repository pointer"}],"argline":"git_signature **out, git_repository *repo","sig":"git_signature **::git_repository *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if config is missing, or error code"},"description":"

Create a new action signature with default user and now timestamp.

\n","comments":"

This looks up the user.name and user.email from the configuration and\n uses the current time as the timestamp, and creates a new signature\n based on that information. It will return GIT_ENOTFOUND if either the\n user.name or user.email are not set.

\n","group":"signature","examples":{"init.c":["ex/v0.22.0-rc1/init.html#git_signature_default-12"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_signature_default-17"]}},"git_signature_dup":{"type":"function","file":"signature.h","line":75,"lineto":75,"args":[{"name":"dest","type":"git_signature **","comment":"pointer where to store the copy"},{"name":"sig","type":"const git_signature *","comment":"signature to duplicate"}],"argline":"git_signature **dest, const git_signature *sig","sig":"git_signature **::const git_signature *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a copy of an existing signature. All internal strings are also\n duplicated.

\n","comments":"

Call git_signature_free() to free the data.

\n","group":"signature"},"git_signature_free":{"type":"function","file":"signature.h","line":86,"lineto":86,"args":[{"name":"sig","type":"git_signature *","comment":"signature to free"}],"argline":"git_signature *sig","sig":"git_signature *","return":{"type":"void","comment":null},"description":"

Free an existing signature.

\n","comments":"

Because the signature is not an opaque structure, it is legal to free it\n manually, but be sure to free the "name" and "email" strings in addition\n to the structure itself.

\n","group":"signature","examples":{"init.c":["ex/v0.22.0-rc1/init.html#git_signature_free-13"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_signature_free-18"]}},"git_stash_foreach":{"type":"function","file":"stash.h","line":104,"lineto":107,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the stash."},{"name":"callback","type":"git_stash_cb","comment":"Callback to invoke per found stashed state. The most\n recent stash state will be enumerated first."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"git_repository *repo, git_stash_cb callback, void *payload","sig":"git_repository *::git_stash_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Loop over all the stashed states and issue a callback for each one.

\n","comments":"

If the callback returns a non-zero value, this will stop looping.

\n","group":"stash"},"git_stash_drop":{"type":"function","file":"stash.h","line":120,"lineto":122,"args":[{"name":"repo","type":"git_repository *","comment":"The owning repository."},{"name":"index","type":"size_t","comment":"The position within the stash list. 0 points to the\n most recent stashed state."}],"argline":"git_repository *repo, size_t index","sig":"git_repository *::size_t","return":{"type":"int","comment":" 0 on success, or error code"},"description":"

Remove a single stashed state from the stash list.

\n","comments":"","group":"stash"},"git_status_init_options":{"type":"function","file":"status.h","line":194,"lineto":196,"args":[{"name":"opts","type":"git_status_options *","comment":"The `git_status_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_STATUS_OPTIONS_VERSION`"}],"argline":"git_status_options *opts, unsigned int version","sig":"git_status_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_status_options with default values. Equivalent to\n creating an instance with GIT_STATUS_OPTIONS_INIT.

\n","comments":"","group":"status"},"git_status_foreach":{"type":"function","file":"status.h","line":234,"lineto":237,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"callback","type":"git_status_cb","comment":"The function to call on each file"},{"name":"payload","type":"void *","comment":"Pointer to pass through to callback function"}],"argline":"git_repository *repo, git_status_cb callback, void *payload","sig":"git_repository *::git_status_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Gather file statuses and run a callback for each one.

\n","comments":"

The callback is passed the path of the file, the status (a combination of\n the git_status_t values above) and the payload data pointer passed\n into this function.

\n\n

If the callback returns a non-zero value, this function will stop looping\n and return that value to caller.

\n","group":"status","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_status_foreach-10"]}},"git_status_foreach_ext":{"type":"function","file":"status.h","line":258,"lineto":262,"args":[{"name":"repo","type":"git_repository *","comment":"Repository object"},{"name":"opts","type":"const git_status_options *","comment":"Status options structure"},{"name":"callback","type":"git_status_cb","comment":"The function to call on each file"},{"name":"payload","type":"void *","comment":"Pointer to pass through to callback function"}],"argline":"git_repository *repo, const git_status_options *opts, git_status_cb callback, void *payload","sig":"git_repository *::const git_status_options *::git_status_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Gather file status information and run callbacks as requested.

\n","comments":"

This is an extended version of the git_status_foreach() API that\n allows for more granular control over which paths will be processed and\n in what order. See the git_status_options structure for details\n about the additional controls that this makes available.

\n\n

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n","group":"status","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_status_foreach_ext-11"]}},"git_status_file":{"type":"function","file":"status.h","line":290,"lineto":293,"args":[{"name":"status_flags","type":"unsigned int *","comment":"Output combination of git_status_t values for file"},{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"path","type":"const char *","comment":"The exact path to retrieve status for relative to the\n repository working directory"}],"argline":"unsigned int *status_flags, git_repository *repo, const char *path","sig":"unsigned int *::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if the file is not found in the HEAD,\n index, and work tree, GIT_EAMBIGUOUS if `path` matches multiple files\n or if it refers to a folder, and -1 on other errors."},"description":"

Get file status for a single file.

\n","comments":"

This tries to get status for the filename that you give. If no files\n match that name (in either the HEAD, index, or working directory), this\n returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a\n directory or if running on a case- insensitive filesystem and yet the\n HEAD has two entries that both match the path), then this returns\n GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of\n targets and because of the path filtering, there is not enough\n information to check renames correctly. To check file status with rename\n detection, there is no choice but to do a full git_status_list_new and\n scan through looking for the path that you are interested in.

\n","group":"status"},"git_status_list_new":{"type":"function","file":"status.h","line":308,"lineto":311,"args":[{"name":"out","type":"git_status_list **","comment":"Pointer to store the status results in"},{"name":"repo","type":"git_repository *","comment":"Repository object"},{"name":"opts","type":"const git_status_options *","comment":"Status options structure"}],"argline":"git_status_list **out, git_repository *repo, const git_status_options *opts","sig":"git_status_list **::git_repository *::const git_status_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Gather file status information and populate the git_status_list.

\n","comments":"

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n","group":"status","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_status_list_new-12","ex/v0.22.0-rc1/status.html#git_status_list_new-13"]}},"git_status_list_entrycount":{"type":"function","file":"status.h","line":322,"lineto":323,"args":[{"name":"statuslist","type":"git_status_list *","comment":"Existing status list object"}],"argline":"git_status_list *statuslist","sig":"git_status_list *","return":{"type":"size_t","comment":" the number of status entries"},"description":"

Gets the count of status entries in this list.

\n","comments":"

If there are no changes in status (at least according the options given\n when the status list was created), this can return 0.

\n","group":"status","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_status_list_entrycount-14","ex/v0.22.0-rc1/status.html#git_status_list_entrycount-15"]}},"git_status_byindex":{"type":"function","file":"status.h","line":334,"lineto":336,"args":[{"name":"statuslist","type":"git_status_list *","comment":"Existing status list object"},{"name":"idx","type":"size_t","comment":"Position of the entry"}],"argline":"git_status_list *statuslist, size_t idx","sig":"git_status_list *::size_t","return":{"type":"const git_status_entry *","comment":" Pointer to the entry; NULL if out of bounds"},"description":"

Get a pointer to one of the entries in the status list.

\n","comments":"

The entry is not modifiable and should not be freed.

\n","group":"status","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_status_byindex-16","ex/v0.22.0-rc1/status.html#git_status_byindex-17","ex/v0.22.0-rc1/status.html#git_status_byindex-18","ex/v0.22.0-rc1/status.html#git_status_byindex-19","ex/v0.22.0-rc1/status.html#git_status_byindex-20","ex/v0.22.0-rc1/status.html#git_status_byindex-21"]}},"git_status_list_free":{"type":"function","file":"status.h","line":343,"lineto":344,"args":[{"name":"statuslist","type":"git_status_list *","comment":"Existing status list object"}],"argline":"git_status_list *statuslist","sig":"git_status_list *","return":{"type":"void","comment":null},"description":"

Free an existing status list

\n","comments":"","group":"status","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_status_list_free-22"]}},"git_status_should_ignore":{"type":"function","file":"status.h","line":362,"lineto":365,"args":[{"name":"ignored","type":"int *","comment":"Boolean returning 0 if the file is not ignored, 1 if it is"},{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"path","type":"const char *","comment":"The file to check ignores for, rooted at the repo's workdir."}],"argline":"int *ignored, git_repository *repo, const char *path","sig":"int *::git_repository *::const char *","return":{"type":"int","comment":" 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not."},"description":"

Test if the ignore rules apply to a given file.

\n","comments":"

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n","group":"status"},"git_strarray_free":{"type":"function","file":"strarray.h","line":41,"lineto":41,"args":[{"name":"array","type":"git_strarray *","comment":"git_strarray from which to free string data"}],"argline":"git_strarray *array","sig":"git_strarray *","return":{"type":"void","comment":null},"description":"

Close a string array object

\n","comments":"

This method should be called on git_strarray objects where the strings\n array is allocated and contains allocated strings, such as what you\n would get from git_strarray_copy(). Not doing so, will result in a\n memory leak.

\n\n

This does not free the git_strarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n","group":"strarray","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_strarray_free-69"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_strarray_free-19"]}},"git_strarray_copy":{"type":"function","file":"strarray.h","line":53,"lineto":53,"args":[{"name":"tgt","type":"git_strarray *","comment":"target"},{"name":"src","type":"const git_strarray *","comment":"source"}],"argline":"git_strarray *tgt, const git_strarray *src","sig":"git_strarray *::const git_strarray *","return":{"type":"int","comment":" 0 on success, \n<\n 0 on allocation failure"},"description":"

Copy a string array object from source to target.

\n","comments":"

Note: target is overwritten and hence should be empty, otherwise its\n contents are leaked. Call git_strarray_free() if necessary.

\n","group":"strarray"},"git_submodule_update":{"type":"function","file":"submodule.h","line":170,"lineto":170,"args":[{"name":"submodule","type":"git_submodule *","comment":"Submodule object"},{"name":"init","type":"int","comment":"If the submodule is not initialized, setting this flag to true\n will initialize the submodule before updating. Otherwise, this will\n return an error if attempting to update an uninitialzed repository.\n but setting this to true forces them to be updated."},{"name":"options","type":"git_submodule_update_options *","comment":"configuration options for the update. If NULL, the\n function works as though GIT_SUBMODULE_UPDATE_OPTIONS_INIT was passed."}],"argline":"git_submodule *submodule, int init, git_submodule_update_options *options","sig":"git_submodule *::int::git_submodule_update_options *","return":{"type":"int","comment":" 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)."},"description":"

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n containing repository.

\n","comments":"","group":"submodule"},"git_submodule_lookup":{"type":"function","file":"submodule.h","line":199,"lineto":202,"args":[{"name":"out","type":"git_submodule **","comment":"Output ptr to submodule; pass NULL to just get return code"},{"name":"repo","type":"git_repository *","comment":"The parent repository"},{"name":"name","type":"const char *","comment":"The name of or path to the submodule; trailing slashes okay"}],"argline":"git_submodule **out, git_repository *repo, const char *name","sig":"git_submodule **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if submodule does not exist,\n GIT_EEXISTS if a repository is found in working directory only,\n -1 on other errors."},"description":"

Lookup submodule information by name or path.

\n","comments":"

Given either the submodule name or path (they are usually the same), this\n returns a structure describing the submodule.

\n\n

There are two expected error scenarios:

\n\n
    \n
  • The submodule is not mentioned in the HEAD, the index, and the config,\nbut does "exist" in the working directory (i.e. there is a subdirectory\nthat appears to be a Git repository). In this case, this function\nreturns GIT_EEXISTS to indicate a sub-repository exists but not in a\nstate where a git_submodule can be instantiated.
  • \n
  • The submodule is not mentioned in the HEAD, index, or config and the\nworking directory doesn't contain a value git repo at that path.\nThere may or may not be anything else at that path, but nothing that\nlooks like a submodule. In this case, this returns GIT_ENOTFOUND.
  • \n
\n\n

You must call git_submodule_free when done with the submodule.

\n","group":"submodule","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_submodule_lookup-23"]}},"git_submodule_free":{"type":"function","file":"submodule.h","line":209,"lineto":209,"args":[{"name":"submodule","type":"git_submodule *","comment":"Submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"void","comment":null},"description":"

Release a submodule

\n","comments":"","group":"submodule","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_submodule_free-24"]}},"git_submodule_foreach":{"type":"function","file":"submodule.h","line":229,"lineto":232,"args":[{"name":"repo","type":"git_repository *","comment":"The repository"},{"name":"callback","type":"int (*)(git_submodule *, const char *, void *)","comment":"Function to be called with the name of each submodule.\n Return a non-zero value to terminate the iteration."},{"name":"payload","type":"void *","comment":"Extra data to pass to callback"}],"argline":"git_repository *repo, int (*)(git_submodule *, const char *, void *) callback, void *payload","sig":"git_repository *::int (*)(git_submodule *, const char *, void *)::void *","return":{"type":"int","comment":" 0 on success, -1 on error, or non-zero return value of callback"},"description":"

Iterate over all tracked submodules of a repository.

\n","comments":"

See the note on git_submodule above. This iterates over the tracked\n submodules as described therein.

\n\n

If you are concerned about items in the working directory that look like\n submodules but are not tracked, the diff API will generate a diff record\n for workdir items that look like submodules but are not tracked, showing\n them as added in the workdir. Also, the status API will treat the entire\n subdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.

\n","group":"submodule","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_submodule_foreach-25"]}},"git_submodule_add_setup":{"type":"function","file":"submodule.h","line":259,"lineto":264,"args":[{"name":"out","type":"git_submodule **","comment":"The newly created submodule ready to open for clone"},{"name":"repo","type":"git_repository *","comment":"The repository in which you want to create the submodule"},{"name":"url","type":"const char *","comment":"URL for the submodule's remote"},{"name":"path","type":"const char *","comment":"Path at which the submodule should be created"},{"name":"use_gitlink","type":"int","comment":"Should workdir contain a gitlink to the repo in\n .git/modules vs. repo directly in workdir."}],"argline":"git_submodule **out, git_repository *repo, const char *url, const char *path, int use_gitlink","sig":"git_submodule **::git_repository *::const char *::const char *::int","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS if submodule already exists,\n -1 on other errors."},"description":"

Set up a new git submodule for checkout.

\n","comments":"

This does "git submodule add" up to the fetch and checkout of the\n submodule contents. It preps a new submodule, creates an entry in\n .gitmodules and creates an empty initialized repository either at the\n given path in the working directory or in .git/modules with a gitlink\n from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the\n submodule repo and perform the clone step as needed. Lastly, call\n git_submodule_add_finalize() to wrap up adding the new submodule and\n .gitmodules to the index to be ready to commit.

\n\n

You must call git_submodule_free on the submodule object when done.

\n","group":"submodule"},"git_submodule_add_finalize":{"type":"function","file":"submodule.h","line":276,"lineto":276,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to finish adding."}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int","comment":null},"description":"

Resolve the setup of a new git submodule.

\n","comments":"

This should be called on a submodule once you have called add setup\n and done the clone of the submodule. This adds the .gitmodules file\n and the newly cloned submodule to the index to be ready to be committed\n (but doesn't actually do the commit).

\n","group":"submodule"},"git_submodule_add_to_index":{"type":"function","file":"submodule.h","line":288,"lineto":290,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to add to the index"},{"name":"write_index","type":"int","comment":"Boolean if this should immediately write the index\n file. If you pass this as false, you will have to get the\n git_index and explicitly call `git_index_write()` on it to\n save the change."}],"argline":"git_submodule *submodule, int write_index","sig":"git_submodule *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Add current submodule HEAD commit to index of superproject.

\n","comments":"","group":"submodule"},"git_submodule_save":{"type":"function","file":"submodule.h","line":304,"lineto":304,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to write."}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure."},"description":"

Write submodule settings to .gitmodules file.

\n","comments":"

This commits any in-memory changes to the submodule to the gitmodules\n file on disk. You may also be interested in git_submodule_init() which\n writes submodule info to ".git/config" (which is better for local changes\n to submodule settings) and/or git_submodule_sync() which writes\n settings about remotes to the actual submodule repository.

\n","group":"submodule"},"git_submodule_owner":{"type":"function","file":"submodule.h","line":317,"lineto":317,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_repository *","comment":" Pointer to `git_repository`"},"description":"

Get the containing repository for a submodule.

\n","comments":"

This returns a pointer to the repository that contains the submodule.\n This is a just a reference to the repository that was passed to the\n original git_submodule_lookup() call, so if that repository has been\n freed, then this may be a dangling reference.

\n","group":"submodule"},"git_submodule_name":{"type":"function","file":"submodule.h","line":325,"lineto":325,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const char *","comment":" Pointer to the submodule name"},"description":"

Get the name of submodule.

\n","comments":"","group":"submodule","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_submodule_name-26"]}},"git_submodule_path":{"type":"function","file":"submodule.h","line":336,"lineto":336,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const char *","comment":" Pointer to the submodule path"},"description":"

Get the path to the submodule.

\n","comments":"

The path is almost always the same as the submodule name, but the\n two are actually not required to match.

\n","group":"submodule","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_submodule_path-27"]}},"git_submodule_url":{"type":"function","file":"submodule.h","line":344,"lineto":344,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const char *","comment":" Pointer to the submodule url"},"description":"

Get the URL for the submodule.

\n","comments":"","group":"submodule"},"git_submodule_resolve_url":{"type":"function","file":"submodule.h","line":354,"lineto":354,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the absolute submodule url in"},{"name":"repo","type":"git_repository *","comment":"Pointer to repository object"},{"name":"url","type":"const char *","comment":"Relative url"}],"argline":"git_buf *out, git_repository *repo, const char *url","sig":"git_buf *::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Resolve a submodule url relative to the given repository.

\n","comments":"","group":"submodule"},"git_submodule_branch":{"type":"function","file":"submodule.h","line":362,"lineto":362,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const char *","comment":" Pointer to the submodule branch"},"description":"

Get the branch for the submodule.

\n","comments":"","group":"submodule"},"git_submodule_set_url":{"type":"function","file":"submodule.h","line":378,"lineto":378,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to the submodule object"},{"name":"url","type":"const char *","comment":"URL that should be used for the submodule"}],"argline":"git_submodule *submodule, const char *url","sig":"git_submodule *::const char *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Set the URL for the submodule.

\n","comments":"

This sets the URL in memory for the submodule. This will be used for\n any following submodule actions while this submodule data is in memory.

\n\n

After calling this, you may wish to call git_submodule_save() to write\n the changes back to the ".gitmodules" file and git_submodule_sync() to\n write the changes to the checked out submodule repository.

\n","group":"submodule"},"git_submodule_index_id":{"type":"function","file":"submodule.h","line":386,"lineto":386,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const git_oid *","comment":" Pointer to git_oid or NULL if submodule is not in index."},"description":"

Get the OID for the submodule in the index.

\n","comments":"","group":"submodule"},"git_submodule_head_id":{"type":"function","file":"submodule.h","line":394,"lineto":394,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const git_oid *","comment":" Pointer to git_oid or NULL if submodule is not in the HEAD."},"description":"

Get the OID for the submodule in the current HEAD tree.

\n","comments":"","group":"submodule"},"git_submodule_wd_id":{"type":"function","file":"submodule.h","line":407,"lineto":407,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const git_oid *","comment":" Pointer to git_oid or NULL if submodule is not checked out."},"description":"

Get the OID for the submodule in the current working directory.

\n","comments":"

This returns the OID that corresponds to looking up 'HEAD' in the checked\n out submodule. If there are pending changes in the index or anything\n else, this won't notice that. You should call git_submodule_status()\n for a more complete picture about the state of the working directory.

\n","group":"submodule"},"git_submodule_ignore":{"type":"function","file":"submodule.h","line":435,"lineto":436,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to check"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_submodule_ignore_t","comment":" The current git_submodule_ignore_t valyue what will be used for\n this submodule."},"description":"

Get the ignore rule that will be used for the submodule.

\n","comments":"

These values control the behavior of git_submodule_status() for this\n submodule. There are four ignore values:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_NONE will consider any change to the contents\nof the submodule from a clean checkout to be dirty, including the\naddition of untracked files. This is the default if unspecified.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED examines the contents of the\nworking tree (i.e. call git_status_foreach() on the submodule) but\nUNTRACKED files will not count as making the submodule dirty.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY means to only check if the HEAD of the\nsubmodule has moved for status. This is fast since it does not need to\nscan the working tree of the submodule at all.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL means not to open the submodule repo.\nThe working directory will be consider clean so long as there is a\nchecked out version present.
  • \n
\n\n

plus the special GIT_SUBMODULE_IGNORE_RESET which can be used with\n git_submodule_set_ignore() to revert to the on-disk setting.

\n","group":"submodule"},"git_submodule_set_ignore":{"type":"function","file":"submodule.h","line":454,"lineto":456,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to update"},{"name":"ignore","type":"git_submodule_ignore_t","comment":"The new value for the ignore rule"}],"argline":"git_submodule *submodule, git_submodule_ignore_t ignore","sig":"git_submodule *::git_submodule_ignore_t","return":{"type":"git_submodule_ignore_t","comment":" old value for ignore"},"description":"

Set the ignore rule for the submodule.

\n","comments":"

This sets the in-memory ignore rule for the submodule which will\n control the behavior of git_submodule_status().

\n\n

To make changes persistent, call git_submodule_save() to write the\n value to disk (in the ".gitmodules" and ".git/config" files).

\n\n

Call with GIT_SUBMODULE_IGNORE_RESET or call git_submodule_reload()\n to revert the in-memory rule to the value that is on disk.

\n","group":"submodule"},"git_submodule_update_strategy":{"type":"function","file":"submodule.h","line":470,"lineto":471,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to check"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_submodule_update_t","comment":" The current git_submodule_update_t value that will be used\n for this submodule."},"description":"

Get the update rule that will be used for the submodule.

\n","comments":"

This value controls the behavior of the git submodule update command.\n There are four useful values documented with git_submodule_update_t\n plus the GIT_SUBMODULE_UPDATE_RESET which can be used to revert to\n the on-disk setting.

\n","group":"submodule"},"git_submodule_set_update":{"type":"function","file":"submodule.h","line":489,"lineto":491,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to update"},{"name":"update","type":"git_submodule_update_t","comment":"The new value to use"}],"argline":"git_submodule *submodule, git_submodule_update_t update","sig":"git_submodule *::git_submodule_update_t","return":{"type":"git_submodule_update_t","comment":" old value for update"},"description":"

Set the update rule for the submodule.

\n","comments":"

The initial value comes from the ".git/config" setting of\n submodule.$name.update for this submodule (which is initialized from\n the ".gitmodules" file). Using this function sets the update rule in\n memory for the submodule. Call git_submodule_save() to write out the\n new update rule.

\n\n

Calling this again with GIT_SUBMODULE_UPDATE_RESET or calling\n git_submodule_reload() will revert the rule to the on disk value.

\n","group":"submodule"},"git_submodule_fetch_recurse_submodules":{"type":"function","file":"submodule.h","line":504,"lineto":505,"args":[{"name":"submodule","type":"git_submodule *","comment":null}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_submodule_recurse_t","comment":" 0 if fetchRecurseSubmodules is false, 1 if true"},"description":"

Read the fetchRecurseSubmodules rule for a submodule.

\n","comments":"

This accesses the submodule.\n<name

\n\n
\n

.fetchRecurseSubmodules value for\n the submodule that controls fetching behavior for the submodule.

\n
\n\n

Note that at this time, libgit2 does not honor this setting and the\n fetch functionality current ignores submodules.

\n","group":"submodule"},"git_submodule_set_fetch_recurse_submodules":{"type":"function","file":"submodule.h","line":518,"lineto":520,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to modify"},{"name":"fetch_recurse_submodules","type":"git_submodule_recurse_t","comment":"Boolean value"}],"argline":"git_submodule *submodule, git_submodule_recurse_t fetch_recurse_submodules","sig":"git_submodule *::git_submodule_recurse_t","return":{"type":"git_submodule_recurse_t","comment":" old value for fetchRecurseSubmodules"},"description":"

Set the fetchRecurseSubmodules rule for a submodule.

\n","comments":"

This sets the submodule.\n<name

\n\n
\n

.fetchRecurseSubmodules value for\n the submodule. You should call git_submodule_save() if you want\n to persist the new value.

\n
\n","group":"submodule"},"git_submodule_init":{"type":"function","file":"submodule.h","line":535,"lineto":535,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to write into the superproject config"},{"name":"overwrite","type":"int","comment":"By default, existing entries will not be overwritten,\n but setting this to true forces them to be updated."}],"argline":"git_submodule *submodule, int overwrite","sig":"git_submodule *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure."},"description":"

Copy submodule info into ".git/config" file.

\n","comments":"

Just like "git submodule init", this copies information about the\n submodule into ".git/config". You can use the accessor functions\n above to alter the in-memory git_submodule object and control what\n is written to the config, overriding what is in .gitmodules.

\n","group":"submodule"},"git_submodule_repo_init":{"type":"function","file":"submodule.h","line":550,"lineto":553,"args":[{"name":"out","type":"git_repository **","comment":"Output pointer to the created git repository."},{"name":"sm","type":"const git_submodule *","comment":"The submodule to create a new subrepository from."},{"name":"use_gitlink","type":"int","comment":"Should the workdir contain a gitlink to\n the repo in .git/modules vs. repo directly in workdir."}],"argline":"git_repository **out, const git_submodule *sm, int use_gitlink","sig":"git_repository **::const git_submodule *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure."},"description":"

Set up the subrepository for a submodule in preparation for clone.

\n","comments":"

This function can be called to init and set up a submodule\n repository from a submodule in preparation to clone it from\n its remote.

\n","group":"submodule"},"git_submodule_sync":{"type":"function","file":"submodule.h","line":563,"lineto":563,"args":[{"name":"submodule","type":"git_submodule *","comment":null}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int","comment":null},"description":"

Copy submodule remote info into submodule repo.

\n","comments":"

This copies the information about the submodules URL into the checked out\n submodule config, acting like "git submodule sync". This is useful if\n you have altered the URL for the submodule (or it has been altered by a\n fetch of upstream changes) and you need to update your local repo.

\n","group":"submodule"},"git_submodule_open":{"type":"function","file":"submodule.h","line":577,"lineto":579,"args":[{"name":"repo","type":"git_repository **","comment":"Pointer to the submodule repo which was opened"},{"name":"submodule","type":"git_submodule *","comment":"Submodule to be opened"}],"argline":"git_repository **repo, git_submodule *submodule","sig":"git_repository **::git_submodule *","return":{"type":"int","comment":" 0 on success, \n<\n0 if submodule repo could not be opened."},"description":"

Open the repository for a submodule.

\n","comments":"

This is a newly opened repository object. The caller is responsible for\n calling git_repository_free() on it when done. Multiple calls to this\n function will return distinct git_repository objects. This will only\n work if the submodule is checked out into the working directory.

\n","group":"submodule"},"git_submodule_reload":{"type":"function","file":"submodule.h","line":591,"lineto":591,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to reload"},{"name":"force","type":"int","comment":"Force reload even if the data doesn't seem out of date"}],"argline":"git_submodule *submodule, int force","sig":"git_submodule *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Reread submodule info from config, index, and HEAD.

\n","comments":"

Call this to reread cached submodule information for this submodule if\n you have reason to believe that it has changed.

\n","group":"submodule"},"git_submodule_reload_all":{"type":"function","file":"submodule.h","line":602,"lineto":602,"args":[{"name":"repo","type":"git_repository *","comment":"The repository to reload submodule data for"},{"name":"force","type":"int","comment":"Force full reload even if the data doesn't seem out of date"}],"argline":"git_repository *repo, int force","sig":"git_repository *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Reread all submodule info.

\n","comments":"

Call this to reload all cached submodule information for the repo.

\n","group":"submodule"},"git_submodule_status":{"type":"function","file":"submodule.h","line":617,"lineto":619,"args":[{"name":"status","type":"unsigned int *","comment":"Combination of `GIT_SUBMODULE_STATUS` flags"},{"name":"submodule","type":"git_submodule *","comment":"Submodule for which to get status"}],"argline":"unsigned int *status, git_submodule *submodule","sig":"unsigned int *::git_submodule *","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Get the status for a submodule.

\n","comments":"

This looks at a submodule and tries to determine the status. It\n will return a combination of the GIT_SUBMODULE_STATUS values above.\n How deeply it examines the working directory to do this will depend\n on the git_submodule_ignore_t value for the submodule - which can be\n set either temporarily or permanently with git_submodule_set_ignore().

\n","group":"submodule","examples":{"status.c":["ex/v0.22.0-rc1/status.html#git_submodule_status-28"]}},"git_submodule_location":{"type":"function","file":"submodule.h","line":635,"lineto":637,"args":[{"name":"location_status","type":"unsigned int *","comment":"Combination of first four `GIT_SUBMODULE_STATUS` flags"},{"name":"submodule","type":"git_submodule *","comment":"Submodule for which to get status"}],"argline":"unsigned int *location_status, git_submodule *submodule","sig":"unsigned int *::git_submodule *","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Get the locations of submodule information.

\n","comments":"

This is a bit like a very lightweight version of git_submodule_status.\n It just returns a made of the first four submodule status values (i.e.\n the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the\n submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.).\n This can be useful if you want to know if the submodule is present in the\n working directory at this point in time, etc.

\n","group":"submodule"},"git_commit_create_from_ids":{"type":"function","file":"sys/commit.h","line":34,"lineto":44,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_oid *","comment":null},{"name":"parent_count","type":"size_t","comment":null},{"name":"parents","type":"const git_oid *[]","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, size_t parent_count, const git_oid *[] parents","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::size_t::const git_oid *[]","return":{"type":"int","comment":null},"description":"

Create new commit in the repository from a list of git_oid values.

\n","comments":"

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree and\n parents now take git_oid. This is a dangerous API in that nor\n the tree, neither the parents list of git_oids are checked for\n validity.

\n","group":"commit"},"git_commit_create_from_callback":{"type":"function","file":"sys/commit.h","line":66,"lineto":76,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_oid *","comment":null},{"name":"parent_cb","type":"git_commit_parent_callback","comment":null},{"name":"parent_payload","type":"void *","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, git_commit_parent_callback parent_cb, void *parent_payload","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::git_commit_parent_callback::void *","return":{"type":"int","comment":null},"description":"

Create a new commit in the repository with an callback to supply parents.

\n","comments":"

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree takes a\n git_oid and doesn't check for validity, and parent_cb is invoked\n with parent_payload and should return git_oid values or NULL to\n indicate that all parents are accounted for.

\n","group":"commit"},"git_config_init_backend":{"type":"function","file":"sys/config.h","line":81,"lineto":83,"args":[{"name":"backend","type":"git_config_backend *","comment":null},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CONFIG_BACKEND_VERSION`"}],"argline":"git_config_backend *backend, unsigned int version","sig":"git_config_backend *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_config_backend with default values. Equivalent to\n creating an instance with GIT_CONFIG_BACKEND_INIT.

\n","comments":"","group":"config"},"git_config_add_backend":{"type":"function","file":"sys/config.h","line":103,"lineto":107,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to add the file to"},{"name":"file","type":"git_config_backend *","comment":"the configuration file (backend) to add"},{"name":"level","type":"git_config_level_t","comment":"the priority level of the backend"},{"name":"force","type":"int","comment":"if a config file already exists for the given\n priority level, replace it"}],"argline":"git_config *cfg, git_config_backend *file, git_config_level_t level, int force","sig":"git_config *::git_config_backend *::git_config_level_t::int","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0), or error code"},"description":"

Add a generic config file instance to an existing config

\n","comments":"

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n","group":"config"},"git_diff_print_callback__to_buf":{"type":"function","file":"sys/diff.h","line":37,"lineto":41,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"line","type":"const git_diff_line *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *","return":{"type":"int","comment":null},"description":"

Diff print callback that writes to a git_buf.

\n","comments":"

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a git_buf buffer. You\n must pass a git_buf * value as the payload to the git_diff_print\n and/or git_patch_print function. The data will be appended to the\n buffer (after any existing content).

\n","group":"diff"},"git_diff_print_callback__to_file_handle":{"type":"function","file":"sys/diff.h","line":57,"lineto":61,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"line","type":"const git_diff_line *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *","return":{"type":"int","comment":null},"description":"

Diff print callback that writes to stdio FILE handle.

\n","comments":"

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a stdio FILE handle. You\n must pass a FILE * value (such as stdout or stderr or the return\n value from fopen()) as the payload to the git_diff_print\n and/or git_patch_print function. If you pass NULL, this will write\n data to stdout.

\n","group":"diff"},"git_diff_get_perfdata":{"type":"function","file":"sys/diff.h","line":83,"lineto":84,"args":[{"name":"out","type":"git_diff_perfdata *","comment":"Structure to be filled with diff performance data"},{"name":"diff","type":"const git_diff *","comment":"Diff to read performance data from"}],"argline":"git_diff_perfdata *out, const git_diff *diff","sig":"git_diff_perfdata *::const git_diff *","return":{"type":"int","comment":" 0 for success, \n<\n0 for error"},"description":"

Get performance data for a diff object.

\n","comments":"","group":"diff"},"git_status_list_get_perfdata":{"type":"function","file":"sys/diff.h","line":89,"lineto":90,"args":[{"name":"out","type":"git_diff_perfdata *","comment":null},{"name":"status","type":"const git_status_list *","comment":null}],"argline":"git_diff_perfdata *out, const git_status_list *status","sig":"git_diff_perfdata *::const git_status_list *","return":{"type":"int","comment":null},"description":"

Get performance data for diffs from a git_status_list

\n","comments":"","group":"status"},"git_filter_lookup":{"type":"function","file":"sys/filter.h","line":27,"lineto":27,"args":[{"name":"name","type":"const char *","comment":"The name of the filter"}],"argline":"const char *name","sig":"const char *","return":{"type":"git_filter *","comment":" Pointer to the filter object or NULL if not found"},"description":"

Look up a filter by name

\n","comments":"","group":"filter"},"git_filter_list_new":{"type":"function","file":"sys/filter.h","line":57,"lineto":61,"args":[{"name":"out","type":"git_filter_list **","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"mode","type":"git_filter_mode_t","comment":null},{"name":"options","type":"uint32_t","comment":null}],"argline":"git_filter_list **out, git_repository *repo, git_filter_mode_t mode, uint32_t options","sig":"git_filter_list **::git_repository *::git_filter_mode_t::uint32_t","return":{"type":"int","comment":null},"description":"

Create a new empty filter list

\n","comments":"

Normally you won't use this because git_filter_list_load will create\n the filter list for you, but you can use this in combination with the\n git_filter_lookup and git_filter_list_push functions to assemble\n your own chains of filters.

\n","group":"filter"},"git_filter_list_push":{"type":"function","file":"sys/filter.h","line":76,"lineto":77,"args":[{"name":"fl","type":"git_filter_list *","comment":null},{"name":"filter","type":"git_filter *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_filter_list *fl, git_filter *filter, void *payload","sig":"git_filter_list *::git_filter *::void *","return":{"type":"int","comment":null},"description":"

Add a filter to a filter list with the given payload.

\n","comments":"

Normally you won't have to do this because the filter list is created\n by calling the "check" function on registered filters when the filter\n attributes are set, but this does allow more direct manipulation of\n filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the\n filter. Using this function, you can either pass in a payload if you\n know the expected payload format, or you can pass NULL. Some filters\n may fail with a NULL payload. Good luck!

\n","group":"filter"},"git_filter_list_length":{"type":"function","file":"sys/filter.h","line":90,"lineto":90,"args":[{"name":"fl","type":"const git_filter_list *","comment":"A filter list"}],"argline":"const git_filter_list *fl","sig":"const git_filter_list *","return":{"type":"size_t","comment":" The number of filters in the list"},"description":"

Look up how many filters are in the list

\n","comments":"

We will attempt to apply all of these filters to any data passed in,\n but note that the filter apply action still has the option of skipping\n data that is passed in (for example, the CRLF filter will skip data\n that appears to be binary).

\n","group":"filter"},"git_filter_source_repo":{"type":"function","file":"sys/filter.h","line":100,"lineto":100,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"git_repository *","comment":null},"description":"

Get the repository that the source data is coming from.

\n","comments":"","group":"filter"},"git_filter_source_path":{"type":"function","file":"sys/filter.h","line":105,"lineto":105,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"const char *","comment":null},"description":"

Get the path that the source data is coming from.

\n","comments":"","group":"filter"},"git_filter_source_filemode":{"type":"function","file":"sys/filter.h","line":111,"lineto":111,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"uint16_t","comment":null},"description":"

Get the file mode of the source file\n If the mode is unknown, this will return 0

\n","comments":"","group":"filter"},"git_filter_source_id":{"type":"function","file":"sys/filter.h","line":118,"lineto":118,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"const git_oid *","comment":null},"description":"

Get the OID of the source\n If the OID is unknown (often the case with GIT_FILTER_CLEAN) then\n this will return NULL.

\n","comments":"","group":"filter"},"git_filter_source_mode":{"type":"function","file":"sys/filter.h","line":123,"lineto":123,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"git_filter_mode_t","comment":null},"description":"

Get the git_filter_mode_t to be used

\n","comments":"","group":"filter"},"git_filter_source_options":{"type":"function","file":"sys/filter.h","line":128,"lineto":128,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"uint32_t","comment":null},"description":"

Get the combination git_filter_opt_t options to be applied

\n","comments":"","group":"filter"},"git_filter_register":{"type":"function","file":"sys/filter.h","line":281,"lineto":282,"args":[{"name":"name","type":"const char *","comment":"A name by which the filter can be referenced. Attempting\n \t\t\tto register with an in-use name will return GIT_EEXISTS."},{"name":"filter","type":"git_filter *","comment":"The filter definition. This pointer will be stored as is\n \t\t\tby libgit2 so it must be a durable allocation (either static\n \t\t\tor on the heap)."},{"name":"priority","type":"int","comment":"The priority for filter application"}],"argline":"const char *name, git_filter *filter, int priority","sig":"const char *::git_filter *::int","return":{"type":"int","comment":" 0 on successful registry, error code \n<\n0 on failure"},"description":"

Register a filter under a given name with a given priority.

\n","comments":"

As mentioned elsewhere, the initialize callback will not be invoked\n immediately. It is deferred until the filter is used in some way.

\n\n

A filter's attribute checks and check and apply callbacks will be\n issued in order of priority on smudge (to workdir), and in reverse\n order of priority on clean (to odb).

\n\n

Two filters are preregistered with libgit2:\n - GIT_FILTER_CRLF with priority 0\n - GIT_FILTER_IDENT with priority 100

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n","group":"filter"},"git_filter_unregister":{"type":"function","file":"sys/filter.h","line":297,"lineto":297,"args":[{"name":"name","type":"const char *","comment":"The name under which the filter was registered"}],"argline":"const char *name","sig":"const char *","return":{"type":"int","comment":" 0 on success, error code \n<\n0 on failure"},"description":"

Remove the filter with the given name

\n","comments":"

Attempting to remove the builtin libgit2 filters is not permitted and\n will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n","group":"filter"},"git_hashsig_create":{"type":"function","file":"sys/hashsig.h","line":43,"lineto":47,"args":[{"name":"out","type":"git_hashsig **","comment":"The array of hashed runs representing the file content"},{"name":"buf","type":"const char *","comment":"The contents of the file to hash"},{"name":"buflen","type":"size_t","comment":"The length of the data at `buf`"},{"name":"opts","type":"git_hashsig_option_t","comment":null}],"argline":"git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts","sig":"git_hashsig **::const char *::size_t::git_hashsig_option_t","return":{"type":"int","comment":null},"description":"

Build a similarity signature for a buffer

\n","comments":"

If you have passed a whitespace-ignoring buffer, then the whitespace\n will be removed from the buffer while it is being processed, modifying\n the buffer in place. Sorry about that!

\n\n

This will return an error if the buffer doesn't contain enough data to\n compute a valid signature.

\n","group":"hashsig"},"git_hashsig_create_fromfile":{"type":"function","file":"sys/hashsig.h","line":58,"lineto":61,"args":[{"name":"out","type":"git_hashsig **","comment":null},{"name":"path","type":"const char *","comment":null},{"name":"opts","type":"git_hashsig_option_t","comment":null}],"argline":"git_hashsig **out, const char *path, git_hashsig_option_t opts","sig":"git_hashsig **::const char *::git_hashsig_option_t","return":{"type":"int","comment":null},"description":"

Build a similarity signature from a file

\n","comments":"

This walks through the file, only loading a maximum of 4K of file data at\n a time. Otherwise, it acts just like git_hashsig_create.

\n\n

This will return an error if the file doesn't contain enough data to\n compute a valid signature.

\n","group":"hashsig"},"git_hashsig_free":{"type":"function","file":"sys/hashsig.h","line":66,"lineto":66,"args":[{"name":"sig","type":"git_hashsig *","comment":null}],"argline":"git_hashsig *sig","sig":"git_hashsig *","return":{"type":"void","comment":null},"description":"

Release memory for a content similarity signature

\n","comments":"","group":"hashsig"},"git_hashsig_compare":{"type":"function","file":"sys/hashsig.h","line":73,"lineto":75,"args":[{"name":"a","type":"const git_hashsig *","comment":null},{"name":"b","type":"const git_hashsig *","comment":null}],"argline":"const git_hashsig *a, const git_hashsig *b","sig":"const git_hashsig *::const git_hashsig *","return":{"type":"int","comment":" \n<\n0 for error, [0 to 100] as similarity score"},"description":"

Measure similarity between two files

\n","comments":"","group":"hashsig"},"git_mempack_new":{"type":"function","file":"sys/mempack.h","line":44,"lineto":44,"args":[{"name":"out","type":"git_odb_backend **","comment":"Poiter where to store the ODB backend"}],"argline":"git_odb_backend **out","sig":"git_odb_backend **","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"
Instantiate a new mempack backend.\n
\n","comments":"
The backend must be added to an existing ODB with the highest\npriority.\n\n    git_mempack_new(\n
\n\n

&mempacker\n);\n git_repository_odb(\n&odb\n, repository);\n git_odb_add_backend(odb, mempacker, 999);

\n\n
Once the backend has been loaded, all writes to the ODB will\ninstead be queued in memory, and can be finalized with\n`git_mempack_dump`.\n\nSubsequent reads will also be served from the in-memory store\nto ensure consistency, until the memory store is dumped.\n
\n","group":"mempack"},"git_mempack_reset":{"type":"function","file":"sys/mempack.h","line":81,"lineto":81,"args":[{"name":"backend","type":"git_odb_backend *","comment":"The mempack backend"}],"argline":"git_odb_backend *backend","sig":"git_odb_backend *","return":{"type":"void","comment":null},"description":"
Reset the memory packer by clearing all the queued objects.\n
\n","comments":"
This assumes that `git_mempack_dump` has been called before to\nstore all the queued objects into a single packfile.\n\nAlternatively, call `reset` without a previous dump to "undo"\nall the recently written objects, giving transaction-like\nsemantics to the Git repository.\n
\n","group":"mempack"},"git_odb_init_backend":{"type":"function","file":"sys/odb_backend.h","line":100,"lineto":102,"args":[{"name":"backend","type":"git_odb_backend *","comment":null},{"name":"version","type":"unsigned int","comment":"Version the struct; pass `GIT_ODB_BACKEND_VERSION`"}],"argline":"git_odb_backend *backend, unsigned int version","sig":"git_odb_backend *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_odb_backend with default values. Equivalent to\n creating an instance with GIT_ODB_BACKEND_INIT.

\n","comments":"","group":"odb"},"git_openssl_set_locking":{"type":"function","file":"sys/openssl.h","line":34,"lineto":34,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" 0 on success, -1 if there are errors or if libgit2 was not\n built with OpenSSL and threading support."},"description":"

Initialize the OpenSSL locks

\n","comments":"

OpenSSL requires the application to determine how it performs\n locking.

\n\n

This is a last-resort convenience function which libgit2 provides for\n allocating and initializing the locks as well as setting the\n locking function to use the system's native locking functions.

\n\n

The locking function will be cleared and the memory will be freed\n when you call git_threads_sutdown().

\n\n

If your programming language has an OpenSSL package/bindings, it\n likely sets up locking. You should very strongly prefer that over\n this function.

\n","group":"openssl"},"git_refdb_init_backend":{"type":"function","file":"sys/refdb_backend.h","line":182,"lineto":184,"args":[{"name":"backend","type":"git_refdb_backend *","comment":null},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REFDB_BACKEND_VERSION`"}],"argline":"git_refdb_backend *backend, unsigned int version","sig":"git_refdb_backend *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_refdb_backend with default values. Equivalent to\n creating an instance with GIT_REFDB_BACKEND_INIT.

\n","comments":"","group":"refdb"},"git_refdb_backend_fs":{"type":"function","file":"sys/refdb_backend.h","line":197,"lineto":199,"args":[{"name":"backend_out","type":"git_refdb_backend **","comment":"Output pointer to the git_refdb_backend object"},{"name":"repo","type":"git_repository *","comment":"Git repository to access"}],"argline":"git_refdb_backend **backend_out, git_repository *repo","sig":"git_refdb_backend **::git_repository *","return":{"type":"int","comment":" 0 on success, \n<\n0 error code on failure"},"description":"

Constructors for default filesystem-based refdb backend

\n","comments":"

Under normal usage, this is called for you when the repository is\n opened / created, but you can use this to explicitly construct a\n filesystem refdb backend for a repository.

\n","group":"refdb"},"git_refdb_set_backend":{"type":"function","file":"sys/refdb_backend.h","line":211,"lineto":213,"args":[{"name":"refdb","type":"git_refdb *","comment":"database to add the backend to"},{"name":"backend","type":"git_refdb_backend *","comment":"pointer to a git_refdb_backend instance"}],"argline":"git_refdb *refdb, git_refdb_backend *backend","sig":"git_refdb *::git_refdb_backend *","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Sets the custom backend to an existing reference DB

\n","comments":"

The git_refdb will take ownership of the git_refdb_backend so you\n should NOT free it after calling this function.

\n","group":"refdb"},"git_reference__alloc":{"type":"function","file":"sys/refs.h","line":31,"lineto":34,"args":[{"name":"name","type":"const char *","comment":"the reference name"},{"name":"oid","type":"const git_oid *","comment":"the object id for a direct reference"},{"name":"peel","type":"const git_oid *","comment":"the first non-tag object's OID, or NULL"}],"argline":"const char *name, const git_oid *oid, const git_oid *peel","sig":"const char *::const git_oid *::const git_oid *","return":{"type":"git_reference *","comment":" the created git_reference or NULL on error"},"description":"

Create a new direct reference from an OID.

\n","comments":"","group":"reference"},"git_reference__alloc_symbolic":{"type":"function","file":"sys/refs.h","line":43,"lineto":45,"args":[{"name":"name","type":"const char *","comment":"the reference name"},{"name":"target","type":"const char *","comment":"the target for a symbolic reference"}],"argline":"const char *name, const char *target","sig":"const char *::const char *","return":{"type":"git_reference *","comment":" the created git_reference or NULL on error"},"description":"

Create a new symbolic reference.

\n","comments":"","group":"reference"},"git_transport_init":{"type":"function","file":"sys/transport.h","line":113,"lineto":115,"args":[{"name":"opts","type":"git_transport *","comment":"the `git_transport` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_TRANSPORT_VERSION`"}],"argline":"git_transport *opts, unsigned int version","sig":"git_transport *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_transport with default values. Equivalent to\n creating an instance with GIT_TRANSPORT_INIT.

\n","comments":"","group":"transport"},"git_transport_new":{"type":"function","file":"sys/transport.h","line":127,"lineto":127,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"url","type":"const char *","comment":"The URL to connect to"}],"argline":"git_transport **out, git_remote *owner, const char *url","sig":"git_transport **::git_remote *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Function to use to create a transport from a URL. The transport database\n is scanned to find a transport that implements the scheme of the URI (i.e.\n git:// or http://) and a transport object is returned to the caller.

\n","comments":"","group":"transport"},"git_transport_ssh_with_paths":{"type":"function","file":"sys/transport.h","line":143,"lineto":143,"args":[{"name":"out","type":"git_transport **","comment":"the resulting transport"},{"name":"owner","type":"git_remote *","comment":"the owning remote"},{"name":"payload","type":"void *","comment":"a strarray with the paths"}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an ssh transport with custom git command paths

\n","comments":"

This is a factory function suitable for setting as the transport\n callback in a remote (or for a clone in the options).

\n\n

The payload argument must be a strarray pointer with the paths for\n the git-upload-pack and git-receive-pack at index 0 and 1.

\n","group":"transport"},"git_transport_register":{"type":"function","file":"sys/transport.h","line":161,"lineto":164,"args":[{"name":"prefix","type":"const char *","comment":"The scheme (ending in \"://\") to match, i.e. \"git://\""},{"name":"cb","type":"git_transport_cb","comment":"The callback used to create an instance of the transport"},{"name":"param","type":"void *","comment":"A fixed parameter to pass to cb at creation time"}],"argline":"const char *prefix, git_transport_cb cb, void *param","sig":"const char *::git_transport_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add a custom transport definition, to be used in addition to the built-in\n set of transports that come with libgit2.

\n","comments":"

The caller is responsible for synchronizing calls to git_transport_register\n and git_transport_unregister with other calls to the library that\n instantiate transports.

\n","group":"transport"},"git_transport_unregister":{"type":"function","file":"sys/transport.h","line":174,"lineto":175,"args":[{"name":"prefix","type":"const char *","comment":"From the previous call to git_transport_register"}],"argline":"const char *prefix","sig":"const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Unregister a custom transport definition which was previously registered\n with git_transport_register.

\n","comments":"","group":"transport"},"git_transport_dummy":{"type":"function","file":"sys/transport.h","line":188,"lineto":191,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"payload","type":"void *","comment":"You must pass NULL for this parameter."}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the dummy transport.

\n","comments":"","group":"transport"},"git_transport_local":{"type":"function","file":"sys/transport.h","line":201,"lineto":204,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"payload","type":"void *","comment":"You must pass NULL for this parameter."}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the local transport.

\n","comments":"","group":"transport"},"git_transport_smart":{"type":"function","file":"sys/transport.h","line":214,"lineto":217,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"payload","type":"void *","comment":"A pointer to a git_smart_subtransport_definition"}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the smart transport.

\n","comments":"","group":"transport"},"git_smart_subtransport_http":{"type":"function","file":"sys/transport.h","line":322,"lineto":324,"args":[{"name":"out","type":"git_smart_subtransport **","comment":"The newly created subtransport"},{"name":"owner","type":"git_transport *","comment":"The smart transport to own this subtransport"}],"argline":"git_smart_subtransport **out, git_transport *owner","sig":"git_smart_subtransport **::git_transport *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the http subtransport. This subtransport\n also supports https. On Win32, this subtransport may be implemented\n using the WinHTTP library.

\n","comments":"","group":"smart"},"git_smart_subtransport_git":{"type":"function","file":"sys/transport.h","line":333,"lineto":335,"args":[{"name":"out","type":"git_smart_subtransport **","comment":"The newly created subtransport"},{"name":"owner","type":"git_transport *","comment":"The smart transport to own this subtransport"}],"argline":"git_smart_subtransport **out, git_transport *owner","sig":"git_smart_subtransport **::git_transport *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the git subtransport.

\n","comments":"","group":"smart"},"git_smart_subtransport_ssh":{"type":"function","file":"sys/transport.h","line":344,"lineto":346,"args":[{"name":"out","type":"git_smart_subtransport **","comment":"The newly created subtransport"},{"name":"owner","type":"git_transport *","comment":"The smart transport to own this subtransport"}],"argline":"git_smart_subtransport **out, git_transport *owner","sig":"git_smart_subtransport **::git_transport *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the ssh subtransport.

\n","comments":"","group":"smart"},"git_remote_set_transport":{"type":"function","file":"sys/transport.h","line":358,"lineto":361,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"transport_cb","type":"git_transport_cb","comment":"the function to use to create a transport"},{"name":"payload","type":"void *","comment":"opaque parameter passed to transport_cb"}],"argline":"git_remote *remote, git_transport_cb transport_cb, void *payload","sig":"git_remote *::git_transport_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Sets a custom transport factory for the remote. The caller can use this\n function to override the transport used for this remote when performing\n network operations.

\n","comments":"","group":"remote"},"git_tag_lookup":{"type":"function","file":"tag.h","line":33,"lineto":34,"args":[{"name":"out","type":"git_tag **","comment":"pointer to the looked up tag"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the tag."},{"name":"id","type":"const git_oid *","comment":"identity of the tag to locate."}],"argline":"git_tag **out, git_repository *repo, const git_oid *id","sig":"git_tag **::git_repository *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a tag object from the repository.

\n","comments":"","group":"tag","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_tag_lookup-70"]}},"git_tag_lookup_prefix":{"type":"function","file":"tag.h","line":48,"lineto":49,"args":[{"name":"out","type":"git_tag **","comment":"pointer to the looked up tag"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the tag."},{"name":"id","type":"const git_oid *","comment":"identity of the tag to locate."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_tag **out, git_repository *repo, const git_oid *id, size_t len","sig":"git_tag **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a tag object from the repository,\n given a prefix of its identifier (short id).

\n","comments":"","group":"tag"},"git_tag_free":{"type":"function","file":"tag.h","line":61,"lineto":61,"args":[{"name":"tag","type":"git_tag *","comment":"the tag to close"}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"void","comment":null},"description":"

Close an open tag

\n","comments":"

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to\n release memory. Failure to do so will cause a memory leak.

\n","group":"tag"},"git_tag_id":{"type":"function","file":"tag.h","line":69,"lineto":69,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const git_oid *","comment":" object identity for the tag."},"description":"

Get the id of a tag.

\n","comments":"","group":"tag"},"git_tag_owner":{"type":"function","file":"tag.h","line":77,"lineto":77,"args":[{"name":"tag","type":"const git_tag *","comment":"A previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"git_repository *","comment":" Repository that contains this tag."},"description":"

Get the repository that contains the tag.

\n","comments":"","group":"tag"},"git_tag_target":{"type":"function","file":"tag.h","line":89,"lineto":89,"args":[{"name":"target_out","type":"git_object **","comment":"pointer where to store the target"},{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"git_object **target_out, const git_tag *tag","sig":"git_object **::const git_tag *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the tagged object of a tag

\n","comments":"

This method performs a repository lookup for the\n given object and returns it

\n","group":"tag","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_tag_target-71"]}},"git_tag_target_id":{"type":"function","file":"tag.h","line":97,"lineto":97,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const git_oid *","comment":" pointer to the OID"},"description":"

Get the OID of the tagged object of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tag_target_id-35"]}},"git_tag_target_type":{"type":"function","file":"tag.h","line":105,"lineto":105,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"git_otype","comment":" type of the tagged object"},"description":"

Get the type of a tag's tagged object

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tag_target_type-36"],"general.c":["ex/v0.22.0-rc1/general.html#git_tag_target_type-72"]}},"git_tag_name":{"type":"function","file":"tag.h","line":113,"lineto":113,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const char *","comment":" name of the tag"},"description":"

Get the name of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tag_name-37"],"general.c":["ex/v0.22.0-rc1/general.html#git_tag_name-73"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_tag_name-20"]}},"git_tag_tagger":{"type":"function","file":"tag.h","line":121,"lineto":121,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const git_signature *","comment":" reference to the tag's author or NULL when unspecified"},"description":"

Get the tagger (author) of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tag_tagger-38"]}},"git_tag_message":{"type":"function","file":"tag.h","line":129,"lineto":129,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const char *","comment":" message of the tag or NULL when unspecified"},"description":"

Get the message of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tag_message-39","ex/v0.22.0-rc1/cat-file.html#git_tag_message-40"],"general.c":["ex/v0.22.0-rc1/general.html#git_tag_message-74"],"tag.c":["ex/v0.22.0-rc1/tag.html#git_tag_message-21"]}},"git_tag_create":{"type":"function","file":"tag.h","line":171,"lineto":178,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the\n newly created tag. If the tag already exists, this parameter\n will be the oid of the existing tag, and the function will\n return a GIT_EEXISTS error code."},{"name":"repo","type":"git_repository *","comment":"Repository where to store the tag"},{"name":"tag_name","type":"const char *","comment":"Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object\n must belong to the given `repo`."},{"name":"tagger","type":"const git_signature *","comment":"Signature of the tagger for this tag, and\n of the tagging time"},{"name":"message","type":"const char *","comment":"Full message for this tag"},{"name":"force","type":"int","comment":"Overwrite existing references"}],"argline":"git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message, int force","sig":"git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *::int","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code\n\tA tag object is written to the ODB, and a proper reference\n\tis written in the /refs/tags folder, pointing to it"},"description":"

Create a new tag in the repository from an object

\n","comments":"

A new reference will also be created pointing to\n this tag object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid\n the characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\n sequences ".." and "\n@\n{" which have special meaning to revparse.

\n","group":"tag","examples":{"tag.c":["ex/v0.22.0-rc1/tag.html#git_tag_create-22"]}},"git_tag_annotation_create":{"type":"function","file":"tag.h","line":203,"lineto":209,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the\n newly created tag"},{"name":"repo","type":"git_repository *","comment":"Repository where to store the tag"},{"name":"tag_name","type":"const char *","comment":"Name for the tag"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object\n must belong to the given `repo`."},{"name":"tagger","type":"const git_signature *","comment":"Signature of the tagger for this tag, and\n of the tagging time"},{"name":"message","type":"const char *","comment":"Full message for this tag"}],"argline":"git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message","sig":"git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success or an error code"},"description":"

Create a new tag in the object database pointing to a git_object

\n","comments":"

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n","group":"tag"},"git_tag_create_frombuffer":{"type":"function","file":"tag.h","line":220,"lineto":224,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the newly created tag"},{"name":"repo","type":"git_repository *","comment":"Repository where to store the tag"},{"name":"buffer","type":"const char *","comment":"Raw tag data"},{"name":"force","type":"int","comment":"Overwrite existing tags"}],"argline":"git_oid *oid, git_repository *repo, const char *buffer, int force","sig":"git_oid *::git_repository *::const char *::int","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Create a new tag in the repository from a buffer

\n","comments":"","group":"tag"},"git_tag_create_lightweight":{"type":"function","file":"tag.h","line":256,"lineto":261,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the provided\n target object. If the tag already exists, this parameter\n will be filled with the oid of the existing pointed object\n and the function will return a GIT_EEXISTS error code."},{"name":"repo","type":"git_repository *","comment":"Repository where to store the lightweight tag"},{"name":"tag_name","type":"const char *","comment":"Name for the tag; this name is validated\n for consistency. It should also not conflict with an\n already existing tag name"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object\n must belong to the given `repo`."},{"name":"force","type":"int","comment":"Overwrite existing references"}],"argline":"git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, int force","sig":"git_oid *::git_repository *::const char *::const git_object *::int","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code\n\tA proper reference is written in the /refs/tags folder,\n pointing to the provided target object"},"description":"

Create a new lightweight tag pointing at a target object

\n","comments":"

A new direct reference will be created pointing to\n this target object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"tag","examples":{"tag.c":["ex/v0.22.0-rc1/tag.html#git_tag_create_lightweight-23"]}},"git_tag_delete":{"type":"function","file":"tag.h","line":276,"lineto":278,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where lives the tag"},{"name":"tag_name","type":"const char *","comment":"Name of the tag to be deleted;\n this name is validated for consistency."}],"argline":"git_repository *repo, const char *tag_name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code"},"description":"

Delete an existing tag reference.

\n","comments":"

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"tag","examples":{"tag.c":["ex/v0.22.0-rc1/tag.html#git_tag_delete-24"]}},"git_tag_list":{"type":"function","file":"tag.h","line":293,"lineto":295,"args":[{"name":"tag_names","type":"git_strarray *","comment":"Pointer to a git_strarray structure where\n\t\tthe tag names will be stored"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the tags"}],"argline":"git_strarray *tag_names, git_repository *repo","sig":"git_strarray *::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Fill a list with all the tags in the Repository

\n","comments":"

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should be free'd manually when no longer needed, using\n git_strarray_free.

\n","group":"tag"},"git_tag_list_match":{"type":"function","file":"tag.h","line":315,"lineto":318,"args":[{"name":"tag_names","type":"git_strarray *","comment":"Pointer to a git_strarray structure where\n\t\tthe tag names will be stored"},{"name":"pattern","type":"const char *","comment":"Standard fnmatch pattern"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the tags"}],"argline":"git_strarray *tag_names, const char *pattern, git_repository *repo","sig":"git_strarray *::const char *::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Fill a list with all the tags in the Repository\n which name match a defined pattern

\n","comments":"

If an empty pattern is provided, all the tags\n will be returned.

\n\n

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should be free'd manually when no longer needed, using\n git_strarray_free.

\n","group":"tag","examples":{"tag.c":["ex/v0.22.0-rc1/tag.html#git_tag_list_match-25"]}},"git_tag_foreach":{"type":"function","file":"tag.h","line":330,"lineto":333,"args":[{"name":"repo","type":"git_repository *","comment":"Repository"},{"name":"callback","type":"git_tag_foreach_cb","comment":"Callback function"},{"name":"payload","type":"void *","comment":"Pointer to callback data (optional)"}],"argline":"git_repository *repo, git_tag_foreach_cb callback, void *payload","sig":"git_repository *::git_tag_foreach_cb::void *","return":{"type":"int","comment":null},"description":"

Call callback `cb' for each tag in the repository

\n","comments":"","group":"tag"},"git_tag_peel":{"type":"function","file":"tag.h","line":346,"lineto":348,"args":[{"name":"tag_target_out","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"tag","type":"const git_tag *","comment":"The tag to be processed"}],"argline":"git_object **tag_target_out, const git_tag *tag","sig":"git_object **::const git_tag *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Recursively peel a tag until a non tag git_object is found

\n","comments":"

The retrieved tag_target object is owned by the repository\n and should be closed with the git_object_free method.

\n","group":"tag"},"git_trace_set":{"type":"function","file":"trace.h","line":63,"lineto":63,"args":[{"name":"level","type":"git_trace_level_t","comment":"Level to set tracing to"},{"name":"cb","type":"git_trace_callback","comment":"Function to call with trace data"}],"argline":"git_trace_level_t level, git_trace_callback cb","sig":"git_trace_level_t::git_trace_callback","return":{"type":"int","comment":" 0 or an error code"},"description":"

Sets the system tracing configuration to the specified level with the\n specified callback. When system events occur at a level equal to, or\n lower than, the given level they will be reported to the given callback.

\n","comments":"","group":"trace"},"git_cred_has_username":{"type":"function","file":"transport.h","line":187,"lineto":187,"args":[{"name":"cred","type":"git_cred *","comment":"object to check"}],"argline":"git_cred *cred","sig":"git_cred *","return":{"type":"int","comment":" 1 if the credential object has non-NULL username, 0 otherwise"},"description":"

Check whether a credential object contains username information.

\n","comments":"","group":"cred"},"git_cred_userpass_plaintext_new":{"type":"function","file":"transport.h","line":198,"lineto":201,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"The username of the credential."},{"name":"password","type":"const char *","comment":"The password of the credential."}],"argline":"git_cred **out, const char *username, const char *password","sig":"git_cred **::const char *::const char *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a new plain-text username and password credential object.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_key_new":{"type":"function","file":"transport.h","line":214,"lineto":219,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"username to use to authenticate"},{"name":"publickey","type":"const char *","comment":"The path to the public key of the credential."},{"name":"privatekey","type":"const char *","comment":"The path to the private key of the credential."},{"name":"passphrase","type":"const char *","comment":"The passphrase of the credential."}],"argline":"git_cred **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase","sig":"git_cred **::const char *::const char *::const char *::const char *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a new passphrase-protected ssh key credential object.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_interactive_new":{"type":"function","file":"transport.h","line":230,"lineto":234,"args":[{"name":"out","type":"git_cred **","comment":null},{"name":"username","type":"const char *","comment":"Username to use to authenticate."},{"name":"prompt_callback","type":"git_cred_ssh_interactive_callback","comment":"The callback method used for prompts."},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback."}],"argline":"git_cred **out, const char *username, git_cred_ssh_interactive_callback prompt_callback, void *payload","sig":"git_cred **::const char *::git_cred_ssh_interactive_callback::void *","return":{"type":"int","comment":" 0 for success or an error code for failure."},"description":"

Create a new ssh keyboard-interactive based credential object.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_key_from_agent":{"type":"function","file":"transport.h","line":244,"lineto":246,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"username to use to authenticate"}],"argline":"git_cred **out, const char *username","sig":"git_cred **::const char *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a new ssh key credential object used for querying an ssh-agent.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_custom_new":{"type":"function","file":"transport.h","line":266,"lineto":272,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"username to use to authenticate"},{"name":"publickey","type":"const char *","comment":"The bytes of the public key."},{"name":"publickey_len","type":"size_t","comment":"The length of the public key in bytes."},{"name":"sign_callback","type":"git_cred_sign_callback","comment":"The callback method to sign the data during the challenge."},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback."}],"argline":"git_cred **out, const char *username, const char *publickey, size_t publickey_len, git_cred_sign_callback sign_callback, void *payload","sig":"git_cred **::const char *::const char *::size_t::git_cred_sign_callback::void *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create an ssh key credential with a custom signing function.

\n","comments":"

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness\n and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n","group":"cred"},"git_cred_default_new":{"type":"function","file":"transport.h","line":280,"lineto":280,"args":[{"name":"out","type":"git_cred **","comment":null}],"argline":"git_cred **out","sig":"git_cred **","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a "default" credential usable for Negotiate mechanisms like NTLM\n or Kerberos authentication.

\n","comments":"","group":"cred"},"git_cred_username_new":{"type":"function","file":"transport.h","line":288,"lineto":288,"args":[{"name":"cred","type":"git_cred **","comment":null},{"name":"username","type":"const char *","comment":null}],"argline":"git_cred **cred, const char *username","sig":"git_cred **::const char *","return":{"type":"int","comment":null},"description":"

Create a credential to specify a username.

\n","comments":"

This is used with ssh authentication to query for the username if\n none is specified in the url.

\n","group":"cred"},"git_tree_lookup":{"type":"function","file":"tree.h","line":32,"lineto":33,"args":[{"name":"out","type":"git_tree **","comment":"Pointer to the looked up tree"},{"name":"repo","type":"git_repository *","comment":"The repo to use when locating the tree."},{"name":"id","type":"const git_oid *","comment":"Identity of the tree to locate."}],"argline":"git_tree **out, git_repository *repo, const git_oid *id","sig":"git_tree **::git_repository *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a tree object from the repository.

\n","comments":"","group":"tree","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_tree_lookup-75","ex/v0.22.0-rc1/general.html#git_tree_lookup-76"],"init.c":["ex/v0.22.0-rc1/init.html#git_tree_lookup-14"]}},"git_tree_lookup_prefix":{"type":"function","file":"tree.h","line":47,"lineto":51,"args":[{"name":"out","type":"git_tree **","comment":"pointer to the looked up tree"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the tree."},{"name":"id","type":"const git_oid *","comment":"identity of the tree to locate."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_tree **out, git_repository *repo, const git_oid *id, size_t len","sig":"git_tree **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a tree object from the repository,\n given a prefix of its identifier (short id).

\n","comments":"","group":"tree"},"git_tree_free":{"type":"function","file":"tree.h","line":63,"lineto":63,"args":[{"name":"tree","type":"git_tree *","comment":"The tree to close"}],"argline":"git_tree *tree","sig":"git_tree *","return":{"type":"void","comment":null},"description":"

Close an open tree

\n","comments":"

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to\n release memory. Failure to do so will cause a memory leak.

\n","group":"tree","examples":{"diff.c":["ex/v0.22.0-rc1/diff.html#git_tree_free-17","ex/v0.22.0-rc1/diff.html#git_tree_free-18"],"init.c":["ex/v0.22.0-rc1/init.html#git_tree_free-15"],"log.c":["ex/v0.22.0-rc1/log.html#git_tree_free-58","ex/v0.22.0-rc1/log.html#git_tree_free-59","ex/v0.22.0-rc1/log.html#git_tree_free-60","ex/v0.22.0-rc1/log.html#git_tree_free-61","ex/v0.22.0-rc1/log.html#git_tree_free-62"]}},"git_tree_id":{"type":"function","file":"tree.h","line":71,"lineto":71,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."}],"argline":"const git_tree *tree","sig":"const git_tree *","return":{"type":"const git_oid *","comment":" object identity for the tree."},"description":"

Get the id of a tree.

\n","comments":"","group":"tree"},"git_tree_owner":{"type":"function","file":"tree.h","line":79,"lineto":79,"args":[{"name":"tree","type":"const git_tree *","comment":"A previously loaded tree."}],"argline":"const git_tree *tree","sig":"const git_tree *","return":{"type":"git_repository *","comment":" Repository that contains this tree."},"description":"

Get the repository that contains the tree.

\n","comments":"","group":"tree"},"git_tree_entrycount":{"type":"function","file":"tree.h","line":87,"lineto":87,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."}],"argline":"const git_tree *tree","sig":"const git_tree *","return":{"type":"size_t","comment":" the number of entries in the tree"},"description":"

Get the number of entries listed in a tree

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tree_entrycount-41"],"general.c":["ex/v0.22.0-rc1/general.html#git_tree_entrycount-77"]}},"git_tree_entry_byname":{"type":"function","file":"tree.h","line":99,"lineto":100,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."},{"name":"filename","type":"const char *","comment":"the filename of the desired entry"}],"argline":"const git_tree *tree, const char *filename","sig":"const git_tree *::const char *","return":{"type":"const git_tree_entry *","comment":" the tree entry; NULL if not found"},"description":"

Lookup a tree entry by its filename

\n","comments":"

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n","group":"tree","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_tree_entry_byname-78"]}},"git_tree_entry_byindex":{"type":"function","file":"tree.h","line":112,"lineto":113,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."},{"name":"idx","type":"size_t","comment":"the position in the entry list"}],"argline":"const git_tree *tree, size_t idx","sig":"const git_tree *::size_t","return":{"type":"const git_tree_entry *","comment":" the tree entry; NULL if not found"},"description":"

Lookup a tree entry by its position in the tree

\n","comments":"

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n","group":"tree","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tree_entry_byindex-42"],"general.c":["ex/v0.22.0-rc1/general.html#git_tree_entry_byindex-79"]}},"git_tree_entry_byid":{"type":"function","file":"tree.h","line":127,"lineto":128,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."},{"name":"id","type":"const git_oid *","comment":"the sha being looked for"}],"argline":"const git_tree *tree, const git_oid *id","sig":"const git_tree *::const git_oid *","return":{"type":"const git_tree_entry *","comment":" the tree entry; NULL if not found"},"description":"

Lookup a tree entry by SHA value.

\n","comments":"

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n","group":"tree"},"git_tree_entry_bypath":{"type":"function","file":"tree.h","line":142,"lineto":145,"args":[{"name":"out","type":"git_tree_entry **","comment":"Pointer where to store the tree entry"},{"name":"root","type":"const git_tree *","comment":"Previously loaded tree which is the root of the relative path"},{"name":"path","type":"const char *","comment":"Path to the contained entry"}],"argline":"git_tree_entry **out, const git_tree *root, const char *path","sig":"git_tree_entry **::const git_tree *::const char *","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND if the path does not exist"},"description":"

Retrieve a tree entry contained in a tree or in any of its subtrees,\n given its relative path.

\n","comments":"

Unlike the other lookup functions, the returned tree entry is owned by\n the user and must be freed explicitly with git_tree_entry_free().

\n","group":"tree"},"git_tree_entry_dup":{"type":"function","file":"tree.h","line":157,"lineto":157,"args":[{"name":"dest","type":"git_tree_entry **","comment":"pointer where to store the copy"},{"name":"source","type":"const git_tree_entry *","comment":"tree entry to duplicate"}],"argline":"git_tree_entry **dest, const git_tree_entry *source","sig":"git_tree_entry **::const git_tree_entry *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Duplicate a tree entry

\n","comments":"

Create a copy of a tree entry. The returned copy is owned by the user,\n and must be freed explicitly with git_tree_entry_free().

\n","group":"tree"},"git_tree_entry_free":{"type":"function","file":"tree.h","line":168,"lineto":168,"args":[{"name":"entry","type":"git_tree_entry *","comment":"The entry to free"}],"argline":"git_tree_entry *entry","sig":"git_tree_entry *","return":{"type":"void","comment":null},"description":"

Free a user-owned tree entry

\n","comments":"

IMPORTANT: This function is only needed for tree entries owned by the\n user, such as the ones returned by git_tree_entry_dup() or\n git_tree_entry_bypath().

\n","group":"tree"},"git_tree_entry_name":{"type":"function","file":"tree.h","line":176,"lineto":176,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"const char *","comment":" the name of the file"},"description":"

Get the filename of a tree entry

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tree_entry_name-43"],"general.c":["ex/v0.22.0-rc1/general.html#git_tree_entry_name-80","ex/v0.22.0-rc1/general.html#git_tree_entry_name-81"]}},"git_tree_entry_id":{"type":"function","file":"tree.h","line":184,"lineto":184,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"const git_oid *","comment":" the oid of the object"},"description":"

Get the id of the object pointed by the entry

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tree_entry_id-44"]}},"git_tree_entry_type":{"type":"function","file":"tree.h","line":192,"lineto":192,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"git_otype","comment":" the type of the pointed object"},"description":"

Get the type of the object pointed by the entry

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tree_entry_type-45"]}},"git_tree_entry_filemode":{"type":"function","file":"tree.h","line":200,"lineto":200,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"git_filemode_t","comment":" filemode as an integer"},"description":"

Get the UNIX file attributes of a tree entry

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.22.0-rc1/cat-file.html#git_tree_entry_filemode-46"]}},"git_tree_entry_filemode_raw":{"type":"function","file":"tree.h","line":212,"lineto":212,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"git_filemode_t","comment":" filemode as an integer"},"description":"

Get the raw UNIX file attributes of a tree entry

\n","comments":"

This function does not perform any normalization and is only useful\n if you need to be able to recreate the original tree object.

\n","group":"tree"},"git_tree_entry_cmp":{"type":"function","file":"tree.h","line":220,"lineto":220,"args":[{"name":"e1","type":"const git_tree_entry *","comment":"first tree entry"},{"name":"e2","type":"const git_tree_entry *","comment":"second tree entry"}],"argline":"const git_tree_entry *e1, const git_tree_entry *e2","sig":"const git_tree_entry *::const git_tree_entry *","return":{"type":"int","comment":" \n<\n0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2"},"description":"

Compare two tree entries

\n","comments":"","group":"tree"},"git_tree_entry_to_object":{"type":"function","file":"tree.h","line":232,"lineto":235,"args":[{"name":"object_out","type":"git_object **","comment":"pointer to the converted object"},{"name":"repo","type":"git_repository *","comment":"repository where to lookup the pointed object"},{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"git_object **object_out, git_repository *repo, const git_tree_entry *entry","sig":"git_object **::git_repository *::const git_tree_entry *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Convert a tree entry to the git_object it points to.

\n","comments":"

You must call git_object_free() on the object when you are done with it.

\n","group":"tree","examples":{"general.c":["ex/v0.22.0-rc1/general.html#git_tree_entry_to_object-82"]}},"git_treebuilder_new":{"type":"function","file":"tree.h","line":254,"lineto":255,"args":[{"name":"out","type":"git_treebuilder **","comment":"Pointer where to store the tree builder"},{"name":"repo","type":"git_repository *","comment":"Repository in which to store the object"},{"name":"source","type":"const git_tree *","comment":"Source tree to initialize the builder (optional)"}],"argline":"git_treebuilder **out, git_repository *repo, const git_tree *source","sig":"git_treebuilder **::git_repository *::const git_tree *","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Create a new tree builder.

\n","comments":"

The tree builder can be used to create or modify trees in memory and\n write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be\n initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no\n entries and will have to be filled manually.

\n","group":"treebuilder"},"git_treebuilder_clear":{"type":"function","file":"tree.h","line":262,"lineto":262,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Builder to clear"}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"void","comment":null},"description":"

Clear all the entires in the builder

\n","comments":"","group":"treebuilder"},"git_treebuilder_entrycount":{"type":"function","file":"tree.h","line":270,"lineto":270,"args":[{"name":"bld","type":"git_treebuilder *","comment":"a previously loaded treebuilder."}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"unsigned int","comment":" the number of entries in the treebuilder"},"description":"

Get the number of entries listed in a treebuilder

\n","comments":"","group":"treebuilder"},"git_treebuilder_free":{"type":"function","file":"tree.h","line":281,"lineto":281,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Builder to free"}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"void","comment":null},"description":"

Free a tree builder

\n","comments":"

This will clear all the entries and free to builder.\n Failing to free the builder after you're done using it\n will result in a memory leak

\n","group":"treebuilder"},"git_treebuilder_get":{"type":"function","file":"tree.h","line":293,"lineto":294,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filename","type":"const char *","comment":"Name of the entry"}],"argline":"git_treebuilder *bld, const char *filename","sig":"git_treebuilder *::const char *","return":{"type":"const git_tree_entry *","comment":" pointer to the entry; NULL if not found"},"description":"

Get an entry from the builder from its filename

\n","comments":"

The returned entry is owned by the builder and should\n not be freed manually.

\n","group":"treebuilder"},"git_treebuilder_insert":{"type":"function","file":"tree.h","line":323,"lineto":328,"args":[{"name":"out","type":"const git_tree_entry **","comment":"Pointer to store the entry (optional)"},{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filename","type":"const char *","comment":"Filename of the entry"},{"name":"id","type":"const git_oid *","comment":"SHA1 oid of the entry"},{"name":"filemode","type":"git_filemode_t","comment":"Folder attributes of the entry. This parameter must\n\t\t\tbe valued with one of the following entries: 0040000, 0100644,\n\t\t\t0100755, 0120000 or 0160000."}],"argline":"const git_tree_entry **out, git_treebuilder *bld, const char *filename, const git_oid *id, git_filemode_t filemode","sig":"const git_tree_entry **::git_treebuilder *::const char *::const git_oid *::git_filemode_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add or update an entry to the builder

\n","comments":"

Insert a new entry for filename in the builder with the\n given attributes.

\n\n

If an entry named filename already exists, its attributes\n will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the\n newly created/updated entry. Pass NULL if you do not need it. The\n pointer may not be valid past the next operation in this\n builder. Duplicate the entry if you want to keep it.

\n\n

No attempt is being made to ensure that the provided oid points\n to an existing git object in the object database, nor that the\n attributes make sense regarding the type of the pointed at object.

\n","group":"treebuilder"},"git_treebuilder_remove":{"type":"function","file":"tree.h","line":336,"lineto":337,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filename","type":"const char *","comment":"Filename of the entry to remove"}],"argline":"git_treebuilder *bld, const char *filename","sig":"git_treebuilder *::const char *","return":{"type":"int","comment":null},"description":"

Remove an entry from the builder by its filename

\n","comments":"","group":"treebuilder"},"git_treebuilder_filter":{"type":"function","file":"tree.h","line":360,"lineto":363,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filter","type":"git_treebuilder_filter_cb","comment":"Callback to filter entries"},{"name":"payload","type":"void *","comment":"Extra data to pass to filter callback"}],"argline":"git_treebuilder *bld, git_treebuilder_filter_cb filter, void *payload","sig":"git_treebuilder *::git_treebuilder_filter_cb::void *","return":{"type":"void","comment":null},"description":"

Selectively remove entries in the tree

\n","comments":"

The filter callback will be called for each entry in the tree with a\n pointer to the entry and the provided payload; if the callback returns\n non-zero, the entry will be filtered (removed from the builder).

\n","group":"treebuilder"},"git_treebuilder_write":{"type":"function","file":"tree.h","line":375,"lineto":376,"args":[{"name":"id","type":"git_oid *","comment":"Pointer to store the OID of the newly written tree"},{"name":"bld","type":"git_treebuilder *","comment":"Tree builder to write"}],"argline":"git_oid *id, git_treebuilder *bld","sig":"git_oid *::git_treebuilder *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write the contents of the tree builder as a tree object

\n","comments":"

The tree builder will be written to the given repo, and its\n identifying SHA1 hash will be stored in the id pointer.

\n","group":"treebuilder"},"git_tree_walk":{"type":"function","file":"tree.h","line":406,"lineto":410,"args":[{"name":"tree","type":"const git_tree *","comment":"The tree to walk"},{"name":"mode","type":"git_treewalk_mode","comment":"Traversal mode (pre or post-order)"},{"name":"callback","type":"git_treewalk_cb","comment":"Function to call on each tree entry"},{"name":"payload","type":"void *","comment":"Opaque pointer to be passed on each callback"}],"argline":"const git_tree *tree, git_treewalk_mode mode, git_treewalk_cb callback, void *payload","sig":"const git_tree *::git_treewalk_mode::git_treewalk_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Traverse the entries in a tree and its subtrees in post or pre order.

\n","comments":"

The entries will be traversed in the specified order, children subtrees\n will be automatically loaded as required, and the callback will be\n called once per entry with the current (relative) root for the entry and\n the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be\n skipped on the traversal (in pre mode). A negative value stops the walk.

\n","group":"tree"}},"callbacks":{"git_checkout_notify_cb":{"type":"callback","file":"checkout.h","line":210,"lineto":216,"args":[{"name":"why","type":"git_checkout_notify_t","comment":null},{"name":"path","type":"const char *","comment":null},{"name":"baseline","type":"const git_diff_file *","comment":null},{"name":"target","type":"const git_diff_file *","comment":null},{"name":"workdir","type":"const git_diff_file *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_checkout_notify_t why, const char *path, const git_diff_file *baseline, const git_diff_file *target, const git_diff_file *workdir, void *payload","sig":"git_checkout_notify_t::const char *::const git_diff_file *::const git_diff_file *::const git_diff_file *::void *","return":{"type":"int","comment":null},"description":"

Checkout notification callback function

\n","comments":""},"git_checkout_progress_cb":{"type":"callback","file":"checkout.h","line":219,"lineto":223,"args":[{"name":"path","type":"const char *","comment":null},{"name":"completed_steps","type":"size_t","comment":null},{"name":"total_steps","type":"size_t","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *path, size_t completed_steps, size_t total_steps, void *payload","sig":"const char *::size_t::size_t::void *","return":{"type":"void","comment":null},"description":"

Checkout progress notification function

\n","comments":""},"git_remote_create_cb":{"type":"callback","file":"clone.h","line":69,"lineto":74,"args":[{"name":"out","type":"git_remote **","comment":"the resulting remote"},{"name":"repo","type":"git_repository *","comment":"the repository in which to create the remote"},{"name":"name","type":"const char *","comment":"the remote's name"},{"name":"url","type":"const char *","comment":"the remote's url"},{"name":"payload","type":"void *","comment":"an opaque payload"}],"argline":"git_remote **out, git_repository *repo, const char *name, const char *url, void *payload","sig":"git_remote **::git_repository *::const char *::const char *::void *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

The signature of a function matching git_remote_create, with an additional\n void* as a callback payload.

\n","comments":"

Callers of git_clone may provide a function matching this signature to override\n the remote creation and customization process during a clone operation.

\n"},"git_repository_create_cb":{"type":"callback","file":"clone.h","line":90,"lineto":94,"args":[{"name":"out","type":"git_repository **","comment":"the resulting repository"},{"name":"path","type":"const char *","comment":"path in which to create the repository"},{"name":"bare","type":"int","comment":"whether the repository is bare. This is the value from the clone options"},{"name":"payload","type":"void *","comment":"payload specified by the options"}],"argline":"git_repository **out, const char *path, int bare, void *payload","sig":"git_repository **::const char *::int::void *","return":{"type":"int","comment":" 0, or a negative value to indicate error"},"description":"

The signature of a function matchin git_repository_init, with an\n aditional void * as callback payload.

\n","comments":"

Callers of git_clone my provide a function matching this signature\n to override the repository creation and customization process\n during a clone operation.

\n"},"git_diff_notify_cb":{"type":"callback","file":"diff.h","line":336,"lineto":340,"args":[{"name":"diff_so_far","type":"const git_diff *","comment":null},{"name":"delta_to_add","type":"const git_diff_delta *","comment":null},{"name":"matched_pathspec","type":"const char *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff *diff_so_far, const git_diff_delta *delta_to_add, const char *matched_pathspec, void *payload","sig":"const git_diff *::const git_diff_delta *::const char *::void *","return":{"type":"int","comment":null},"description":"

Diff notification callback function.

\n","comments":"

The callback will be called for each file, just before the git_delta_t\n gets inserted into the diff.

\n\n

When the callback:\n - returns \n<\n 0, the diff process will be aborted.\n - returns > 0, the delta will not be inserted into the diff, but the\n diff process continues.\n - returns 0, the delta is inserted into the diff, and the diff process\n continues.

\n"},"git_diff_file_cb":{"type":"callback","file":"diff.h","line":416,"lineto":419,"args":[{"name":"delta","type":"const git_diff_delta *","comment":"A pointer to the delta data for the file"},{"name":"progress","type":"float","comment":"Goes from 0 to 1 over the diff"},{"name":"payload","type":"void *","comment":"User-specified pointer from foreach function"}],"argline":"const git_diff_delta *delta, float progress, void *payload","sig":"const git_diff_delta *::float::void *","return":{"type":"int","comment":null},"description":"

When iterating over a diff, callback that will be made per file.

\n","comments":""},"git_diff_hunk_cb":{"type":"callback","file":"diff.h","line":436,"lineto":439,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::void *","return":{"type":"int","comment":null},"description":"

When iterating over a diff, callback that will be made per hunk.

\n","comments":""},"git_diff_line_cb":{"type":"callback","file":"diff.h","line":489,"lineto":493,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"line","type":"const git_diff_line *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *","return":{"type":"int","comment":null},"description":"

When iterating over a diff, callback that will be made per text diff\n line. In this context, the provided range will be NULL.

\n","comments":"

When printing a diff, callback that will be made to output each line\n of text. This uses some extra GIT_DIFF_LINE_... constants for output\n of lines of file and hunk headers.

\n"},"git_index_matched_path_cb":{"type":"callback","file":"index.h","line":141,"lineto":142,"args":[{"name":"path","type":"const char *","comment":null},{"name":"matched_pathspec","type":"const char *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *path, const char *matched_pathspec, void *payload","sig":"const char *::const char *::void *","return":{"type":"int","comment":null},"description":"

Callback for APIs that add/remove/update files matching pathspec

\n","comments":""},"git_headlist_cb":{"type":"callback","file":"net.h","line":55,"lineto":55,"args":[{"name":"rhead","type":"git_remote_head *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_remote_head *rhead, void *payload","sig":"git_remote_head *::void *","return":{"type":"int","comment":null},"description":"

Callback for listing the remote heads

\n","comments":""},"git_note_foreach_cb":{"type":"callback","file":"notes.h","line":29,"lineto":30,"args":[{"name":"blob_id","type":"const git_oid *","comment":null},{"name":"annotated_object_id","type":"const git_oid *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_oid *blob_id, const git_oid *annotated_object_id, void *payload","sig":"const git_oid *::const git_oid *::void *","return":{"type":"int","comment":null},"description":"

Callback for git_note_foreach.

\n","comments":"

Receives:\n - blob_id: Oid of the blob containing the message\n - annotated_object_id: Oid of the git object being annotated\n - payload: Payload data passed to git_note_foreach

\n"},"git_odb_foreach_cb":{"type":"callback","file":"odb.h","line":26,"lineto":26,"args":[{"name":"id","type":"const git_oid *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_oid *id, void *payload","sig":"const git_oid *::void *","return":{"type":"int","comment":null},"description":"

Function type for callbacks from git_odb_foreach.

\n","comments":""},"git_packbuilder_progress":{"type":"callback","file":"pack.h","line":185,"lineto":189,"args":[{"name":"stage","type":"int","comment":null},{"name":"current","type":"unsigned int","comment":null},{"name":"total","type":"unsigned int","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"int stage, unsigned int current, unsigned int total, void *payload","sig":"int::unsigned int::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Packbuilder progress notification function

\n","comments":""},"git_push_transfer_progress":{"type":"callback","file":"push.h","line":56,"lineto":60,"args":[{"name":"current","type":"unsigned int","comment":null},{"name":"total","type":"unsigned int","comment":null},{"name":"bytes","type":"size_t","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"unsigned int current, unsigned int total, size_t bytes, void *payload","sig":"unsigned int::unsigned int::size_t::void *","return":{"type":"int","comment":null},"description":"

Push network progress notification function

\n","comments":""},"git_remote_rename_problem_cb":{"type":"callback","file":"remote.h","line":28,"lineto":28,"args":[{"name":"problematic_refspec","type":"const char *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *problematic_refspec, void *payload","sig":"const char *::void *","return":{"type":"int","comment":null},"description":"

git2/remote.h

\n","comments":"

@\n{

\n"},"git_revwalk_hide_cb":{"type":"callback","file":"revwalk.h","line":277,"lineto":279,"args":[{"name":"commit_id","type":"const git_oid *","comment":"oid of Commit"},{"name":"payload","type":"void *","comment":"User-specified pointer to data to be passed as data payload"}],"argline":"const git_oid *commit_id, void *payload","sig":"const git_oid *::void *","return":{"type":"int","comment":null},"description":"

This is a callback function that user can provide to hide a\n commit and its parents. If the callback function returns non-zero value,\n then this commit and its parents will be hidden.

\n","comments":""},"git_stash_cb":{"type":"callback","file":"stash.h","line":84,"lineto":88,"args":[{"name":"index","type":"size_t","comment":"The position within the stash list. 0 points to the\n most recent stashed state."},{"name":"message","type":"const char *","comment":"The stash message."},{"name":"stash_id","type":"const int *","comment":"The commit oid of the stashed state."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"size_t index, const char *message, const int *stash_id, void *payload","sig":"size_t::const char *::const int *::void *","return":{"type":"int","comment":" 0 to continue iterating or non-zero to stop"},"description":"

This is a callback function you can provide to iterate over all the\n stashed states that will be invoked per entry.

\n","comments":""},"git_status_cb":{"type":"callback","file":"status.h","line":60,"lineto":61,"args":[{"name":"path","type":"const char *","comment":null},{"name":"status_flags","type":"unsigned int","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *path, unsigned int status_flags, void *payload","sig":"const char *::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Function pointer to receive status on individual files

\n","comments":"

path is the relative path to the file from the root of the repository.

\n\n

status_flags is a combination of git_status_t values that apply.

\n\n

payload is the value you passed to the foreach function as payload.

\n"},"git_filter_init_fn":{"type":"callback","file":"sys/filter.h","line":152,"lineto":152,"args":[{"name":"self","type":"git_filter *","comment":null}],"argline":"git_filter *self","sig":"git_filter *","return":{"type":"int","comment":null},"description":"

Initialize callback on filter

\n","comments":"

Specified as filter.initialize, this is an optional callback invoked\n before a filter is first used. It will be called once at most.

\n\n

If non-NULL, the filter's initialize callback will be invoked right\n before the first use of the filter, so you can defer expensive\n initialization operations (in case libgit2 is being used in a way that\n doesn't need the filter).

\n"},"git_filter_shutdown_fn":{"type":"callback","file":"sys/filter.h","line":164,"lineto":164,"args":[{"name":"self","type":"git_filter *","comment":null}],"argline":"git_filter *self","sig":"git_filter *","return":{"type":"void","comment":null},"description":"

Shutdown callback on filter

\n","comments":"

Specified as filter.shutdown, this is an optional callback invoked\n when the filter is unregistered or when libgit2 is shutting down. It\n will be called once at most and should release resources as needed.\n This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_filter object itself.

\n"},"git_filter_check_fn":{"type":"callback","file":"sys/filter.h","line":186,"lineto":190,"args":[{"name":"self","type":"git_filter *","comment":null},{"name":"payload","type":"void **","comment":null},{"name":"src","type":"const git_filter_source *","comment":null},{"name":"attr_values","type":"const char **","comment":null}],"argline":"git_filter *self, void **payload, const git_filter_source *src, const char **attr_values","sig":"git_filter *::void **::const git_filter_source *::const char **","return":{"type":"int","comment":null},"description":"

Callback to decide if a given source needs this filter

\n","comments":"

Specified as filter.check, this is an optional callback that checks\n if filtering is needed for a given source.

\n\n

It should return 0 if the filter should be applied (i.e. success),\n GIT_PASSTHROUGH if the filter should not be applied, or an error code\n to fail out of the filter processing pipeline and return to the caller.

\n\n

The attr_values will be set to the values of any attributes given in\n the filter definition. See git_filter below for more detail.

\n\n

The payload will be a pointer to a reference payload for the filter.\n This will start as NULL, but check can assign to this pointer for\n later use by the apply callback. Note that the value should be heap\n allocated (not stack), so that it doesn't go away before the apply\n callback can use it. If a filter allocates and assigns a value to the\n payload, it will need a cleanup callback to free the payload.

\n"},"git_filter_apply_fn":{"type":"callback","file":"sys/filter.h","line":204,"lineto":209,"args":[{"name":"self","type":"git_filter *","comment":null},{"name":"payload","type":"void **","comment":null},{"name":"to","type":"git_buf *","comment":null},{"name":"from","type":"const git_buf *","comment":null},{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"git_filter *self, void **payload, git_buf *to, const git_buf *from, const git_filter_source *src","sig":"git_filter *::void **::git_buf *::const git_buf *::const git_filter_source *","return":{"type":"int","comment":null},"description":"

Callback to actually perform the data filtering

\n","comments":"

Specified as filter.apply, this is the callback that actually filters\n data. If it successfully writes the output, it should return 0. Like\n check, it can return GIT_PASSTHROUGH to indicate that the filter\n doesn't want to run. Other error codes will stop filter processing and\n return to the caller.

\n\n

The payload value will refer to any payload that was set by the\n check callback. It may be read from or written to as needed.

\n"},"git_filter_cleanup_fn":{"type":"callback","file":"sys/filter.h","line":219,"lineto":221,"args":[{"name":"self","type":"git_filter *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_filter *self, void *payload","sig":"git_filter *::void *","return":{"type":"void","comment":null},"description":"

Callback to clean up after filtering has been applied

\n","comments":"

Specified as filter.cleanup, this is an optional callback invoked\n after the filter has been applied. If the check or apply callbacks\n allocated a payload to keep per-source filter state, use this\n callback to free that payload and release resources as required.

\n"},"git_trace_callback":{"type":"callback","file":"trace.h","line":52,"lineto":52,"args":[{"name":"level","type":"git_trace_level_t","comment":null},{"name":"msg","type":"const char *","comment":null}],"argline":"git_trace_level_t level, const char *msg","sig":"git_trace_level_t::const char *","return":{"type":"void","comment":null},"description":"

An instance for a tracing function

\n","comments":""},"git_cred_acquire_cb":{"type":"callback","file":"transport.h","line":302,"lineto":307,"args":[{"name":"cred","type":"git_cred **","comment":null},{"name":"url","type":"const char *","comment":null},{"name":"username_from_url","type":"const char *","comment":null},{"name":"allowed_types","type":"unsigned int","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload","sig":"git_cred **::const char *::const char *::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Signature of a function which acquires a credential object.

\n","comments":"
    \n
  • cred: The newly created credential object.
  • \n
  • url: The resource for which we are demanding a credential.
  • \n
  • username_from_url: The username that was embedded in a "user
  • \n
\n"},"git_treebuilder_filter_cb":{"type":"callback","file":"tree.h","line":346,"lineto":347,"args":[{"name":"entry","type":"const git_tree_entry *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_tree_entry *entry, void *payload","sig":"const git_tree_entry *::void *","return":{"type":"int","comment":null},"description":"

Callback for git_treebuilder_filter

\n","comments":"

The return value is treated as a boolean, with zero indicating that the\n entry should be left alone and any non-zero value meaning that the\n entry should be removed from the treebuilder list (i.e. filtered out).

\n"},"git_treewalk_cb":{"type":"callback","file":"tree.h","line":380,"lineto":381,"args":[{"name":"root","type":"const char *","comment":null},{"name":"entry","type":"const git_tree_entry *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *root, const git_tree_entry *entry, void *payload","sig":"const char *::const git_tree_entry *::void *","return":{"type":"int","comment":null},"description":"

Callback for the tree traversal method

\n","comments":""},"git_transfer_progress_cb":{"type":"callback","file":"types.h","line":264,"lineto":264,"args":[{"name":"stats","type":"const git_transfer_progress *","comment":"Structure containing information about the state of the transfer"},{"name":"payload","type":"void *","comment":"Payload provided by caller"}],"argline":"const git_transfer_progress *stats, void *payload","sig":"const git_transfer_progress *::void *","return":{"type":"int","comment":null},"description":"

Type for progress callbacks during indexing. Return a value less than zero\n to cancel the transfer.

\n","comments":""},"git_transport_message_cb":{"type":"callback","file":"types.h","line":274,"lineto":274,"args":[{"name":"str","type":"const char *","comment":"The message from the transport"},{"name":"len","type":"int","comment":"The length of the message"},{"name":"payload","type":"void *","comment":"Payload provided by the caller"}],"argline":"const char *str, int len, void *payload","sig":"const char *::int::void *","return":{"type":"int","comment":null},"description":"

Type for messages delivered by the transport. Return a negative value\n to cancel the network operation.

\n","comments":""},"git_transport_certificate_check_cb":{"type":"callback","file":"types.h","line":313,"lineto":313,"args":[{"name":"cert","type":"git_cert *","comment":null},{"name":"valid","type":"int","comment":"Whether the libgit2 checks (OpenSSL or WinHTTP) think\n this certificate is valid"},{"name":"host","type":"const char *","comment":"Hostname of the host libgit2 connected to"},{"name":"payload","type":"void *","comment":"Payload provided by the caller"}],"argline":"git_cert *cert, int valid, const char *host, void *payload","sig":"git_cert *::int::const char *::void *","return":{"type":"int","comment":null},"description":"

Callback for the user's custom certificate checks.

\n","comments":""}},"globals":{},"types":[["git_annotated_commit",{"decl":"git_annotated_commit","type":"struct","value":"git_annotated_commit","file":"types.h","line":178,"lineto":178,"tdef":"typedef","description":" Annotated commits, the input to merge and rebase. ","comments":"","used":{"returns":[],"needs":["git_annotated_commit_free","git_annotated_commit_from_fetchhead","git_annotated_commit_from_ref","git_annotated_commit_id","git_annotated_commit_lookup","git_merge","git_merge_analysis","git_rebase_init"]}}],["git_attr_t",{"decl":["GIT_ATTR_UNSPECIFIED_T","GIT_ATTR_TRUE_T","GIT_ATTR_FALSE_T","GIT_ATTR_VALUE_T"],"type":"enum","file":"attr.h","line":82,"lineto":87,"block":"GIT_ATTR_UNSPECIFIED_T\nGIT_ATTR_TRUE_T\nGIT_ATTR_FALSE_T\nGIT_ATTR_VALUE_T","tdef":"typedef","description":" Possible states for an attribute","comments":"","fields":[{"type":"int","name":"GIT_ATTR_UNSPECIFIED_T","comments":"

The attribute has been left unspecified

\n","value":0},{"type":"int","name":"GIT_ATTR_TRUE_T","comments":"

The attribute has been set

\n","value":1},{"type":"int","name":"GIT_ATTR_FALSE_T","comments":"

The attribute has been unset

\n","value":2},{"type":"int","name":"GIT_ATTR_VALUE_T","comments":"

This attribute has a value

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_blame_flag_t",{"decl":["GIT_BLAME_NORMAL","GIT_BLAME_TRACK_COPIES_SAME_FILE","GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES","GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES","GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES","GIT_BLAME_FIRST_PARENT"],"type":"enum","file":"blame.h","line":26,"lineto":46,"block":"GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT","tdef":"typedef","description":" Flags for indicating option behavior for git_blame APIs.","comments":"","fields":[{"type":"int","name":"GIT_BLAME_NORMAL","comments":"

Normal blame, the default

\n","value":0},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_SAME_FILE","comments":"

Track lines that have moved within a file (like git blame -M).\n NOT IMPLEMENTED.

\n","value":1},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES","comments":"

Track lines that have moved across files in the same commit (like git blame -C).\n NOT IMPLEMENTED.

\n","value":2},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES","comments":"

Track lines that have been copied from another file that exists in the\n same commit (like git blame -CC). Implies SAME_FILE.\n NOT IMPLEMENTED.

\n","value":4},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES","comments":"

Track lines that have been copied from another file that exists in any\n commit (like git blame -CCC). Implies SAME_COMMIT_COPIES.\n NOT IMPLEMENTED.

\n","value":8},{"type":"int","name":"GIT_BLAME_FIRST_PARENT","comments":"

Restrict the search of commits to those reachable following only the\n first parents.

\n","value":16}],"used":{"returns":[],"needs":[]}}],["git_blame_hunk",{"decl":["uint16_t lines_in_hunk","git_oid final_commit_id","uint16_t final_start_line_number","git_signature * final_signature","git_oid orig_commit_id","const char * orig_path","uint16_t orig_start_line_number","git_signature * orig_signature","char boundary"],"type":"struct","value":"git_blame_hunk","file":"blame.h","line":115,"lineto":128,"block":"uint16_t lines_in_hunk\ngit_oid final_commit_id\nuint16_t final_start_line_number\ngit_signature * final_signature\ngit_oid orig_commit_id\nconst char * orig_path\nuint16_t orig_start_line_number\ngit_signature * orig_signature\nchar boundary","tdef":"typedef","description":" Structure that represents a blame hunk.","comments":"
    \n
  • lines_in_hunk is the number of lines in this hunk
  • \n
  • final_commit_id is the OID of the commit where this line was last\nchanged.
  • \n
  • final_start_line_number is the 1-based line number where this hunk\nbegins, in the final version of the file
  • \n
  • orig_commit_id is the OID of the commit where this hunk was found. This\nwill usually be the same as final_commit_id, except when\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES has been specified.
  • \n
  • orig_path is the path to the file where this hunk originated, as of the\ncommit specified by orig_commit_id.
  • \n
  • orig_start_line_number is the 1-based line number where this hunk begins\nin the file named by orig_path in the commit specified by\norig_commit_id.
  • \n
  • boundary is 1 iff the hunk has been tracked to a boundary commit (the\nroot, or the commit specified in git_blame_options.oldest_commit)
  • \n
\n","fields":[{"type":"uint16_t","name":"lines_in_hunk","comments":""},{"type":"git_oid","name":"final_commit_id","comments":""},{"type":"uint16_t","name":"final_start_line_number","comments":""},{"type":"git_signature *","name":"final_signature","comments":""},{"type":"git_oid","name":"orig_commit_id","comments":""},{"type":"const char *","name":"orig_path","comments":""},{"type":"uint16_t","name":"orig_start_line_number","comments":""},{"type":"git_signature *","name":"orig_signature","comments":""},{"type":"char","name":"boundary","comments":""}],"used":{"returns":["git_blame_get_hunk_byindex","git_blame_get_hunk_byline"],"needs":[]}}],["git_blame_options",{"decl":["unsigned int version","uint32_t flags","uint16_t min_match_characters","git_oid newest_commit","git_oid oldest_commit","uint32_t min_line","uint32_t max_line"],"type":"struct","value":"git_blame_options","file":"blame.h","line":70,"lineto":79,"block":"unsigned int version\nuint32_t flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nuint32_t min_line\nuint32_t max_line","tdef":"typedef","description":" Blame options structure","comments":"

Use zeros to indicate default settings. It's easiest to use the\n GIT_BLAME_OPTIONS_INIT macro:\n git_blame_options opts = GIT_BLAME_OPTIONS_INIT;

\n\n
    \n
  • flags is a combination of the git_blame_flag_t values above.
  • \n
  • min_match_characters is the lower bound on the number of alphanumeric\ncharacters that must be detected as moving/copying within a file for it to\nassociate those lines with the parent commit. The default value is 20.\nThis value only takes effect if any of the GIT_BLAME_TRACK_COPIES_*\nflags are specified.
  • \n
  • newest_commit is the id of the newest commit to consider. The default\n is HEAD.
  • \n
  • oldest_commit is the id of the oldest commit to consider. The default\n is the first commit encountered with a NULL parent.\n\n
      \n
    • min_line is the first line in the file to blame. The default is 1 (line\n numbers start with 1).
    • \n
    • max_line is the last line in the file to blame. The default is the last\n line of the file.
    • \n
  • \n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"uint32_t","name":"flags","comments":""},{"type":"uint16_t","name":"min_match_characters","comments":""},{"type":"git_oid","name":"newest_commit","comments":""},{"type":"git_oid","name":"oldest_commit","comments":""},{"type":"uint32_t","name":"min_line","comments":""},{"type":"uint32_t","name":"max_line","comments":""}],"used":{"returns":[],"needs":["git_blame_file","git_blame_init_options"]}}],["git_blob",{"decl":"git_blob","type":"struct","value":"git_blob","file":"types.h","line":117,"lineto":117,"tdef":"typedef","description":" In-memory representation of a blob object. ","comments":"","used":{"returns":[],"needs":["git_blob_filtered_content","git_blob_free","git_blob_id","git_blob_is_binary","git_blob_lookup","git_blob_lookup_prefix","git_blob_owner","git_blob_rawcontent","git_blob_rawsize","git_diff_blob_to_buffer","git_diff_blobs","git_filter_list_apply_to_blob","git_filter_list_load","git_patch_from_blob_and_buffer","git_patch_from_blobs"]}}],["git_branch_iterator",{"decl":"git_branch_iterator","type":"struct","value":"git_branch_iterator","file":"branch.h","line":78,"lineto":78,"tdef":"typedef","description":" Iterator type for branches ","comments":"","used":{"returns":[],"needs":["git_branch_iterator_free","git_branch_iterator_new","git_branch_next"]}}],["git_branch_t",{"decl":["GIT_BRANCH_LOCAL","GIT_BRANCH_REMOTE","GIT_BRANCH_ALL"],"type":"enum","file":"types.h","line":198,"lineto":202,"block":"GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE\nGIT_BRANCH_ALL","tdef":"typedef","description":" Basic type of any Git branch. ","comments":"","fields":[{"type":"int","name":"GIT_BRANCH_LOCAL","comments":"","value":1},{"type":"int","name":"GIT_BRANCH_REMOTE","comments":"","value":2},{"type":"int","name":"GIT_BRANCH_ALL","comments":"","value":3}],"used":{"returns":[],"needs":["git_branch_iterator_new","git_branch_lookup","git_branch_next"]}}],["git_buf",{"decl":["char * ptr","size_t asize","size_t size"],"type":"struct","value":"git_buf","file":"buffer.h","line":52,"lineto":55,"block":"char * ptr\nsize_t asize\nsize_t size","tdef":"typedef","description":" A data buffer for exporting data from libgit2","comments":"

Sometimes libgit2 wants to return an allocated data buffer to the\n caller and have the caller take responsibility for freeing that memory.\n This can be awkward if the caller does not have easy access to the same\n allocation functions that libgit2 is using. In those cases, libgit2\n will fill in a git_buf and the caller can use git_buf_free() to\n release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to\n a block of memory they hold. In this case, libgit2 will not resize or\n free the memory, but will read from it as needed.

\n\n

A git_buf is a public structure with three fields:

\n\n
    \n
  • ptr points to the start of the allocated memory. If it is NULL,\nthen the git_buf is considered empty and libgit2 will feel free\nto overwrite it with new data.

  • \n
  • size holds the size (in bytes) of the data that is actually used.

  • \n
  • asize holds the known total amount of allocated memory if the ptr\nwas allocated by libgit2. It may be larger than size. If ptr\nwas not allocated by libgit2 and should not be resized and/or freed,\nthen asize will be set to zero.

  • \n
\n\n

Some APIs may occasionally do something slightly unusual with a buffer,\n such as setting ptr to a value that was passed in by the user. In\n those cases, the behavior will be clearly documented by the API.

\n","fields":[{"type":"char *","name":"ptr","comments":""},{"type":"size_t","name":"asize","comments":""},{"type":"size_t","name":"size","comments":""}],"used":{"returns":[],"needs":["git_blob_filtered_content","git_buf_contains_nul","git_buf_free","git_buf_grow","git_buf_is_binary","git_buf_set","git_config_find_global","git_config_find_system","git_config_find_xdg","git_describe_format","git_diff_commit_as_email","git_diff_format_email","git_diff_stats_to_buf","git_filter_list_apply_to_blob","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_message_prettify","git_object_short_id","git_patch_to_buf","git_refspec_rtransform","git_refspec_transform","git_remote_default_branch","git_repository_discover","git_repository_message","git_submodule_resolve_url"]}}],["git_cert",{"decl":["git_cert_t cert_type"],"type":"struct","value":"git_cert","file":"types.h","line":295,"lineto":300,"block":"git_cert_t cert_type","tdef":"typedef","description":" Parent type for `git_cert_hostkey` and `git_cert_x509`.","comments":"","fields":[{"type":"git_cert_t","name":"cert_type","comments":" Type of certificate. A `GIT_CERT_` value."}],"used":{"returns":[],"needs":[]}}],["git_cert_hostkey",{"decl":["git_cert_t cert_type","git_cert_ssh_t type","unsigned char [16] hash_md5","unsigned char [20] hash_sha1"],"type":"struct","value":"git_cert_hostkey","file":"transport.h","line":36,"lineto":59,"block":"git_cert_t cert_type\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1","tdef":"typedef","description":" Hostkey information taken from libssh2","comments":"","fields":[{"type":"git_cert_t","name":"cert_type","comments":" Type of certificate. Here to share the header with\n `git_cert`."},{"type":"git_cert_ssh_t","name":"type","comments":" A hostkey type from libssh2, either\n `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`"},{"type":"unsigned char [16]","name":"hash_md5","comments":" Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will\n have the MD5 hash of the hostkey."},{"type":"unsigned char [20]","name":"hash_sha1","comments":" Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will\n have the SHA-1 hash of the hostkey."}],"used":{"returns":[],"needs":[]}}],["git_cert_ssh_t",{"decl":["GIT_CERT_SSH_MD5","GIT_CERT_SSH_SHA1"],"type":"enum","file":"transport.h","line":26,"lineto":31,"block":"GIT_CERT_SSH_MD5\nGIT_CERT_SSH_SHA1","tdef":"typedef","description":" Type of SSH host fingerprint","comments":"","fields":[{"type":"int","name":"GIT_CERT_SSH_MD5","comments":"

MD5 is available

\n","value":1},{"type":"int","name":"GIT_CERT_SSH_SHA1","comments":"

SHA-1 is available

\n","value":2}],"used":{"returns":[],"needs":[]}}],["git_cert_t",{"decl":["GIT_CERT_X509","GIT_CERT_HOSTKEY_LIBSSH2"],"type":"enum","file":"types.h","line":279,"lineto":290,"block":"GIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2","tdef":"typedef","description":" Type of host certificate structure that is passed to the check callback","comments":"","fields":[{"type":"int","name":"GIT_CERT_X509","comments":"

The data argument to the callback will be a pointer to\n the DER-encoded data.

\n","value":0},{"type":"int","name":"GIT_CERT_HOSTKEY_LIBSSH2","comments":"

The data argument to the callback will be a pointer to a\n git_cert_hostkey structure.

\n","value":1}],"used":{"returns":[],"needs":[]}}],["git_cert_x509",{"decl":["git_cert_t cert_type","void * data","size_t len"],"type":"struct","value":"git_cert_x509","file":"transport.h","line":64,"lineto":78,"block":"git_cert_t cert_type\nvoid * data\nsize_t len","tdef":"typedef","description":" X.509 certificate information","comments":"","fields":[{"type":"git_cert_t","name":"cert_type","comments":" Type of certificate. Here to share the header with\n `git_cert`."},{"type":"void *","name":"data","comments":" Pointer to the X.509 certificate data"},{"type":"size_t","name":"len","comments":" Length of the memory block pointed to by `data`."}],"used":{"returns":[],"needs":[]}}],["git_checkout_notify_t",{"decl":["GIT_CHECKOUT_NOTIFY_NONE","GIT_CHECKOUT_NOTIFY_CONFLICT","GIT_CHECKOUT_NOTIFY_DIRTY","GIT_CHECKOUT_NOTIFY_UPDATED","GIT_CHECKOUT_NOTIFY_UNTRACKED","GIT_CHECKOUT_NOTIFY_IGNORED","GIT_CHECKOUT_NOTIFY_ALL"],"type":"enum","file":"checkout.h","line":198,"lineto":207,"block":"GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL","tdef":"typedef","description":" Checkout notification flags","comments":"

Checkout will invoke an options notification callback (notify_cb) for\n certain cases - you pick which ones via notify_flags:

\n\n
    \n
  • GIT_CHECKOUT_NOTIFY_CONFLICT invokes checkout on conflicting paths.

  • \n
  • GIT_CHECKOUT_NOTIFY_DIRTY notifies about "dirty" files, i.e. those that\ndo not need an update but no longer match the baseline. Core git\ndisplays these files when checkout runs, but won't stop the checkout.

  • \n
  • GIT_CHECKOUT_NOTIFY_UPDATED sends notification for any file changed.

  • \n
  • GIT_CHECKOUT_NOTIFY_UNTRACKED notifies about untracked files.

  • \n
  • GIT_CHECKOUT_NOTIFY_IGNORED notifies about ignored files.

  • \n
\n\n

Returning a non-zero value from this callback will cancel the checkout.\n The non-zero return value will be propagated back and returned by the\n git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk,\n so canceling on any notification will still happen prior to any files\n being modified.

\n","fields":[{"type":"int","name":"GIT_CHECKOUT_NOTIFY_NONE","comments":"","value":0},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_CONFLICT","comments":"","value":1},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_DIRTY","comments":"","value":2},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_UPDATED","comments":"","value":4},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_UNTRACKED","comments":"","value":8},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_IGNORED","comments":"","value":16},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_ALL","comments":"","value":65535}],"used":{"returns":[],"needs":[]}}],["git_checkout_options",{"decl":["unsigned int version","unsigned int checkout_strategy","int disable_filters","unsigned int dir_mode","unsigned int file_mode","int file_open_flags","unsigned int notify_flags","git_checkout_notify_cb notify_cb","void * notify_payload","git_checkout_progress_cb progress_cb","void * progress_payload","git_strarray paths","git_tree * baseline","const char * target_directory","const char * ancestor_label","const char * our_label","const char * their_label"],"type":"struct","value":"git_checkout_options","file":"checkout.h","line":233,"lineto":264,"block":"unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label","tdef":"typedef","description":" Checkout options structure","comments":"

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to\n correctly set the version field. E.g.

\n\n
    git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;\n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"checkout_strategy","comments":" default will be a dry run "},{"type":"int","name":"disable_filters","comments":" don't apply filters like CRLF conversion "},{"type":"unsigned int","name":"dir_mode","comments":" default is 0755 "},{"type":"unsigned int","name":"file_mode","comments":" default is 0644 or 0755 as dictated by blob "},{"type":"int","name":"file_open_flags","comments":" default is O_CREAT | O_TRUNC | O_WRONLY "},{"type":"unsigned int","name":"notify_flags","comments":" see `git_checkout_notify_t` above "},{"type":"git_checkout_notify_cb","name":"notify_cb","comments":""},{"type":"void *","name":"notify_payload","comments":""},{"type":"git_checkout_progress_cb","name":"progress_cb","comments":" Optional callback to notify the consumer of checkout progress. "},{"type":"void *","name":"progress_payload","comments":""},{"type":"git_strarray","name":"paths","comments":" When not zeroed out, array of fnmatch patterns specifying which\n paths should be taken into account, otherwise all files. Use\n GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as simple list."},{"type":"git_tree *","name":"baseline","comments":" expected content of workdir, defaults to HEAD "},{"type":"const char *","name":"target_directory","comments":" alternative checkout path to workdir "},{"type":"const char *","name":"ancestor_label","comments":" the name of the common ancestor side of conflicts "},{"type":"const char *","name":"our_label","comments":" the name of the \"our\" side of conflicts "},{"type":"const char *","name":"their_label","comments":" the name of the \"their\" side of conflicts "}],"used":{"returns":[],"needs":["git_checkout_head","git_checkout_index","git_checkout_init_options","git_checkout_tree","git_merge"]}}],["git_checkout_strategy_t",{"decl":["GIT_CHECKOUT_NONE","GIT_CHECKOUT_SAFE","GIT_CHECKOUT_SAFE_CREATE","GIT_CHECKOUT_FORCE","GIT_CHECKOUT_ALLOW_CONFLICTS","GIT_CHECKOUT_REMOVE_UNTRACKED","GIT_CHECKOUT_REMOVE_IGNORED","GIT_CHECKOUT_UPDATE_ONLY","GIT_CHECKOUT_DONT_UPDATE_INDEX","GIT_CHECKOUT_NO_REFRESH","GIT_CHECKOUT_SKIP_UNMERGED","GIT_CHECKOUT_USE_OURS","GIT_CHECKOUT_USE_THEIRS","GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH","GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES","GIT_CHECKOUT_DONT_OVERWRITE_IGNORED","GIT_CHECKOUT_CONFLICT_STYLE_MERGE","GIT_CHECKOUT_CONFLICT_STYLE_DIFF3","GIT_CHECKOUT_UPDATE_SUBMODULES","GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED"],"type":"enum","file":"checkout.h","line":108,"lineto":170,"block":"GIT_CHECKOUT_NONE\nGIT_CHECKOUT_SAFE\nGIT_CHECKOUT_SAFE_CREATE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED","tdef":"typedef","description":" Checkout behavior flags","comments":"

In libgit2, checkout is used to update the working directory and index\n to match a target tree. Unlike git checkout, it does not move the HEAD\n commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to\n check out, the "baseline" tree of what was checked out previously, the\n working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of four strategies for update:

\n\n
    \n
  • GIT_CHECKOUT_NONE is a dry-run strategy that checks for conflicts,\netc., but doesn't make any actual changes.

  • \n
  • GIT_CHECKOUT_FORCE is at the opposite extreme, taking any action to\nmake the working directory match the target (including potentially\ndiscarding modified files).

  • \n
\n\n

In between those are GIT_CHECKOUT_SAFE and GIT_CHECKOUT_SAFE_CREATE\n both of which only make modifications that will not lose changes.

\n\n
                     |  target == baseline   |  target != baseline  |\n---------------------|-----------------------|----------------------|\n workdir == baseline |       no action       |  create, update, or  |\n                     |                       |     delete file      |\n---------------------|-----------------------|----------------------|\n workdir exists and  |       no action       |   conflict (notify   |\n   is != baseline    | notify dirty MODIFIED | and cancel checkout) |\n---------------------|-----------------------|----------------------|\n  workdir missing,   | create if SAFE_CREATE |     create file      |\n  baseline present   | notify dirty DELETED  |                      |\n---------------------|-----------------------|----------------------|\n
\n\n

The only difference between SAFE and SAFE_CREATE is that SAFE_CREATE\n will cause a file to be checked out if it is missing from the working\n directory even if it is not modified between the target and baseline.

\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout\n notification callback (see below) that displays information about dirty\n files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE_CREATE with a\n notification callback that cancels the operation if a dirty-but-existing\n file is found in the working directory. This core git command isn't\n quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

To emulate git clone use GIT_CHECKOUT_SAFE_CREATE in the options.

\n\n

There are some additional flags to modified the behavior of checkout:

\n\n
    \n
  • GIT_CHECKOUT_ALLOW_CONFLICTS makes SAFE mode apply safe file updates\neven if there are conflicts (instead of cancelling the checkout).

  • \n
  • GIT_CHECKOUT_REMOVE_UNTRACKED means remove untracked files (i.e. not\nin target, baseline, or index, and not ignored) from the working dir.

  • \n
  • GIT_CHECKOUT_REMOVE_IGNORED means remove ignored files (that are also\nuntracked) from the working directory as well.

  • \n
  • GIT_CHECKOUT_UPDATE_ONLY means to only update the content of files that\nalready exist. Files will not be created nor deleted. This just skips\napplying adds, deletes, and typechanges.

  • \n
  • GIT_CHECKOUT_DONT_UPDATE_INDEX prevents checkout from writing the\nupdated files' information to the index.

  • \n
  • Normally, checkout will reload the index and git attributes from disk\nbefore any operations. GIT_CHECKOUT_NO_REFRESH prevents this reload.

  • \n
  • Unmerged index entries are conflicts. GIT_CHECKOUT_SKIP_UNMERGED skips\nfiles with unmerged index entries instead. GIT_CHECKOUT_USE_OURS and\nGIT_CHECKOUT_USE_THEIRS to proceed with the checkout using either the\nstage 2 ("ours") or stage 3 ("theirs") version of files in the index.

  • \n
  • GIT_CHECKOUT_DONT_OVERWRITE_IGNORED prevents ignored files from being\noverwritten. Normally, files that are ignored in the working directory\nare not considered "precious" and may be overwritten if the checkout\ntarget contains that file.

  • \n
\n","fields":[{"type":"int","name":"GIT_CHECKOUT_NONE","comments":"

default is a dry run, no actual updates

\n","value":0},{"type":"int","name":"GIT_CHECKOUT_SAFE","comments":"

Allow safe updates that cannot overwrite uncommitted data

\n","value":1},{"type":"int","name":"GIT_CHECKOUT_SAFE_CREATE","comments":"

Allow safe updates plus creation of missing files

\n","value":2},{"type":"int","name":"GIT_CHECKOUT_FORCE","comments":"

Allow all updates to force working directory to look like index

\n","value":4},{"type":"int","name":"GIT_CHECKOUT_ALLOW_CONFLICTS","comments":"

Allow checkout to make safe updates even if conflicts are found

\n","value":16},{"type":"int","name":"GIT_CHECKOUT_REMOVE_UNTRACKED","comments":"

Remove untracked files not in index (that are not ignored)

\n","value":32},{"type":"int","name":"GIT_CHECKOUT_REMOVE_IGNORED","comments":"

Remove ignored files not in index

\n","value":64},{"type":"int","name":"GIT_CHECKOUT_UPDATE_ONLY","comments":"

Only update existing files, don't create new ones

\n","value":128},{"type":"int","name":"GIT_CHECKOUT_DONT_UPDATE_INDEX","comments":"

Normally checkout updates index entries as it goes; this stops that

\n","value":256},{"type":"int","name":"GIT_CHECKOUT_NO_REFRESH","comments":"

Don't refresh index/config/etc before doing checkout

\n","value":512},{"type":"int","name":"GIT_CHECKOUT_SKIP_UNMERGED","comments":"

Allow checkout to skip unmerged files

\n","value":1024},{"type":"int","name":"GIT_CHECKOUT_USE_OURS","comments":"

For unmerged files, checkout stage 2 from index

\n","value":2048},{"type":"int","name":"GIT_CHECKOUT_USE_THEIRS","comments":"

For unmerged files, checkout stage 3 from index

\n","value":4096},{"type":"int","name":"GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH","comments":"

Treat pathspec as simple list of exact match file paths

\n","value":8192},{"type":"int","name":"GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES","comments":"

Ignore directories in use, they will be left empty

\n","value":262144},{"type":"int","name":"GIT_CHECKOUT_DONT_OVERWRITE_IGNORED","comments":"

Don't overwrite ignored files that exist in the checkout target

\n","value":524288},{"type":"int","name":"GIT_CHECKOUT_CONFLICT_STYLE_MERGE","comments":"

Write normal merge files for conflicts

\n","value":1048576},{"type":"int","name":"GIT_CHECKOUT_CONFLICT_STYLE_DIFF3","comments":"

Include common ancestor data in diff3 format files for conflicts

\n","value":2097152},{"type":"int","name":"GIT_CHECKOUT_UPDATE_SUBMODULES","comments":"

Recursively checkout submodules with same options (NOT IMPLEMENTED)

\n","value":65536},{"type":"int","name":"GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED","comments":"

Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)

\n","value":131072}],"used":{"returns":[],"needs":[]}}],["git_cherrypick_options",{"decl":["unsigned int version","unsigned int mainline","git_merge_options merge_opts","git_checkout_options checkout_opts"],"type":"struct","value":"git_cherrypick_options","file":"cherrypick.h","line":26,"lineto":34,"block":"unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts","tdef":"typedef","description":" Cherry-pick options","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"mainline","comments":" For merge commits, the \"mainline\" is treated as the parent. "},{"type":"git_merge_options","name":"merge_opts","comments":""},{"type":"git_checkout_options","name":"checkout_opts","comments":""}],"used":{"returns":[],"needs":["git_cherrypick","git_cherrypick_init_options"]}}],["git_clone_local_t",{"decl":["GIT_CLONE_LOCAL_AUTO","GIT_CLONE_LOCAL","GIT_CLONE_NO_LOCAL","GIT_CLONE_LOCAL_NO_LINKS"],"type":"enum","file":"clone.h","line":33,"lineto":53,"block":"GIT_CLONE_LOCAL_AUTO\nGIT_CLONE_LOCAL\nGIT_CLONE_NO_LOCAL\nGIT_CLONE_LOCAL_NO_LINKS","tdef":"typedef","description":" Options for bypassing the git-aware transport on clone. Bypassing\n it means that instead of a fetch, libgit2 will copy the object\n database directory instead of figuring out what it needs, which is\n faster. If possible, it will hardlink the files to save space.","comments":"","fields":[{"type":"int","name":"GIT_CLONE_LOCAL_AUTO","comments":"

Auto-detect (default), libgit2 will bypass the git-aware\n transport for local paths, but use a normal fetch for\n file:// urls.

\n","value":0},{"type":"int","name":"GIT_CLONE_LOCAL","comments":"

Bypass the git-aware transport even for a file:// url.

\n","value":1},{"type":"int","name":"GIT_CLONE_NO_LOCAL","comments":"

Do no bypass the git-aware transport

\n","value":2},{"type":"int","name":"GIT_CLONE_LOCAL_NO_LINKS","comments":"

Bypass the git-aware transport, but do not try to use\n hardlinks.

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_clone_options",{"decl":["unsigned int version","git_checkout_options checkout_opts","git_remote_callbacks remote_callbacks","int bare","git_clone_local_t local","const char * checkout_branch","git_signature * signature","git_repository_create_cb repository_cb","void * repository_cb_payload","git_remote_create_cb remote_cb","void * remote_cb_payload"],"type":"struct","value":"git_clone_options","file":"clone.h","line":103,"lineto":173,"block":"unsigned int version\ngit_checkout_options checkout_opts\ngit_remote_callbacks remote_callbacks\nint bare\ngit_clone_local_t local\nconst char * checkout_branch\ngit_signature * signature\ngit_repository_create_cb repository_cb\nvoid * repository_cb_payload\ngit_remote_create_cb remote_cb\nvoid * remote_cb_payload","tdef":"typedef","description":" Clone options structure","comments":"

Use the GIT_CLONE_OPTIONS_INIT to get the default settings, like this:

\n\n
    git_clone_options opts = GIT_CLONE_OPTIONS_INIT;\n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_checkout_options","name":"checkout_opts","comments":" These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`. Generally you will want the use\n GIT_CHECKOUT_SAFE_CREATE to create all files in the working\n directory for the newly cloned repository."},{"type":"git_remote_callbacks","name":"remote_callbacks","comments":" Callbacks to use for reporting fetch progress, and for acquiring\n credentials in the event they are needed. This parameter is ignored if\n the remote_cb parameter is set; if you provide a remote creation\n callback, then you have the opportunity to configure remote callbacks in\n provided function."},{"type":"int","name":"bare","comments":" Set to zero (false) to create a standard repo, or non-zero\n for a bare repo"},{"type":"git_clone_local_t","name":"local","comments":" Whether to use a fetch or copy the object database."},{"type":"const char *","name":"checkout_branch","comments":" The name of the branch to checkout. NULL means use the\n remote's default branch."},{"type":"git_signature *","name":"signature","comments":" The identity used when updating the reflog. NULL means to\n use the default signature using the config."},{"type":"git_repository_create_cb","name":"repository_cb","comments":" A callback used to create the new repository into which to\n clone. If NULL, the 'bare' field will be used to determine\n whether to create a bare repository."},{"type":"void *","name":"repository_cb_payload","comments":" An opaque payload to pass to the git_repository creation callback.\n This parameter is ignored unless repository_cb is non-NULL."},{"type":"git_remote_create_cb","name":"remote_cb","comments":" A callback used to create the git_remote, prior to its being\n used to perform the clone operation. See the documentation for\n git_remote_create_cb for details. This parameter may be NULL,\n indicating that git_clone should provide default behavior."},{"type":"void *","name":"remote_cb_payload","comments":" An opaque payload to pass to the git_remote creation callback.\n This parameter is ignored unless remote_cb is non-NULL."}],"used":{"returns":[],"needs":["git_clone","git_clone_init_options"]}}],["git_commit",{"decl":"git_commit","type":"struct","value":"git_commit","file":"types.h","line":120,"lineto":120,"tdef":"typedef","description":" Parsed representation of a commit object. ","comments":"","used":{"returns":[],"needs":["git_branch_create","git_cherrypick","git_cherrypick_commit","git_commit_amend","git_commit_author","git_commit_committer","git_commit_create","git_commit_free","git_commit_id","git_commit_lookup","git_commit_lookup_prefix","git_commit_message","git_commit_message_encoding","git_commit_message_raw","git_commit_nth_gen_ancestor","git_commit_owner","git_commit_parent","git_commit_parent_id","git_commit_parentcount","git_commit_raw_header","git_commit_summary","git_commit_time","git_commit_time_offset","git_commit_tree","git_commit_tree_id","git_diff_commit_as_email","git_merge_commits","git_revert","git_revert_commit"]}}],["git_config",{"decl":"git_config","type":"struct","value":"git_config","file":"types.h","line":138,"lineto":138,"tdef":"typedef","description":" Memory representation of a set of config files ","comments":"","used":{"returns":[],"needs":["git_config_add_backend","git_config_add_file_ondisk","git_config_delete_entry","git_config_delete_multivar","git_config_foreach","git_config_foreach_match","git_config_free","git_config_get_bool","git_config_get_entry","git_config_get_int32","git_config_get_int64","git_config_get_mapped","git_config_get_multivar_foreach","git_config_get_string","git_config_iterator_glob_new","git_config_iterator_new","git_config_multivar_iterator_new","git_config_new","git_config_open_default","git_config_open_global","git_config_open_level","git_config_open_ondisk","git_config_set_bool","git_config_set_int32","git_config_set_int64","git_config_set_multivar","git_config_set_string","git_config_snapshot","git_repository_config","git_repository_config_snapshot"]}}],["git_config_backend",{"decl":"git_config_backend","type":"struct","value":"git_config_backend","file":"types.h","line":141,"lineto":141,"block":"unsigned int version\nstruct git_config * cfg\nint (*)(struct git_config_backend *, git_config_level_t) open\nint (*)(struct git_config_backend *, const char *, const git_config_entry **) get\nint (*)(struct git_config_backend *, const char *, const char *) set\nint (*)(git_config_backend *, const char *, const char *, const char *) set_multivar\nint (*)(struct git_config_backend *, const char *) del\nint (*)(struct git_config_backend *, const char *, const char *) del_multivar\nint (*)(git_config_iterator **, struct git_config_backend *) iterator\nint (*)(struct git_config_backend **, struct git_config_backend *) snapshot\nvoid (*)(struct git_config_backend *) free","tdef":"typedef","description":" Interface to access a configuration file ","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"struct git_config *","name":"cfg","comments":""},{"type":"int (*)(struct git_config_backend *, git_config_level_t)","name":"open","comments":""},{"type":"int (*)(struct git_config_backend *, const char *, const git_config_entry **)","name":"get","comments":""},{"type":"int (*)(struct git_config_backend *, const char *, const char *)","name":"set","comments":""},{"type":"int (*)(git_config_backend *, const char *, const char *, const char *)","name":"set_multivar","comments":""},{"type":"int (*)(struct git_config_backend *, const char *)","name":"del","comments":""},{"type":"int (*)(struct git_config_backend *, const char *, const char *)","name":"del_multivar","comments":""},{"type":"int (*)(git_config_iterator **, struct git_config_backend *)","name":"iterator","comments":""},{"type":"int (*)(struct git_config_backend **, struct git_config_backend *)","name":"snapshot","comments":" Produce a read-only version of this backend "},{"type":"void (*)(struct git_config_backend *)","name":"free","comments":""}],"used":{"returns":[],"needs":["git_config_add_backend","git_config_backend_foreach_match","git_config_init_backend"]}}],["git_config_entry",{"decl":["const char * name","const char * value","git_config_level_t level"],"type":"struct","value":"git_config_entry","file":"config.h","line":61,"lineto":65,"block":"const char * name\nconst char * value\ngit_config_level_t level","tdef":"typedef","description":" An entry in a configuration file","comments":"","fields":[{"type":"const char *","name":"name","comments":""},{"type":"const char *","name":"value","comments":""},{"type":"git_config_level_t","name":"level","comments":""}],"used":{"returns":[],"needs":["git_config_get_entry","git_config_next"]}}],["git_config_iterator",{"decl":["git_config_backend * backend","unsigned int flags","int (*)(git_config_entry **, git_config_iterator *) next","void (*)(git_config_iterator *) free"],"type":"struct","value":"git_config_iterator","file":"sys/config.h","line":34,"lineto":48,"block":"git_config_backend * backend\nunsigned int flags\nint (*)(git_config_entry **, git_config_iterator *) next\nvoid (*)(git_config_iterator *) free","tdef":null,"description":" Every iterator must have this struct as its first element, so the\n API can talk to it. You'd define your iterator as","comments":"
 struct my_iterator {\n         git_config_iterator parent;\n         ...\n }\n
\n\n

and assign iter->parent.backend to your git_config_backend.

\n","fields":[{"type":"git_config_backend *","name":"backend","comments":""},{"type":"unsigned int","name":"flags","comments":""},{"type":"int (*)(git_config_entry **, git_config_iterator *)","name":"next","comments":" Return the current entry and advance the iterator. The\n memory belongs to the library."},{"type":"void (*)(git_config_iterator *)","name":"free","comments":" Free the iterator"}],"used":{"returns":[],"needs":["git_config_iterator_free","git_config_iterator_glob_new","git_config_iterator_new","git_config_multivar_iterator_new","git_config_next"]}}],["git_config_level_t",{"decl":["GIT_CONFIG_LEVEL_SYSTEM","GIT_CONFIG_LEVEL_XDG","GIT_CONFIG_LEVEL_GLOBAL","GIT_CONFIG_LEVEL_LOCAL","GIT_CONFIG_LEVEL_APP","GIT_CONFIG_HIGHEST_LEVEL"],"type":"enum","file":"config.h","line":31,"lineto":56,"block":"GIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL","tdef":"typedef","description":" Priority level of a config file.\n These priority levels correspond to the natural escalation logic\n (from higher to lower) when searching for config entries in git.git.","comments":"

git_config_open_default() and git_repository_config() honor those\n priority levels as well.

\n","fields":[{"type":"int","name":"GIT_CONFIG_LEVEL_SYSTEM","comments":"

System-wide configuration file; /etc/gitconfig on Linux systems

\n","value":1},{"type":"int","name":"GIT_CONFIG_LEVEL_XDG","comments":"

XDG compatible configuration file; typically ~/.config/git/config

\n","value":2},{"type":"int","name":"GIT_CONFIG_LEVEL_GLOBAL","comments":"

User-specific configuration file (also called Global configuration\n file); typically ~/.gitconfig

\n","value":3},{"type":"int","name":"GIT_CONFIG_LEVEL_LOCAL","comments":"

Repository specific configuration file; $WORK_DIR/.git/config on\n non-bare repos

\n","value":4},{"type":"int","name":"GIT_CONFIG_LEVEL_APP","comments":"

Application specific configuration file; freely defined by applications

\n","value":5},{"type":"int","name":"GIT_CONFIG_HIGHEST_LEVEL","comments":"

Represents the highest level available config file (i.e. the most\n specific config file available that actually is loaded)

\n","value":-1}],"used":{"returns":[],"needs":["git_config_add_backend","git_config_add_file_ondisk","git_config_open_level"]}}],["git_cred_default",{"decl":"git_cred_default","type":"struct","value":"git_cred_default","file":"transport.h","line":173,"lineto":173,"tdef":"typedef","description":" A key for NTLM/Kerberos \"default\" credentials ","comments":"","used":{"returns":[],"needs":[]}}],["git_cred_ssh_custom",{"decl":["git_cred parent","char * username","char * publickey","size_t publickey_len","git_cred_sign_callback sign_callback","void * payload"],"type":"struct","value":"git_cred_ssh_custom","file":"transport.h","line":163,"lineto":170,"block":"git_cred parent\nchar * username\nchar * publickey\nsize_t publickey_len\ngit_cred_sign_callback sign_callback\nvoid * payload","tdef":"typedef","description":" A key with a custom signature function","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"char *","name":"publickey","comments":""},{"type":"size_t","name":"publickey_len","comments":""},{"type":"git_cred_sign_callback","name":"sign_callback","comments":""},{"type":"void *","name":"payload","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_ssh_interactive",{"decl":["git_cred parent","char * username","git_cred_ssh_interactive_callback prompt_callback","void * payload"],"type":"struct","value":"git_cred_ssh_interactive","file":"transport.h","line":153,"lineto":158,"block":"git_cred parent\nchar * username\ngit_cred_ssh_interactive_callback prompt_callback\nvoid * payload","tdef":"typedef","description":" Keyboard-interactive based ssh authentication","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"git_cred_ssh_interactive_callback","name":"prompt_callback","comments":""},{"type":"void *","name":"payload","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_ssh_key",{"decl":["git_cred parent","char * username","char * publickey","char * privatekey","char * passphrase"],"type":"struct","value":"git_cred_ssh_key","file":"transport.h","line":142,"lineto":148,"block":"git_cred parent\nchar * username\nchar * publickey\nchar * privatekey\nchar * passphrase","tdef":"typedef","description":" A ssh key from disk","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"char *","name":"publickey","comments":""},{"type":"char *","name":"privatekey","comments":""},{"type":"char *","name":"passphrase","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_username",{"decl":["git_cred parent","char [1] username"],"type":"struct","value":"git_cred_username","file":"transport.h","line":176,"lineto":179,"block":"git_cred parent\nchar [1] username","tdef":"typedef","description":" Username-only credential information ","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char [1]","name":"username","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_userpass_payload",{"decl":["char * username","char * password"],"type":"struct","value":"git_cred_userpass_payload","file":"cred_helpers.h","line":24,"lineto":27,"block":"char * username\nchar * password","tdef":"typedef","description":" Payload for git_cred_stock_userpass_plaintext.","comments":"","fields":[{"type":"char *","name":"username","comments":""},{"type":"char *","name":"password","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_userpass_plaintext",{"decl":["git_cred parent","char * username","char * password"],"type":"struct","value":"git_cred_userpass_plaintext","file":"transport.h","line":119,"lineto":123,"block":"git_cred parent\nchar * username\nchar * password","tdef":"typedef","description":" A plaintext username and password ","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"char *","name":"password","comments":""}],"used":{"returns":[],"needs":[]}}],["git_credtype_t",{"decl":["GIT_CREDTYPE_USERPASS_PLAINTEXT","GIT_CREDTYPE_SSH_KEY","GIT_CREDTYPE_SSH_CUSTOM","GIT_CREDTYPE_DEFAULT","GIT_CREDTYPE_SSH_INTERACTIVE","GIT_CREDTYPE_USERNAME"],"type":"enum","file":"transport.h","line":85,"lineto":108,"block":"GIT_CREDTYPE_USERPASS_PLAINTEXT\nGIT_CREDTYPE_SSH_KEY\nGIT_CREDTYPE_SSH_CUSTOM\nGIT_CREDTYPE_DEFAULT\nGIT_CREDTYPE_SSH_INTERACTIVE\nGIT_CREDTYPE_USERNAME","tdef":"typedef","description":" Authentication type requested ","comments":"","fields":[{"type":"int","name":"GIT_CREDTYPE_USERPASS_PLAINTEXT","comments":"","value":1},{"type":"int","name":"GIT_CREDTYPE_SSH_KEY","comments":"","value":2},{"type":"int","name":"GIT_CREDTYPE_SSH_CUSTOM","comments":"","value":4},{"type":"int","name":"GIT_CREDTYPE_DEFAULT","comments":"","value":8},{"type":"int","name":"GIT_CREDTYPE_SSH_INTERACTIVE","comments":"","value":16},{"type":"int","name":"GIT_CREDTYPE_USERNAME","comments":"

Username-only information

\n\n

If the SSH transport does not know which username to use,\n it will ask via this credential type.

\n","value":32}],"used":{"returns":[],"needs":[]}}],["git_cvar_map",{"decl":["git_cvar_t cvar_type","const char * str_match","int map_value"],"type":"struct","value":"git_cvar_map","file":"config.h","line":83,"lineto":87,"block":"git_cvar_t cvar_type\nconst char * str_match\nint map_value","tdef":"typedef","description":" Mapping from config variables to values.","comments":"","fields":[{"type":"git_cvar_t","name":"cvar_type","comments":""},{"type":"const char *","name":"str_match","comments":""},{"type":"int","name":"map_value","comments":""}],"used":{"returns":[],"needs":["git_config_get_mapped","git_config_lookup_map_value"]}}],["git_cvar_t",{"decl":["GIT_CVAR_FALSE","GIT_CVAR_TRUE","GIT_CVAR_INT32","GIT_CVAR_STRING"],"type":"enum","file":"config.h","line":73,"lineto":78,"block":"GIT_CVAR_FALSE\nGIT_CVAR_TRUE\nGIT_CVAR_INT32\nGIT_CVAR_STRING","tdef":"typedef","description":" Config var type","comments":"","fields":[{"type":"int","name":"GIT_CVAR_FALSE","comments":"","value":0},{"type":"int","name":"GIT_CVAR_TRUE","comments":"","value":1},{"type":"int","name":"GIT_CVAR_INT32","comments":"","value":2},{"type":"int","name":"GIT_CVAR_STRING","comments":"","value":3}],"used":{"returns":[],"needs":[]}}],["git_delta_t",{"decl":["GIT_DELTA_UNMODIFIED","GIT_DELTA_ADDED","GIT_DELTA_DELETED","GIT_DELTA_MODIFIED","GIT_DELTA_RENAMED","GIT_DELTA_COPIED","GIT_DELTA_IGNORED","GIT_DELTA_UNTRACKED","GIT_DELTA_TYPECHANGE","GIT_DELTA_UNREADABLE"],"type":"enum","file":"diff.h","line":236,"lineto":247,"block":"GIT_DELTA_UNMODIFIED\nGIT_DELTA_ADDED\nGIT_DELTA_DELETED\nGIT_DELTA_MODIFIED\nGIT_DELTA_RENAMED\nGIT_DELTA_COPIED\nGIT_DELTA_IGNORED\nGIT_DELTA_UNTRACKED\nGIT_DELTA_TYPECHANGE\nGIT_DELTA_UNREADABLE","tdef":"typedef","description":" What type of change is described by a git_diff_delta?","comments":"

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run\n git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE\n in the option flags (otherwise type changes will be split into ADDED /\n DELETED pairs).

\n","fields":[{"type":"int","name":"GIT_DELTA_UNMODIFIED","comments":"

no changes

\n","value":0},{"type":"int","name":"GIT_DELTA_ADDED","comments":"

entry does not exist in old version

\n","value":1},{"type":"int","name":"GIT_DELTA_DELETED","comments":"

entry does not exist in new version

\n","value":2},{"type":"int","name":"GIT_DELTA_MODIFIED","comments":"

entry content changed between old and new

\n","value":3},{"type":"int","name":"GIT_DELTA_RENAMED","comments":"

entry was renamed between old and new

\n","value":4},{"type":"int","name":"GIT_DELTA_COPIED","comments":"

entry was copied from another old entry

\n","value":5},{"type":"int","name":"GIT_DELTA_IGNORED","comments":"

entry is ignored item in workdir

\n","value":6},{"type":"int","name":"GIT_DELTA_UNTRACKED","comments":"

entry is untracked item in workdir

\n","value":7},{"type":"int","name":"GIT_DELTA_TYPECHANGE","comments":"

type of entry changed between old and new

\n","value":8},{"type":"int","name":"GIT_DELTA_UNREADABLE","comments":"

entry is unreadable

\n","value":9}],"used":{"returns":[],"needs":["git_diff_num_deltas_of_type","git_diff_status_char"]}}],["git_describe_format_options",{"decl":["unsigned int version","unsigned int abbreviated_size","int always_use_long_format","char * dirty_suffix"],"type":"struct","value":"git_describe_format_options","file":"describe.h","line":78,"lineto":98,"block":"unsigned int version\nunsigned int abbreviated_size\nint always_use_long_format\nchar * dirty_suffix","tdef":"typedef","description":" Options for formatting the describe string","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"abbreviated_size","comments":" Size of the abbreviated commit id to use. This value is the\n lower bound for the length of the abbreviated string. The\n default is 7."},{"type":"int","name":"always_use_long_format","comments":" Set to use the long format even when a shorter name could be used."},{"type":"char *","name":"dirty_suffix","comments":" If the workdir is dirty and this is set, this string will\n be appended to the description string."}],"used":{"returns":[],"needs":["git_describe_format"]}}],["git_describe_options",{"decl":["unsigned int version","unsigned int max_candidates_tags","unsigned int describe_strategy","const char * pattern","int only_follow_first_parent","int show_commit_oid_as_fallback"],"type":"struct","value":"git_describe_options","file":"describe.h","line":44,"lineto":62,"block":"unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback","tdef":"typedef","description":" Describe options structure","comments":"

Initialize with GIT_DESCRIBE_OPTIONS_INIT macro to correctly set\n the version field. E.g.

\n\n
    git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;\n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"max_candidates_tags","comments":""},{"type":"unsigned int","name":"describe_strategy","comments":" default: 10 "},{"type":"const char *","name":"pattern","comments":" default: GIT_DESCRIBE_DEFAULT "},{"type":"int","name":"only_follow_first_parent","comments":" When calculating the distance from the matching tag or\n reference, only walk down the first-parent ancestry."},{"type":"int","name":"show_commit_oid_as_fallback","comments":" If no matching tag or reference is found, the describe\n operation would normally fail. If this option is set, it\n will instead fall back to showing the full id of the\n commit."}],"used":{"returns":[],"needs":["git_describe_commit","git_describe_workdir"]}}],["git_describe_strategy_t",{"decl":["GIT_DESCRIBE_DEFAULT","GIT_DESCRIBE_TAGS","GIT_DESCRIBE_ALL"],"type":"enum","file":"describe.h","line":30,"lineto":34,"block":"GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL","tdef":"typedef","description":" Reference lookup strategy","comments":"

These behave like the --tags and --all optios to git-describe,\n namely they say to look for any reference in either refs/tags/ or\n refs/ respectively.

\n","fields":[{"type":"int","name":"GIT_DESCRIBE_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_DESCRIBE_TAGS","comments":"","value":1},{"type":"int","name":"GIT_DESCRIBE_ALL","comments":"","value":2}],"used":{"returns":[],"needs":[]}}],["git_diff",{"decl":"git_diff","type":"struct","value":"git_diff","file":"diff.h","line":210,"lineto":210,"tdef":"typedef","description":" The diff object that contains all individual file deltas.","comments":"

This is an opaque structure which will be allocated by one of the diff\n generator functions below (such as git_diff_tree_to_tree). You are\n responsible for releasing the object memory when done, using the\n git_diff_free() function.

\n","used":{"returns":[],"needs":["git_diff_find_similar","git_diff_foreach","git_diff_format_email","git_diff_free","git_diff_get_delta","git_diff_get_perfdata","git_diff_get_stats","git_diff_index_to_workdir","git_diff_is_sorted_icase","git_diff_merge","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_print","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_patch_from_diff","git_pathspec_match_diff"]}}],["git_diff_delta",{"decl":["git_delta_t status","uint32_t flags","uint16_t similarity","uint16_t nfiles","git_diff_file old_file","git_diff_file new_file"],"type":"struct","value":"git_diff_delta","file":"diff.h","line":314,"lineto":321,"block":"git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file","tdef":"typedef","description":" Description of changes to one entry.","comments":"

When iterating over a diff, this will be passed to most callbacks and\n you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file\n represents to "to" side of the diff. What those means depend on the\n function that was used to generate the diff and will be documented below.\n You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file",\n they actually may correspond to entries that represent a file, a symbolic\n link, a submodule commit id, or even a tree (if you are tracking type\n changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will\n be filled in, but we generally try to fill in as much as possible. One\n example is that the "flags" field may not have either the BINARY or the\n NOT_BINARY flag set to avoid examining file contents if you do not pass\n in hunk and/or line callbacks to the diff foreach iteration function. It\n will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar()\n which does a similarity analysis of files in the diff. Use that\n function to do rename and copy detection, and to split heavily modified\n files in add/delete pairs. After that call, deltas with a status of\n GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score\n between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to\n break, but to not actually break the records, then GIT_DELTA_MODIFIED\n records may have a non-zero similarity score if the self-similarity is\n below the split threshold. To display this value like core Git, invert\n the score (a la printf("M%03d", 100 - delta->similarity)).

\n","fields":[{"type":"git_delta_t","name":"status","comments":""},{"type":"uint32_t","name":"flags","comments":" git_diff_flag_t values "},{"type":"uint16_t","name":"similarity","comments":" for RENAMED and COPIED, value 0-100 "},{"type":"uint16_t","name":"nfiles","comments":" number of files in this delta "},{"type":"git_diff_file","name":"old_file","comments":""},{"type":"git_diff_file","name":"new_file","comments":""}],"used":{"returns":["git_diff_get_delta","git_patch_get_delta","git_pathspec_match_list_diff_entry"],"needs":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle"]}}],["git_diff_file",{"decl":["git_oid id","const char * path","git_off_t size","uint32_t flags","uint16_t mode"],"type":"struct","value":"git_diff_file","file":"diff.h","line":270,"lineto":276,"block":"git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode","tdef":"typedef","description":" Description of one side of a delta.","comments":"

Although this is called a "file", it could represent a file, a symbolic\n link, a submodule commit id, or even a tree (although that only if you\n are tracking type changes or ignored/untracked directories).

\n\n

The oid is the git_oid of the item. If the entry represents an\n absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta),\n then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working\n directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will\n be restricted to one of the git_filemode_t values.

\n","fields":[{"type":"git_oid","name":"id","comments":""},{"type":"const char *","name":"path","comments":""},{"type":"git_off_t","name":"size","comments":""},{"type":"uint32_t","name":"flags","comments":""},{"type":"uint16_t","name":"mode","comments":""}],"used":{"returns":[],"needs":[]}}],["git_diff_find_options",{"decl":["unsigned int version","uint32_t flags","uint16_t rename_threshold","uint16_t rename_from_rewrite_threshold","uint16_t copy_threshold","uint16_t break_rewrite_threshold","size_t rename_limit","git_diff_similarity_metric * metric"],"type":"struct","value":"git_diff_find_options","file":"diff.h","line":604,"lineto":630,"block":"unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric","tdef":"typedef","description":" Control behavior of rename and copy detection","comments":"

These options mostly mimic parameters that can be passed to git-diff.

\n\n
    \n
  • rename_threshold is the same as the -M option with a value
  • \n
  • copy_threshold is the same as the -C option with a value
  • \n
  • rename_from_rewrite_threshold matches the top of the -B option
  • \n
  • break_rewrite_threshold matches the bottom of the -B option
  • \n
  • rename_limit is the maximum number of matches to consider for\na particular file. This is a little different from the -l option\nto regular Git because we will still process up to this many matches\nbefore abandoning the search.
  • \n
\n\n

The metric option allows you to plug in a custom similarity metric.\n Set it to NULL for the default internal metric which is based on sampling\n hashes of ranges of data in the file. The default metric is a pretty\n good similarity approximation that should work fairly well for both text\n and binary data, and is pretty fast with fixed memory overhead.

\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"uint32_t","name":"flags","comments":" Combination of git_diff_find_t values (default GIT_DIFF_FIND_BY_CONFIG).\n NOTE: if you don't explicitly set this, `diff.renames` could be set\n to false, resulting in `git_diff_find_similar` doing nothing."},{"type":"uint16_t","name":"rename_threshold","comments":" Similarity to consider a file renamed (default 50) "},{"type":"uint16_t","name":"rename_from_rewrite_threshold","comments":" Similarity of modified to be eligible rename source (default 50) "},{"type":"uint16_t","name":"copy_threshold","comments":" Similarity to consider a file a copy (default 50) "},{"type":"uint16_t","name":"break_rewrite_threshold","comments":" Similarity to split modify into delete/add pair (default 60) "},{"type":"size_t","name":"rename_limit","comments":" Maximum similarity sources to examine for a file (somewhat like\n git-diff's `-l` option or `diff.renameLimit` config) (default 200)"},{"type":"git_diff_similarity_metric *","name":"metric","comments":" Pluggable similarity metric; pass NULL to use internal metric "}],"used":{"returns":[],"needs":["git_diff_find_init_options","git_diff_find_similar"]}}],["git_diff_find_t",{"decl":["GIT_DIFF_FIND_BY_CONFIG","GIT_DIFF_FIND_RENAMES","GIT_DIFF_FIND_RENAMES_FROM_REWRITES","GIT_DIFF_FIND_COPIES","GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED","GIT_DIFF_FIND_REWRITES","GIT_DIFF_BREAK_REWRITES","GIT_DIFF_FIND_AND_BREAK_REWRITES","GIT_DIFF_FIND_FOR_UNTRACKED","GIT_DIFF_FIND_ALL","GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE","GIT_DIFF_FIND_IGNORE_WHITESPACE","GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE","GIT_DIFF_FIND_EXACT_MATCH_ONLY","GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY","GIT_DIFF_FIND_REMOVE_UNMODIFIED"],"type":"enum","file":"diff.h","line":498,"lineto":567,"block":"GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED","tdef":"typedef","description":" Flags to control the behavior of diff rename/copy detection.","comments":"","fields":[{"type":"int","name":"GIT_DIFF_FIND_BY_CONFIG","comments":"

Obey diff.renames. Overridden by any other GIT_DIFF_FIND_... flag.

\n","value":0},{"type":"int","name":"GIT_DIFF_FIND_RENAMES","comments":"

Look for renames? (--find-renames)

\n","value":1},{"type":"int","name":"GIT_DIFF_FIND_RENAMES_FROM_REWRITES","comments":"

Consider old side of MODIFIED for renames? (--break-rewrites=N)

\n","value":2},{"type":"int","name":"GIT_DIFF_FIND_COPIES","comments":"

Look for copies? (a la --find-copies).

\n","value":4},{"type":"int","name":"GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED","comments":"

Consider UNMODIFIED as copy sources? (--find-copies-harder).

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNMODIFIED when\n the initial git_diff is being generated.

\n","value":8},{"type":"int","name":"GIT_DIFF_FIND_REWRITES","comments":"

Mark significant rewrites for split (--break-rewrites=/M)

\n","value":16},{"type":"int","name":"GIT_DIFF_BREAK_REWRITES","comments":"

Actually split large rewrites into delete/add pairs

\n","value":32},{"type":"int","name":"GIT_DIFF_FIND_AND_BREAK_REWRITES","comments":"

Mark rewrites for split and break into delete/add pairs

\n","value":48},{"type":"int","name":"GIT_DIFF_FIND_FOR_UNTRACKED","comments":"

Find renames/copies for UNTRACKED items in working directory.

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNTRACKED when the\n initial git_diff is being generated (and obviously the diff must\n be against the working directory for this to make sense).

\n","value":64},{"type":"int","name":"GIT_DIFF_FIND_ALL","comments":"

Turn on all finding features.

\n","value":255},{"type":"int","name":"GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE","comments":"

Measure similarity ignoring leading whitespace (default)

\n","value":0},{"type":"int","name":"GIT_DIFF_FIND_IGNORE_WHITESPACE","comments":"

Measure similarity ignoring all whitespace

\n","value":4096},{"type":"int","name":"GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE","comments":"

Measure similarity including all data

\n","value":8192},{"type":"int","name":"GIT_DIFF_FIND_EXACT_MATCH_ONLY","comments":"

Measure similarity only by comparing SHAs (fast and cheap)

\n","value":16384},{"type":"int","name":"GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY","comments":"

Do not break rewrites unless they contribute to a rename.

\n\n

Normally, GIT_DIFF_FIND_AND_BREAK_REWRITES will measure the self-\n similarity of modified files and split the ones that have changed a\n lot into a DELETE / ADD pair. Then the sides of that pair will be\n considered candidates for rename and copy detection.

\n\n

If you add this flag in and the split pair is not used for an\n actual rename or copy, then the modified record will be restored to\n a regular MODIFIED record instead of being split.

\n","value":32768},{"type":"int","name":"GIT_DIFF_FIND_REMOVE_UNMODIFIED","comments":"

Remove any UNMODIFIED deltas after find_similar is done.

\n\n

Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the\n --find-copies-harder behavior requires building a diff with the\n GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED\n records in the final result, pass this flag to have them removed.

\n","value":65536}],"used":{"returns":[],"needs":[]}}],["git_diff_flag_t",{"decl":["GIT_DIFF_FLAG_BINARY","GIT_DIFF_FLAG_NOT_BINARY","GIT_DIFF_FLAG_VALID_ID"],"type":"enum","file":"diff.h","line":220,"lineto":224,"block":"GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID","tdef":"typedef","description":" Flags for the delta object and the file objects on each side.","comments":"

These flags are used for both the flags value of the git_diff_delta\n and the flags for the git_diff_file objects representing the old and\n new sides of the delta. Values outside of this public range should be\n considered reserved for internal or future use.

\n","fields":[{"type":"int","name":"GIT_DIFF_FLAG_BINARY","comments":"

file(s) treated as binary data

\n","value":1},{"type":"int","name":"GIT_DIFF_FLAG_NOT_BINARY","comments":"

file(s) treated as text data

\n","value":2},{"type":"int","name":"GIT_DIFF_FLAG_VALID_ID","comments":"

id value is known correct

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_diff_format_email_flags_t",{"decl":["GIT_DIFF_FORMAT_EMAIL_NONE","GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER"],"type":"enum","file":"diff.h","line":1156,"lineto":1163,"block":"GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER","tdef":"typedef","description":" Formatting options for diff e-mail generation","comments":"","fields":[{"type":"int","name":"GIT_DIFF_FORMAT_EMAIL_NONE","comments":"

Normal patch, the default

\n","value":0},{"type":"int","name":"GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER","comments":"

Don't insert "[PATCH]" in the subject header

\n","value":1}],"used":{"returns":[],"needs":["git_diff_commit_as_email"]}}],["git_diff_format_email_options",{"decl":["unsigned int version","git_diff_format_email_flags_t flags","size_t patch_no","size_t total_patches","const git_oid * id","const char * summary","const git_signature * author"],"type":"struct","value":"git_diff_format_email_options","file":"diff.h","line":1168,"lineto":1187,"block":"unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst git_signature * author","tdef":"typedef","description":" Options for controlling the formatting of the generated e-mail.","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_diff_format_email_flags_t","name":"flags","comments":""},{"type":"size_t","name":"patch_no","comments":" This patch number "},{"type":"size_t","name":"total_patches","comments":" Total number of patches in this series "},{"type":"const git_oid *","name":"id","comments":" id to use for the commit "},{"type":"const char *","name":"summary","comments":" Summary of the change "},{"type":"const git_signature *","name":"author","comments":" Author of the change "}],"used":{"returns":[],"needs":["git_diff_format_email","git_diff_format_email_init_options"]}}],["git_diff_format_t",{"decl":["GIT_DIFF_FORMAT_PATCH","GIT_DIFF_FORMAT_PATCH_HEADER","GIT_DIFF_FORMAT_RAW","GIT_DIFF_FORMAT_NAME_ONLY","GIT_DIFF_FORMAT_NAME_STATUS"],"type":"enum","file":"diff.h","line":925,"lineto":931,"block":"GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS","tdef":"typedef","description":" Possible output formats for diff data","comments":"","fields":[{"type":"int","name":"GIT_DIFF_FORMAT_PATCH","comments":"

full git diff

\n","value":1},{"type":"int","name":"GIT_DIFF_FORMAT_PATCH_HEADER","comments":"

just the file headers of patch

\n","value":2},{"type":"int","name":"GIT_DIFF_FORMAT_RAW","comments":"

like git diff --raw

\n","value":3},{"type":"int","name":"GIT_DIFF_FORMAT_NAME_ONLY","comments":"

like git diff --name-only

\n","value":4},{"type":"int","name":"GIT_DIFF_FORMAT_NAME_STATUS","comments":"

like git diff --name-status

\n","value":5}],"used":{"returns":[],"needs":["git_diff_print"]}}],["git_diff_hunk",{"decl":["int old_start","int old_lines","int new_start","int new_lines","size_t header_len","char [128] header"],"type":"struct","value":"git_diff_hunk","file":"diff.h","line":424,"lineto":431,"block":"int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header","tdef":"typedef","description":" Structure describing a hunk of a diff.","comments":"","fields":[{"type":"int","name":"old_start","comments":" Starting line number in old_file "},{"type":"int","name":"old_lines","comments":" Number of lines in old_file "},{"type":"int","name":"new_start","comments":" Starting line number in new_file "},{"type":"int","name":"new_lines","comments":" Number of lines in new_file "},{"type":"size_t","name":"header_len","comments":" Number of bytes in header text "},{"type":"char [128]","name":"header","comments":" Header text, NUL-byte terminated "}],"used":{"returns":[],"needs":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_patch_get_hunk"]}}],["git_diff_line",{"decl":["char origin","int old_lineno","int new_lineno","int num_lines","size_t content_len","git_off_t content_offset","const char * content"],"type":"struct","value":"git_diff_line","file":"diff.h","line":471,"lineto":479,"block":"char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content","tdef":"typedef","description":" Structure describing a line (or data span) of a diff.","comments":"","fields":[{"type":"char","name":"origin","comments":" A git_diff_line_t value "},{"type":"int","name":"old_lineno","comments":" Line number in old file or -1 for added line "},{"type":"int","name":"new_lineno","comments":" Line number in new file or -1 for deleted line "},{"type":"int","name":"num_lines","comments":" Number of newline characters in content "},{"type":"size_t","name":"content_len","comments":" Number of bytes of data "},{"type":"git_off_t","name":"content_offset","comments":" Offset in the original file to the content "},{"type":"const char *","name":"content","comments":" Pointer to diff text, not NUL-byte terminated "}],"used":{"returns":[],"needs":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_patch_get_line_in_hunk"]}}],["git_diff_line_t",{"decl":["GIT_DIFF_LINE_CONTEXT","GIT_DIFF_LINE_ADDITION","GIT_DIFF_LINE_DELETION","GIT_DIFF_LINE_CONTEXT_EOFNL","GIT_DIFF_LINE_ADD_EOFNL","GIT_DIFF_LINE_DEL_EOFNL","GIT_DIFF_LINE_FILE_HDR","GIT_DIFF_LINE_HUNK_HDR","GIT_DIFF_LINE_BINARY"],"type":"enum","file":"diff.h","line":450,"lineto":466,"block":"GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\nGIT_DIFF_LINE_ADD_EOFNL\nGIT_DIFF_LINE_DEL_EOFNL\nGIT_DIFF_LINE_FILE_HDR\nGIT_DIFF_LINE_HUNK_HDR\nGIT_DIFF_LINE_BINARY","tdef":"typedef","description":" Line origin constants.","comments":"

These values describe where a line came from and will be passed to\n the git_diff_line_cb when iterating over a diff. There are some\n special origin constants at the end that are used for the text\n output callbacks to demarcate lines that are actually part of\n the file or hunk headers.

\n","fields":[{"type":"int","name":"GIT_DIFF_LINE_CONTEXT","comments":"","value":32},{"type":"int","name":"GIT_DIFF_LINE_ADDITION","comments":"","value":43},{"type":"int","name":"GIT_DIFF_LINE_DELETION","comments":"","value":45},{"type":"int","name":"GIT_DIFF_LINE_CONTEXT_EOFNL","comments":"

Both files have no LF at end

\n","value":61},{"type":"int","name":"GIT_DIFF_LINE_ADD_EOFNL","comments":"

Old has no LF at end, new does

\n","value":62},{"type":"int","name":"GIT_DIFF_LINE_DEL_EOFNL","comments":"

Old has LF at end, new does not

\n","value":60},{"type":"int","name":"GIT_DIFF_LINE_FILE_HDR","comments":"","value":70},{"type":"int","name":"GIT_DIFF_LINE_HUNK_HDR","comments":"","value":72},{"type":"int","name":"GIT_DIFF_LINE_BINARY","comments":"

For "Binary files x and y differ"

\n","value":66}],"used":{"returns":[],"needs":[]}}],["git_diff_option_t",{"decl":["GIT_DIFF_NORMAL","GIT_DIFF_REVERSE","GIT_DIFF_INCLUDE_IGNORED","GIT_DIFF_RECURSE_IGNORED_DIRS","GIT_DIFF_INCLUDE_UNTRACKED","GIT_DIFF_RECURSE_UNTRACKED_DIRS","GIT_DIFF_INCLUDE_UNMODIFIED","GIT_DIFF_INCLUDE_TYPECHANGE","GIT_DIFF_INCLUDE_TYPECHANGE_TREES","GIT_DIFF_IGNORE_FILEMODE","GIT_DIFF_IGNORE_SUBMODULES","GIT_DIFF_IGNORE_CASE","GIT_DIFF_DISABLE_PATHSPEC_MATCH","GIT_DIFF_SKIP_BINARY_CHECK","GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS","GIT_DIFF_UPDATE_INDEX","GIT_DIFF_INCLUDE_UNREADABLE","GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED","GIT_DIFF_FORCE_TEXT","GIT_DIFF_FORCE_BINARY","GIT_DIFF_IGNORE_WHITESPACE","GIT_DIFF_IGNORE_WHITESPACE_CHANGE","GIT_DIFF_IGNORE_WHITESPACE_EOL","GIT_DIFF_SHOW_UNTRACKED_CONTENT","GIT_DIFF_SHOW_UNMODIFIED","GIT_DIFF_PATIENCE","GIT_DIFF_MINIMAL","GIT_DIFF_SHOW_BINARY"],"type":"enum","file":"diff.h","line":72,"lineto":200,"block":"GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY","tdef":"typedef","description":" Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.","comments":"","fields":[{"type":"int","name":"GIT_DIFF_NORMAL","comments":"

Normal diff, the default

\n","value":0},{"type":"int","name":"GIT_DIFF_REVERSE","comments":"

Reverse the sides of the diff

\n","value":1},{"type":"int","name":"GIT_DIFF_INCLUDE_IGNORED","comments":"

Include ignored files in the diff

\n","value":2},{"type":"int","name":"GIT_DIFF_RECURSE_IGNORED_DIRS","comments":"

Even with GIT_DIFF_INCLUDE_IGNORED, an entire ignored directory\n will be marked with only a single entry in the diff; this flag\n adds all files under the directory as IGNORED entries, too.

\n","value":4},{"type":"int","name":"GIT_DIFF_INCLUDE_UNTRACKED","comments":"

Include untracked files in the diff

\n","value":8},{"type":"int","name":"GIT_DIFF_RECURSE_UNTRACKED_DIRS","comments":"

Even with GIT_DIFF_INCLUDE_UNTRACKED, an entire untracked\n directory will be marked with only a single entry in the diff\n (a la what core Git does in git status); this flag adds all\n files under untracked directories as UNTRACKED entries, too.

\n","value":16},{"type":"int","name":"GIT_DIFF_INCLUDE_UNMODIFIED","comments":"

Include unmodified files in the diff

\n","value":32},{"type":"int","name":"GIT_DIFF_INCLUDE_TYPECHANGE","comments":"

Normally, a type change between files will be converted into a\n DELETED record for the old and an ADDED record for the new; this\n options enabled the generation of TYPECHANGE delta records.

\n","value":64},{"type":"int","name":"GIT_DIFF_INCLUDE_TYPECHANGE_TREES","comments":"

Even with GIT_DIFF_INCLUDE_TYPECHANGE, blob->tree changes still\n generally show as a DELETED blob. This flag tries to correctly\n label blob->tree transitions as TYPECHANGE records with new_file's\n mode set to tree. Note: the tree SHA will not be available.

\n","value":128},{"type":"int","name":"GIT_DIFF_IGNORE_FILEMODE","comments":"

Ignore file mode changes

\n","value":256},{"type":"int","name":"GIT_DIFF_IGNORE_SUBMODULES","comments":"

Treat all submodules as unmodified

\n","value":512},{"type":"int","name":"GIT_DIFF_IGNORE_CASE","comments":"

Use case insensitive filename comparisons

\n","value":1024},{"type":"int","name":"GIT_DIFF_DISABLE_PATHSPEC_MATCH","comments":"

If the pathspec is set in the diff options, this flags means to\n apply it as an exact match instead of as an fnmatch pattern.

\n","value":4096},{"type":"int","name":"GIT_DIFF_SKIP_BINARY_CHECK","comments":"

Disable updating of the binary flag in delta records. This is\n useful when iterating over a diff if you don't need hunk and data\n callbacks and want to avoid having to load file completely.

\n","value":8192},{"type":"int","name":"GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS","comments":"

When diff finds an untracked directory, to match the behavior of\n core Git, it scans the contents for IGNORED and UNTRACKED files.\n If all contents are IGNORED, then the directory is IGNORED; if\n any contents are not IGNORED, then the directory is UNTRACKED.\n This is extra work that may not matter in many cases. This flag\n turns off that scan and immediately labels an untracked directory\n as UNTRACKED (changing the behavior to not match core Git).

\n","value":16384},{"type":"int","name":"GIT_DIFF_UPDATE_INDEX","comments":"

When diff finds a file in the working directory with stat\n information different from the index, but the OID ends up being the\n same, write the correct stat information into the index. Note:\n without this flag, diff will always leave the index untouched.

\n","value":32768},{"type":"int","name":"GIT_DIFF_INCLUDE_UNREADABLE","comments":"

Include unreadable files in the diff

\n","value":65536},{"type":"int","name":"GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED","comments":"

Include unreadable files in the diff

\n","value":131072},{"type":"int","name":"GIT_DIFF_FORCE_TEXT","comments":"

Treat all files as text, disabling binary attributes \n&\n detection

\n","value":1048576},{"type":"int","name":"GIT_DIFF_FORCE_BINARY","comments":"

Treat all files as binary, disabling text diffs

\n","value":2097152},{"type":"int","name":"GIT_DIFF_IGNORE_WHITESPACE","comments":"

Ignore all whitespace

\n","value":4194304},{"type":"int","name":"GIT_DIFF_IGNORE_WHITESPACE_CHANGE","comments":"

Ignore changes in amount of whitespace

\n","value":8388608},{"type":"int","name":"GIT_DIFF_IGNORE_WHITESPACE_EOL","comments":"

Ignore whitespace at end of line

\n","value":16777216},{"type":"int","name":"GIT_DIFF_SHOW_UNTRACKED_CONTENT","comments":"

When generating patch text, include the content of untracked\n files. This automatically turns on GIT_DIFF_INCLUDE_UNTRACKED but\n it does not turn on GIT_DIFF_RECURSE_UNTRACKED_DIRS. Add that\n flag if you want the content of every single UNTRACKED file.

\n","value":33554432},{"type":"int","name":"GIT_DIFF_SHOW_UNMODIFIED","comments":"

When generating output, include the names of unmodified files if\n they are included in the git_diff. Normally these are skipped in\n the formats that list files (e.g. name-only, name-status, raw).\n Even with this, these will not be included in patch format.

\n","value":67108864},{"type":"int","name":"GIT_DIFF_PATIENCE","comments":"

Use the "patience diff" algorithm

\n","value":268435456},{"type":"int","name":"GIT_DIFF_MINIMAL","comments":"

Take extra time to find minimal diff

\n","value":536870912},{"type":"int","name":"GIT_DIFF_SHOW_BINARY","comments":"

Include the necessary deflate / delta information so that git-apply\n can apply given diff information to binary files.

\n","value":1073741824}],"used":{"returns":[],"needs":[]}}],["git_diff_options",{"decl":["unsigned int version","uint32_t flags","git_submodule_ignore_t ignore_submodules","git_strarray pathspec","git_diff_notify_cb notify_cb","void * notify_payload","uint32_t context_lines","uint32_t interhunk_lines","uint16_t id_abbrev","git_off_t max_size","const char * old_prefix","const char * new_prefix"],"type":"struct","value":"git_diff_options","file":"diff.h","line":367,"lineto":386,"block":"unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\nvoid * notify_payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix","tdef":"typedef","description":" Structure describing options about how the diff should be executed.","comments":"

Setting all values of the structure to zero will yield the default\n values. Similarly, passing NULL for the options structure will\n give the defaults. The default values are marked below.

\n\n
    \n
  • flags is a combination of the git_diff_option_t values above
  • \n
  • context_lines is the number of unchanged lines that define the\nboundary of a hunk (and to display before and after)
  • \n
  • interhunk_lines is the maximum number of unchanged lines between\nhunk boundaries before the hunks will be merged into a one.
  • \n
  • old_prefix is the virtual "directory" to prefix to old file names\nin hunk headers (default "a")
  • \n
  • new_prefix is the virtual "directory" to prefix to new file names\nin hunk headers (default "b")
  • \n
  • pathspec is an array of paths / fnmatch patterns to constrain diff
  • \n
  • max_size is a file size (in bytes) above which a blob will be marked\nas binary automatically; pass a negative value to disable.
  • \n
  • notify_cb is an optional callback function, notifying the consumer of\nwhich files are being examined as the diff is generated
  • \n
  • notify_payload is the payload data to pass to the notify_cb function
  • \n
  • ignore_submodules overrides the submodule ignore setting for all\nsubmodules in the diff.
  • \n
\n","fields":[{"type":"unsigned int","name":"version","comments":" version for the struct "},{"type":"uint32_t","name":"flags","comments":" defaults to GIT_DIFF_NORMAL "},{"type":"git_submodule_ignore_t","name":"ignore_submodules","comments":" submodule ignore rule "},{"type":"git_strarray","name":"pathspec","comments":" defaults to include all paths "},{"type":"git_diff_notify_cb","name":"notify_cb","comments":""},{"type":"void *","name":"notify_payload","comments":""},{"type":"uint32_t","name":"context_lines","comments":" defaults to 3 "},{"type":"uint32_t","name":"interhunk_lines","comments":" defaults to 0 "},{"type":"uint16_t","name":"id_abbrev","comments":" default 'core.abbrev' or 7 if unset "},{"type":"git_off_t","name":"max_size","comments":" defaults to 512MB "},{"type":"const char *","name":"old_prefix","comments":" defaults to \"a\" "},{"type":"const char *","name":"new_prefix","comments":" defaults to \"b\" "}],"used":{"returns":[],"needs":["git_diff_blob_to_buffer","git_diff_blobs","git_diff_buffers","git_diff_commit_as_email","git_diff_index_to_workdir","git_diff_init_options","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_patch_from_blob_and_buffer","git_patch_from_blobs","git_patch_from_buffers"]}}],["git_diff_perfdata",{"decl":["unsigned int version","size_t stat_calls","size_t oid_calculations"],"type":"struct","value":"git_diff_perfdata","file":"sys/diff.h","line":67,"lineto":71,"block":"unsigned int version\nsize_t stat_calls\nsize_t oid_calculations","tdef":"typedef","description":" Performance data from diffing","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"size_t","name":"stat_calls","comments":""},{"type":"size_t","name":"oid_calculations","comments":""}],"used":{"returns":[],"needs":["git_diff_get_perfdata","git_status_list_get_perfdata"]}}],["git_diff_similarity_metric",{"decl":["int (*)(void **, const git_diff_file *, const char *, void *) file_signature","int (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature","void (*)(void *, void *) free_signature","int (*)(int *, void *, void *, void *) similarity","void * payload"],"type":"struct","value":"git_diff_similarity_metric","file":"diff.h","line":572,"lineto":582,"block":"int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload","tdef":"typedef","description":" Pluggable similarity metric","comments":"","fields":[{"type":"int (*)(void **, const git_diff_file *, const char *, void *)","name":"file_signature","comments":""},{"type":"int (*)(void **, const git_diff_file *, const char *, size_t, void *)","name":"buffer_signature","comments":""},{"type":"void (*)(void *, void *)","name":"free_signature","comments":""},{"type":"int (*)(int *, void *, void *, void *)","name":"similarity","comments":""},{"type":"void *","name":"payload","comments":""}],"used":{"returns":[],"needs":[]}}],["git_diff_stats",{"decl":"git_diff_stats","type":"struct","value":"git_diff_stats","file":"diff.h","line":1070,"lineto":1070,"tdef":"typedef","description":" This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.","comments":"","used":{"returns":[],"needs":["git_diff_get_stats","git_diff_stats_deletions","git_diff_stats_files_changed","git_diff_stats_free","git_diff_stats_insertions","git_diff_stats_to_buf"]}}],["git_diff_stats_format_t",{"decl":["GIT_DIFF_STATS_NONE","GIT_DIFF_STATS_FULL","GIT_DIFF_STATS_SHORT","GIT_DIFF_STATS_NUMBER","GIT_DIFF_STATS_INCLUDE_SUMMARY"],"type":"enum","file":"diff.h","line":1075,"lineto":1090,"block":"GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY","tdef":"typedef","description":" Formatting options for diff stats","comments":"","fields":[{"type":"int","name":"GIT_DIFF_STATS_NONE","comments":"

No stats

\n","value":0},{"type":"int","name":"GIT_DIFF_STATS_FULL","comments":"

Full statistics, equivalent of --stat

\n","value":1},{"type":"int","name":"GIT_DIFF_STATS_SHORT","comments":"

Short statistics, equivalent of --shortstat

\n","value":2},{"type":"int","name":"GIT_DIFF_STATS_NUMBER","comments":"

Number statistics, equivalent of --numstat

\n","value":4},{"type":"int","name":"GIT_DIFF_STATS_INCLUDE_SUMMARY","comments":"

Extended header information such as creations, renames and mode changes, equivalent of --summary

\n","value":8}],"used":{"returns":[],"needs":["git_diff_stats_to_buf"]}}],["git_direction",{"decl":["GIT_DIRECTION_FETCH","GIT_DIRECTION_PUSH"],"type":"enum","file":"net.h","line":31,"lineto":34,"block":"GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH","tdef":"typedef","description":" Direction of the connection.","comments":"

We need this because we need to know whether we should call\n git-upload-pack or git-receive-pack on the remote end when get_refs\n gets called.

\n","fields":[{"type":"int","name":"GIT_DIRECTION_FETCH","comments":"","value":0},{"type":"int","name":"GIT_DIRECTION_PUSH","comments":"","value":1}],"used":{"returns":[],"needs":["git_remote_connect"]}}],["git_error",{"decl":["char * message","int klass"],"type":"struct","value":"git_error","file":"errors.h","line":59,"lineto":62,"block":"char * message\nint klass","tdef":"typedef","description":" Structure to store extra details of the last error that occurred.","comments":"

This is kept on a per-thread basis if GIT_THREADS was defined when the\n library was build, otherwise one is kept globally for the library

\n","fields":[{"type":"char *","name":"message","comments":""},{"type":"int","name":"klass","comments":""}],"used":{"returns":["giterr_last"],"needs":["giterr_detach"]}}],["git_error_code",{"decl":["GIT_OK","GIT_ERROR","GIT_ENOTFOUND","GIT_EEXISTS","GIT_EAMBIGUOUS","GIT_EBUFS","GIT_EUSER","GIT_EBAREREPO","GIT_EUNBORNBRANCH","GIT_EUNMERGED","GIT_ENONFASTFORWARD","GIT_EINVALIDSPEC","GIT_EMERGECONFLICT","GIT_ELOCKED","GIT_EMODIFIED","GIT_EAUTH","GIT_ECERTIFICATE","GIT_EAPPLIED","GIT_EPEEL","GIT_PASSTHROUGH","GIT_ITEROVER"],"type":"enum","file":"errors.h","line":21,"lineto":51,"block":"GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_EMERGECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_PASSTHROUGH\nGIT_ITEROVER","tdef":"typedef","description":" Generic return codes ","comments":"","fields":[{"type":"int","name":"GIT_OK","comments":"

No error

\n","value":0},{"type":"int","name":"GIT_ERROR","comments":"

Generic error

\n","value":-1},{"type":"int","name":"GIT_ENOTFOUND","comments":"

Requested object could not be found

\n","value":-3},{"type":"int","name":"GIT_EEXISTS","comments":"

Object exists preventing operation

\n","value":-4},{"type":"int","name":"GIT_EAMBIGUOUS","comments":"

More than one object matches

\n","value":-5},{"type":"int","name":"GIT_EBUFS","comments":"

Output buffer too short to hold data

\n","value":-6},{"type":"int","name":"GIT_EUSER","comments":"","value":-7},{"type":"int","name":"GIT_EBAREREPO","comments":"

Operation not allowed on bare repository

\n","value":-8},{"type":"int","name":"GIT_EUNBORNBRANCH","comments":"

HEAD refers to branch with no commits

\n","value":-9},{"type":"int","name":"GIT_EUNMERGED","comments":"

Merge in progress prevented operation

\n","value":-10},{"type":"int","name":"GIT_ENONFASTFORWARD","comments":"

Reference was not fast-forwardable

\n","value":-11},{"type":"int","name":"GIT_EINVALIDSPEC","comments":"

Name/ref spec was not in a valid format

\n","value":-12},{"type":"int","name":"GIT_EMERGECONFLICT","comments":"

Merge conflicts prevented operation

\n","value":-13},{"type":"int","name":"GIT_ELOCKED","comments":"

Lock file prevented operation

\n","value":-14},{"type":"int","name":"GIT_EMODIFIED","comments":"

Reference value does not match expected

\n","value":-15},{"type":"int","name":"GIT_EAUTH","comments":"

Authentication error

\n","value":-16},{"type":"int","name":"GIT_ECERTIFICATE","comments":"

Server certificate is invalid

\n","value":-17},{"type":"int","name":"GIT_EAPPLIED","comments":"

Patch/merge has already been applied

\n","value":-18},{"type":"int","name":"GIT_EPEEL","comments":"

The requested peel operation is not possible

\n","value":-19},{"type":"int","name":"GIT_PASSTHROUGH","comments":"

Internal only

\n","value":-30},{"type":"int","name":"GIT_ITEROVER","comments":"

Signals end of iteration with iterator

\n","value":-31}],"used":{"returns":[],"needs":[]}}],["git_error_t",{"decl":["GITERR_NONE","GITERR_NOMEMORY","GITERR_OS","GITERR_INVALID","GITERR_REFERENCE","GITERR_ZLIB","GITERR_REPOSITORY","GITERR_CONFIG","GITERR_REGEX","GITERR_ODB","GITERR_INDEX","GITERR_OBJECT","GITERR_NET","GITERR_TAG","GITERR_TREE","GITERR_INDEXER","GITERR_SSL","GITERR_SUBMODULE","GITERR_THREAD","GITERR_STASH","GITERR_CHECKOUT","GITERR_FETCHHEAD","GITERR_MERGE","GITERR_SSH","GITERR_FILTER","GITERR_REVERT","GITERR_CALLBACK","GITERR_CHERRYPICK","GITERR_DESCRIBE","GITERR_REBASE"],"type":"enum","file":"errors.h","line":65,"lineto":96,"block":"GITERR_NONE\nGITERR_NOMEMORY\nGITERR_OS\nGITERR_INVALID\nGITERR_REFERENCE\nGITERR_ZLIB\nGITERR_REPOSITORY\nGITERR_CONFIG\nGITERR_REGEX\nGITERR_ODB\nGITERR_INDEX\nGITERR_OBJECT\nGITERR_NET\nGITERR_TAG\nGITERR_TREE\nGITERR_INDEXER\nGITERR_SSL\nGITERR_SUBMODULE\nGITERR_THREAD\nGITERR_STASH\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE","tdef":"typedef","description":" Error classes ","comments":"","fields":[{"type":"int","name":"GITERR_NONE","comments":"","value":0},{"type":"int","name":"GITERR_NOMEMORY","comments":"","value":1},{"type":"int","name":"GITERR_OS","comments":"","value":2},{"type":"int","name":"GITERR_INVALID","comments":"","value":3},{"type":"int","name":"GITERR_REFERENCE","comments":"","value":4},{"type":"int","name":"GITERR_ZLIB","comments":"","value":5},{"type":"int","name":"GITERR_REPOSITORY","comments":"","value":6},{"type":"int","name":"GITERR_CONFIG","comments":"","value":7},{"type":"int","name":"GITERR_REGEX","comments":"","value":8},{"type":"int","name":"GITERR_ODB","comments":"","value":9},{"type":"int","name":"GITERR_INDEX","comments":"","value":10},{"type":"int","name":"GITERR_OBJECT","comments":"","value":11},{"type":"int","name":"GITERR_NET","comments":"","value":12},{"type":"int","name":"GITERR_TAG","comments":"","value":13},{"type":"int","name":"GITERR_TREE","comments":"","value":14},{"type":"int","name":"GITERR_INDEXER","comments":"","value":15},{"type":"int","name":"GITERR_SSL","comments":"","value":16},{"type":"int","name":"GITERR_SUBMODULE","comments":"","value":17},{"type":"int","name":"GITERR_THREAD","comments":"","value":18},{"type":"int","name":"GITERR_STASH","comments":"","value":19},{"type":"int","name":"GITERR_CHECKOUT","comments":"","value":20},{"type":"int","name":"GITERR_FETCHHEAD","comments":"","value":21},{"type":"int","name":"GITERR_MERGE","comments":"","value":22},{"type":"int","name":"GITERR_SSH","comments":"","value":23},{"type":"int","name":"GITERR_FILTER","comments":"","value":24},{"type":"int","name":"GITERR_REVERT","comments":"","value":25},{"type":"int","name":"GITERR_CALLBACK","comments":"","value":26},{"type":"int","name":"GITERR_CHERRYPICK","comments":"","value":27},{"type":"int","name":"GITERR_DESCRIBE","comments":"","value":28},{"type":"int","name":"GITERR_REBASE","comments":"","value":29}],"used":{"returns":[],"needs":[]}}],["git_feature_t",{"decl":["GIT_FEATURE_THREADS","GIT_FEATURE_HTTPS","GIT_FEATURE_SSH"],"type":"enum","file":"common.h","line":100,"lineto":104,"block":"GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH","tdef":"typedef","description":" Combinations of these values describe the features with which libgit2\n was compiled","comments":"","fields":[{"type":"int","name":"GIT_FEATURE_THREADS","comments":"","value":1},{"type":"int","name":"GIT_FEATURE_HTTPS","comments":"","value":2},{"type":"int","name":"GIT_FEATURE_SSH","comments":"","value":4}],"used":{"returns":[],"needs":[]}}],["git_filemode_t",{"decl":["GIT_FILEMODE_UNREADABLE","GIT_FILEMODE_TREE","GIT_FILEMODE_BLOB","GIT_FILEMODE_BLOB_EXECUTABLE","GIT_FILEMODE_LINK","GIT_FILEMODE_COMMIT"],"type":"enum","file":"types.h","line":205,"lineto":212,"block":"GIT_FILEMODE_UNREADABLE\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT","tdef":"typedef","description":" Valid modes for index and tree entries. ","comments":"","fields":[{"type":"int","name":"GIT_FILEMODE_UNREADABLE","comments":"","value":0},{"type":"int","name":"GIT_FILEMODE_TREE","comments":"","value":16384},{"type":"int","name":"GIT_FILEMODE_BLOB","comments":"","value":33188},{"type":"int","name":"GIT_FILEMODE_BLOB_EXECUTABLE","comments":"","value":33261},{"type":"int","name":"GIT_FILEMODE_LINK","comments":"","value":40960},{"type":"int","name":"GIT_FILEMODE_COMMIT","comments":"","value":57344}],"used":{"returns":[],"needs":["git_treebuilder_insert"]}}],["git_filter",{"decl":["unsigned int version","const char * attributes","git_filter_init_fn initialize","git_filter_shutdown_fn shutdown","git_filter_check_fn check","git_filter_apply_fn apply","git_filter_cleanup_fn cleanup"],"type":"struct","value":"git_filter","file":"sys/filter.h","line":241,"lineto":251,"tdef":null,"description":" Filter structure used to register custom filters.","comments":"

To associate extra data with a filter, allocate extra data and put the\n git_filter struct at the start of your data buffer, then cast the\n self pointer to your larger structure when your callback is invoked.

\n\n

version should be set to GIT_FILTER_VERSION

\n\n

attributes is a whitespace-separated list of attribute names to check\n for this filter (e.g. "eol crlf text"). If the attribute name is bare,\n it will be simply loaded and passed to the check callback. If it has\n a value (i.e. "name=value"), the attribute must match that value for\n the filter to be applied.

\n\n

The initialize, shutdown, check, apply, and cleanup callbacks\n are all documented above with the respective function pointer typedefs.

\n","block":"unsigned int version\nconst char * attributes\ngit_filter_init_fn initialize\ngit_filter_shutdown_fn shutdown\ngit_filter_check_fn check\ngit_filter_apply_fn apply\ngit_filter_cleanup_fn cleanup","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"const char *","name":"attributes","comments":""},{"type":"git_filter_init_fn","name":"initialize","comments":""},{"type":"git_filter_shutdown_fn","name":"shutdown","comments":""},{"type":"git_filter_check_fn","name":"check","comments":""},{"type":"git_filter_apply_fn","name":"apply","comments":""},{"type":"git_filter_cleanup_fn","name":"cleanup","comments":""}],"used":{"returns":["git_filter_lookup"],"needs":["git_filter_list_push","git_filter_register"]}}],["git_filter_list",{"decl":"git_filter_list","type":"struct","value":"git_filter_list","file":"filter.h","line":73,"lineto":73,"tdef":"typedef","description":" List of filters to be applied","comments":"

This represents a list of filters to be applied to a file / blob. You\n can build the list with one call, apply it with another, and dispose it\n with a third. In typical usage, there are not many occasions where a\n git_filter_list is needed directly since the library will generally\n handle conversions for you, but it can be convenient to be able to\n build and apply the list sometimes.

\n","used":{"returns":[],"needs":["git_filter_list_apply_to_blob","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_filter_list_free","git_filter_list_length","git_filter_list_load","git_filter_list_new","git_filter_list_push"]}}],["git_filter_mode_t",{"decl":["GIT_FILTER_TO_WORKTREE","GIT_FILTER_SMUDGE","GIT_FILTER_TO_ODB","GIT_FILTER_CLEAN"],"type":"enum","file":"filter.h","line":31,"lineto":36,"block":"GIT_FILTER_TO_WORKTREE\nGIT_FILTER_SMUDGE\nGIT_FILTER_TO_ODB\nGIT_FILTER_CLEAN","tdef":"typedef","description":" Filters are applied in one of two directions: smudging - which is\n exporting a file from the Git object database to the working directory,\n and cleaning - which is importing a file from the working directory to\n the Git object database. These values control which direction of\n change is being applied.","comments":"","fields":[{"type":"int","name":"GIT_FILTER_TO_WORKTREE","comments":"","value":0},{"type":"int","name":"GIT_FILTER_SMUDGE","comments":"","value":0},{"type":"int","name":"GIT_FILTER_TO_ODB","comments":"","value":1},{"type":"int","name":"GIT_FILTER_CLEAN","comments":"","value":1}],"used":{"returns":[],"needs":["git_filter_list_load","git_filter_list_new"]}}],["git_filter_opt_t",{"decl":["GIT_FILTER_OPT_DEFAULT","GIT_FILTER_OPT_ALLOW_UNSAFE"],"type":"enum","file":"filter.h","line":41,"lineto":44,"block":"GIT_FILTER_OPT_DEFAULT\nGIT_FILTER_OPT_ALLOW_UNSAFE","tdef":"typedef","description":" Filter option flags.","comments":"","fields":[{"type":"int","name":"GIT_FILTER_OPT_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_FILTER_OPT_ALLOW_UNSAFE","comments":"","value":1}],"used":{"returns":[],"needs":[]}}],["git_filter_source",{"decl":"git_filter_source","type":"struct","value":"git_filter_source","file":"sys/filter.h","line":95,"lineto":95,"tdef":"typedef","description":" A filter source represents a file/blob to be processed","comments":"","used":{"returns":[],"needs":["git_filter_source_filemode","git_filter_source_id","git_filter_source_mode","git_filter_source_options","git_filter_source_path","git_filter_source_repo"]}}],["git_hashsig",{"decl":"git_hashsig","type":"struct","value":"git_hashsig","file":"sys/hashsig.h","line":17,"lineto":17,"tdef":"typedef","description":" Similarity signature of line hashes for a buffer","comments":"","used":{"returns":[],"needs":["git_hashsig_compare","git_hashsig_create","git_hashsig_create_fromfile","git_hashsig_free"]}}],["git_hashsig_option_t",{"decl":["GIT_HASHSIG_NORMAL","GIT_HASHSIG_IGNORE_WHITESPACE","GIT_HASHSIG_SMART_WHITESPACE"],"type":"enum","file":"sys/hashsig.h","line":22,"lineto":26,"block":"GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE","tdef":"typedef","description":" Options for hashsig calculation","comments":"","fields":[{"type":"int","name":"GIT_HASHSIG_NORMAL","comments":"","value":0},{"type":"int","name":"GIT_HASHSIG_IGNORE_WHITESPACE","comments":"","value":1},{"type":"int","name":"GIT_HASHSIG_SMART_WHITESPACE","comments":"","value":2}],"used":{"returns":[],"needs":["git_hashsig_create","git_hashsig_create_fromfile"]}}],["git_idxentry_extended_flag_t",{"decl":["GIT_IDXENTRY_INTENT_TO_ADD","GIT_IDXENTRY_SKIP_WORKTREE","GIT_IDXENTRY_EXTENDED2","GIT_IDXENTRY_EXTENDED_FLAGS","GIT_IDXENTRY_UPDATE","GIT_IDXENTRY_REMOVE","GIT_IDXENTRY_UPTODATE","GIT_IDXENTRY_ADDED","GIT_IDXENTRY_HASHED","GIT_IDXENTRY_UNHASHED","GIT_IDXENTRY_WT_REMOVE","GIT_IDXENTRY_CONFLICTED","GIT_IDXENTRY_UNPACKED","GIT_IDXENTRY_NEW_SKIP_WORKTREE"],"type":"enum","file":"index.h","line":110,"lineto":130,"block":"GIT_IDXENTRY_INTENT_TO_ADD\nGIT_IDXENTRY_SKIP_WORKTREE\nGIT_IDXENTRY_EXTENDED2\nGIT_IDXENTRY_EXTENDED_FLAGS\nGIT_IDXENTRY_UPDATE\nGIT_IDXENTRY_REMOVE\nGIT_IDXENTRY_UPTODATE\nGIT_IDXENTRY_ADDED\nGIT_IDXENTRY_HASHED\nGIT_IDXENTRY_UNHASHED\nGIT_IDXENTRY_WT_REMOVE\nGIT_IDXENTRY_CONFLICTED\nGIT_IDXENTRY_UNPACKED\nGIT_IDXENTRY_NEW_SKIP_WORKTREE","tdef":"typedef","description":" Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`","comments":"

In memory, the flags_extended fields are divided into two parts: the\n fields that are read from and written to disk, and other fields that\n in-memory only and used by libgit2. Only the flags in\n GIT_IDXENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the\n git_index_entry flags_extended value that belong on disk. You\n can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry\n flags_extended value that are only used in-memory by libgit2.\n You can use them to interpret the data in the flags_extended.

\n","fields":[{"type":"int","name":"GIT_IDXENTRY_INTENT_TO_ADD","comments":"","value":8192},{"type":"int","name":"GIT_IDXENTRY_SKIP_WORKTREE","comments":"","value":16384},{"type":"int","name":"GIT_IDXENTRY_EXTENDED2","comments":"

Reserved for future extension

\n","value":32768},{"type":"int","name":"GIT_IDXENTRY_EXTENDED_FLAGS","comments":"

Reserved for future extension

\n","value":24576},{"type":"int","name":"GIT_IDXENTRY_UPDATE","comments":"

Reserved for future extension

\n","value":1},{"type":"int","name":"GIT_IDXENTRY_REMOVE","comments":"

Reserved for future extension

\n","value":2},{"type":"int","name":"GIT_IDXENTRY_UPTODATE","comments":"

Reserved for future extension

\n","value":4},{"type":"int","name":"GIT_IDXENTRY_ADDED","comments":"

Reserved for future extension

\n","value":8},{"type":"int","name":"GIT_IDXENTRY_HASHED","comments":"

Reserved for future extension

\n","value":16},{"type":"int","name":"GIT_IDXENTRY_UNHASHED","comments":"

Reserved for future extension

\n","value":32},{"type":"int","name":"GIT_IDXENTRY_WT_REMOVE","comments":"

remove in work directory

\n","value":64},{"type":"int","name":"GIT_IDXENTRY_CONFLICTED","comments":"","value":128},{"type":"int","name":"GIT_IDXENTRY_UNPACKED","comments":"","value":256},{"type":"int","name":"GIT_IDXENTRY_NEW_SKIP_WORKTREE","comments":"","value":512}],"used":{"returns":[],"needs":[]}}],["git_index",{"decl":"git_index","type":"struct","value":"git_index","file":"types.h","line":132,"lineto":132,"tdef":"typedef","description":" Memory representation of an index file. ","comments":"","used":{"returns":[],"needs":["git_checkout_index","git_cherrypick_commit","git_diff_index_to_workdir","git_diff_tree_to_index","git_index_add","git_index_add_all","git_index_add_bypath","git_index_caps","git_index_clear","git_index_conflict_add","git_index_conflict_cleanup","git_index_conflict_get","git_index_conflict_iterator_new","git_index_conflict_remove","git_index_entrycount","git_index_find","git_index_free","git_index_get_byindex","git_index_get_bypath","git_index_has_conflicts","git_index_new","git_index_open","git_index_owner","git_index_path","git_index_read","git_index_read_tree","git_index_remove","git_index_remove_all","git_index_remove_bypath","git_index_remove_directory","git_index_set_caps","git_index_update_all","git_index_write","git_index_write_tree","git_index_write_tree_to","git_merge_commits","git_merge_trees","git_pathspec_match_index","git_repository_index","git_revert_commit"]}}],["git_index_add_option_t",{"decl":["GIT_INDEX_ADD_DEFAULT","GIT_INDEX_ADD_FORCE","GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH","GIT_INDEX_ADD_CHECK_PATHSPEC"],"type":"enum","file":"index.h","line":145,"lineto":150,"block":"GIT_INDEX_ADD_DEFAULT\nGIT_INDEX_ADD_FORCE\nGIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\nGIT_INDEX_ADD_CHECK_PATHSPEC","tdef":"typedef","description":" Flags for APIs that add files matching pathspec ","comments":"","fields":[{"type":"int","name":"GIT_INDEX_ADD_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_INDEX_ADD_FORCE","comments":"","value":1},{"type":"int","name":"GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH","comments":"","value":2},{"type":"int","name":"GIT_INDEX_ADD_CHECK_PATHSPEC","comments":"","value":4}],"used":{"returns":[],"needs":[]}}],["git_index_conflict_iterator",{"decl":"git_index_conflict_iterator","type":"struct","value":"git_index_conflict_iterator","file":"types.h","line":135,"lineto":135,"tdef":"typedef","description":" An iterator for conflicts in the index. ","comments":"","used":{"returns":[],"needs":["git_index_conflict_iterator_free","git_index_conflict_iterator_new","git_index_conflict_next"]}}],["git_index_entry",{"decl":["git_index_time ctime","git_index_time mtime","unsigned int dev","unsigned int ino","unsigned int mode","unsigned int uid","unsigned int gid","git_off_t file_size","git_oid id","unsigned short flags","unsigned short flags_extended","const char * path"],"type":"struct","value":"git_index_entry","file":"index.h","line":48,"lineto":65,"block":"git_index_time ctime\ngit_index_time mtime\nunsigned int dev\nunsigned int ino\nunsigned int mode\nunsigned int uid\nunsigned int gid\ngit_off_t file_size\ngit_oid id\nunsigned short flags\nunsigned short flags_extended\nconst char * path","tdef":"typedef","description":" In-memory representation of a file entry in the index.","comments":"

This is a public structure that represents a file entry in the index.\n The meaning of the fields corresponds to core Git's documentation (in\n "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be\n accessed via the first set of GIT_IDXENTRY_... bitmasks below. These\n flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be\n accessed via the later GIT_IDXENTRY_... bitmasks below. Some of\n these flags are read from and written to disk, but some are set aside\n for in-memory only reference.

\n","fields":[{"type":"git_index_time","name":"ctime","comments":""},{"type":"git_index_time","name":"mtime","comments":""},{"type":"unsigned int","name":"dev","comments":""},{"type":"unsigned int","name":"ino","comments":""},{"type":"unsigned int","name":"mode","comments":""},{"type":"unsigned int","name":"uid","comments":""},{"type":"unsigned int","name":"gid","comments":""},{"type":"git_off_t","name":"file_size","comments":""},{"type":"git_oid","name":"id","comments":""},{"type":"unsigned short","name":"flags","comments":""},{"type":"unsigned short","name":"flags_extended","comments":""},{"type":"const char *","name":"path","comments":""}],"used":{"returns":["git_index_get_byindex","git_index_get_bypath"],"needs":["git_index_add","git_index_conflict_add","git_index_conflict_get","git_index_conflict_next","git_index_entry_stage","git_merge_file_from_index"]}}],["git_index_time",{"decl":["git_time_t seconds","unsigned int nanoseconds"],"type":"struct","value":"git_index_time","file":"index.h","line":26,"lineto":30,"block":"git_time_t seconds\nunsigned int nanoseconds","tdef":"typedef","description":" Time structure used in a git index entry ","comments":"","fields":[{"type":"git_time_t","name":"seconds","comments":""},{"type":"unsigned int","name":"nanoseconds","comments":""}],"used":{"returns":[],"needs":[]}}],["git_indexcap_t",{"decl":["GIT_INDEXCAP_IGNORE_CASE","GIT_INDEXCAP_NO_FILEMODE","GIT_INDEXCAP_NO_SYMLINKS","GIT_INDEXCAP_FROM_OWNER"],"type":"enum","file":"index.h","line":133,"lineto":138,"block":"GIT_INDEXCAP_IGNORE_CASE\nGIT_INDEXCAP_NO_FILEMODE\nGIT_INDEXCAP_NO_SYMLINKS\nGIT_INDEXCAP_FROM_OWNER","tdef":"typedef","description":" Capabilities of system that affect index actions. ","comments":"","fields":[{"type":"int","name":"GIT_INDEXCAP_IGNORE_CASE","comments":"","value":1},{"type":"int","name":"GIT_INDEXCAP_NO_FILEMODE","comments":"","value":2},{"type":"int","name":"GIT_INDEXCAP_NO_SYMLINKS","comments":"","value":4},{"type":"int","name":"GIT_INDEXCAP_FROM_OWNER","comments":"","value":-1}],"used":{"returns":[],"needs":[]}}],["git_indxentry_flag_t",{"decl":["GIT_IDXENTRY_EXTENDED","GIT_IDXENTRY_VALID"],"type":"enum","file":"index.h","line":81,"lineto":84,"block":"GIT_IDXENTRY_EXTENDED\nGIT_IDXENTRY_VALID","tdef":"typedef","description":" Flags for index entries","comments":"","fields":[{"type":"int","name":"GIT_IDXENTRY_EXTENDED","comments":"","value":16384},{"type":"int","name":"GIT_IDXENTRY_VALID","comments":"","value":32768}],"used":{"returns":[],"needs":[]}}],["git_libgit2_opt_t",{"decl":["GIT_OPT_GET_MWINDOW_SIZE","GIT_OPT_SET_MWINDOW_SIZE","GIT_OPT_GET_MWINDOW_MAPPED_LIMIT","GIT_OPT_SET_MWINDOW_MAPPED_LIMIT","GIT_OPT_GET_SEARCH_PATH","GIT_OPT_SET_SEARCH_PATH","GIT_OPT_SET_CACHE_OBJECT_LIMIT","GIT_OPT_SET_CACHE_MAX_SIZE","GIT_OPT_ENABLE_CACHING","GIT_OPT_GET_CACHED_MEMORY","GIT_OPT_GET_TEMPLATE_PATH","GIT_OPT_SET_TEMPLATE_PATH","GIT_OPT_SET_SSL_CERT_LOCATIONS"],"type":"enum","file":"common.h","line":132,"lineto":146,"block":"GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS","tdef":"typedef","description":" Global library options","comments":"

These are used to select which global option to set or get and are\n used in git_libgit2_opts().

\n","fields":[{"type":"int","name":"GIT_OPT_GET_MWINDOW_SIZE","comments":"","value":0},{"type":"int","name":"GIT_OPT_SET_MWINDOW_SIZE","comments":"","value":1},{"type":"int","name":"GIT_OPT_GET_MWINDOW_MAPPED_LIMIT","comments":"","value":2},{"type":"int","name":"GIT_OPT_SET_MWINDOW_MAPPED_LIMIT","comments":"","value":3},{"type":"int","name":"GIT_OPT_GET_SEARCH_PATH","comments":"","value":4},{"type":"int","name":"GIT_OPT_SET_SEARCH_PATH","comments":"","value":5},{"type":"int","name":"GIT_OPT_SET_CACHE_OBJECT_LIMIT","comments":"","value":6},{"type":"int","name":"GIT_OPT_SET_CACHE_MAX_SIZE","comments":"","value":7},{"type":"int","name":"GIT_OPT_ENABLE_CACHING","comments":"","value":8},{"type":"int","name":"GIT_OPT_GET_CACHED_MEMORY","comments":"","value":9},{"type":"int","name":"GIT_OPT_GET_TEMPLATE_PATH","comments":"","value":10},{"type":"int","name":"GIT_OPT_SET_TEMPLATE_PATH","comments":"","value":11},{"type":"int","name":"GIT_OPT_SET_SSL_CERT_LOCATIONS","comments":"","value":12}],"used":{"returns":[],"needs":[]}}],["git_merge_analysis_t",{"decl":["GIT_MERGE_ANALYSIS_NONE","GIT_MERGE_ANALYSIS_NORMAL","GIT_MERGE_ANALYSIS_UP_TO_DATE","GIT_MERGE_ANALYSIS_FASTFORWARD","GIT_MERGE_ANALYSIS_UNBORN"],"type":"enum","file":"merge.h","line":254,"lineto":283,"block":"GIT_MERGE_ANALYSIS_NONE\nGIT_MERGE_ANALYSIS_NORMAL\nGIT_MERGE_ANALYSIS_UP_TO_DATE\nGIT_MERGE_ANALYSIS_FASTFORWARD\nGIT_MERGE_ANALYSIS_UNBORN","tdef":"typedef","description":" The results of `git_merge_analysis` indicate the merge opportunities.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_ANALYSIS_NONE","comments":"

No merge is possible. (Unused.)

\n","value":0},{"type":"int","name":"GIT_MERGE_ANALYSIS_NORMAL","comments":"

A "normal" merge; both HEAD and the given merge input have diverged\n from their common ancestor. The divergent commits must be merged.

\n","value":1},{"type":"int","name":"GIT_MERGE_ANALYSIS_UP_TO_DATE","comments":"

All given merge inputs are reachable from HEAD, meaning the\n repository is up-to-date and no merge needs to be performed.

\n","value":2},{"type":"int","name":"GIT_MERGE_ANALYSIS_FASTFORWARD","comments":"

The given merge input is a fast-forward from HEAD and no merge\n needs to be performed. Instead, the client can check out the\n given merge input.

\n","value":4},{"type":"int","name":"GIT_MERGE_ANALYSIS_UNBORN","comments":"

The HEAD of the current repository is "unborn" and does not point to\n a valid commit. No merge can be performed, but the caller may wish\n to simply set HEAD to the target commit(s).

\n","value":8}],"used":{"returns":[],"needs":["git_merge_analysis"]}}],["git_merge_file_favor_t",{"decl":["GIT_MERGE_FILE_FAVOR_NORMAL","GIT_MERGE_FILE_FAVOR_OURS","GIT_MERGE_FILE_FAVOR_THEIRS","GIT_MERGE_FILE_FAVOR_UNION"],"type":"enum","file":"merge.h","line":81,"lineto":111,"block":"GIT_MERGE_FILE_FAVOR_NORMAL\nGIT_MERGE_FILE_FAVOR_OURS\nGIT_MERGE_FILE_FAVOR_THEIRS\nGIT_MERGE_FILE_FAVOR_UNION","tdef":"typedef","description":" Merge file favor options for `git_merge_options` instruct the file-level\n merging functionality how to deal with conflicting regions of the files.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_FILE_FAVOR_NORMAL","comments":"

When a region of a file is changed in both branches, a conflict\n will be recorded in the index so that git_checkout can produce\n a merge file with conflict markers in the working directory.\n This is the default.

\n","value":0},{"type":"int","name":"GIT_MERGE_FILE_FAVOR_OURS","comments":"

When a region of a file is changed in both branches, the file\n created in the index will contain the "ours" side of any conflicting\n region. The index will not record a conflict.

\n","value":1},{"type":"int","name":"GIT_MERGE_FILE_FAVOR_THEIRS","comments":"

When a region of a file is changed in both branches, the file\n created in the index will contain the "theirs" side of any conflicting\n region. The index will not record a conflict.

\n","value":2},{"type":"int","name":"GIT_MERGE_FILE_FAVOR_UNION","comments":"

When a region of a file is changed in both branches, the file\n created in the index will contain each unique line from each side,\n which has the result of combining both files. The index will not\n record a conflict.

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_merge_file_flags_t",{"decl":["GIT_MERGE_FILE_DEFAULT","GIT_MERGE_FILE_STYLE_MERGE","GIT_MERGE_FILE_STYLE_DIFF3","GIT_MERGE_FILE_SIMPLIFY_ALNUM"],"type":"enum","file":"merge.h","line":116,"lineto":128,"block":"GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM","tdef":"typedef","description":" File merging flags","comments":"","fields":[{"type":"int","name":"GIT_MERGE_FILE_DEFAULT","comments":"

Defaults

\n","value":0},{"type":"int","name":"GIT_MERGE_FILE_STYLE_MERGE","comments":"

Create standard conflicted merge files

\n","value":1},{"type":"int","name":"GIT_MERGE_FILE_STYLE_DIFF3","comments":"

Create diff3-style files

\n","value":2},{"type":"int","name":"GIT_MERGE_FILE_SIMPLIFY_ALNUM","comments":"

Condense non-alphanumeric regions for simplified diff file

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_merge_file_input",{"decl":["unsigned int version","const char * ptr","size_t size","const char * path","unsigned int mode"],"type":"struct","value":"git_merge_file_input","file":"merge.h","line":32,"lineto":46,"block":"unsigned int version\nconst char * ptr\nsize_t size\nconst char * path\nunsigned int mode","tdef":"typedef","description":" The file inputs to `git_merge_file`. Callers should populate the\n `git_merge_file_input` structure with descriptions of the files in\n each side of the conflict for use in producing the merge file.","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"const char *","name":"ptr","comments":" Pointer to the contents of the file. "},{"type":"size_t","name":"size","comments":" Size of the contents pointed to in `ptr`. "},{"type":"const char *","name":"path","comments":" File name of the conflicted file, or `NULL` to not merge the path. "},{"type":"unsigned int","name":"mode","comments":" File mode of the conflicted file, or `0` to not merge the mode. "}],"used":{"returns":[],"needs":["git_merge_file","git_merge_file_init_input"]}}],["git_merge_file_options",{"decl":["unsigned int version","const char * ancestor_label","const char * our_label","const char * their_label","git_merge_file_favor_t favor","git_merge_file_flags_t flags"],"type":"struct","value":"git_merge_file_options","file":"merge.h","line":133,"lineto":159,"block":"unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\ngit_merge_file_flags_t flags","tdef":"typedef","description":" Options for merging a file","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"const char *","name":"ancestor_label","comments":" Label for the ancestor file side of the conflict which will be prepended\n to labels in diff3-format merge files."},{"type":"const char *","name":"our_label","comments":" Label for our file side of the conflict which will be prepended\n to labels in merge files."},{"type":"const char *","name":"their_label","comments":" Label for their file side of the conflict which will be prepended\n to labels in merge files."},{"type":"git_merge_file_favor_t","name":"favor","comments":" The file to favor in region conflicts. "},{"type":"git_merge_file_flags_t","name":"flags","comments":" Merge file flags. "}],"used":{"returns":[],"needs":["git_merge_file","git_merge_file_from_index","git_merge_file_init_options"]}}],["git_merge_file_result",{"decl":["unsigned int automergeable","const char * path","unsigned int mode","const char * ptr","size_t len"],"type":"struct","value":"git_merge_file_result","file":"merge.h","line":180,"lineto":201,"block":"unsigned int automergeable\nconst char * path\nunsigned int mode\nconst char * ptr\nsize_t len","tdef":"typedef","description":" Information about file-level merging","comments":"","fields":[{"type":"unsigned int","name":"automergeable","comments":" True if the output was automerged, false if the output contains\n conflict markers."},{"type":"const char *","name":"path","comments":" The path that the resultant merge file should use, or NULL if a\n filename conflict would occur."},{"type":"unsigned int","name":"mode","comments":" The mode that the resultant merge file should use. "},{"type":"const char *","name":"ptr","comments":" The contents of the merge. "},{"type":"size_t","name":"len","comments":" The length of the merge contents. "}],"used":{"returns":[],"needs":["git_merge_file","git_merge_file_from_index","git_merge_file_result_free"]}}],["git_merge_options",{"decl":["unsigned int version","git_merge_tree_flag_t flags","unsigned int rename_threshold","unsigned int target_limit","git_diff_similarity_metric * metric","git_merge_file_favor_t file_favor"],"type":"struct","value":"git_merge_options","file":"merge.h","line":206,"lineto":233,"block":"unsigned int version\ngit_merge_tree_flag_t flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\ngit_merge_file_favor_t file_favor","tdef":"typedef","description":" Merging options","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_merge_tree_flag_t","name":"flags","comments":""},{"type":"unsigned int","name":"rename_threshold","comments":" Similarity to consider a file renamed (default 50). If\n `GIT_MERGE_TREE_FIND_RENAMES` is enabled, added files will be compared\n with deleted files to determine their similarity. Files that are\n more similar than the rename threshold (percentage-wise) will be\n treated as a rename."},{"type":"unsigned int","name":"target_limit","comments":" Maximum similarity sources to examine for renames (default 200).\n If the number of rename candidates (add / delete pairs) is greater\n than this value, inexact rename detection is aborted.\n\n This setting overrides the `merge.renameLimit` configuration value."},{"type":"git_diff_similarity_metric *","name":"metric","comments":" Pluggable similarity metric; pass NULL to use internal metric "},{"type":"git_merge_file_favor_t","name":"file_favor","comments":" Flags for handling conflicting content. "}],"used":{"returns":[],"needs":["git_cherrypick_commit","git_merge","git_merge_commits","git_merge_init_options","git_merge_trees","git_revert_commit"]}}],["git_merge_preference_t",{"decl":["GIT_MERGE_PREFERENCE_NONE","GIT_MERGE_PREFERENCE_NO_FASTFORWARD","GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY"],"type":"enum","file":"merge.h","line":288,"lineto":306,"block":"GIT_MERGE_PREFERENCE_NONE\nGIT_MERGE_PREFERENCE_NO_FASTFORWARD\nGIT_MERGE_PREFERENCE_FASTFORWARD_ONLY","tdef":"typedef","description":" The user's stated preference for merges.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_PREFERENCE_NONE","comments":"

No configuration was found that suggests a preferred behavior for\n merge.

\n","value":0},{"type":"int","name":"GIT_MERGE_PREFERENCE_NO_FASTFORWARD","comments":"

There is a merge.ff=false configuration setting, suggesting that\n the user does not want to allow a fast-forward merge.

\n","value":1},{"type":"int","name":"GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY","comments":"

There is a merge.ff=only configuration setting, suggesting that\n the user only wants fast-forward merges.

\n","value":2}],"used":{"returns":[],"needs":["git_merge_analysis"]}}],["git_merge_result",{"decl":"git_merge_result","type":"struct","value":"git_merge_result","file":"types.h","line":181,"lineto":181,"tdef":"typedef","description":" Merge result ","comments":"","used":{"returns":[],"needs":[]}}],["git_merge_tree_flag_t",{"decl":["GIT_MERGE_TREE_FIND_RENAMES"],"type":"enum","file":"merge.h","line":68,"lineto":75,"block":"GIT_MERGE_TREE_FIND_RENAMES","tdef":"typedef","description":" Flags for `git_merge_tree` options. A combination of these flags can be\n passed in via the `flags` value in the `git_merge_options`.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_TREE_FIND_RENAMES","comments":"

Detect renames that occur between the common ancestor and the "ours"\n side or the common ancestor and the "theirs" side. This will enable\n the ability to merge between a modified and renamed file.

\n","value":1}],"used":{"returns":[],"needs":[]}}],["git_note",{"decl":"git_note","type":"struct","value":"git_note","file":"types.h","line":150,"lineto":150,"tdef":"typedef","description":" Representation of a git note ","comments":"","used":{"returns":[],"needs":["git_note_author","git_note_committer","git_note_free","git_note_id","git_note_message","git_note_read"]}}],["git_note_iterator",{"decl":"git_note_iterator","type":"struct","value":"git_note_iterator","file":"notes.h","line":35,"lineto":35,"tdef":"typedef","description":" note iterator","comments":"","used":{"returns":[],"needs":["git_note_iterator_free","git_note_iterator_new","git_note_next"]}}],["git_object",{"decl":"git_object","type":"struct","value":"git_object","file":"types.h","line":108,"lineto":108,"tdef":"typedef","description":" Representation of a generic object in a repository ","comments":"","used":{"returns":[],"needs":["git_checkout_tree","git_describe_commit","git_object_dup","git_object_free","git_object_id","git_object_lookup","git_object_lookup_bypath","git_object_lookup_prefix","git_object_owner","git_object_peel","git_object_short_id","git_object_type","git_reference_peel","git_reset_default","git_revparse_ext","git_revparse_single","git_tag_annotation_create","git_tag_create","git_tag_create_lightweight","git_tag_peel","git_tag_target","git_tree_entry_to_object"]}}],["git_odb",{"decl":"git_odb","type":"struct","value":"git_odb","file":"types.h","line":81,"lineto":81,"tdef":"typedef","description":" An open object database handle. ","comments":"","used":{"returns":[],"needs":["git_indexer_new","git_odb_add_alternate","git_odb_add_backend","git_odb_add_disk_alternate","git_odb_exists","git_odb_exists_prefix","git_odb_foreach","git_odb_free","git_odb_get_backend","git_odb_new","git_odb_num_backends","git_odb_open","git_odb_open_rstream","git_odb_open_wstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_refresh","git_odb_write","git_odb_write_pack","git_repository_odb","git_repository_wrap_odb"]}}],["git_odb_backend",{"decl":"git_odb_backend","type":"struct","value":"git_odb_backend","file":"types.h","line":84,"lineto":84,"block":"unsigned int version\ngit_odb * odb\nint (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t) read_prefix\nint (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, size_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, size_t) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nvoid (*)(git_odb_backend *) free","tdef":"typedef","description":" A custom backend in an ODB ","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_odb *","name":"odb","comments":""},{"type":"int (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *)","name":"read","comments":""},{"type":"int (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t)","name":"read_prefix","comments":""},{"type":"int (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *)","name":"read_header","comments":""},{"type":"int (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype)","name":"write","comments":" Write an object into the backend. The id of the object has\n already been calculated and is passed in."},{"type":"int (*)(git_odb_stream **, git_odb_backend *, size_t, git_otype)","name":"writestream","comments":""},{"type":"int (*)(git_odb_stream **, git_odb_backend *, const git_oid *)","name":"readstream","comments":""},{"type":"int (*)(git_odb_backend *, const git_oid *)","name":"exists","comments":""},{"type":"int (*)(git_oid *, git_odb_backend *, const git_oid *, size_t)","name":"exists_prefix","comments":""},{"type":"int (*)(git_odb_backend *)","name":"refresh","comments":" If the backend implements a refreshing mechanism, it should be exposed\n through this endpoint. Each call to `git_odb_refresh()` will invoke it.\n\n However, the backend implementation should try to stay up-to-date as much\n as possible by itself as libgit2 will not automatically invoke\n `git_odb_refresh()`. For instance, a potential strategy for the backend\n implementation to achieve this could be to internally invoke this\n endpoint on failed lookups (ie. `exists()`, `read()`, `read_header()`)."},{"type":"int (*)(git_odb_backend *, git_odb_foreach_cb, void *)","name":"foreach","comments":""},{"type":"int (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *)","name":"writepack","comments":""},{"type":"void (*)(git_odb_backend *)","name":"free","comments":""}],"used":{"returns":[],"needs":["git_mempack_new","git_mempack_reset","git_odb_add_alternate","git_odb_add_backend","git_odb_backend_loose","git_odb_backend_one_pack","git_odb_backend_pack","git_odb_get_backend","git_odb_init_backend"]}}],["git_odb_object",{"decl":"git_odb_object","type":"struct","value":"git_odb_object","file":"types.h","line":87,"lineto":87,"tdef":"typedef","description":" An object read from the ODB ","comments":"","used":{"returns":[],"needs":["git_odb_object_data","git_odb_object_dup","git_odb_object_free","git_odb_object_id","git_odb_object_size","git_odb_object_type","git_odb_read","git_odb_read_prefix"]}}],["git_odb_stream",{"decl":"git_odb_stream","type":"struct","value":"git_odb_stream","file":"types.h","line":90,"lineto":90,"block":"git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\nsize_t declared_size\nsize_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const int *) finalize_write\nvoid (*)(git_odb_stream *) free","tdef":"typedef","description":" A stream to read/write from the ODB ","comments":"","fields":[{"type":"git_odb_backend *","name":"backend","comments":""},{"type":"unsigned int","name":"mode","comments":""},{"type":"void *","name":"hash_ctx","comments":""},{"type":"size_t","name":"declared_size","comments":""},{"type":"size_t","name":"received_bytes","comments":""},{"type":"int (*)(git_odb_stream *, char *, size_t)","name":"read","comments":" Write at most `len` bytes into `buffer` and advance the stream."},{"type":"int (*)(git_odb_stream *, const char *, size_t)","name":"write","comments":" Write `len` bytes from `buffer` into the stream."},{"type":"int (*)(git_odb_stream *, const int *)","name":"finalize_write","comments":" Store the contents of the stream as an object with the id\n specified in `oid`.\n\n This method might not be invoked if:\n - an error occurs earlier with the `write` callback,\n - the object referred to by `oid` already exists in any backend, or\n - the final number of received bytes differs from the size declared\n with `git_odb_open_wstream()`"},{"type":"void (*)(git_odb_stream *)","name":"free","comments":" Free the stream's memory.\n\n This method might be called without a call to `finalize_write` if\n an error occurs or if the object is already present in the ODB."}],"used":{"returns":[],"needs":["git_odb_open_rstream","git_odb_open_wstream","git_odb_stream_finalize_write","git_odb_stream_free","git_odb_stream_read","git_odb_stream_write"]}}],["git_odb_stream_t",{"decl":["GIT_STREAM_RDONLY","GIT_STREAM_WRONLY","GIT_STREAM_RW"],"type":"enum","file":"odb_backend.h","line":70,"lineto":74,"block":"GIT_STREAM_RDONLY\nGIT_STREAM_WRONLY\nGIT_STREAM_RW","tdef":"typedef","description":" Streaming mode ","comments":"","fields":[{"type":"int","name":"GIT_STREAM_RDONLY","comments":"","value":2},{"type":"int","name":"GIT_STREAM_WRONLY","comments":"","value":4},{"type":"int","name":"GIT_STREAM_RW","comments":"","value":6}],"used":{"returns":[],"needs":[]}}],["git_odb_writepack",{"decl":"git_odb_writepack","type":"struct","value":"git_odb_writepack","file":"types.h","line":93,"lineto":93,"block":"git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *) append\nint (*)(git_odb_writepack *, git_transfer_progress *) commit\nvoid (*)(git_odb_writepack *) free","tdef":"typedef","description":" A stream to write a packfile to the ODB ","comments":"","fields":[{"type":"git_odb_backend *","name":"backend","comments":""},{"type":"int (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *)","name":"append","comments":""},{"type":"int (*)(git_odb_writepack *, git_transfer_progress *)","name":"commit","comments":""},{"type":"void (*)(git_odb_writepack *)","name":"free","comments":""}],"used":{"returns":[],"needs":["git_odb_write_pack"]}}],["git_oid",{"decl":["unsigned char [20] id"],"type":"struct","value":"git_oid","file":"oid.h","line":33,"lineto":36,"block":"unsigned char [20] id","tdef":"typedef","description":" Unique identity of any object (commit, tree, blob, tag). ","comments":"","fields":[{"type":"unsigned char [20]","name":"id","comments":" raw binary formatted id "}],"used":{"returns":["git_annotated_commit_id","git_blob_id","git_commit_id","git_commit_parent_id","git_commit_tree_id","git_filter_source_id","git_indexer_hash","git_note_id","git_object_id","git_odb_object_id","git_packbuilder_hash","git_reference_target","git_reference_target_peel","git_reflog_entry_id_new","git_reflog_entry_id_old","git_submodule_head_id","git_submodule_index_id","git_submodule_wd_id","git_tag_id","git_tag_target_id","git_tree_entry_id","git_tree_id"],"needs":["git_annotated_commit_from_fetchhead","git_annotated_commit_lookup","git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromworkdir","git_blob_lookup","git_blob_lookup_prefix","git_commit_amend","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_commit_lookup","git_commit_lookup_prefix","git_graph_ahead_behind","git_graph_descendant_of","git_index_write_tree","git_index_write_tree_to","git_merge_base","git_merge_base_many","git_merge_base_octopus","git_merge_bases","git_merge_bases_many","git_note_create","git_note_next","git_note_read","git_note_remove","git_object_lookup","git_object_lookup_prefix","git_odb_exists","git_odb_exists_prefix","git_odb_hash","git_odb_hashfile","git_odb_open_rstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_stream_finalize_write","git_odb_write","git_oid_cmp","git_oid_cpy","git_oid_equal","git_oid_fmt","git_oid_fromraw","git_oid_fromstr","git_oid_fromstrn","git_oid_fromstrp","git_oid_iszero","git_oid_ncmp","git_oid_nfmt","git_oid_pathfmt","git_oid_strcmp","git_oid_streq","git_oid_tostr","git_oid_tostr_s","git_packbuilder_insert","git_packbuilder_insert_commit","git_packbuilder_insert_tree","git_rebase_commit","git_reference__alloc","git_reference_create","git_reference_create_matching","git_reference_name_to_id","git_reference_set_target","git_reflog_append","git_repository_hashfile","git_repository_set_head_detached","git_revwalk_hide","git_revwalk_next","git_revwalk_push","git_tag_annotation_create","git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_lookup","git_tag_lookup_prefix","git_tree_entry_byid","git_tree_lookup","git_tree_lookup_prefix","git_treebuilder_insert","git_treebuilder_write"]}}],["git_oid_shorten",{"decl":"git_oid_shorten","type":"struct","value":"git_oid_shorten","file":"oid.h","line":216,"lineto":216,"tdef":"typedef","description":" OID Shortener object","comments":"","used":{"returns":["git_oid_shorten_new"],"needs":["git_oid_shorten_add","git_oid_shorten_free"]}}],["git_oidarray",{"decl":["git_oid * ids","size_t count"],"type":"struct","value":"git_oidarray","file":"oidarray.h","line":16,"lineto":19,"block":"git_oid * ids\nsize_t count","tdef":"typedef","description":" Array of object ids ","comments":"","fields":[{"type":"git_oid *","name":"ids","comments":""},{"type":"size_t","name":"count","comments":""}],"used":{"returns":[],"needs":["git_merge_bases","git_merge_bases_many","git_oidarray_free"]}}],["git_otype",{"decl":["GIT_OBJ_ANY","GIT_OBJ_BAD","GIT_OBJ__EXT1","GIT_OBJ_COMMIT","GIT_OBJ_TREE","GIT_OBJ_BLOB","GIT_OBJ_TAG","GIT_OBJ__EXT2","GIT_OBJ_OFS_DELTA","GIT_OBJ_REF_DELTA"],"type":"enum","file":"types.h","line":67,"lineto":78,"block":"GIT_OBJ_ANY\nGIT_OBJ_BAD\nGIT_OBJ__EXT1\nGIT_OBJ_COMMIT\nGIT_OBJ_TREE\nGIT_OBJ_BLOB\nGIT_OBJ_TAG\nGIT_OBJ__EXT2\nGIT_OBJ_OFS_DELTA\nGIT_OBJ_REF_DELTA","tdef":"typedef","description":" Basic type (loose or packed) of any Git object. ","comments":"","fields":[{"type":"int","name":"GIT_OBJ_ANY","comments":"

Object can be any of the following

\n","value":-2},{"type":"int","name":"GIT_OBJ_BAD","comments":"

Object is invalid.

\n","value":-1},{"type":"int","name":"GIT_OBJ__EXT1","comments":"

Reserved for future use.

\n","value":0},{"type":"int","name":"GIT_OBJ_COMMIT","comments":"

A commit object.

\n","value":1},{"type":"int","name":"GIT_OBJ_TREE","comments":"

A tree (directory listing) object.

\n","value":2},{"type":"int","name":"GIT_OBJ_BLOB","comments":"

A file revision object.

\n","value":3},{"type":"int","name":"GIT_OBJ_TAG","comments":"

An annotated tag object.

\n","value":4},{"type":"int","name":"GIT_OBJ__EXT2","comments":"

Reserved for future use.

\n","value":5},{"type":"int","name":"GIT_OBJ_OFS_DELTA","comments":"

A delta, base is given by an offset.

\n","value":6},{"type":"int","name":"GIT_OBJ_REF_DELTA","comments":"

A delta, base is given by object id.

\n","value":7}],"used":{"returns":[],"needs":["git_object__size","git_object_lookup","git_object_lookup_bypath","git_object_lookup_prefix","git_object_peel","git_object_type2string","git_object_typeisloose","git_odb_hash","git_odb_hashfile","git_odb_open_wstream","git_odb_read_header","git_odb_write","git_reference_peel","git_repository_hashfile"]}}],["git_packbuilder",{"decl":"git_packbuilder","type":"struct","value":"git_packbuilder","file":"types.h","line":153,"lineto":153,"tdef":"typedef","description":" Representation of a git packbuilder ","comments":"","used":{"returns":[],"needs":["git_packbuilder_foreach","git_packbuilder_free","git_packbuilder_hash","git_packbuilder_insert","git_packbuilder_insert_commit","git_packbuilder_insert_tree","git_packbuilder_new","git_packbuilder_object_count","git_packbuilder_set_callbacks","git_packbuilder_set_threads","git_packbuilder_write","git_packbuilder_written"]}}],["git_packbuilder_stage_t",{"decl":["GIT_PACKBUILDER_ADDING_OBJECTS","GIT_PACKBUILDER_DELTAFICATION"],"type":"enum","file":"pack.h","line":51,"lineto":54,"block":"GIT_PACKBUILDER_ADDING_OBJECTS\nGIT_PACKBUILDER_DELTAFICATION","tdef":"typedef","description":" Stages that are reported by the packbuilder progress callback.","comments":"","fields":[{"type":"int","name":"GIT_PACKBUILDER_ADDING_OBJECTS","comments":"","value":0},{"type":"int","name":"GIT_PACKBUILDER_DELTAFICATION","comments":"","value":1}],"used":{"returns":[],"needs":[]}}],["git_patch",{"decl":"git_patch","type":"struct","value":"git_patch","file":"patch.h","line":29,"lineto":29,"tdef":"typedef","description":" The diff patch is used to store all the text diffs for a delta.","comments":"

You can easily loop over the content of patches and get information about\n them.

\n","used":{"returns":[],"needs":["git_patch_free","git_patch_from_blob_and_buffer","git_patch_from_blobs","git_patch_from_buffers","git_patch_from_diff","git_patch_get_delta","git_patch_get_hunk","git_patch_get_line_in_hunk","git_patch_line_stats","git_patch_num_hunks","git_patch_num_lines_in_hunk","git_patch_print","git_patch_size","git_patch_to_buf"]}}],["git_pathspec",{"decl":"git_pathspec","type":"struct","value":"git_pathspec","file":"pathspec.h","line":20,"lineto":20,"tdef":"typedef","description":" Compiled pathspec","comments":"","used":{"returns":[],"needs":["git_pathspec_free","git_pathspec_match_diff","git_pathspec_match_index","git_pathspec_match_tree","git_pathspec_match_workdir","git_pathspec_matches_path","git_pathspec_new"]}}],["git_pathspec_flag_t",{"decl":["GIT_PATHSPEC_DEFAULT","GIT_PATHSPEC_IGNORE_CASE","GIT_PATHSPEC_USE_CASE","GIT_PATHSPEC_NO_GLOB","GIT_PATHSPEC_NO_MATCH_ERROR","GIT_PATHSPEC_FIND_FAILURES","GIT_PATHSPEC_FAILURES_ONLY"],"type":"enum","file":"pathspec.h","line":48,"lineto":56,"block":"GIT_PATHSPEC_DEFAULT\nGIT_PATHSPEC_IGNORE_CASE\nGIT_PATHSPEC_USE_CASE\nGIT_PATHSPEC_NO_GLOB\nGIT_PATHSPEC_NO_MATCH_ERROR\nGIT_PATHSPEC_FIND_FAILURES\nGIT_PATHSPEC_FAILURES_ONLY","tdef":"typedef","description":" Options controlling how pathspec match should be executed","comments":"
    \n
  • GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple\nstring comparison for matching
  • \n
  • GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error\ncode GIT_ENOTFOUND if no matches are found; otherwise no matches is\nstill success (return 0) but git_pathspec_match_list_entrycount\nwill indicate 0 matches.
  • \n
  • GIT_PATHSPEC_FIND_FAILURES means that the git_pathspec_match_list\nshould track which patterns matched which files so that at the end of\nthe match we can identify patterns that did not match any files.
  • \n
  • GIT_PATHSPEC_FAILURES_ONLY means that the git_pathspec_match_list\ndoes not need to keep the actual matching filenames. Use this to\njust test if there were any matches at all or in combination with\nGIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
  • \n
\n","fields":[{"type":"int","name":"GIT_PATHSPEC_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_PATHSPEC_IGNORE_CASE","comments":"","value":1},{"type":"int","name":"GIT_PATHSPEC_USE_CASE","comments":"","value":2},{"type":"int","name":"GIT_PATHSPEC_NO_GLOB","comments":"","value":4},{"type":"int","name":"GIT_PATHSPEC_NO_MATCH_ERROR","comments":"","value":8},{"type":"int","name":"GIT_PATHSPEC_FIND_FAILURES","comments":"","value":16},{"type":"int","name":"GIT_PATHSPEC_FAILURES_ONLY","comments":"","value":32}],"used":{"returns":[],"needs":[]}}],["git_pathspec_match_list",{"decl":"git_pathspec_match_list","type":"struct","value":"git_pathspec_match_list","file":"pathspec.h","line":25,"lineto":25,"tdef":"typedef","description":" List of filenames matching a pathspec","comments":"","used":{"returns":[],"needs":["git_pathspec_match_diff","git_pathspec_match_index","git_pathspec_match_list_diff_entry","git_pathspec_match_list_entry","git_pathspec_match_list_entrycount","git_pathspec_match_list_failed_entry","git_pathspec_match_list_failed_entrycount","git_pathspec_match_list_free","git_pathspec_match_tree","git_pathspec_match_workdir"]}}],["git_push",{"decl":"git_push","type":"struct","value":"git_push","file":"types.h","line":230,"lineto":230,"tdef":"typedef","description":" Preparation for a push operation. Can be used to configure what to\n push and the level of parallelism of the packfile builder.","comments":"","used":{"returns":[],"needs":[]}}],["git_push_options",{"decl":["unsigned int version","unsigned int pb_parallelism"],"type":"struct","value":"git_push_options","file":"push.h","line":25,"lineto":37,"block":"unsigned int version\nunsigned int pb_parallelism","tdef":"typedef","description":" Controls the behavior of a git_push object.","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"pb_parallelism","comments":" If the transport being used to push to the remote requires the creation\n of a pack file, this controls the number of worker threads used by\n the packbuilder when creating that pack file to be sent to the remote.\n\n If set to 0, the packbuilder will auto-detect the number of threads\n to create. The default value is 1."}],"used":{"returns":[],"needs":["git_push_init_options","git_remote_push","git_remote_upload"]}}],["git_rebase",{"decl":"git_rebase","type":"struct","value":"git_rebase","file":"types.h","line":187,"lineto":187,"tdef":"typedef","description":" Representation of a rebase ","comments":"","used":{"returns":[],"needs":["git_rebase_abort","git_rebase_commit","git_rebase_finish","git_rebase_free","git_rebase_init","git_rebase_open","git_rebase_operation_byindex","git_rebase_operation_current","git_rebase_operation_entrycount"]}}],["git_rebase_operation",{"decl":["git_rebase_operation_t type","const git_oid id","const char * exec"],"type":"struct","value":"git_rebase_operation","file":"rebase.h","line":98,"lineto":113,"block":"git_rebase_operation_t type\nconst git_oid id\nconst char * exec","tdef":"typedef","description":" A rebase operation","comments":"

Describes a single instruction/operation to be performed during the\n rebase.

\n","fields":[{"type":"git_rebase_operation_t","name":"type","comments":" The type of rebase operation. "},{"type":"const git_oid","name":"id","comments":" The commit ID being cherry-picked. This will be populated for\n all operations except those of type `GIT_REBASE_OPERATION_EXEC`."},{"type":"const char *","name":"exec","comments":" The executable the user has requested be run. This will only\n be populated for operations of type `GIT_REBASE_OPERATION_EXEC`."}],"used":{"returns":["git_rebase_operation_byindex"],"needs":[]}}],["git_rebase_operation_t",{"decl":["GIT_REBASE_OPERATION_PICK","GIT_REBASE_OPERATION_REWORD","GIT_REBASE_OPERATION_EDIT","GIT_REBASE_OPERATION_SQUASH","GIT_REBASE_OPERATION_FIXUP","GIT_REBASE_OPERATION_EXEC"],"type":"enum","file":"rebase.h","line":51,"lineto":87,"block":"GIT_REBASE_OPERATION_PICK\nGIT_REBASE_OPERATION_REWORD\nGIT_REBASE_OPERATION_EDIT\nGIT_REBASE_OPERATION_SQUASH\nGIT_REBASE_OPERATION_FIXUP\nGIT_REBASE_OPERATION_EXEC","tdef":"typedef","description":" Type of rebase operation in-progress after calling `git_rebase_next`.","comments":"","fields":[{"type":"int","name":"GIT_REBASE_OPERATION_PICK","comments":"

The given commit is to be cherry-picked. The client should commit\n the changes and continue if there are no conflicts.

\n","value":0},{"type":"int","name":"GIT_REBASE_OPERATION_REWORD","comments":"

The given commit is to be cherry-picked, but the client should prompt\n the user to provide an updated commit message.

\n","value":1},{"type":"int","name":"GIT_REBASE_OPERATION_EDIT","comments":"

The given commit is to be cherry-picked, but the client should stop\n to allow the user to edit the changes before committing them.

\n","value":2},{"type":"int","name":"GIT_REBASE_OPERATION_SQUASH","comments":"

The given commit is to be squashed into the previous commit. The\n commit message will be merged with the previous message.

\n","value":3},{"type":"int","name":"GIT_REBASE_OPERATION_FIXUP","comments":"

The given commit is to be squashed into the previous commit. The\n commit message from this commit will be discarded.

\n","value":4},{"type":"int","name":"GIT_REBASE_OPERATION_EXEC","comments":"

No commit will be cherry-picked. The client should run the given\n command and (if successful) continue.

\n","value":5}],"used":{"returns":[],"needs":[]}}],["git_rebase_options",{"decl":["unsigned int version","int quiet","const char * rewrite_notes_ref"],"type":"struct","value":"git_rebase_options","file":"rebase.h","line":29,"lineto":46,"block":"unsigned int version\nint quiet\nconst char * rewrite_notes_ref","tdef":"typedef","description":" Rebase options","comments":"

Use to tell the rebase machinery how to operate.

\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"int","name":"quiet","comments":" Provide a quiet rebase experience; unused by libgit2 but provided for\n interoperability with other clients."},{"type":"const char *","name":"rewrite_notes_ref","comments":" Canonical name of the notes reference used to rewrite notes for\n rebased commits when finishing the rebase; if NULL, the contents of\n the coniguration option `notes.rewriteRef` is examined, unless the\n configuration option `notes.rewrite.rebase` is set to false. If\n `notes.rewriteRef` is NULL, notes will not be rewritten."}],"used":{"returns":[],"needs":["git_rebase_finish","git_rebase_init","git_rebase_init_options"]}}],["git_ref_t",{"decl":["GIT_REF_INVALID","GIT_REF_OID","GIT_REF_SYMBOLIC","GIT_REF_LISTALL"],"type":"enum","file":"types.h","line":190,"lineto":195,"block":"GIT_REF_INVALID\nGIT_REF_OID\nGIT_REF_SYMBOLIC\nGIT_REF_LISTALL","tdef":"typedef","description":" Basic type of any Git reference. ","comments":"","fields":[{"type":"int","name":"GIT_REF_INVALID","comments":"

Invalid reference

\n","value":0},{"type":"int","name":"GIT_REF_OID","comments":"

A reference which points at an object id

\n","value":1},{"type":"int","name":"GIT_REF_SYMBOLIC","comments":"

A reference which points at another reference

\n","value":2},{"type":"int","name":"GIT_REF_LISTALL","comments":"","value":3}],"used":{"returns":[],"needs":[]}}],["git_refdb",{"decl":"git_refdb","type":"struct","value":"git_refdb","file":"types.h","line":96,"lineto":96,"tdef":"typedef","description":" An open refs database handle. ","comments":"","used":{"returns":[],"needs":["git_refdb_compress","git_refdb_free","git_refdb_new","git_refdb_open","git_refdb_set_backend","git_repository_refdb"]}}],["git_refdb_backend",{"decl":"git_refdb_backend","type":"struct","value":"git_refdb_backend","file":"types.h","line":99,"lineto":99,"block":"unsigned int version\nint (*)(int *, git_refdb_backend *, const char *) exists\nint (*)(git_reference **, git_refdb_backend *, const char *) lookup\nint (*)(git_reference_iterator **, struct git_refdb_backend *, const char *) iterator\nint (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *) write\nint (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *) rename\nint (*)(git_refdb_backend *, const char *, const git_oid *, const char *) del\nint (*)(git_refdb_backend *) compress\nint (*)(git_refdb_backend *, const char *) has_log\nint (*)(git_refdb_backend *, const char *) ensure_log\nvoid (*)(git_refdb_backend *) free\nint (*)(git_reflog **, git_refdb_backend *, const char *) reflog_read\nint (*)(git_refdb_backend *, git_reflog *) reflog_write\nint (*)(git_refdb_backend *, const char *, const char *) reflog_rename\nint (*)(git_refdb_backend *, const char *) reflog_delete\nint (*)(void **, git_refdb_backend *, const char *) lock\nint (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *) unlock","tdef":"typedef","description":" A custom backend for refs ","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"int (*)(int *, git_refdb_backend *, const char *)","name":"exists","comments":" Queries the refdb backend to determine if the given ref_name\n exists. A refdb implementation must provide this function."},{"type":"int (*)(git_reference **, git_refdb_backend *, const char *)","name":"lookup","comments":" Queries the refdb backend for a given reference. A refdb\n implementation must provide this function."},{"type":"int (*)(git_reference_iterator **, struct git_refdb_backend *, const char *)","name":"iterator","comments":" Allocate an iterator object for the backend.\n\n A refdb implementation must provide this function."},{"type":"int (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *)","name":"write","comments":""},{"type":"int (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *)","name":"rename","comments":""},{"type":"int (*)(git_refdb_backend *, const char *, const git_oid *, const char *)","name":"del","comments":" Deletes the given reference from the refdb. A refdb implementation\n must provide this function."},{"type":"int (*)(git_refdb_backend *)","name":"compress","comments":" Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. (For on-disk reference\n databases, this may pack all loose references.) A refdb\n implementation may provide this function; if it is not provided,\n nothing will be done."},{"type":"int (*)(git_refdb_backend *, const char *)","name":"has_log","comments":" Query whether a particular reference has a log (may be empty)"},{"type":"int (*)(git_refdb_backend *, const char *)","name":"ensure_log","comments":" Make sure a particular reference will have a reflog which\n will be appended to on writes."},{"type":"void (*)(git_refdb_backend *)","name":"free","comments":" Frees any resources held by the refdb. A refdb implementation may\n provide this function; if it is not provided, nothing will be done."},{"type":"int (*)(git_reflog **, git_refdb_backend *, const char *)","name":"reflog_read","comments":" Read the reflog for the given reference name."},{"type":"int (*)(git_refdb_backend *, git_reflog *)","name":"reflog_write","comments":" Write a reflog to disk."},{"type":"int (*)(git_refdb_backend *, const char *, const char *)","name":"reflog_rename","comments":" Rename a reflog"},{"type":"int (*)(git_refdb_backend *, const char *)","name":"reflog_delete","comments":" Remove a reflog."},{"type":"int (*)(void **, git_refdb_backend *, const char *)","name":"lock","comments":" Lock a reference. The opaque parameter will be passed to the unlock function"},{"type":"int (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *)","name":"unlock","comments":" Unlock a reference. Only one of target or symbolic_target\n will be set. success indicates whether to update the\n reference or discard the lock (if it's false)"}],"used":{"returns":[],"needs":["git_refdb_backend_fs","git_refdb_init_backend","git_refdb_set_backend"]}}],["git_reference",{"decl":"git_reference","type":"struct","value":"git_reference","file":"types.h","line":169,"lineto":169,"tdef":"typedef","description":" In-memory representation of a reference. ","comments":"","used":{"returns":["git_reference__alloc","git_reference__alloc_symbolic"],"needs":["git_annotated_commit_from_ref","git_branch_create","git_branch_delete","git_branch_is_head","git_branch_lookup","git_branch_move","git_branch_name","git_branch_next","git_branch_set_upstream","git_branch_upstream","git_reference_cmp","git_reference_create","git_reference_create_matching","git_reference_delete","git_reference_dwim","git_reference_free","git_reference_is_branch","git_reference_is_note","git_reference_is_remote","git_reference_is_tag","git_reference_lookup","git_reference_name","git_reference_next","git_reference_owner","git_reference_peel","git_reference_rename","git_reference_resolve","git_reference_set_target","git_reference_shorthand","git_reference_symbolic_create","git_reference_symbolic_create_matching","git_reference_symbolic_set_target","git_reference_symbolic_target","git_reference_target","git_reference_target_peel","git_reference_type","git_repository_head","git_revparse_ext"]}}],["git_reference_iterator",{"decl":"git_reference_iterator","type":"struct","value":"git_reference_iterator","file":"types.h","line":172,"lineto":172,"block":"git_refdb * db\nint (*)(git_reference **, git_reference_iterator *) next\nint (*)(const char **, git_reference_iterator *) next_name\nvoid (*)(git_reference_iterator *) free","tdef":"typedef","description":" Iterator for references ","comments":"","fields":[{"type":"git_refdb *","name":"db","comments":""},{"type":"int (*)(git_reference **, git_reference_iterator *)","name":"next","comments":" Return the current reference and advance the iterator."},{"type":"int (*)(const char **, git_reference_iterator *)","name":"next_name","comments":" Return the name of the current reference and advance the iterator"},{"type":"void (*)(git_reference_iterator *)","name":"free","comments":" Free the iterator"}],"used":{"returns":[],"needs":["git_reference_iterator_free","git_reference_iterator_glob_new","git_reference_iterator_new","git_reference_next","git_reference_next_name"]}}],["git_reference_normalize_t",{"decl":["GIT_REF_FORMAT_NORMAL","GIT_REF_FORMAT_ALLOW_ONELEVEL","GIT_REF_FORMAT_REFSPEC_PATTERN","GIT_REF_FORMAT_REFSPEC_SHORTHAND"],"type":"enum","file":"refs.h","line":635,"lineto":664,"block":"GIT_REF_FORMAT_NORMAL\nGIT_REF_FORMAT_ALLOW_ONELEVEL\nGIT_REF_FORMAT_REFSPEC_PATTERN\nGIT_REF_FORMAT_REFSPEC_SHORTHAND","tdef":"typedef","description":" Normalization options for reference lookup","comments":"","fields":[{"type":"int","name":"GIT_REF_FORMAT_NORMAL","comments":"

No particular normalization.

\n","value":0},{"type":"int","name":"GIT_REF_FORMAT_ALLOW_ONELEVEL","comments":"

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n","value":1},{"type":"int","name":"GIT_REF_FORMAT_REFSPEC_PATTERN","comments":"

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n","value":2},{"type":"int","name":"GIT_REF_FORMAT_REFSPEC_SHORTHAND","comments":"

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_reflog",{"decl":"git_reflog","type":"struct","value":"git_reflog","file":"types.h","line":147,"lineto":147,"tdef":"typedef","description":" Representation of a reference log ","comments":"","used":{"returns":[],"needs":["git_reflog_append","git_reflog_drop","git_reflog_entry_byindex","git_reflog_entrycount","git_reflog_free","git_reflog_read","git_reflog_write"]}}],["git_reflog_entry",{"decl":"git_reflog_entry","type":"struct","value":"git_reflog_entry","file":"types.h","line":144,"lineto":144,"tdef":"typedef","description":" Representation of a reference log entry ","comments":"","used":{"returns":["git_reflog_entry_byindex"],"needs":["git_reflog_entry_committer","git_reflog_entry_id_new","git_reflog_entry_id_old","git_reflog_entry_message"]}}],["git_remote",{"decl":"git_remote","type":"struct","value":"git_remote","file":"types.h","line":224,"lineto":224,"tdef":"typedef","description":" Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entires).","comments":"","used":{"returns":[],"needs":["git_remote_add_fetch","git_remote_add_push","git_remote_autotag","git_remote_clear_refspecs","git_remote_connect","git_remote_connected","git_remote_create","git_remote_create_anonymous","git_remote_create_with_fetchspec","git_remote_default_branch","git_remote_disconnect","git_remote_download","git_remote_dup","git_remote_fetch","git_remote_free","git_remote_get_callbacks","git_remote_get_fetch_refspecs","git_remote_get_push_refspecs","git_remote_get_refspec","git_remote_lookup","git_remote_ls","git_remote_name","git_remote_owner","git_remote_prune","git_remote_prune_refs","git_remote_push","git_remote_pushurl","git_remote_refspec_count","git_remote_save","git_remote_set_autotag","git_remote_set_callbacks","git_remote_set_fetch_refspecs","git_remote_set_push_refspecs","git_remote_set_pushurl","git_remote_set_transport","git_remote_set_update_fetchhead","git_remote_set_url","git_remote_stats","git_remote_stop","git_remote_update_fetchhead","git_remote_update_tips","git_remote_upload","git_remote_url","git_transport_dummy","git_transport_local","git_transport_new","git_transport_smart","git_transport_ssh_with_paths"]}}],["git_remote_autotag_option_t",{"decl":["GIT_REMOTE_DOWNLOAD_TAGS_AUTO","GIT_REMOTE_DOWNLOAD_TAGS_NONE","GIT_REMOTE_DOWNLOAD_TAGS_ALL"],"type":"enum","file":"remote.h","line":584,"lineto":588,"block":"GIT_REMOTE_DOWNLOAD_TAGS_AUTO\nGIT_REMOTE_DOWNLOAD_TAGS_NONE\nGIT_REMOTE_DOWNLOAD_TAGS_ALL","tdef":"typedef","description":" Automatic tag following option","comments":"

Lets us select the --tags option to use.

\n","fields":[{"type":"int","name":"GIT_REMOTE_DOWNLOAD_TAGS_AUTO","comments":"","value":0},{"type":"int","name":"GIT_REMOTE_DOWNLOAD_TAGS_NONE","comments":"","value":1},{"type":"int","name":"GIT_REMOTE_DOWNLOAD_TAGS_ALL","comments":"","value":2}],"used":{"returns":[],"needs":["git_remote_set_autotag"]}}],["git_remote_callbacks",{"decl":["unsigned int version","git_transport_message_cb sideband_progress","int (*)(git_remote_completion_type, void *) completion","git_cred_acquire_cb credentials","git_transport_certificate_check_cb certificate_check","git_transfer_progress_cb transfer_progress","int (*)(const char *, const git_oid *, const git_oid *, void *) update_tips","git_packbuilder_progress pack_progress","git_push_transfer_progress push_transfer_progress","int (*)(const char *, const char *, void *) push_update_reference","void * payload"],"type":"struct","value":"git_remote_callbacks","file":"remote.h","line":462,"lineto":534,"block":"unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_type, void *) completion\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_transfer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress push_transfer_progress\nint (*)(const char *, const char *, void *) push_update_reference\nvoid * payload","tdef":null,"description":" The callback settings structure","comments":"

Set the callbacks to be called by the remote when informing the user\n about the progress of the network operations.

\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_transport_message_cb","name":"sideband_progress","comments":" Textual progress from the remote. Text send over the\n progress side-band will be passed to this function (this is\n the 'counting objects' output."},{"type":"int (*)(git_remote_completion_type, void *)","name":"completion","comments":" Completion is called when different parts of the download\n process are done (currently unused)."},{"type":"git_cred_acquire_cb","name":"credentials","comments":" This will be called if the remote host requires\n authentication in order to connect to it.\n\n Returning GIT_PASSTHROUGH will make libgit2 behave as\n though this field isn't set."},{"type":"git_transport_certificate_check_cb","name":"certificate_check","comments":" If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 1 to allow the connection, 0\n to disallow it or a negative value to indicate an error."},{"type":"git_transfer_progress_cb","name":"transfer_progress","comments":" During the download of new data, this will be regularly\n called with the current count of progress done by the\n indexer."},{"type":"int (*)(const char *, const git_oid *, const git_oid *, void *)","name":"update_tips","comments":" Each time a reference is updated locally, this function\n will be called with information about it."},{"type":"git_packbuilder_progress","name":"pack_progress","comments":" Function to call with progress information during pack\n building. Be aware that this is called inline with pack\n building operations, so performance may be affected."},{"type":"git_push_transfer_progress","name":"push_transfer_progress","comments":" Function to call with progress information during the\n upload portion of a push. Be aware that this is called\n inline with pack building operations, so performance may be\n affected."},{"type":"int (*)(const char *, const char *, void *)","name":"push_update_reference","comments":" Called for each updated reference on push. If `status` is\n not `NULL`, the update was rejected by the remote server\n and `status` contains the reason given."},{"type":"void *","name":"payload","comments":" This will be passed to each of the callbacks in this struct\n as the last parameter."}],"used":{"returns":["git_remote_get_callbacks"],"needs":["git_remote_init_callbacks","git_remote_set_callbacks"]}}],["git_remote_completion_type",{"decl":["GIT_REMOTE_COMPLETION_DOWNLOAD","GIT_REMOTE_COMPLETION_INDEXING","GIT_REMOTE_COMPLETION_ERROR"],"type":"enum","file":"remote.h","line":450,"lineto":454,"block":"GIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR\nGIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR","tdef":"typedef","description":" Argument to the completion callback which tells it which operation\n finished.","comments":"","fields":[{"type":"int","name":"GIT_REMOTE_COMPLETION_DOWNLOAD","comments":"","value":0},{"type":"int","name":"GIT_REMOTE_COMPLETION_INDEXING","comments":"","value":1},{"type":"int","name":"GIT_REMOTE_COMPLETION_ERROR","comments":"","value":2}],"used":{"returns":[],"needs":[]}}],["git_remote_head",{"decl":["int local","git_oid oid","git_oid loid","char * name","char * symref_target"],"type":"struct","value":"git_remote_head","file":"net.h","line":40,"lineto":50,"block":"int local\ngit_oid oid\ngit_oid loid\nchar * name\nchar * symref_target","tdef":null,"description":" Description of a reference advertised by a remote server, given out\n on `ls` calls.","comments":"","fields":[{"type":"int","name":"local","comments":""},{"type":"git_oid","name":"oid","comments":""},{"type":"git_oid","name":"loid","comments":""},{"type":"char *","name":"name","comments":""},{"type":"char *","name":"symref_target","comments":" If the server send a symref mapping for this ref, this will\n point to the target."}],"used":{"returns":[],"needs":["git_remote_ls"]}}],["git_repository",{"decl":"git_repository","type":"struct","value":"git_repository","file":"types.h","line":105,"lineto":105,"tdef":"typedef","description":" Representation of an existing git repository,\n including all its object contents","comments":"","used":{"returns":["git_blob_owner","git_commit_owner","git_filter_source_repo","git_index_owner","git_object_owner","git_reference_owner","git_remote_owner","git_revwalk_repository","git_submodule_owner","git_tag_owner","git_tree_owner"],"needs":["git_annotated_commit_from_fetchhead","git_annotated_commit_from_ref","git_annotated_commit_lookup","git_attr_add_macro","git_attr_cache_flush","git_attr_foreach","git_attr_get","git_attr_get_many","git_blame_file","git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromworkdir","git_blob_lookup","git_blob_lookup_prefix","git_branch_create","git_branch_iterator_new","git_branch_lookup","git_checkout_head","git_checkout_index","git_checkout_tree","git_cherrypick","git_cherrypick_commit","git_clone","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_commit_lookup","git_commit_lookup_prefix","git_describe_workdir","git_diff_commit_as_email","git_diff_index_to_workdir","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_filter_list_apply_to_file","git_filter_list_load","git_filter_list_new","git_graph_ahead_behind","git_graph_descendant_of","git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored","git_index_write_tree_to","git_merge","git_merge_analysis","git_merge_base","git_merge_base_many","git_merge_base_octopus","git_merge_bases","git_merge_bases_many","git_merge_commits","git_merge_file_from_index","git_merge_trees","git_note_create","git_note_default_ref","git_note_foreach","git_note_iterator_new","git_note_read","git_note_remove","git_object_lookup","git_object_lookup_prefix","git_packbuilder_new","git_pathspec_match_workdir","git_rebase_init","git_rebase_open","git_refdb_backend_fs","git_refdb_new","git_refdb_open","git_reference_create","git_reference_create_matching","git_reference_dwim","git_reference_ensure_log","git_reference_foreach","git_reference_foreach_glob","git_reference_foreach_name","git_reference_has_log","git_reference_iterator_glob_new","git_reference_iterator_new","git_reference_list","git_reference_lookup","git_reference_name_to_id","git_reference_remove","git_reference_symbolic_create","git_reference_symbolic_create_matching","git_reflog_delete","git_reflog_read","git_reflog_rename","git_remote_create","git_remote_create_anonymous","git_remote_create_with_fetchspec","git_remote_delete","git_remote_list","git_remote_lookup","git_remote_rename","git_repository_config","git_repository_config_snapshot","git_repository_detach_head","git_repository_fetchhead_foreach","git_repository_free","git_repository_get_namespace","git_repository_hashfile","git_repository_head","git_repository_head_detached","git_repository_head_unborn","git_repository_index","git_repository_init","git_repository_init_ext","git_repository_is_bare","git_repository_is_empty","git_repository_is_shallow","git_repository_mergehead_foreach","git_repository_message","git_repository_message_remove","git_repository_odb","git_repository_open","git_repository_open_bare","git_repository_open_ext","git_repository_path","git_repository_refdb","git_repository_set_head","git_repository_set_head_detached","git_repository_set_namespace","git_repository_set_workdir","git_repository_state","git_repository_state_cleanup","git_repository_workdir","git_repository_wrap_odb","git_reset_default","git_revert","git_revert_commit","git_revparse","git_revparse_ext","git_revparse_single","git_revwalk_new","git_signature_default","git_stash_drop","git_stash_foreach","git_status_file","git_status_foreach","git_status_foreach_ext","git_status_list_new","git_status_should_ignore","git_submodule_add_setup","git_submodule_foreach","git_submodule_lookup","git_submodule_open","git_submodule_reload_all","git_submodule_repo_init","git_submodule_resolve_url","git_tag_annotation_create","git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_delete","git_tag_foreach","git_tag_list","git_tag_list_match","git_tag_lookup","git_tag_lookup_prefix","git_tree_entry_to_object","git_tree_lookup","git_tree_lookup_prefix","git_treebuilder_new"]}}],["git_repository_init_flag_t",{"decl":["GIT_REPOSITORY_INIT_BARE","GIT_REPOSITORY_INIT_NO_REINIT","GIT_REPOSITORY_INIT_NO_DOTGIT_DIR","GIT_REPOSITORY_INIT_MKDIR","GIT_REPOSITORY_INIT_MKPATH","GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE","GIT_REPOSITORY_INIT_RELATIVE_GITLINK"],"type":"enum","file":"repository.h","line":202,"lineto":210,"block":"GIT_REPOSITORY_INIT_BARE\nGIT_REPOSITORY_INIT_NO_REINIT\nGIT_REPOSITORY_INIT_NO_DOTGIT_DIR\nGIT_REPOSITORY_INIT_MKDIR\nGIT_REPOSITORY_INIT_MKPATH\nGIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK","tdef":"typedef","description":" Option flags for `git_repository_init_ext`.","comments":"

These flags configure extra behaviors to git_repository_init_ext.\n In every case, the default behavior is the zero value (i.e. flag is\n not set). Just OR the flag values together for the flags parameter\n when initializing a new repo. Details of individual values are:

\n\n
    \n
  • BARE - Create a bare repository with no working directory.
  • \n
  • NO_REINIT - Return an GIT_EEXISTS error if the repo_path appears to\n already be an git repository.
  • \n
  • NO_DOTGIT_DIR - Normally a "/.git/" will be appended to the repo\n path for non-bare repos (if it is not already there), but\n passing this flag prevents that behavior.
  • \n
  • MKDIR - Make the repo_path (and workdir_path) as needed. Init is\n always willing to create the ".git" directory even without this\n flag. This flag tells init to create the trailing component of\n the repo and workdir paths as needed.
  • \n
  • MKPATH - Recursively make all components of the repo and workdir\n paths as necessary.
  • \n
  • EXTERNAL_TEMPLATE - libgit2 normally uses internal templates to\n initialize a new repo. This flags enables external templates,\n looking the "template_path" from the options if set, or the\n init.templatedir global config if not, or falling back on\n "/usr/share/git-core/templates" if it exists.
  • \n
  • GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is\n specified, use relative paths for the gitdir and core.worktree.
  • \n
\n","fields":[{"type":"int","name":"GIT_REPOSITORY_INIT_BARE","comments":"","value":1},{"type":"int","name":"GIT_REPOSITORY_INIT_NO_REINIT","comments":"","value":2},{"type":"int","name":"GIT_REPOSITORY_INIT_NO_DOTGIT_DIR","comments":"","value":4},{"type":"int","name":"GIT_REPOSITORY_INIT_MKDIR","comments":"","value":8},{"type":"int","name":"GIT_REPOSITORY_INIT_MKPATH","comments":"","value":16},{"type":"int","name":"GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE","comments":"","value":32},{"type":"int","name":"GIT_REPOSITORY_INIT_RELATIVE_GITLINK","comments":"","value":64}],"used":{"returns":[],"needs":[]}}],["git_repository_init_mode_t",{"decl":["GIT_REPOSITORY_INIT_SHARED_UMASK","GIT_REPOSITORY_INIT_SHARED_GROUP","GIT_REPOSITORY_INIT_SHARED_ALL"],"type":"enum","file":"repository.h","line":225,"lineto":229,"block":"GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL","tdef":"typedef","description":" Mode options for `git_repository_init_ext`.","comments":"

Set the mode field of the git_repository_init_options structure\n either to the custom mode that you would like, or to one of the\n following modes:

\n\n
    \n
  • SHARED_UMASK - Use permissions configured by umask - the default.
  • \n
  • SHARED_GROUP - Use "--shared=group" behavior, chmod'ing the new repo\n to be group writable and "g+sx" for sticky group assignment.
  • \n
  • SHARED_ALL - Use "--shared=all" behavior, adding world readability.
  • \n
  • Anything else - Set to custom value.
  • \n
\n","fields":[{"type":"int","name":"GIT_REPOSITORY_INIT_SHARED_UMASK","comments":"","value":0},{"type":"int","name":"GIT_REPOSITORY_INIT_SHARED_GROUP","comments":"","value":1533},{"type":"int","name":"GIT_REPOSITORY_INIT_SHARED_ALL","comments":"","value":1535}],"used":{"returns":[],"needs":[]}}],["git_repository_init_options",{"decl":["unsigned int version","uint32_t flags","uint32_t mode","const char * workdir_path","const char * description","const char * template_path","const char * initial_head","const char * origin_url"],"type":"struct","value":"git_repository_init_options","file":"repository.h","line":259,"lineto":268,"block":"unsigned int version\nuint32_t flags\nuint32_t mode\nconst char * workdir_path\nconst char * description\nconst char * template_path\nconst char * initial_head\nconst char * origin_url","tdef":"typedef","description":" Extended options structure for `git_repository_init_ext`.","comments":"

This contains extra options for git_repository_init_ext that enable\n additional initialization features. The fields are:

\n\n
    \n
  • flags - Combination of GIT_REPOSITORY_INIT flags above.
  • \n
  • mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_...\n constants above, or to a custom value that you would like.
  • \n
  • workdir_path - The path to the working dir or NULL for default (i.e.\n repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH,\n IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not\n the "natural" working directory, a .git gitlink file will be\n created here linking to the repo_path.
  • \n
  • description - If set, this will be used to initialize the "description"\n file in the repository, instead of using the template content.
  • \n
  • template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set,\n this contains the path to use for the template directory. If\n this is NULL, the config or default directory options will be\n used instead.
  • \n
  • initial_head - The name of the head to point HEAD at. If NULL, then\n this will be treated as "master" and the HEAD ref will be set\n to "refs/heads/master". If this begins with "refs/" it will be\n used verbatim; otherwise "refs/heads/" will be prefixed.
  • \n
  • origin_url - If this is non-NULL, then after the rest of the\n repository initialization is completed, an "origin" remote\n will be added pointing to this URL.
  • \n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"uint32_t","name":"flags","comments":""},{"type":"uint32_t","name":"mode","comments":""},{"type":"const char *","name":"workdir_path","comments":""},{"type":"const char *","name":"description","comments":""},{"type":"const char *","name":"template_path","comments":""},{"type":"const char *","name":"initial_head","comments":""},{"type":"const char *","name":"origin_url","comments":""}],"used":{"returns":[],"needs":["git_repository_init_ext","git_repository_init_init_options"]}}],["git_repository_open_flag_t",{"decl":["GIT_REPOSITORY_OPEN_NO_SEARCH","GIT_REPOSITORY_OPEN_CROSS_FS","GIT_REPOSITORY_OPEN_BARE"],"type":"enum","file":"repository.h","line":99,"lineto":103,"block":"GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE","tdef":"typedef","description":" Option flags for `git_repository_open_ext`.","comments":"
    \n
  • GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be\nimmediately found in the start_path. Do not walk up from the\nstart_path looking at parent directories.
  • \n
  • GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not\ncontinue searching across filesystem boundaries (i.e. when st_dev\nchanges from the stat system call). (E.g. Searching in a user's home\ndirectory "/home/user/source/" will not return "/.git/" as the found\nrepo if "/" is a different filesystem than "/home".)
  • \n
  • GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless\nof core.bare config, and defer loading config file for faster setup.\nUnlike git_repository_open_bare, this can follow gitlinks.
  • \n
\n","fields":[{"type":"int","name":"GIT_REPOSITORY_OPEN_NO_SEARCH","comments":"","value":1},{"type":"int","name":"GIT_REPOSITORY_OPEN_CROSS_FS","comments":"","value":2},{"type":"int","name":"GIT_REPOSITORY_OPEN_BARE","comments":"","value":4}],"used":{"returns":[],"needs":[]}}],["git_repository_state_t",{"decl":["GIT_REPOSITORY_STATE_NONE","GIT_REPOSITORY_STATE_MERGE","GIT_REPOSITORY_STATE_REVERT","GIT_REPOSITORY_STATE_CHERRYPICK","GIT_REPOSITORY_STATE_BISECT","GIT_REPOSITORY_STATE_REBASE","GIT_REPOSITORY_STATE_REBASE_INTERACTIVE","GIT_REPOSITORY_STATE_REBASE_MERGE","GIT_REPOSITORY_STATE_APPLY_MAILBOX","GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE"],"type":"enum","file":"repository.h","line":670,"lineto":681,"block":"GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE","tdef":"typedef","description":" Repository state","comments":"

These values represent possible states for the repository to be in,\n based on the current operation which is ongoing.

\n","fields":[{"type":"int","name":"GIT_REPOSITORY_STATE_NONE","comments":"","value":0},{"type":"int","name":"GIT_REPOSITORY_STATE_MERGE","comments":"","value":1},{"type":"int","name":"GIT_REPOSITORY_STATE_REVERT","comments":"","value":2},{"type":"int","name":"GIT_REPOSITORY_STATE_CHERRYPICK","comments":"","value":3},{"type":"int","name":"GIT_REPOSITORY_STATE_BISECT","comments":"","value":4},{"type":"int","name":"GIT_REPOSITORY_STATE_REBASE","comments":"","value":5},{"type":"int","name":"GIT_REPOSITORY_STATE_REBASE_INTERACTIVE","comments":"","value":6},{"type":"int","name":"GIT_REPOSITORY_STATE_REBASE_MERGE","comments":"","value":7},{"type":"int","name":"GIT_REPOSITORY_STATE_APPLY_MAILBOX","comments":"","value":8},{"type":"int","name":"GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE","comments":"","value":9}],"used":{"returns":[],"needs":[]}}],["git_reset_t",{"decl":["GIT_RESET_SOFT","GIT_RESET_MIXED","GIT_RESET_HARD"],"type":"enum","file":"reset.h","line":25,"lineto":29,"block":"GIT_RESET_SOFT\nGIT_RESET_MIXED\nGIT_RESET_HARD","tdef":"typedef","description":" Kinds of reset operation","comments":"","fields":[{"type":"int","name":"GIT_RESET_SOFT","comments":"

Move the head to the given commit

\n","value":1},{"type":"int","name":"GIT_RESET_MIXED","comments":"

SOFT plus reset index to the commit

\n","value":2},{"type":"int","name":"GIT_RESET_HARD","comments":"

MIXED plus changes in working tree discarded

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_revert_options",{"decl":["unsigned int version","unsigned int mainline","git_merge_options merge_opts","git_checkout_options checkout_opts"],"type":"struct","value":"git_revert_options","file":"revert.h","line":26,"lineto":34,"block":"unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts","tdef":"typedef","description":" Options for revert","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"mainline","comments":" For merge commits, the \"mainline\" is treated as the parent. "},{"type":"git_merge_options","name":"merge_opts","comments":""},{"type":"git_checkout_options","name":"checkout_opts","comments":""}],"used":{"returns":[],"needs":["git_revert","git_revert_init_options"]}}],["git_revparse_mode_t",{"decl":["GIT_REVPARSE_SINGLE","GIT_REVPARSE_RANGE","GIT_REVPARSE_MERGE_BASE"],"type":"enum","file":"revparse.h","line":71,"lineto":78,"block":"GIT_REVPARSE_SINGLE\nGIT_REVPARSE_RANGE\nGIT_REVPARSE_MERGE_BASE","tdef":"typedef","description":" Revparse flags. These indicate the intended behavior of the spec passed to\n git_revparse.","comments":"","fields":[{"type":"int","name":"GIT_REVPARSE_SINGLE","comments":"

The spec targeted a single object.

\n","value":1},{"type":"int","name":"GIT_REVPARSE_RANGE","comments":"

The spec targeted a range of commits.

\n","value":2},{"type":"int","name":"GIT_REVPARSE_MERGE_BASE","comments":"

The spec used the '...' operator, which invokes special semantics.

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_revspec",{"decl":["git_object * from","git_object * to","unsigned int flags"],"type":"struct","value":"git_revspec","file":"revparse.h","line":83,"lineto":90,"block":"git_object * from\ngit_object * to\nunsigned int flags","tdef":"typedef","description":" Git Revision Spec: output of a `git_revparse` operation","comments":"","fields":[{"type":"git_object *","name":"from","comments":" The left element of the revspec; must be freed by the user "},{"type":"git_object *","name":"to","comments":" The right element of the revspec; must be freed by the user "},{"type":"unsigned int","name":"flags","comments":" The intent of the revspec (i.e. `git_revparse_mode_t` flags) "}],"used":{"returns":[],"needs":["git_revparse"]}}],["git_revwalk",{"decl":"git_revwalk","type":"struct","value":"git_revwalk","file":"types.h","line":111,"lineto":111,"tdef":"typedef","description":" Representation of an in-progress walk through the commits in a repo ","comments":"","used":{"returns":[],"needs":["git_revwalk_add_hide_cb","git_revwalk_free","git_revwalk_hide","git_revwalk_hide_glob","git_revwalk_hide_head","git_revwalk_hide_ref","git_revwalk_new","git_revwalk_next","git_revwalk_push","git_revwalk_push_glob","git_revwalk_push_head","git_revwalk_push_range","git_revwalk_push_ref","git_revwalk_repository","git_revwalk_reset","git_revwalk_simplify_first_parent","git_revwalk_sorting"]}}],["git_signature",{"decl":["char * name","char * email","git_time when"],"type":"struct","value":"git_signature","file":"types.h","line":162,"lineto":166,"block":"char * name\nchar * email\ngit_time when","tdef":"typedef","description":" An action signature (e.g. for committers, taggers, etc) ","comments":"","fields":[{"type":"char *","name":"name","comments":" full name of the author "},{"type":"char *","name":"email","comments":" email of the author "},{"type":"git_time","name":"when","comments":" time when the action happened "}],"used":{"returns":["git_commit_author","git_commit_committer","git_note_author","git_note_committer","git_reflog_entry_committer","git_tag_tagger"],"needs":["git_branch_create","git_branch_move","git_commit_amend","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_note_create","git_note_remove","git_rebase_abort","git_rebase_commit","git_rebase_finish","git_rebase_init","git_reference_create","git_reference_create_matching","git_reference_rename","git_reference_set_target","git_reference_symbolic_create","git_reference_symbolic_create_matching","git_reference_symbolic_set_target","git_reflog_append","git_remote_fetch","git_remote_push","git_remote_update_tips","git_repository_detach_head","git_repository_set_head","git_repository_set_head_detached","git_signature_default","git_signature_dup","git_signature_free","git_signature_new","git_signature_now","git_tag_annotation_create","git_tag_create"]}}],["git_smart_subtransport_definition",{"decl":["git_smart_subtransport_cb callback","unsigned int rpc"],"type":"struct","value":"git_smart_subtransport_definition","file":"sys/transport.h","line":300,"lineto":309,"block":"git_smart_subtransport_cb callback\nunsigned int rpc","tdef":"typedef","description":" Definition for a \"subtransport\"","comments":"

This is used to let the smart protocol code know about the protocol\n which you are implementing.

\n","fields":[{"type":"git_smart_subtransport_cb","name":"callback","comments":" The function to use to create the git_smart_subtransport "},{"type":"unsigned int","name":"rpc","comments":" True if the protocol is stateless; false otherwise. For example,\n http:// is stateless, but git:// is not."}],"used":{"returns":[],"needs":[]}}],["git_sort_t",{"decl":["GIT_SORT_NONE","GIT_SORT_TOPOLOGICAL","GIT_SORT_TIME","GIT_SORT_REVERSE"],"type":"enum","file":"revwalk.h","line":26,"lineto":55,"block":"GIT_SORT_NONE\nGIT_SORT_TOPOLOGICAL\nGIT_SORT_TIME\nGIT_SORT_REVERSE","tdef":"typedef","description":" Flags to specify the sorting which a revwalk should perform.","comments":"","fields":[{"type":"int","name":"GIT_SORT_NONE","comments":"

Sort the repository contents in no particular ordering;\n this sorting is arbitrary, implementation-specific\n and subject to change at any time.\n This is the default sorting for new walkers.

\n","value":0},{"type":"int","name":"GIT_SORT_TOPOLOGICAL","comments":"

Sort the repository contents in topological order\n (parents before children); this sorting mode\n can be combined with time sorting.

\n","value":1},{"type":"int","name":"GIT_SORT_TIME","comments":"

Sort the repository contents by commit time;\n this sorting mode can be combined with\n topological sorting.

\n","value":2},{"type":"int","name":"GIT_SORT_REVERSE","comments":"

Iterate through the repository contents in reverse\n order; this sorting mode can be combined with\n any of the above.

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_stash_flags",{"decl":["GIT_STASH_DEFAULT","GIT_STASH_KEEP_INDEX","GIT_STASH_INCLUDE_UNTRACKED","GIT_STASH_INCLUDE_IGNORED"],"type":"enum","file":"stash.h","line":24,"lineto":47,"block":"GIT_STASH_DEFAULT\nGIT_STASH_KEEP_INDEX\nGIT_STASH_INCLUDE_UNTRACKED\nGIT_STASH_INCLUDE_IGNORED","tdef":"typedef","description":" Stash flags","comments":"","fields":[{"type":"int","name":"GIT_STASH_DEFAULT","comments":"

No option, default

\n","value":0},{"type":"int","name":"GIT_STASH_KEEP_INDEX","comments":"

All changes already added to the index are left intact in\n the working directory

\n","value":1},{"type":"int","name":"GIT_STASH_INCLUDE_UNTRACKED","comments":"

All untracked files are also stashed and then cleaned up\n from the working directory

\n","value":2},{"type":"int","name":"GIT_STASH_INCLUDE_IGNORED","comments":"

All ignored files are also stashed and then cleaned up from\n the working directory

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_status_list",{"decl":"git_status_list","type":"struct","value":"git_status_list","file":"types.h","line":184,"lineto":184,"tdef":"typedef","description":" Representation of a status collection ","comments":"","used":{"returns":[],"needs":["git_status_byindex","git_status_list_entrycount","git_status_list_free","git_status_list_get_perfdata","git_status_list_new"]}}],["git_status_opt_t",{"decl":["GIT_STATUS_OPT_INCLUDE_UNTRACKED","GIT_STATUS_OPT_INCLUDE_IGNORED","GIT_STATUS_OPT_INCLUDE_UNMODIFIED","GIT_STATUS_OPT_EXCLUDE_SUBMODULES","GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS","GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH","GIT_STATUS_OPT_RECURSE_IGNORED_DIRS","GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX","GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR","GIT_STATUS_OPT_SORT_CASE_SENSITIVELY","GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY","GIT_STATUS_OPT_RENAMES_FROM_REWRITES","GIT_STATUS_OPT_NO_REFRESH","GIT_STATUS_OPT_UPDATE_INDEX","GIT_STATUS_OPT_INCLUDE_UNREADABLE","GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED"],"type":"enum","file":"status.h","line":136,"lineto":153,"block":"GIT_STATUS_OPT_INCLUDE_UNTRACKED\nGIT_STATUS_OPT_INCLUDE_IGNORED\nGIT_STATUS_OPT_INCLUDE_UNMODIFIED\nGIT_STATUS_OPT_EXCLUDE_SUBMODULES\nGIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS\nGIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH\nGIT_STATUS_OPT_RECURSE_IGNORED_DIRS\nGIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\nGIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\nGIT_STATUS_OPT_SORT_CASE_SENSITIVELY\nGIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\nGIT_STATUS_OPT_RENAMES_FROM_REWRITES\nGIT_STATUS_OPT_NO_REFRESH\nGIT_STATUS_OPT_UPDATE_INDEX\nGIT_STATUS_OPT_INCLUDE_UNREADABLE\nGIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED","tdef":"typedef","description":" Flags to control status callbacks","comments":"
    \n
  • GIT_STATUS_OPT_INCLUDE_UNTRACKED says that callbacks should be made\non untracked files. These will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_IGNORED says that ignored files get callbacks.\nAgain, these callbacks will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_UNMODIFIED indicates that callback should be\nmade even on unmodified files.
  • \n
  • GIT_STATUS_OPT_EXCLUDE_SUBMODULES indicates that submodules should be\nskipped. This only applies if there are no pending typechanges to\nthe submodule (either from or to another type).
  • \n
  • GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS indicates that all files in\nuntracked directories should be included. Normally if an entire\ndirectory is new, then just the top-level directory is included (with\na trailing slash on the entry name). This flag says to include all\nof the individual files in the directory instead.
  • \n
  • GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH indicates that the given path\nshould be treated as a literal path, and not as a pathspec pattern.
  • \n
  • GIT_STATUS_OPT_RECURSE_IGNORED_DIRS indicates that the contents of\nignored directories should be included in the status. This is like\ndoing git ls-files -o -i --exclude-standard with core git.
  • \n
  • GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX indicates that rename detection\nshould be processed between the head and the index and enables\nthe GIT_STATUS_INDEX_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR indicates that rename\ndetection should be run between the index and the working directory\nand enabled GIT_STATUS_WT_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_SORT_CASE_SENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-sensitive order
  • \n
  • GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-insensitive order
  • \n
  • GIT_STATUS_OPT_RENAMES_FROM_REWRITES indicates that rename detection\nshould include rewritten files
  • \n
  • GIT_STATUS_OPT_NO_REFRESH bypasses the default status behavior of\ndoing a "soft" index reload (i.e. reloading the index data if the\nfile on disk has been modified outside libgit2).
  • \n
  • GIT_STATUS_OPT_UPDATE_INDEX tells libgit2 to refresh the stat cache\nin the index for files that are unchanged but have out of date stat\ninformation in the index. It will result in less work being done on\nsubsequent calls to get status. This is mutually exclusive with the\nNO_REFRESH option.
  • \n
\n\n

Calling git_status_foreach() is like calling the extended version\n with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED,\n and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled\n together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n","fields":[{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNTRACKED","comments":"","value":1},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_IGNORED","comments":"","value":2},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNMODIFIED","comments":"","value":4},{"type":"int","name":"GIT_STATUS_OPT_EXCLUDE_SUBMODULES","comments":"","value":8},{"type":"int","name":"GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS","comments":"","value":16},{"type":"int","name":"GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH","comments":"","value":32},{"type":"int","name":"GIT_STATUS_OPT_RECURSE_IGNORED_DIRS","comments":"","value":64},{"type":"int","name":"GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX","comments":"","value":128},{"type":"int","name":"GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR","comments":"","value":256},{"type":"int","name":"GIT_STATUS_OPT_SORT_CASE_SENSITIVELY","comments":"","value":512},{"type":"int","name":"GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY","comments":"","value":1024},{"type":"int","name":"GIT_STATUS_OPT_RENAMES_FROM_REWRITES","comments":"","value":2048},{"type":"int","name":"GIT_STATUS_OPT_NO_REFRESH","comments":"","value":4096},{"type":"int","name":"GIT_STATUS_OPT_UPDATE_INDEX","comments":"","value":8192},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNREADABLE","comments":"","value":16384},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED","comments":"","value":32768}],"used":{"returns":[],"needs":[]}}],["git_status_show_t",{"decl":["GIT_STATUS_SHOW_INDEX_AND_WORKDIR","GIT_STATUS_SHOW_INDEX_ONLY","GIT_STATUS_SHOW_WORKDIR_ONLY"],"type":"enum","file":"status.h","line":78,"lineto":82,"block":"GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY","tdef":"typedef","description":" Select the files on which to report status.","comments":"

With git_status_foreach_ext, this will control which changes get\n callbacks. With git_status_list_new, these will control which\n changes are included in the list.

\n\n
    \n
  • GIT_STATUS_SHOW_INDEX_AND_WORKDIR is the default. This roughly\nmatches git status --porcelain regarding which files are\nincluded and in what order.
  • \n
  • GIT_STATUS_SHOW_INDEX_ONLY only gives status based on HEAD to index\ncomparison, not looking at working directory changes.
  • \n
  • GIT_STATUS_SHOW_WORKDIR_ONLY only gives status based on index to\nworking directory comparison, not comparing the index to the HEAD.
  • \n
\n","fields":[{"type":"int","name":"GIT_STATUS_SHOW_INDEX_AND_WORKDIR","comments":"","value":0},{"type":"int","name":"GIT_STATUS_SHOW_INDEX_ONLY","comments":"","value":1},{"type":"int","name":"GIT_STATUS_SHOW_WORKDIR_ONLY","comments":"","value":2}],"used":{"returns":[],"needs":[]}}],["git_status_t",{"decl":["GIT_STATUS_CURRENT","GIT_STATUS_INDEX_NEW","GIT_STATUS_INDEX_MODIFIED","GIT_STATUS_INDEX_DELETED","GIT_STATUS_INDEX_RENAMED","GIT_STATUS_INDEX_TYPECHANGE","GIT_STATUS_WT_NEW","GIT_STATUS_WT_MODIFIED","GIT_STATUS_WT_DELETED","GIT_STATUS_WT_TYPECHANGE","GIT_STATUS_WT_RENAMED","GIT_STATUS_WT_UNREADABLE","GIT_STATUS_IGNORED"],"type":"enum","file":"status.h","line":32,"lineto":49,"block":"GIT_STATUS_CURRENT\nGIT_STATUS_INDEX_NEW\nGIT_STATUS_INDEX_MODIFIED\nGIT_STATUS_INDEX_DELETED\nGIT_STATUS_INDEX_RENAMED\nGIT_STATUS_INDEX_TYPECHANGE\nGIT_STATUS_WT_NEW\nGIT_STATUS_WT_MODIFIED\nGIT_STATUS_WT_DELETED\nGIT_STATUS_WT_TYPECHANGE\nGIT_STATUS_WT_RENAMED\nGIT_STATUS_WT_UNREADABLE\nGIT_STATUS_IGNORED","tdef":"typedef","description":" Status flags for a single file.","comments":"

A combination of these values will be returned to indicate the status of\n a file. Status compares the working directory, the index, and the\n current HEAD of the repository. The GIT_STATUS_INDEX set of flags\n represents the status of file in the index relative to the HEAD, and the\n GIT_STATUS_WT set of flags represent the status of the file in the\n working directory relative to the index.

\n","fields":[{"type":"int","name":"GIT_STATUS_CURRENT","comments":"","value":0},{"type":"int","name":"GIT_STATUS_INDEX_NEW","comments":"","value":1},{"type":"int","name":"GIT_STATUS_INDEX_MODIFIED","comments":"","value":2},{"type":"int","name":"GIT_STATUS_INDEX_DELETED","comments":"","value":4},{"type":"int","name":"GIT_STATUS_INDEX_RENAMED","comments":"","value":8},{"type":"int","name":"GIT_STATUS_INDEX_TYPECHANGE","comments":"","value":16},{"type":"int","name":"GIT_STATUS_WT_NEW","comments":"","value":128},{"type":"int","name":"GIT_STATUS_WT_MODIFIED","comments":"","value":256},{"type":"int","name":"GIT_STATUS_WT_DELETED","comments":"","value":512},{"type":"int","name":"GIT_STATUS_WT_TYPECHANGE","comments":"","value":1024},{"type":"int","name":"GIT_STATUS_WT_RENAMED","comments":"","value":2048},{"type":"int","name":"GIT_STATUS_WT_UNREADABLE","comments":"","value":4096},{"type":"int","name":"GIT_STATUS_IGNORED","comments":"","value":16384}],"used":{"returns":[],"needs":[]}}],["git_strarray",{"decl":["char ** strings","size_t count"],"type":"struct","value":"git_strarray","file":"strarray.h","line":22,"lineto":25,"block":"char ** strings\nsize_t count","tdef":"typedef","description":" Array of strings ","comments":"","fields":[{"type":"char **","name":"strings","comments":""},{"type":"size_t","name":"count","comments":""}],"used":{"returns":[],"needs":["git_index_add_all","git_index_remove_all","git_index_update_all","git_pathspec_new","git_reference_list","git_remote_download","git_remote_fetch","git_remote_get_fetch_refspecs","git_remote_get_push_refspecs","git_remote_list","git_remote_push","git_remote_rename","git_remote_set_fetch_refspecs","git_remote_set_push_refspecs","git_remote_upload","git_reset_default","git_strarray_copy","git_strarray_free","git_tag_list","git_tag_list_match"]}}],["git_stream",{"decl":["int version","int encrypted","int (*)(struct git_stream *) connect","int (*)(int **, struct git_stream *) certificate","ssize_t (*)(struct git_stream *, void *, size_t) read","ssize_t (*)(struct git_stream *, const char *, size_t, int) write","int (*)(struct git_stream *) close","void (*)(struct git_stream *) free"],"type":"struct","value":"git_stream","file":"sys/stream.h","line":28,"lineto":38,"block":"int version\nint encrypted\nint (*)(struct git_stream *) connect\nint (*)(int **, struct git_stream *) certificate\nssize_t (*)(struct git_stream *, void *, size_t) read\nssize_t (*)(struct git_stream *, const char *, size_t, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free","tdef":"typedef","description":" Every stream must have this struct as its first element, so the\n API can talk to it. You'd define your stream as","comments":"
 struct my_stream {\n         git_stream parent;\n         ...\n }\n
\n\n

and fill the functions

\n","fields":[{"type":"int","name":"version","comments":""},{"type":"int","name":"encrypted","comments":""},{"type":"int (*)(struct git_stream *)","name":"connect","comments":""},{"type":"int (*)(int **, struct git_stream *)","name":"certificate","comments":""},{"type":"ssize_t (*)(struct git_stream *, void *, size_t)","name":"read","comments":""},{"type":"ssize_t (*)(struct git_stream *, const char *, size_t, int)","name":"write","comments":""},{"type":"int (*)(struct git_stream *)","name":"close","comments":""},{"type":"void (*)(struct git_stream *)","name":"free","comments":""}],"used":{"returns":[],"needs":[]}}],["git_submodule",{"decl":"git_submodule","type":"struct","value":"git_submodule","file":"types.h","line":318,"lineto":318,"tdef":"typedef","description":" Opaque structure representing a submodule.","comments":"","used":{"returns":[],"needs":["git_submodule_add_finalize","git_submodule_add_setup","git_submodule_add_to_index","git_submodule_branch","git_submodule_fetch_recurse_submodules","git_submodule_foreach","git_submodule_free","git_submodule_head_id","git_submodule_ignore","git_submodule_index_id","git_submodule_init","git_submodule_location","git_submodule_lookup","git_submodule_name","git_submodule_open","git_submodule_owner","git_submodule_path","git_submodule_reload","git_submodule_repo_init","git_submodule_save","git_submodule_set_fetch_recurse_submodules","git_submodule_set_ignore","git_submodule_set_update","git_submodule_set_url","git_submodule_status","git_submodule_sync","git_submodule_update","git_submodule_update_strategy","git_submodule_url","git_submodule_wd_id"]}}],["git_submodule_ignore_t",{"decl":["GIT_SUBMODULE_IGNORE_RESET","GIT_SUBMODULE_IGNORE_NONE","GIT_SUBMODULE_IGNORE_UNTRACKED","GIT_SUBMODULE_IGNORE_DIRTY","GIT_SUBMODULE_IGNORE_ALL","GIT_SUBMODULE_IGNORE_DEFAULT"],"type":"enum","file":"types.h","line":385,"lineto":394,"block":"GIT_SUBMODULE_IGNORE_RESET\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL\nGIT_SUBMODULE_IGNORE_DEFAULT","tdef":"typedef","description":" Submodule ignore values","comments":"

These values represent settings for the submodule.$name.ignore\n configuration value which says how deeply to look at the working\n directory when getting submodule status.

\n\n

You can override this value in memory on a per-submodule basis with\n git_submodule_set_ignore() and can write the changed value to disk\n with git_submodule_save(). If you have overwritten the value, you\n can revert to the on disk value by using GIT_SUBMODULE_IGNORE_RESET.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_RESET: reset to the on-disk value.
  • \n
  • GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an\nuntracked file, will mark the submodule as dirty. Ignored files are\nstill ignored, of course.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED: ignore untracked files; only changes\nto tracked files, or the index or the HEAD commit will matter.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY: ignore changes in the working directory,\nonly considering changes if the HEAD of submodule has moved from the\nvalue in the superproject.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL: never check if the submodule is dirty
  • \n
  • GIT_SUBMODULE_IGNORE_DEFAULT: not used except as static initializer\nwhen we don't want any particular ignore rule to be specified.
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_IGNORE_RESET","comments":"

reset to on-disk value

\n","value":-1},{"type":"int","name":"GIT_SUBMODULE_IGNORE_NONE","comments":"

any change or untracked == dirty

\n","value":1},{"type":"int","name":"GIT_SUBMODULE_IGNORE_UNTRACKED","comments":"

dirty if tracked files change

\n","value":2},{"type":"int","name":"GIT_SUBMODULE_IGNORE_DIRTY","comments":"

only dirty if HEAD moved

\n","value":3},{"type":"int","name":"GIT_SUBMODULE_IGNORE_ALL","comments":"

never dirty

\n","value":4},{"type":"int","name":"GIT_SUBMODULE_IGNORE_DEFAULT","comments":"","value":0}],"used":{"returns":[],"needs":["git_submodule_set_ignore"]}}],["git_submodule_recurse_t",{"decl":["GIT_SUBMODULE_RECURSE_RESET","GIT_SUBMODULE_RECURSE_NO","GIT_SUBMODULE_RECURSE_YES","GIT_SUBMODULE_RECURSE_ONDEMAND"],"type":"enum","file":"types.h","line":407,"lineto":413,"block":"GIT_SUBMODULE_RECURSE_RESET\nGIT_SUBMODULE_RECURSE_NO\nGIT_SUBMODULE_RECURSE_YES\nGIT_SUBMODULE_RECURSE_ONDEMAND","tdef":"typedef","description":" Options for submodule recurse.","comments":"

Represent the value of submodule.$name.fetchRecurseSubmodules

\n\n
    \n
  • GIT_SUBMODULE_RECURSE_RESET - reset to the on-disk value
  • \n
  • GIT_SUBMODULE_RECURSE_NO - do no recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_YES - recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_ONDEMAND - recurse into submodules only when\n commit not already in local clone
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_RECURSE_RESET","comments":"","value":-1},{"type":"int","name":"GIT_SUBMODULE_RECURSE_NO","comments":"","value":0},{"type":"int","name":"GIT_SUBMODULE_RECURSE_YES","comments":"","value":1},{"type":"int","name":"GIT_SUBMODULE_RECURSE_ONDEMAND","comments":"","value":2}],"used":{"returns":[],"needs":["git_submodule_set_fetch_recurse_submodules"]}}],["git_submodule_status_t",{"decl":["GIT_SUBMODULE_STATUS_IN_HEAD","GIT_SUBMODULE_STATUS_IN_INDEX","GIT_SUBMODULE_STATUS_IN_CONFIG","GIT_SUBMODULE_STATUS_IN_WD","GIT_SUBMODULE_STATUS_INDEX_ADDED","GIT_SUBMODULE_STATUS_INDEX_DELETED","GIT_SUBMODULE_STATUS_INDEX_MODIFIED","GIT_SUBMODULE_STATUS_WD_UNINITIALIZED","GIT_SUBMODULE_STATUS_WD_ADDED","GIT_SUBMODULE_STATUS_WD_DELETED","GIT_SUBMODULE_STATUS_WD_MODIFIED","GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED","GIT_SUBMODULE_STATUS_WD_WD_MODIFIED","GIT_SUBMODULE_STATUS_WD_UNTRACKED"],"type":"enum","file":"submodule.h","line":74,"lineto":89,"block":"GIT_SUBMODULE_STATUS_IN_HEAD\nGIT_SUBMODULE_STATUS_IN_INDEX\nGIT_SUBMODULE_STATUS_IN_CONFIG\nGIT_SUBMODULE_STATUS_IN_WD\nGIT_SUBMODULE_STATUS_INDEX_ADDED\nGIT_SUBMODULE_STATUS_INDEX_DELETED\nGIT_SUBMODULE_STATUS_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNINITIALIZED\nGIT_SUBMODULE_STATUS_WD_ADDED\nGIT_SUBMODULE_STATUS_WD_DELETED\nGIT_SUBMODULE_STATUS_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNTRACKED","tdef":"typedef","description":" Return codes for submodule status.","comments":"

A combination of these flags will be returned to describe the status of a\n submodule. Depending on the "ignore" property of the submodule, some of\n the flags may never be returned because they indicate changes that are\n supposed to be ignored.

\n\n

Submodule info is contained in 4 places: the HEAD tree, the index, config\n files (both .git/config and .gitmodules), and the working directory. Any\n or all of those places might be missing information about the submodule\n depending on what state the repo is in. We consider all four places to\n build the combination of status flags.

\n\n

There are four values that are not really status, but give basic info\n about what sources of submodule data are available. These will be\n returned even if ignore is set to "ALL".

\n\n
    \n
  • IN_HEAD - superproject head contains submodule
  • \n
  • IN_INDEX - superproject index contains submodule
  • \n
  • IN_CONFIG - superproject gitmodules has submodule
  • \n
  • IN_WD - superproject workdir has submodule
  • \n
\n\n

The following values will be returned so long as ignore is not "ALL".

\n\n
    \n
  • INDEX_ADDED - in index, not in head
  • \n
  • INDEX_DELETED - in head, not in index
  • \n
  • INDEX_MODIFIED - index and head don't match
  • \n
  • WD_UNINITIALIZED - workdir contains empty directory
  • \n
  • WD_ADDED - in workdir, not index
  • \n
  • WD_DELETED - in index, not workdir
  • \n
  • WD_MODIFIED - index and workdir head don't match
  • \n
\n\n

The following can only be returned if ignore is "NONE" or "UNTRACKED".

\n\n
    \n
  • WD_INDEX_MODIFIED - submodule workdir index is dirty
  • \n
  • WD_WD_MODIFIED - submodule workdir has modified files
  • \n
\n\n

Lastly, the following will only be returned for ignore "NONE".

\n\n
    \n
  • WD_UNTRACKED - wd contains untracked files
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_HEAD","comments":"","value":1},{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_INDEX","comments":"","value":2},{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_CONFIG","comments":"","value":4},{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_WD","comments":"","value":8},{"type":"int","name":"GIT_SUBMODULE_STATUS_INDEX_ADDED","comments":"","value":16},{"type":"int","name":"GIT_SUBMODULE_STATUS_INDEX_DELETED","comments":"","value":32},{"type":"int","name":"GIT_SUBMODULE_STATUS_INDEX_MODIFIED","comments":"","value":64},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_UNINITIALIZED","comments":"","value":128},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_ADDED","comments":"","value":256},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_DELETED","comments":"","value":512},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_MODIFIED","comments":"","value":1024},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED","comments":"","value":2048},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_WD_MODIFIED","comments":"","value":4096},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_UNTRACKED","comments":"","value":8192}],"used":{"returns":[],"needs":[]}}],["git_submodule_update_options",{"decl":["unsigned int version","git_checkout_options checkout_opts","git_remote_callbacks remote_callbacks","unsigned int clone_checkout_strategy","git_signature * signature"],"type":"struct","value":"git_submodule_update_options","file":"submodule.h","line":117,"lineto":149,"block":"unsigned int version\ngit_checkout_options checkout_opts\ngit_remote_callbacks remote_callbacks\nunsigned int clone_checkout_strategy\ngit_signature * signature","tdef":"typedef","description":" Submodule update options structure","comments":"

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings, like this:

\n\n
    git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;\n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_checkout_options","name":"checkout_opts","comments":" These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`. Generally you will want the use\n GIT_CHECKOUT_SAFE to update files in the working\n directory. Use the `clone_checkout_strategy` field\n to set the checkout strategy that will be used in\n the case where update needs to clone the repository."},{"type":"git_remote_callbacks","name":"remote_callbacks","comments":" Callbacks to use for reporting fetch progress, and for acquiring\n credentials in the event they are needed."},{"type":"unsigned int","name":"clone_checkout_strategy","comments":" The checkout strategy to use when the sub repository needs to\n be cloned. Use GIT_CHECKOUT_SAFE_CREATE to create all files\n in the working directory for the newly cloned repository."},{"type":"git_signature *","name":"signature","comments":" The identity used when updating the reflog. NULL means to\n use the default signature using the config."}],"used":{"returns":[],"needs":["git_submodule_update"]}}],["git_submodule_update_t",{"decl":["GIT_SUBMODULE_UPDATE_RESET","GIT_SUBMODULE_UPDATE_CHECKOUT","GIT_SUBMODULE_UPDATE_REBASE","GIT_SUBMODULE_UPDATE_MERGE","GIT_SUBMODULE_UPDATE_NONE","GIT_SUBMODULE_UPDATE_DEFAULT"],"type":"enum","file":"types.h","line":347,"lineto":356,"block":"GIT_SUBMODULE_UPDATE_RESET\nGIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE\nGIT_SUBMODULE_UPDATE_DEFAULT","tdef":"typedef","description":" Submodule update values","comments":"

These values represent settings for the submodule.$name.update\n configuration value which says how to handle git submodule update for\n this submodule. The value is usually set in the ".gitmodules" file and\n copied to ".git/config" when the submodule is initialized.

\n\n

You can override this setting on a per-submodule basis with\n git_submodule_set_update() and write the changed value to disk using\n git_submodule_save(). If you have overwritten the value, you can\n revert it by passing GIT_SUBMODULE_UPDATE_RESET to the set function.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_UPDATE_RESET: reset to the on-disk value.
  • \n
  • GIT_SUBMODULE_UPDATE_CHECKOUT: the default; when a submodule is\nupdated, checkout the new detached HEAD to the submodule directory.
  • \n
  • GIT_SUBMODULE_UPDATE_REBASE: update by rebasing the current checked\nout branch onto the commit from the superproject.
  • \n
  • GIT_SUBMODULE_UPDATE_MERGE: update by merging the commit in the\nsuperproject into the current checkout out branch of the submodule.
  • \n
  • GIT_SUBMODULE_UPDATE_NONE: do not update this submodule even when\nthe commit in the superproject is updated.
  • \n
  • GIT_SUBMODULE_UPDATE_DEFAULT: not used except as static initializer\nwhen we don't want any particular update rule to be specified.
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_UPDATE_RESET","comments":"","value":-1},{"type":"int","name":"GIT_SUBMODULE_UPDATE_CHECKOUT","comments":"","value":1},{"type":"int","name":"GIT_SUBMODULE_UPDATE_REBASE","comments":"","value":2},{"type":"int","name":"GIT_SUBMODULE_UPDATE_MERGE","comments":"","value":3},{"type":"int","name":"GIT_SUBMODULE_UPDATE_NONE","comments":"","value":4},{"type":"int","name":"GIT_SUBMODULE_UPDATE_DEFAULT","comments":"","value":0}],"used":{"returns":[],"needs":["git_submodule_set_update"]}}],["git_tag",{"decl":"git_tag","type":"struct","value":"git_tag","file":"types.h","line":114,"lineto":114,"tdef":"typedef","description":" Parsed representation of a tag object. ","comments":"","used":{"returns":[],"needs":["git_tag_free","git_tag_id","git_tag_lookup","git_tag_lookup_prefix","git_tag_message","git_tag_name","git_tag_owner","git_tag_peel","git_tag_tagger","git_tag_target","git_tag_target_id","git_tag_target_type"]}}],["git_time",{"decl":["git_time_t time","int offset"],"type":"struct","value":"git_time","file":"types.h","line":156,"lineto":159,"block":"git_time_t time\nint offset","tdef":"typedef","description":" Time in a signature ","comments":"","fields":[{"type":"git_time_t","name":"time","comments":" time in seconds from epoch "},{"type":"int","name":"offset","comments":" timezone offset, in minutes "}],"used":{"returns":[],"needs":[]}}],["git_trace_level_t",{"decl":["GIT_TRACE_NONE","GIT_TRACE_FATAL","GIT_TRACE_ERROR","GIT_TRACE_WARN","GIT_TRACE_INFO","GIT_TRACE_DEBUG","GIT_TRACE_TRACE"],"type":"enum","file":"trace.h","line":26,"lineto":47,"block":"GIT_TRACE_NONE\nGIT_TRACE_FATAL\nGIT_TRACE_ERROR\nGIT_TRACE_WARN\nGIT_TRACE_INFO\nGIT_TRACE_DEBUG\nGIT_TRACE_TRACE","tdef":"typedef","description":" Available tracing levels. When tracing is set to a particular level,\n callers will be provided tracing at the given level and all lower levels.","comments":"","fields":[{"type":"int","name":"GIT_TRACE_NONE","comments":"

No tracing will be performed.

\n","value":0},{"type":"int","name":"GIT_TRACE_FATAL","comments":"

Severe errors that may impact the program's execution

\n","value":1},{"type":"int","name":"GIT_TRACE_ERROR","comments":"

Errors that do not impact the program's execution

\n","value":2},{"type":"int","name":"GIT_TRACE_WARN","comments":"

Warnings that suggest abnormal data

\n","value":3},{"type":"int","name":"GIT_TRACE_INFO","comments":"

Informational messages about program execution

\n","value":4},{"type":"int","name":"GIT_TRACE_DEBUG","comments":"

Detailed data that allows for debugging

\n","value":5},{"type":"int","name":"GIT_TRACE_TRACE","comments":"

Exceptionally detailed debugging data

\n","value":6}],"used":{"returns":[],"needs":["git_trace_set"]}}],["git_transaction",{"decl":"git_transaction","type":"struct","value":"git_transaction","file":"types.h","line":175,"lineto":175,"tdef":"typedef","description":" Transactional interface to references ","comments":"","used":{"returns":[],"needs":[]}}],["git_transfer_progress",{"decl":["unsigned int total_objects","unsigned int indexed_objects","unsigned int received_objects","unsigned int local_objects","unsigned int total_deltas","unsigned int indexed_deltas","size_t received_bytes"],"type":"struct","value":"git_transfer_progress","file":"types.h","line":247,"lineto":255,"block":"unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes","tdef":"typedef","description":" This is passed as the first argument to the callback to allow the\n user to see the progress.","comments":"
    \n
  • total_objects: number of objects in the packfile being downloaded
  • \n
  • indexed_objects: received objects that have been hashed
  • \n
  • received_objects: objects which have been downloaded
  • \n
  • local_objects: locally-available objects that have been injected\nin order to fix a thin pack.
  • \n
  • received-bytes: size of the packfile received up to now
  • \n
\n","fields":[{"type":"unsigned int","name":"total_objects","comments":""},{"type":"unsigned int","name":"indexed_objects","comments":""},{"type":"unsigned int","name":"received_objects","comments":""},{"type":"unsigned int","name":"local_objects","comments":""},{"type":"unsigned int","name":"total_deltas","comments":""},{"type":"unsigned int","name":"indexed_deltas","comments":""},{"type":"size_t","name":"received_bytes","comments":""}],"used":{"returns":["git_remote_stats"],"needs":["git_indexer_append","git_indexer_commit"]}}],["git_transport_flags_t",{"decl":["GIT_TRANSPORTFLAGS_NONE"],"type":"enum","file":"sys/transport.h","line":29,"lineto":31,"block":"GIT_TRANSPORTFLAGS_NONE","tdef":"typedef","description":" Flags to pass to transport","comments":"

Currently unused.

\n","fields":[{"type":"int","name":"GIT_TRANSPORTFLAGS_NONE","comments":"","value":0}],"used":{"returns":[],"needs":[]}}],["git_tree",{"decl":"git_tree","type":"struct","value":"git_tree","file":"types.h","line":126,"lineto":126,"tdef":"typedef","description":" Representation of a tree object. ","comments":"","used":{"returns":[],"needs":["git_commit_amend","git_commit_create","git_commit_create_v","git_commit_tree","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_index_read_tree","git_merge_trees","git_pathspec_match_tree","git_tree_entry_byid","git_tree_entry_byindex","git_tree_entry_byname","git_tree_entry_bypath","git_tree_entrycount","git_tree_free","git_tree_id","git_tree_lookup","git_tree_lookup_prefix","git_tree_owner","git_tree_walk","git_treebuilder_new"]}}],["git_tree_entry",{"decl":"git_tree_entry","type":"struct","value":"git_tree_entry","file":"types.h","line":123,"lineto":123,"tdef":"typedef","description":" Representation of each one of the entries in a tree object. ","comments":"","used":{"returns":["git_tree_entry_byid","git_tree_entry_byindex","git_tree_entry_byname","git_treebuilder_get"],"needs":["git_tree_entry_bypath","git_tree_entry_cmp","git_tree_entry_dup","git_tree_entry_filemode","git_tree_entry_filemode_raw","git_tree_entry_free","git_tree_entry_id","git_tree_entry_name","git_tree_entry_to_object","git_tree_entry_type","git_treebuilder_insert"]}}],["git_treebuilder",{"decl":"git_treebuilder","type":"struct","value":"git_treebuilder","file":"types.h","line":129,"lineto":129,"tdef":"typedef","description":" Constructor for in-memory trees ","comments":"","used":{"returns":[],"needs":["git_treebuilder_clear","git_treebuilder_entrycount","git_treebuilder_filter","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_new","git_treebuilder_remove","git_treebuilder_write"]}}],["git_treewalk_mode",{"decl":["GIT_TREEWALK_PRE","GIT_TREEWALK_POST"],"type":"enum","file":"tree.h","line":384,"lineto":387,"block":"GIT_TREEWALK_PRE\nGIT_TREEWALK_POST","tdef":"typedef","description":" Tree traversal modes ","comments":"","fields":[{"type":"int","name":"GIT_TREEWALK_PRE","comments":"","value":0},{"type":"int","name":"GIT_TREEWALK_POST","comments":"","value":1}],"used":{"returns":[],"needs":["git_tree_walk"]}}]],"prefix":"include/git2","groups":[["annotated",["git_annotated_commit_free","git_annotated_commit_from_fetchhead","git_annotated_commit_from_ref","git_annotated_commit_id","git_annotated_commit_lookup"]],["attr",["git_attr_add_macro","git_attr_cache_flush","git_attr_foreach","git_attr_get","git_attr_get_many","git_attr_value"]],["blame",["git_blame_buffer","git_blame_file","git_blame_free","git_blame_get_hunk_byindex","git_blame_get_hunk_byline","git_blame_get_hunk_count","git_blame_init_options"]],["blob",["git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromworkdir","git_blob_filtered_content","git_blob_free","git_blob_id","git_blob_is_binary","git_blob_lookup","git_blob_lookup_prefix","git_blob_owner","git_blob_rawcontent","git_blob_rawsize"]],["branch",["git_branch_create","git_branch_delete","git_branch_is_head","git_branch_iterator_free","git_branch_iterator_new","git_branch_lookup","git_branch_move","git_branch_name","git_branch_next","git_branch_set_upstream","git_branch_upstream"]],["buf",["git_buf_contains_nul","git_buf_free","git_buf_grow","git_buf_is_binary","git_buf_set"]],["checkout",["git_checkout_head","git_checkout_index","git_checkout_init_options","git_checkout_tree"]],["cherrypick",["git_cherrypick","git_cherrypick_commit","git_cherrypick_init_options"]],["clone",["git_clone","git_clone_init_options"]],["commit",["git_commit_amend","git_commit_author","git_commit_committer","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_commit_free","git_commit_id","git_commit_lookup","git_commit_lookup_prefix","git_commit_message","git_commit_message_encoding","git_commit_message_raw","git_commit_nth_gen_ancestor","git_commit_owner","git_commit_parent","git_commit_parent_id","git_commit_parentcount","git_commit_raw_header","git_commit_summary","git_commit_time","git_commit_time_offset","git_commit_tree","git_commit_tree_id"]],["config",["git_config_add_backend","git_config_add_file_ondisk","git_config_backend_foreach_match","git_config_delete_entry","git_config_delete_multivar","git_config_find_global","git_config_find_system","git_config_find_xdg","git_config_foreach","git_config_foreach_match","git_config_free","git_config_get_bool","git_config_get_entry","git_config_get_int32","git_config_get_int64","git_config_get_mapped","git_config_get_multivar_foreach","git_config_get_string","git_config_init_backend","git_config_iterator_free","git_config_iterator_glob_new","git_config_iterator_new","git_config_lookup_map_value","git_config_multivar_iterator_new","git_config_new","git_config_next","git_config_open_default","git_config_open_global","git_config_open_level","git_config_open_ondisk","git_config_parse_bool","git_config_parse_int32","git_config_parse_int64","git_config_set_bool","git_config_set_int32","git_config_set_int64","git_config_set_multivar","git_config_set_string","git_config_snapshot"]],["cred",["git_cred_default_new","git_cred_has_username","git_cred_ssh_custom_new","git_cred_ssh_interactive_new","git_cred_ssh_key_from_agent","git_cred_ssh_key_new","git_cred_username_new","git_cred_userpass","git_cred_userpass_plaintext_new"]],["describe",["git_describe_commit","git_describe_format","git_describe_result_free","git_describe_workdir"]],["diff",["git_diff_blob_to_buffer","git_diff_blobs","git_diff_buffers","git_diff_commit_as_email","git_diff_find_init_options","git_diff_find_similar","git_diff_foreach","git_diff_format_email","git_diff_format_email_init_options","git_diff_free","git_diff_get_delta","git_diff_get_perfdata","git_diff_get_stats","git_diff_index_to_workdir","git_diff_init_options","git_diff_is_sorted_icase","git_diff_merge","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_print","git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_diff_stats_deletions","git_diff_stats_files_changed","git_diff_stats_free","git_diff_stats_insertions","git_diff_stats_to_buf","git_diff_status_char","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index"]],["filter",["git_filter_list_apply_to_blob","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_filter_list_free","git_filter_list_length","git_filter_list_load","git_filter_list_new","git_filter_list_push","git_filter_lookup","git_filter_register","git_filter_source_filemode","git_filter_source_id","git_filter_source_mode","git_filter_source_options","git_filter_source_path","git_filter_source_repo","git_filter_unregister"]],["giterr",["giterr_clear","giterr_detach","giterr_last","giterr_set_oom","giterr_set_str"]],["graph",["git_graph_ahead_behind","git_graph_descendant_of"]],["hashsig",["git_hashsig_compare","git_hashsig_create","git_hashsig_create_fromfile","git_hashsig_free"]],["ignore",["git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored"]],["index",["git_index_add","git_index_add_all","git_index_add_bypath","git_index_caps","git_index_clear","git_index_conflict_add","git_index_conflict_cleanup","git_index_conflict_get","git_index_conflict_iterator_free","git_index_conflict_iterator_new","git_index_conflict_next","git_index_conflict_remove","git_index_entry_stage","git_index_entrycount","git_index_find","git_index_free","git_index_get_byindex","git_index_get_bypath","git_index_has_conflicts","git_index_new","git_index_open","git_index_owner","git_index_path","git_index_read","git_index_read_tree","git_index_remove","git_index_remove_all","git_index_remove_bypath","git_index_remove_directory","git_index_set_caps","git_index_update_all","git_index_write","git_index_write_tree","git_index_write_tree_to"]],["indexer",["git_indexer_append","git_indexer_commit","git_indexer_free","git_indexer_hash","git_indexer_new"]],["libgit2",["git_libgit2_features","git_libgit2_init","git_libgit2_opts","git_libgit2_shutdown","git_libgit2_version"]],["mempack",["git_mempack_new","git_mempack_reset"]],["merge",["git_merge","git_merge_analysis","git_merge_base","git_merge_base_many","git_merge_base_octopus","git_merge_bases","git_merge_bases_many","git_merge_commits","git_merge_file","git_merge_file_from_index","git_merge_file_init_input","git_merge_file_init_options","git_merge_file_result_free","git_merge_init_options","git_merge_trees"]],["message",["git_message_prettify"]],["note",["git_note_author","git_note_committer","git_note_create","git_note_default_ref","git_note_foreach","git_note_free","git_note_id","git_note_iterator_free","git_note_iterator_new","git_note_message","git_note_next","git_note_read","git_note_remove"]],["object",["git_object__size","git_object_dup","git_object_free","git_object_id","git_object_lookup","git_object_lookup_bypath","git_object_lookup_prefix","git_object_owner","git_object_peel","git_object_short_id","git_object_string2type","git_object_type","git_object_type2string","git_object_typeisloose"]],["odb",["git_odb_add_alternate","git_odb_add_backend","git_odb_add_disk_alternate","git_odb_backend_loose","git_odb_backend_one_pack","git_odb_backend_pack","git_odb_exists","git_odb_exists_prefix","git_odb_foreach","git_odb_free","git_odb_get_backend","git_odb_hash","git_odb_hashfile","git_odb_init_backend","git_odb_new","git_odb_num_backends","git_odb_object_data","git_odb_object_dup","git_odb_object_free","git_odb_object_id","git_odb_object_size","git_odb_object_type","git_odb_open","git_odb_open_rstream","git_odb_open_wstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_refresh","git_odb_stream_finalize_write","git_odb_stream_free","git_odb_stream_read","git_odb_stream_write","git_odb_write","git_odb_write_pack"]],["oid",["git_oid_cmp","git_oid_cpy","git_oid_equal","git_oid_fmt","git_oid_fromraw","git_oid_fromstr","git_oid_fromstrn","git_oid_fromstrp","git_oid_iszero","git_oid_ncmp","git_oid_nfmt","git_oid_pathfmt","git_oid_shorten_add","git_oid_shorten_free","git_oid_shorten_new","git_oid_strcmp","git_oid_streq","git_oid_tostr","git_oid_tostr_s"]],["oidarray",["git_oidarray_free"]],["openssl",["git_openssl_set_locking"]],["packbuilder",["git_packbuilder_foreach","git_packbuilder_free","git_packbuilder_hash","git_packbuilder_insert","git_packbuilder_insert_commit","git_packbuilder_insert_tree","git_packbuilder_new","git_packbuilder_object_count","git_packbuilder_set_callbacks","git_packbuilder_set_threads","git_packbuilder_write","git_packbuilder_written"]],["patch",["git_patch_free","git_patch_from_blob_and_buffer","git_patch_from_blobs","git_patch_from_buffers","git_patch_from_diff","git_patch_get_delta","git_patch_get_hunk","git_patch_get_line_in_hunk","git_patch_line_stats","git_patch_num_hunks","git_patch_num_lines_in_hunk","git_patch_print","git_patch_size","git_patch_to_buf"]],["pathspec",["git_pathspec_free","git_pathspec_match_diff","git_pathspec_match_index","git_pathspec_match_list_diff_entry","git_pathspec_match_list_entry","git_pathspec_match_list_entrycount","git_pathspec_match_list_failed_entry","git_pathspec_match_list_failed_entrycount","git_pathspec_match_list_free","git_pathspec_match_tree","git_pathspec_match_workdir","git_pathspec_matches_path","git_pathspec_new"]],["push",["git_push_init_options"]],["rebase",["git_rebase_abort","git_rebase_commit","git_rebase_finish","git_rebase_free","git_rebase_init","git_rebase_init_options","git_rebase_open","git_rebase_operation_byindex","git_rebase_operation_current","git_rebase_operation_entrycount"]],["refdb",["git_refdb_backend_fs","git_refdb_compress","git_refdb_free","git_refdb_init_backend","git_refdb_new","git_refdb_open","git_refdb_set_backend"]],["reference",["git_reference__alloc","git_reference__alloc_symbolic","git_reference_cmp","git_reference_create","git_reference_create_matching","git_reference_delete","git_reference_dwim","git_reference_ensure_log","git_reference_foreach","git_reference_foreach_glob","git_reference_foreach_name","git_reference_free","git_reference_has_log","git_reference_is_branch","git_reference_is_note","git_reference_is_remote","git_reference_is_tag","git_reference_is_valid_name","git_reference_iterator_free","git_reference_iterator_glob_new","git_reference_iterator_new","git_reference_list","git_reference_lookup","git_reference_name","git_reference_name_to_id","git_reference_next","git_reference_next_name","git_reference_normalize_name","git_reference_owner","git_reference_peel","git_reference_remove","git_reference_rename","git_reference_resolve","git_reference_set_target","git_reference_shorthand","git_reference_symbolic_create","git_reference_symbolic_create_matching","git_reference_symbolic_set_target","git_reference_symbolic_target","git_reference_target","git_reference_target_peel","git_reference_type"]],["reflog",["git_reflog_append","git_reflog_delete","git_reflog_drop","git_reflog_entry_byindex","git_reflog_entry_committer","git_reflog_entry_id_new","git_reflog_entry_id_old","git_reflog_entry_message","git_reflog_entrycount","git_reflog_free","git_reflog_read","git_reflog_rename","git_reflog_write"]],["refspec",["git_refspec_direction","git_refspec_dst","git_refspec_dst_matches","git_refspec_force","git_refspec_rtransform","git_refspec_src","git_refspec_src_matches","git_refspec_string","git_refspec_transform"]],["remote",["git_remote_add_fetch","git_remote_add_push","git_remote_autotag","git_remote_clear_refspecs","git_remote_connect","git_remote_connected","git_remote_create","git_remote_create_anonymous","git_remote_create_with_fetchspec","git_remote_default_branch","git_remote_delete","git_remote_disconnect","git_remote_download","git_remote_dup","git_remote_fetch","git_remote_free","git_remote_get_callbacks","git_remote_get_fetch_refspecs","git_remote_get_push_refspecs","git_remote_get_refspec","git_remote_init_callbacks","git_remote_is_valid_name","git_remote_list","git_remote_lookup","git_remote_ls","git_remote_name","git_remote_owner","git_remote_prune","git_remote_prune_refs","git_remote_push","git_remote_pushurl","git_remote_refspec_count","git_remote_rename","git_remote_save","git_remote_set_autotag","git_remote_set_callbacks","git_remote_set_fetch_refspecs","git_remote_set_push_refspecs","git_remote_set_pushurl","git_remote_set_transport","git_remote_set_update_fetchhead","git_remote_set_url","git_remote_stats","git_remote_stop","git_remote_update_fetchhead","git_remote_update_tips","git_remote_upload","git_remote_url"]],["repository",["git_repository_config","git_repository_config_snapshot","git_repository_detach_head","git_repository_discover","git_repository_fetchhead_foreach","git_repository_free","git_repository_get_namespace","git_repository_hashfile","git_repository_head","git_repository_head_detached","git_repository_head_unborn","git_repository_index","git_repository_init","git_repository_init_ext","git_repository_init_init_options","git_repository_is_bare","git_repository_is_empty","git_repository_is_shallow","git_repository_mergehead_foreach","git_repository_message","git_repository_message_remove","git_repository_odb","git_repository_open","git_repository_open_bare","git_repository_open_ext","git_repository_path","git_repository_refdb","git_repository_set_head","git_repository_set_head_detached","git_repository_set_namespace","git_repository_set_workdir","git_repository_state","git_repository_state_cleanup","git_repository_workdir","git_repository_wrap_odb"]],["reset",["git_reset_default"]],["revert",["git_revert","git_revert_commit","git_revert_init_options"]],["revparse",["git_revparse","git_revparse_ext","git_revparse_single"]],["revwalk",["git_revwalk_add_hide_cb","git_revwalk_free","git_revwalk_hide","git_revwalk_hide_glob","git_revwalk_hide_head","git_revwalk_hide_ref","git_revwalk_new","git_revwalk_next","git_revwalk_push","git_revwalk_push_glob","git_revwalk_push_head","git_revwalk_push_range","git_revwalk_push_ref","git_revwalk_repository","git_revwalk_reset","git_revwalk_simplify_first_parent","git_revwalk_sorting"]],["signature",["git_signature_default","git_signature_dup","git_signature_free","git_signature_new","git_signature_now"]],["smart",["git_smart_subtransport_git","git_smart_subtransport_http","git_smart_subtransport_ssh"]],["stash",["git_stash_drop","git_stash_foreach"]],["status",["git_status_byindex","git_status_file","git_status_foreach","git_status_foreach_ext","git_status_init_options","git_status_list_entrycount","git_status_list_free","git_status_list_get_perfdata","git_status_list_new","git_status_should_ignore"]],["strarray",["git_strarray_copy","git_strarray_free"]],["submodule",["git_submodule_add_finalize","git_submodule_add_setup","git_submodule_add_to_index","git_submodule_branch","git_submodule_fetch_recurse_submodules","git_submodule_foreach","git_submodule_free","git_submodule_head_id","git_submodule_ignore","git_submodule_index_id","git_submodule_init","git_submodule_location","git_submodule_lookup","git_submodule_name","git_submodule_open","git_submodule_owner","git_submodule_path","git_submodule_reload","git_submodule_reload_all","git_submodule_repo_init","git_submodule_resolve_url","git_submodule_save","git_submodule_set_fetch_recurse_submodules","git_submodule_set_ignore","git_submodule_set_update","git_submodule_set_url","git_submodule_status","git_submodule_sync","git_submodule_update","git_submodule_update_strategy","git_submodule_url","git_submodule_wd_id"]],["tag",["git_tag_annotation_create","git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_delete","git_tag_foreach","git_tag_free","git_tag_id","git_tag_list","git_tag_list_match","git_tag_lookup","git_tag_lookup_prefix","git_tag_message","git_tag_name","git_tag_owner","git_tag_peel","git_tag_tagger","git_tag_target","git_tag_target_id","git_tag_target_type"]],["trace",["git_trace_set"]],["transport",["git_transport_dummy","git_transport_init","git_transport_local","git_transport_new","git_transport_register","git_transport_smart","git_transport_ssh_with_paths","git_transport_unregister"]],["tree",["git_tree_entry_byid","git_tree_entry_byindex","git_tree_entry_byname","git_tree_entry_bypath","git_tree_entry_cmp","git_tree_entry_dup","git_tree_entry_filemode","git_tree_entry_filemode_raw","git_tree_entry_free","git_tree_entry_id","git_tree_entry_name","git_tree_entry_to_object","git_tree_entry_type","git_tree_entrycount","git_tree_free","git_tree_id","git_tree_lookup","git_tree_lookup_prefix","git_tree_owner","git_tree_walk"]],["treebuilder",["git_treebuilder_clear","git_treebuilder_entrycount","git_treebuilder_filter","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_new","git_treebuilder_remove","git_treebuilder_write"]]],"examples":[["add.c","ex/v0.22.0-rc1/add.html"],["blame.c","ex/v0.22.0-rc1/blame.html"],["cat-file.c","ex/v0.22.0-rc1/cat-file.html"],["common.c","ex/v0.22.0-rc1/common.html"],["describe.c","ex/v0.22.0-rc1/describe.html"],["diff.c","ex/v0.22.0-rc1/diff.html"],["for-each-ref.c","ex/v0.22.0-rc1/for-each-ref.html"],["general.c","ex/v0.22.0-rc1/general.html"],["init.c","ex/v0.22.0-rc1/init.html"],["log.c","ex/v0.22.0-rc1/log.html"],["network/clone.c","ex/v0.22.0-rc1/network/clone.html"],["network/common.c","ex/v0.22.0-rc1/network/common.html"],["network/fetch.c","ex/v0.22.0-rc1/network/fetch.html"],["network/git2.c","ex/v0.22.0-rc1/network/git2.html"],["network/index-pack.c","ex/v0.22.0-rc1/network/index-pack.html"],["network/ls-remote.c","ex/v0.22.0-rc1/network/ls-remote.html"],["rev-list.c","ex/v0.22.0-rc1/rev-list.html"],["rev-parse.c","ex/v0.22.0-rc1/rev-parse.html"],["showindex.c","ex/v0.22.0-rc1/showindex.html"],["status.c","ex/v0.22.0-rc1/status.html"],["tag.c","ex/v0.22.0-rc1/tag.html"]]} diff --git a/generate/scripts/generateJson.js b/generate/scripts/generateJson.js index 4bfd3137e0..49a2795c2d 100644 --- a/generate/scripts/generateJson.js +++ b/generate/scripts/generateJson.js @@ -1,10 +1,8 @@ -const fs = require("fs"); const path = require("path"); const utils = require("./utils"); var _; -var version = require("../../package.json").libgit2.version; -var libgit2 = require("../input/v" + version + ".json"); +var libgit2 = require("../input/libgit2-docs.json"); var descriptor = require("../input/descriptor.json"); var supplement = require("../input/libgit2-supplement.json"); @@ -46,8 +44,13 @@ module.exports = function generateJson() { !~supplement.remove[groupName].functions.indexOf(fnName); }); + // If we've already found some functions for this group lets add the new + // ones we found instead of overwriting the old ones + if (memo[groupName]) { + memo[groupName] = memo[groupName].concat(functionNames); + } // if we have an empty group then just ignore it - if (functionNames.length) { + else if (functionNames.length) { memo[groupName] = functionNames; } @@ -146,7 +149,6 @@ module.exports = function generateJson() { if (def.ignore) { return; } - var dependencies = {}; var addDependencies = function (prop) { if (prop.ignore) { @@ -156,7 +158,7 @@ module.exports = function generateJson() { var type = helpers.normalizeCtype(prop.type || prop.cType).replace("git_", ""); var dependencyFilename = dependencyLookup[type]; - if (dependencyFilename) { + if (dependencyFilename && dependencyFilename !== def.filename) { dependencies[dependencyFilename] = dependencyFilename; } @@ -167,9 +169,18 @@ module.exports = function generateJson() { } }; + var addSelfReferentialField = function(prop){ + if (helpers.isSelfReferential(prop.type)) { + prop.isSelfReferential = true; + def.isExtendedStruct = true; + } + }; + def.fields.forEach(addDependencies); + def.fields.forEach(addSelfReferentialField); def.functions.forEach(addDependencies); + Object.keys(dependencies).forEach(function (dependencyFilename) { def.dependencies.push("../include/" + dependencyFilename + ".h"); }); @@ -181,7 +192,6 @@ module.exports = function generateJson() { fn.cppClassName = def.cppClassName; }); }); - // Process enums _(enums).forEach(function(enumerable) { output.some(function(obj) { @@ -220,7 +230,7 @@ module.exports = function generateJson() { _.merge(enumerable, _.omit(override, ["values"])); output.push(enumerable); - }).value(); + }); output = _.sortBy(output, "typeName"); @@ -229,8 +239,7 @@ module.exports = function generateJson() { } - utils.writeFile("output/idefs.json", output); - + utils.writeLocalFile("output/idefs.json", output); }; if (require.main === module) { diff --git a/generate/scripts/generateMissingTests.js b/generate/scripts/generateMissingTests.js index 0a89c7bd8f..29b6474b3e 100644 --- a/generate/scripts/generateMissingTests.js +++ b/generate/scripts/generateMissingTests.js @@ -1,7 +1,4 @@ const path = require("path"); -const Promise = require("nodegit-promise"); -const promisify = require("promisify-node"); -const fse = promisify(require("fs-extra")); const utils = require("./utils"); const testFilesPath = "../test/tests"; @@ -15,7 +12,7 @@ module.exports = function generateMissingTests() { var testFilePath = path.join(testFilesPath, idef.filename + ".js"); var result = {}; - var file = utils.readFile(testFilePath); + var file = utils.readLocalFile(testFilePath); if (file) { var fieldsResult = []; var functionsResult = []; @@ -61,7 +58,7 @@ module.exports = function generateMissingTests() { Promise.all(promises).then( function() { - utils.writeFile("output/missing-tests.json", output); + utils.writeLocalFile("/output/missing-tests.json", output); }, function(fail) { console.error(fail); diff --git a/generate/scripts/generateNativeCode.js b/generate/scripts/generateNativeCode.js index 4e2884c1be..44fb21dec5 100644 --- a/generate/scripts/generateNativeCode.js +++ b/generate/scripts/generateNativeCode.js @@ -1,10 +1,7 @@ const path = require("path"); -const promisify = require("promisify-node"); -const fse = promisify(require("fs-extra")); -const exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); - +const fse = require("fs-extra"); +const os = require('os'); +const exec = require('../../utils/execPromise'); const utils = require("./utils"); module.exports = function generateNativeCode() { @@ -27,36 +24,45 @@ module.exports = function generateNativeCode() { }; var partials = { - asyncFunction: utils.readFile("templates/partials/async_function.cc"), - callbackHelpers: utils.readFile("templates/partials/callback_helpers.cc"), - convertFromV8: utils.readFile("templates/partials/convert_from_v8.cc"), - convertToV8: utils.readFile("templates/partials/convert_to_v8.cc"), - doc: utils.readFile("templates/partials/doc.cc"), - fields: utils.readFile("templates/partials/fields.cc"), - guardArguments: utils.readFile("templates/partials/guard_arguments.cc"), - syncFunction: utils.readFile("templates/partials/sync_function.cc"), - fieldAccessors: utils.readFile("templates/partials/field_accessors.cc") + asyncFunction: utils.readLocalFile("templates/partials/async_function.cc"), + callbackHelpers: utils.readLocalFile("templates/partials/callback_helpers.cc"), + configurableCallbacks: utils.readLocalFile("templates/partials/configurable_callbacks.cc"), + convertFromV8: utils.readLocalFile("templates/partials/convert_from_v8.cc"), + convertToV8: utils.readLocalFile("templates/partials/convert_to_v8.cc"), + doc: utils.readLocalFile("templates/partials/doc.cc"), + fields: utils.readLocalFile("templates/partials/fields.cc"), + guardArguments: utils.readLocalFile("templates/partials/guard_arguments.cc"), + syncFunction: utils.readLocalFile("templates/partials/sync_function.cc"), + fieldAccessors: utils.readLocalFile("templates/partials/field_accessors.cc"), + traits: utils.readLocalFile("templates/partials/traits.h") }; var templates = { - class_content: utils.readFile("templates/templates/class_content.cc"), - struct_content: utils.readFile("templates/templates/struct_content.cc"), - class_header: utils.readFile("templates/templates/class_header.h"), - struct_header: utils.readFile("templates/templates/struct_header.h"), - binding: utils.readFile("templates/templates/binding.gyp"), - nodegitCC: utils.readFile("templates/templates/nodegit.cc"), - nodegitJS: utils.readFile("templates/templates/nodegit.js"), - enums: utils.readFile("templates/templates/enums.js") + class_content: utils.readLocalFile("templates/templates/class_content.cc"), + struct_content: utils.readLocalFile("templates/templates/struct_content.cc"), + class_header: utils.readLocalFile("templates/templates/class_header.h"), + struct_header: utils.readLocalFile("templates/templates/struct_header.h"), + binding: utils.readLocalFile("templates/templates/binding.gyp"), + nodegitCC: utils.readLocalFile("templates/templates/nodegit.cc"), + nodegitJS: utils.readLocalFile("templates/templates/nodegit.js"), + enums: utils.readLocalFile("templates/templates/enums.js") }; var filters = { and: require("../templates/filters/and"), argsInfo: require("../templates/filters/args_info"), + arrayTypeToPlainType: require("../templates/filters/array_type_to_plain_type"), + asElementPointer: require("../templates/filters/as_element_pointer"), + callbackArgsInfo: require("../templates/filters/callback_args_info"), + callbackArgsCount: require("../templates/filters/callback_args_count"), cppToV8: require("../templates/filters/cpp_to_v8"), defaultValue: require("../templates/filters/default_value"), fieldsInfo: require("../templates/filters/fields_info"), + getCPPFunctionForRootProto: require("../templates/filters/get_cpp_function_for_root_proto"), + hasFunctionOnRootProto: require("../templates/filters/has_function_on_root_proto"), hasReturnType: require("../templates/filters/has_return_type"), hasReturnValue: require("../templates/filters/has_return_value"), + isArrayType: require("../templates/filters/is_array_type"), isDoublePointer: require("../templates/filters/is_double_pointer"), isFixedLengthString: require("../templates/filters/is_fixed_length_string"), isOid: require("../templates/filters/is_oid"), @@ -69,8 +75,13 @@ module.exports = function generateNativeCode() { replace: require("../templates/filters/replace"), returnsCount: require("../templates/filters/returns_count"), returnsInfo: require("../templates/filters/returns_info"), + subtract: require("../templates/filters/subtract"), + thisInfo: require("../templates/filters/this_info"), titleCase: require("../templates/filters/title_case"), + toBool: require('../templates/filters/to_bool'), + toSizeOfArray: require("../templates/filters/to_size_of_array"), unPointer: require("../templates/filters/un_pointer"), + setUnsigned: require("../templates/filters/unsigned"), upper: require("../templates/filters/upper") }; @@ -86,7 +97,9 @@ module.exports = function generateNativeCode() { // Attach all partials to select templates. Object.keys(partials).forEach(function(partial) { + templates.class_header.registerPartial(partial, combyne(partials[partial])); templates.class_content.registerPartial(partial, combyne(partials[partial])); + templates.struct_header.registerPartial(partial, combyne(partials[partial])); templates.struct_content.registerPartial(partial, combyne(partials[partial])); }); @@ -98,52 +111,63 @@ module.exports = function generateNativeCode() { return !idef.ignore; }); + const tempDirPath = path.join(os.tmpdir(), 'nodegit_build'); + const tempSrcDirPath = path.join(tempDirPath, "src"); + const tempIncludeDirPath = path.join(tempDirPath, "include"); + + const finalSrcDirPath = path.join(__dirname, '../../src'); + const finalIncludeDirPath = path.join(__dirname, '../../include'); - fse.remove(path.resolve(__dirname, "../../src")).then(function() { - return fse.remove(path.resolve(__dirname, "../../include")); + fse.remove(tempDirPath).then(function() { + return fse.copy(path.resolve(__dirname, "../templates/manual/include"), tempIncludeDirPath); }).then(function() { - return fse.copy(path.resolve(__dirname, "../templates/manual/"), path.resolve(__dirname, "../../")); + return fse.copy(path.resolve(__dirname, "../templates/manual/src"), tempSrcDirPath); }).then(function() { // Write out single purpose templates. - utils.writeFile("../binding.gyp", beautify(templates.binding.render(enabled))); - utils.writeFile("../src/nodegit.cc", templates.nodegitCC.render(enabled)); - utils.writeFile("../lib/nodegit.js", beautify(templates.nodegitJS.render(enabled))); + utils.writeLocalFile("../binding.gyp", beautify(templates.binding.render(enabled)), "binding.gyp"); + utils.writeFile(path.join(tempSrcDirPath, "nodegit.cc"), templates.nodegitCC.render(enabled), "nodegit.cc"); + utils.writeLocalFile("../lib/nodegit.js", beautify(templates.nodegitJS.render(enabled)), "nodegit.js"); // Write out all the classes. enabled.forEach(function(idef) { - try { - if (idef.type && idef.type != "enum") { - utils.writeFile( - "../src/" + idef.filename + ".cc", templates[idef.type + "_content"].render(idef) - ); - utils.writeFile( - "../include/" + idef.filename + ".h", templates[idef.type + "_header"].render(idef) - ); - } - } - catch (e) { - if (process.env.BUILD_ONLY) { - console.error(e); - } + if (idef.type && idef.type != "enum") { + utils.writeFile( + path.join(tempSrcDirPath, idef.filename + ".cc"), + templates[idef.type + "_content"].render(idef), + idef.type + "_content.cc" + ); + + utils.writeFile( + path.join(tempIncludeDirPath, idef.filename + ".h"), + templates[idef.type + "_header"].render(idef), + idef.type + "_header.h" + ); } }); - utils.writeFile("../lib/enums.js", beautify(templates.enums.render(enabled))); + utils.writeLocalFile("../lib/enums.js", beautify(templates.enums.render(enabled)), "enums.js"); }).then(function() { return exec("command -v astyle").then(function(astyle) { if (astyle) { return exec( "astyle --options=\".astylerc\" " - + path.resolve(__dirname, "../../src") + "/*.cc " - + path.resolve(__dirname, "../../include") + "/*.h" + + tempSrcDirPath + "/*.cc " + + tempIncludeDirPath + "/*.h" ).then(function() { return exec( "rm " - + path.resolve(__dirname, "../../src") + "/*.cc.orig " - + path.resolve(__dirname, "../../include") + "/*.h.orig " + + tempSrcDirPath + "/*.cc.orig " + + tempIncludeDirPath + "/*.h.orig " ); }); } }, function() {}) + }).then(function() { + return Promise.all([ + utils.syncDirs(tempSrcDirPath, finalSrcDirPath), + utils.syncDirs(tempIncludeDirPath, finalIncludeDirPath), + ]); + }).then(function() { + return fse.remove(tempDirPath); }).catch(console.log); }; diff --git a/generate/scripts/helpers.js b/generate/scripts/helpers.js index db8600ace4..e278e1cc05 100644 --- a/generate/scripts/helpers.js +++ b/generate/scripts/helpers.js @@ -1,14 +1,15 @@ - -var callbackTypePattern = /\s*_cb/; +var callbackTypePattern = /\s*_(cb|fn)/, + selfReferentialTypePattern = /\s*_fn/; var utils = require("./utils"); var _ = require("lodash"); +var path = require("path"); +var fs = require("fs"); // TODO: When libgit2's docs include callbacks we should be able to remove this -var version = require("../../package.json").libgit2.version; var callbackDefs = require("../input/callbacks.json"); var descriptor = require("../input/descriptor.json"); -var libgit2 = require("../input/v" + version + ".json"); +var libgit2 = require("../input/libgit2-docs.json"); var cTypes = libgit2.groups.map(function(group) { return group[0];}); @@ -22,7 +23,10 @@ var cTypeMappings = { "size_t": "Number", "uint16_t": "Number", "uint32_t": "Number", - "uint64_t": "Number" + "uint64_t": "Number", + "double": "Number", + "git_object_size_t": "Number", + "git_time_t": "Number", } var collisionMappings = { @@ -38,6 +42,7 @@ var Helpers = { .replace("struct", "") .replace(utils.doublePointerRegex, "") .replace(utils.pointerRegex, "") + .replace(utils.arrayTypeRegex, "") .trim(); }, @@ -66,15 +71,23 @@ var Helpers = { }, isConstructorFunction: function(cType, fnName) { - var initFnName = cType.split('_'); + var deprecatedInitFnName = cType.split("_"); + deprecatedInitFnName.splice(-1, 0, "init"); + deprecatedInitFnName = deprecatedInitFnName.join("_"); - initFnName.splice(-1, 0, "init"); - initFnName = initFnName.join('_'); + var initFnName = cType + "_init"; - return initFnName === fnName; + return initFnName === fnName || deprecatedInitFnName === fnName; }, hasConstructor: function(type, normalizedType) { + if (normalizedType && descriptor.types[normalizedType.substr(4)]) { + var descriptorEntry = descriptor.types[normalizedType.substr(4)]; + if (descriptorEntry.hasOwnProperty('hasConstructor')) { + return descriptorEntry.hasConstructor; + } + } + return type.used && type.used.needs && type.used.needs.some(function (fnName) { @@ -82,8 +95,8 @@ var Helpers = { }); }, - isCallbackFunction: function(cType) { - return callbackTypePattern.test(cType); + isCallbackFunction: function(cType, isCallback) { + return isCallback === true || callbackTypePattern.test(cType); }, isPayloadFor: function(cbField, payloadName) { @@ -92,6 +105,10 @@ var Helpers = { && ~cbField.name.indexOf(payloadName.replace("_payload", "")); }, + isSelfReferential: function(cType){ + return selfReferentialTypePattern.test(cType); + }, + getLibgitType: function(normalizedType, types) { var libgitType; @@ -108,8 +125,9 @@ var Helpers = { processCallback: function(field) { field.isCallbackFunction = true; - if (callbackDefs[field.type]) { - _.merge(field, callbackDefs[field.type]); + var callbackDef = callbackDefs[field.type] || callbackDefs[field.cType]; + if (callbackDef) { + _.merge(field, callbackDef); } else { if (process.env.BUILD_ONLY) { @@ -141,6 +159,7 @@ var Helpers = { } }, + // returns the libgittype found in types decorateLibgitType: function(type, types, enums) { var normalizedType = Helpers.normalizeCtype(type.cType); var libgitType = Helpers.getLibgitType(normalizedType, types); @@ -148,7 +167,9 @@ var Helpers = { if (libgitType) { type.isLibgitType = true; type.isEnum = libgitType.type === "enum"; - type.hasConstructor = Helpers.hasConstructor(type, normalizedType); + type.hasConstructor = Helpers.hasConstructor(libgitType, normalizedType); + type.isClassType = !type.isEnum && !type.hasConstructor; + type.isStructType = !type.isEnum && !!type.hasConstructor; // there are no enums at the struct level currently, but we still need to override function args if (type.isEnum) { @@ -159,9 +180,13 @@ var Helpers = { } } + type.freeFunctionName = libgitType.freeFunctionName; + // we don't want to overwrite the c type of the passed in type _.merge(type, descriptor.types[normalizedType.replace("git_", "")] || {}, { cType: type.cType }); } + + return libgitType; }, decoratePrimaryType: function(typeDef, enums) { @@ -174,6 +199,13 @@ var Helpers = { typeDef.filename = typeDef.typeName; typeDef.isLibgitType = true; typeDef.dependencies = []; + typeDef.selfFreeing = Boolean(typeDefOverrides.selfFreeing); + + if (typeDefOverrides.freeFunctionName) { + typeDef.freeFunctionName = typeDefOverrides.freeFunctionName; + } else if (typeDef.type === 'struct') { + typeDef.freeFunctionName = 'free'; + } typeDef.fields = typeDef.fields || []; typeDef.fields.forEach(function (field, index, allFields) { @@ -209,8 +241,9 @@ var Helpers = { field.jsFunctionName = utils.camelCase(field.name); field.cppClassName = Helpers.cTypeToCppName(field.type); field.jsClassName = utils.titleCase(Helpers.cTypeToJsName(field.type)); + field.ownedByThis = true; - if (Helpers.isCallbackFunction(field.cType)) { + if (Helpers.isCallbackFunction(field.cType, field.isCallback)) { Helpers.processCallback(field); var argOverrides = fieldOverrides.args || {}; @@ -232,7 +265,7 @@ var Helpers = { }, decorateArg: function(arg, allArgs, typeDef, fnDef, argOverrides, enums) { - var type = arg.cType || arg.type; + var type = argOverrides.cType || argOverrides.type || arg.cType || arg.type; var normalizedType = Helpers.normalizeCtype(type); arg.cType = type; @@ -261,8 +294,13 @@ var Helpers = { // itself and determine if this function goes on the prototype // or is a constructor method. arg.isReturn = arg.name === "out" || (utils.isDoublePointer(arg.type) && normalizedType == typeDef.cType); - arg.isSelf = utils.isPointer(arg.type) && normalizedType == typeDef.cType; - + if (typeof arg.isSelf == 'undefined') { + arg.isSelf = utils.isPointer(arg.type) && + normalizedType == typeDef.cType && + arg.cppClassName !== "Array" && + argOverrides.cppClassName !== "Array" && + _.every(allArgs, function(_arg) { return !_arg.isSelf; }); + } if (arg.isReturn && fnDef.return && fnDef.return.type === "int") { fnDef.return.isErrorCode = true; fnDef.isAsync = true; @@ -288,13 +326,11 @@ var Helpers = { // available if (key == typeDef.cType + "_free") { typeDef.freeFunctionName = key; - //fnDef.ignore = true; - //return; } fnDef.cppFunctionName = Helpers.cTypeToCppName(key, "git_" + typeDef.typeName); fnDef.jsFunctionName = Helpers.cTypeToJsName(key, "git_" + typeDef.typeName); - //fnDef.isAsync = false; // until proven otherwise + fnDef.jsClassName = typeDef.jsClassName; if (fnDef.cppFunctionName == typeDef.cppClassName) { fnDef.cppFunctionName = fnDef.cppFunctionName.replace("Git", ""); @@ -310,6 +346,10 @@ var Helpers = { } }); + if (fnDef.cFile) { + fnDef.implementation = fs.readFileSync(path.resolve(fnDef.cFile), 'utf8'); + } + if (fnDef.return) { Helpers.decorateArg(fnDef.return, fnDef.args, typeDef, fnDef, fnOverrides.return || {}, enums); } @@ -322,7 +362,7 @@ var Helpers = { if (fnDef.jsFunctionName == utils.camelCase(collidingName)) { fnDef.jsFunctionName = utils.camelCase(newName); } - }).value(); + }); if ("git_" + typeDef.typeName == fnDef.cFunctionName) { fnDef.useAsOnRootProto = true; diff --git a/generate/scripts/utils.js b/generate/scripts/utils.js index 3395fe272f..c6e843134a 100644 --- a/generate/scripts/utils.js +++ b/generate/scripts/utils.js @@ -1,5 +1,6 @@ -const promisify = require("promisify-node"); const fse = require("fs-extra"); +const walk = require("walk"); +const _ = require('lodash'); const fs = require("fs"); const path = require("path"); @@ -8,27 +9,44 @@ const path = require("path"); var local = path.join.bind(null, __dirname, "../"); var util = { + arrayTypeRegex: /\[\d*\]\s*/, pointerRegex: /\s*\*\s*/, doublePointerRegex: /\s*\*\*\s*/, - readFile: function(file) { + readLocalFile: function(filePath) { + return util.readFile(local(filePath)); + }, + + readFile: function(filePath) { try { - return fs.readFileSync(local(file)).toString(); + return fs.readFileSync(filePath).toString(); } catch (unhandledException) { return ""; } }, - writeFile: function(file, content) { + writeLocalFile: function(filePath, content, header) { + return util.writeFile(local(filePath), content, header); + }, + + writeFile: function(filePath, content, header) { try { - var file = local(file); if (typeof content == "object") { content = JSON.stringify(content, null, 2) } - fse.ensureFileSync(file); - fse.writeFileSync(file, content); + if (header) { + var commentPrefix = ~header.indexOf('.gyp') ? '#' : '//' + content = commentPrefix + + " This is a generated file, modify: generate/templates/templates/" + + header + + "\n\n" + + content; + } + + fse.ensureFileSync(filePath); + fse.writeFileSync(filePath, content); return true; } catch (exception) { @@ -46,12 +64,51 @@ var util = { }).join(""); }, - camelCase: function(str) { - return str.split(/_|\//).map(function(val, index) { - return (index >= 1 - ? val[0].toUpperCase() + val.slice(1) - : val[0].toLowerCase() + val.slice(1)); - }).join(""); + camelCase: _.camelCase, + + getFilePathsRelativeToDir: function(dir) { + const files = []; + const walker = walk.walk(dir, { followLinks: false }); + if (!util.isDirectory(dir)) { + return Promise.resolve([]); + } + + return new Promise(function(resolve, reject) { + walker.on('file', function(root, stat, next) { + files.push(path.relative(dir, path.join(root, stat.name))); + next(); + }); + + walker.on('end', function() { + resolve(files); + }); + + walker.on('errors', function() { + reject(); + }); + }); + }, + + isFile: function(path) { + var isFile; + try { + isFile = fse.statSync(path).isFile(); + } catch(e) { + isFile = false; + } + + return isFile; + }, + + isDirectory: function(path) { + var isDirectory; + try { + isDirectory = fse.statSync(path).isDirectory(); + } catch(e) { + isDirectory = false; + } + + return isDirectory; }, isPointer: function(type) { @@ -60,8 +117,39 @@ var util = { isDoublePointer: function(type) { return util.doublePointerRegex.test(type); - } + }, + + syncDirs: function(fromDir, toDir) { + let toFilePaths; + let fromFilePaths; + return Promise.all([ + util.getFilePathsRelativeToDir(toDir), + util.getFilePathsRelativeToDir(fromDir) + ]) + .then(function(filePaths) { + toFilePaths = filePaths[0]; + fromFilePaths = filePaths[1]; + // Delete files that aren't in fromDir + return Promise.all(toFilePaths.map(function(filePath) { + if (!util.isFile(path.join(fromDir, filePath))) { + return fse.remove(path.join(toDir, filePath)); + } + return Promise.resolve(); + })); + }) + .then(function() { + // Copy files that don't exist in toDir or have different contents + return Promise.all(fromFilePaths.map(function(filePath) { + const toFilePath = path.join(toDir, filePath); + const fromFilePath = path.join(fromDir, filePath); + if (!util.isFile(toFilePath) || util.readFile(toFilePath) !== util.readFile(fromFilePath)) { + return fse.copy(fromFilePath, toFilePath); + } + return Promise.resolve(); + })); + }); + } }; module.exports = util; diff --git a/generate/templates/README.md b/generate/templates/README.md new file mode 100644 index 0000000000..ee8b1f70c5 --- /dev/null +++ b/generate/templates/README.md @@ -0,0 +1,35 @@ +# Manual templates + + Manual templates override generated code from nodegit while generating source code. They really should be avoid untill absolutely necessary. + +## Why? + + #### 1. Performance + > Everytime the library switches between C land and the javascript thread, there is a penalty in performance. If in practice the usage of a method in libgit2 requires crossing the c/javascript boundary frequently, it might be better option to use manual templates. An example being ```Revwalk::FastWalk```. + + #### 2. Saftey + > The generated code sometimes does not handle structures that are interdependent. An example would be ```git_patch``` and ```git_diff```. A ```git_patch```'s memory is owned by ```git_diff```, and that includes all of the children of ```git_patch```, as well. So a ```git_diff_hunk```, ```git_diff_line```, and ```git_patch``` all are owned by a ```git_diff```, and when that ```git_diff``` is deleted, all the memory for any patches, hunks, or lines that are in use as NodeGitWrappers are now corrupted. Further, a ```git_diff``` keeps a file handle open for its entire lifespan, which can lead to NodeGit holding onto file locks in Windows. Due to both of these compounding issues, we wrote manual templates to shift ownership away from a ```git_diff``` to ```git_patch```, ```git_diff_hunk```, and ```git_diff_line``` and also shorten the lifespan of a diff. + + #### 3. Odd cases + > If a new pattern exists in libgit that would be difficult to implement using generated code, manual templates can be used for one-off cases. Typically generated code takes care of most patterns seen in libgit, but if function signatures do not follow typical pattern, manual templates could be used. Example: ```git_filter``` and ```git_remote_ls```. + +
+----- +## Implementing manual templates + +#### 1. Write manual .cc and .h files to *generate/templates/manual/* + *.cc files -> /generate/templates/manual/src/ + *.h files -> /generate/templates/manual/include/ + +#### 2. Remove all references from /generate configuration files + +#### 3. Add references to binding.gyp template + location: /generate/templates/templates/binding.gyp + +#### 4. Add headers to nodegit.cc template + location: /generate/templates/templates/nodegit.cc + +#### 5. Add new wrapper to nodegit.js template + use rawApi.ManualWrapper reference to add _ManualWrapper + add any js wrapper (if any) via importExtension + diff --git a/generate/templates/filters/args_info.js b/generate/templates/filters/args_info.js index e2fe799d79..55270102d1 100644 --- a/generate/templates/filters/args_info.js +++ b/generate/templates/filters/args_info.js @@ -1,3 +1,11 @@ +var bannedCppClassNames = [ + "Buffer", + "Function", + "GitBuf", + "GitStrarray", + "Wrapper" +]; + module.exports = function(args) { var result = [], cArg, @@ -13,15 +21,15 @@ module.exports = function(args) { jsArg++; } - if (cArg === args.length -1) { - arg.lastArg = true; - } - else { - arg.lastArg = false; - } + arg.lastArg = cArg === args.length - 1; + arg.firstArg = !arg.lastArg && cArg === 0; arg.cArg = cArg; arg.isCppClassStringOrArray = ~["String", "Array"].indexOf(arg.cppClassName); + arg.isConst = ~arg.cType.indexOf("const "); + + arg.isUnwrappable = !arg.isStructType && arg.isLibgitType && !arg.isEnum && + !bannedCppClassNames.includes(arg.cppClassName); // if we have a callback then we also need the corresponding payload for that callback if (arg.isCallbackFunction) { diff --git a/generate/templates/filters/array_type_to_plain_type.js b/generate/templates/filters/array_type_to_plain_type.js new file mode 100644 index 0000000000..55f2833500 --- /dev/null +++ b/generate/templates/filters/array_type_to_plain_type.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /(.*)\s\[\d+\]\s*/.exec(cType)[1]; +}; diff --git a/generate/templates/filters/as_element_pointer.js b/generate/templates/filters/as_element_pointer.js new file mode 100644 index 0000000000..8b34eed172 --- /dev/null +++ b/generate/templates/filters/as_element_pointer.js @@ -0,0 +1,7 @@ +const isArrayType = require("./is_array_type"); + +module.exports = function(cType, parsedName) { + return isArrayType(cType) ? + "&" + parsedName + "[i]" : + parsedName; +}; diff --git a/generate/templates/filters/callback_args_count.js b/generate/templates/filters/callback_args_count.js new file mode 100644 index 0000000000..26c7762ead --- /dev/null +++ b/generate/templates/filters/callback_args_count.js @@ -0,0 +1,18 @@ +module.exports = function(args) { + if (!args) { + return 0; + } + + return args.reduce( + function(count, arg) { + var shouldCount = !arg.isReturn && + !arg.isSelf && + arg.name !== "payload" && + arg.name !== "self" && + !arg.ignore; + + return shouldCount ? count + 1 : count; + }, + 0 + ); +}; diff --git a/generate/templates/filters/callback_args_info.js b/generate/templates/filters/callback_args_info.js new file mode 100644 index 0000000000..a7285c0b85 --- /dev/null +++ b/generate/templates/filters/callback_args_info.js @@ -0,0 +1,27 @@ +module.exports = function(args) { + var result = args.reduce( + function(argList, arg) { + var useArg = !arg.isReturn && + !arg.isSelf && + arg.name !== "payload" && + arg.name !== "self" && + !arg.ignore; + + if (!useArg) { + return argList; + } + + arg.firstArg = argList.length === 0; + argList.push(arg); + + return argList; + }, + [] + ); + + if (result.length) { + result[result.length - 1].lastArg = true; + } + + return result; +}; diff --git a/generate/templates/filters/fields_info.js b/generate/templates/filters/fields_info.js index 8ec8a930b1..6022aab127 100644 --- a/generate/templates/filters/fields_info.js +++ b/generate/templates/filters/fields_info.js @@ -1,14 +1,26 @@ +var bannedCppClassNames = [ + "Buffer", + "Function", + "GitBuf", + "GitStrarray", + "Wrapper" +]; + module.exports = function(fields) { var result = []; - fields.forEach(function (field){ + fields.forEach(function (field, index){ var fieldInfo = {}; fieldInfo.__proto__ = field; + fieldInfo.index = index; fieldInfo.parsedName = field.name || "result"; fieldInfo.isCppClassIntType = ~["Uint32", "Int32"].indexOf(field.cppClassName); fieldInfo.parsedClassName = (field.cppClassName || '').toLowerCase() + "_t"; + fieldInfo.hasOwner = !fieldInfo.selfOwned && !!fieldInfo.ownedByThis; + fieldInfo.isUnwrappable = fieldInfo.isLibgitType && !fieldInfo.isEnum && + !bannedCppClassNames.includes(fieldInfo.cppClassName); result.push(fieldInfo); }); diff --git a/generate/templates/filters/get_cpp_function_for_root_proto.js b/generate/templates/filters/get_cpp_function_for_root_proto.js new file mode 100644 index 0000000000..6571af880a --- /dev/null +++ b/generate/templates/filters/get_cpp_function_for_root_proto.js @@ -0,0 +1,12 @@ +module.exports = function(functions) { + if (!functions || functions.length === 0) { + throw new Error("Should not be able to get function from empty function list"); + } + + const fun = functions.find(function(f) { return f.useAsOnRootProto; }); + if (!fun) { + throw new Error("There is no function on the root prototype for this collection"); + } + + return fun.cppFunctionName; +}; diff --git a/generate/templates/filters/has_function_on_root_proto.js b/generate/templates/filters/has_function_on_root_proto.js new file mode 100644 index 0000000000..626ce0ff65 --- /dev/null +++ b/generate/templates/filters/has_function_on_root_proto.js @@ -0,0 +1,7 @@ +module.exports = function(functions) { + if (!functions || functions.length === 0) { + return false; + } + + return functions.some(function(f) { return f.useAsOnRootProto; }); +}; diff --git a/generate/templates/filters/is_array_type.js b/generate/templates/filters/is_array_type.js new file mode 100644 index 0000000000..d633d9e407 --- /dev/null +++ b/generate/templates/filters/is_array_type.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /\s\[\d+\]\s*/.test(cType); +}; diff --git a/generate/templates/filters/js_args_count.js b/generate/templates/filters/js_args_count.js index 5be437f417..17a56a1c11 100644 --- a/generate/templates/filters/js_args_count.js +++ b/generate/templates/filters/js_args_count.js @@ -5,11 +5,11 @@ module.exports = function(args) { if (!args) { return 0; } - + for(cArg = 0, jsArg = 0; cArg < args.length; cArg++) { var arg = args[cArg]; - if (!arg.isReturn && !arg.isSelf && !arg.isPayload) { + if (!arg.isReturn && !arg.isSelf) { jsArg++; } } diff --git a/generate/templates/filters/returns_info.js b/generate/templates/filters/returns_info.js index 7eaf26e7ad..5f7bcdc08a 100644 --- a/generate/templates/filters/returns_info.js +++ b/generate/templates/filters/returns_info.js @@ -4,6 +4,22 @@ module.exports = function(fn, argReturnsOnly, isAsync) { var result = []; var args = fn.args || []; + // We will use this to figure out the index + // of arguments, because sync functions + // need to respect ownership to an arbitrary + // parameter that is labeled by name in the + // descriptor, and we won't have access to + // any sort of string to argument index + // in the template. + var nameToArgIndex = {}; + var thisArgName = ''; + args.forEach(function (arg, index) { + nameToArgIndex[arg.name] = index; + if (arg.isSelf) { + thisArgName = arg.name; + } + }); + args.forEach(function (arg) { if (!arg.isReturn) return; @@ -11,6 +27,7 @@ module.exports = function(fn, argReturnsOnly, isAsync) { return_info.__proto__ = arg; + return_info.isAsync = isAsync; return_info.parsedName = isAsync ? "baton->" + return_info.name : return_info.name; return_info.isCppClassIntType = ~['Uint32', 'Int32'].indexOf(return_info.cppClassName); return_info.needsDereference @@ -21,6 +38,23 @@ module.exports = function(fn, argReturnsOnly, isAsync) { return_info.returnNameOrName = return_info.returnName || return_info.name; return_info.jsOrCppClassName = return_info.jsClassName || return_info.cppClassName; return_info.isOutParam = true; + return_info.hasOwner = !return_info.selfOwned && + !!(return_info.ownedBy || return_info.ownedByThis || return_info.ownerFn); + return_info.ownedByIndices = []; + + if (isAsync && return_info.ownedByThis) { + return_info.ownedBy = return_info.ownedBy || []; + return_info.ownedBy.unshift(thisArgName); + } + + // Here we convert ownedBy, which is the list of parameter names + // that own this result to the argument index. + // sync functions will need to know this. + if (!isAsync && return_info.ownedBy) { + return_info.ownedBy.forEach(function (argName) { + return_info.ownedByIndices.push(nameToArgIndex[argName]); + }) + } result.push(return_info); }); @@ -33,7 +67,28 @@ module.exports = function(fn, argReturnsOnly, isAsync) { var return_info = {}; return_info.__proto__ = fn.return; - return_info.parsedName = return_info.name && isAsync ? "baton->" + return_info.name : "result"; + + return_info.isAsync = isAsync; + return_info.hasOwner = !return_info.selfOwned && + !!(return_info.ownedBy || return_info.ownedByThis || return_info.ownerFn); + return_info.ownedByIndices = []; + return_info.ownedBy = return_info.ownedBy || []; + + if (return_info.ownedByThis && isAsync) { + return_info.ownedBy.push(thisArgName); + } + + if (!isAsync) { + return_info.ownedByIndices = return_info.ownedBy.map(function (ownerName) { + return nameToArgIndex[ownerName]; + }); + } + + if (isAsync) { + return_info.parsedName = "baton->" + (return_info.name || "result"); + } else { + return_info.parsedName = "result"; + } return_info.isCppClassIntType = ~['Uint32', 'Int32'].indexOf(return_info.cppClassName); return_info.parsedClassName = (return_info.cppClassName || '').toLowerCase() + "_t"; return_info.returnNameOrName = return_info.returnName || return_info.name; diff --git a/generate/templates/filters/subtract.js b/generate/templates/filters/subtract.js new file mode 100644 index 0000000000..6329f2e2cd --- /dev/null +++ b/generate/templates/filters/subtract.js @@ -0,0 +1,3 @@ +module.exports = function(value, other) { + return value - other; +}; diff --git a/generate/templates/filters/this_info.js b/generate/templates/filters/this_info.js new file mode 100644 index 0000000000..e5d57520ab --- /dev/null +++ b/generate/templates/filters/this_info.js @@ -0,0 +1,8 @@ +module.exports = function(args, fieldToRetrieve) { + const thisArg = args.find(arg => arg.isSelf); + if (thisArg) { + return thisArg[fieldToRetrieve]; + } + + return; +}; diff --git a/generate/templates/filters/to_bool.js b/generate/templates/filters/to_bool.js new file mode 100644 index 0000000000..dd6063f287 --- /dev/null +++ b/generate/templates/filters/to_bool.js @@ -0,0 +1,3 @@ +module.exports = function(value) { + return !!value; +}; diff --git a/generate/templates/filters/to_size_of_array.js b/generate/templates/filters/to_size_of_array.js new file mode 100644 index 0000000000..b56e9315fa --- /dev/null +++ b/generate/templates/filters/to_size_of_array.js @@ -0,0 +1,3 @@ +module.exports = function(cType) { + return /\s\[(\d+)\]\s*/.exec(cType)[1]; +}; diff --git a/generate/templates/filters/unsigned.js b/generate/templates/filters/unsigned.js new file mode 100644 index 0000000000..a460783311 --- /dev/null +++ b/generate/templates/filters/unsigned.js @@ -0,0 +1,3 @@ +module.exports = function(value) { + return value < 0 ? 0 : value; +}; diff --git a/generate/templates/manual/clone/clone.cc b/generate/templates/manual/clone/clone.cc new file mode 100644 index 0000000000..02c47ff58b --- /dev/null +++ b/generate/templates/manual/clone/clone.cc @@ -0,0 +1,210 @@ +// NOTE you may need to occasionally rebuild this method by calling the generators +// if major changes are made to the templates / generator. + +// Due to some file locking issues, we have the need to free a repository after it's cloned. +// We do not expose free functions to javascript, and so, we've moved the implementation of +// cloning, freeing the repo, and opening the repo into a custom template. + +/* + * @param String url + * @param String local_path + * @param CloneOptions options + * @param Repository callback + */ +NAN_METHOD(GitClone::Clone) { + + if (info.Length() == 0 || !info[0]->IsString()) { + return Nan::ThrowError("String url is required."); + } + + if (info.Length() == 1 || !info[1]->IsString()) { + return Nan::ThrowError("String local_path is required."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + CloneBaton *baton = new CloneBaton(); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + std::map> cleanupHandles; + + if (info[2]->IsNull() || info[2]->IsUndefined()) { + baton->options = nullptr; + } else { + auto conversionResult = ConfigurableGitCloneOptions::fromJavascript(nodegitContext, info[2]); + if (!conversionResult.result) { + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles["options"] = convertedObject; + baton->options = convertedObject->GetValue(); + } + + baton->error_code = GIT_OK; + baton->error = NULL; + + // start convert_from_v8 block + const char *from_url = NULL; + + Nan::Utf8String url(Nan::To(info[0]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character + // C-strings expect: + from_url = (const char *)malloc(url.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead + // of strdup or strcpy because nulls in the middle of strings are valid coming + // from nodejs): + memcpy((void *)from_url, *url, url.length()); + // ensure the final byte of our new string is null, extra casts added to + // ensure compatibility with various C types used in the nodejs binding + // generation: + memset((void *)(((char *)from_url) + url.length()), 0, 1); + // end convert_from_v8 block + baton->url = from_url; + // start convert_from_v8 block + const char *from_local_path = NULL; + + Nan::Utf8String local_path(Nan::To(info[1]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character + // C-strings expect: + from_local_path = (const char *)malloc(local_path.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead + // of strdup or strcpy because nulls in the middle of strings are valid coming + // from nodejs): + memcpy((void *)from_local_path, *local_path, local_path.length()); + // ensure the final byte of our new string is null, extra casts added to + // ensure compatibility with various C types used in the nodejs binding + // generation: + memset((void *)(((char *)from_local_path) + local_path.length()), 0, 1); + // end convert_from_v8 block + baton->local_path = from_local_path; + + Nan::Callback *callback = + new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + CloneWorker *worker = new CloneWorker(baton, callback, cleanupHandles); + + worker->Reference("url", info[0]); + worker->Reference("local_path", info[1]); + + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitClone::CloneWorker::AcquireLocks() { + nodegit::LockMaster lockMaster( + true, + baton->url, + baton->local_path, + baton->options + ); + return lockMaster; +} + +void GitClone::CloneWorker::Execute() { + git_error_clear(); + + git_repository *repo; + int result = + git_clone(&repo, baton->url, baton->local_path, baton->options); + + if (result == GIT_OK) { + // This is required to clean up after the clone to avoid file locking + // issues in Windows and potentially other issues we don't know about. + git_repository_free(repo); + + // We want to provide a valid repository object, so reopen the repository + // after clone and cleanup. + result = git_repository_open(&baton->out, baton->local_path); + } + + baton->error_code = result; + + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitClone::CloneWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_repository_free(baton->out); + + free((void*)baton->url); + free((void*)baton->local_path); + + delete baton; +} + +void GitClone::CloneWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + v8::Local to; + // start convert_to_v8 block + + if (baton->out != NULL) { + // GitRepository baton->out + to = GitRepository::New(baton->out, true); + } else { + to = Nan::Null(); + } + + // end convert_to_v8 block + v8::Local result = to; + + v8::Local argv[2] = {Nan::Null(), result}; + callback->Call(2, argv, async_resource); + } else { + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method clone has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("Clone.clone").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } else if (baton->error_code < 0) { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) { + v8::Local err = + Nan::To(Nan::Error("Method clone has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), + Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("Clone.clone").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + } + } else { + callback->Call(0, NULL, async_resource); + } + } + + free((void*)baton->url); + free((void*)baton->local_path); + + delete baton; +} diff --git a/generate/templates/manual/commit/extract_signature.cc b/generate/templates/manual/commit/extract_signature.cc new file mode 100644 index 0000000000..82a2141116 --- /dev/null +++ b/generate/templates/manual/commit/extract_signature.cc @@ -0,0 +1,162 @@ +NAN_METHOD(GitCommit::ExtractSignature) +{ + if (info.Length() == 0 || !info[0]->IsObject()) { + return Nan::ThrowError("Repository repo is required."); + } + + if (info.Length() == 1 || (!info[1]->IsObject() && !info[1]->IsString())) { + return Nan::ThrowError("Oid commit_id is required."); + } + + if (info.Length() >= 4 && !info[2]->IsString() && !info[2]->IsUndefined() && !info[2]->IsNull()) { + return Nan::ThrowError("String signature_field must be a string or undefined/null."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + ExtractSignatureBaton* baton = new ExtractSignatureBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->signature = GIT_BUF_INIT_CONST(NULL, 0); + baton->signed_data = GIT_BUF_INIT_CONST(NULL, 0); + baton->repo = Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); + + // baton->commit_id + if (info[1]->IsString()) { + Nan::Utf8String oidString(Nan::To(info[1]).ToLocalChecked()); + baton->commit_id = (git_oid *)malloc(sizeof(git_oid)); + if (git_oid_fromstr(baton->commit_id, (const char *)strdup(*oidString)) != GIT_OK) { + free(baton->commit_id); + + if (git_error_last()->klass != GIT_ERROR_NONE) { + return Nan::ThrowError(git_error_last()->message); + } else { + return Nan::ThrowError("Unknown Error"); + } + } + } else { + baton->commit_id = Nan::ObjectWrap::Unwrap(Nan::To(info[1]).ToLocalChecked())->GetValue(); + } + + // baton->field + if (info[2]->IsString()) { + Nan::Utf8String field(Nan::To(info[2]).ToLocalChecked()); + baton->field = (char *)malloc(field.length() + 1); + memcpy((void *)baton->field, *field, field.length()); + baton->field[field.length()] = 0; + } else { + baton->field = NULL; + } + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + + std::map> cleanupHandles; + ExtractSignatureWorker *worker = new ExtractSignatureWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info[0]); + worker->Reference("commit_id", info[1]); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitCommit::ExtractSignatureWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitCommit::ExtractSignatureWorker::Execute() +{ + git_error_clear(); + + baton->error_code = git_commit_extract_signature( + &baton->signature, + &baton->signed_data, + baton->repo, + baton->commit_id, + (const char *)baton->field + ); + + if (baton->error_code != GIT_OK) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitCommit::ExtractSignatureWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_buf_dispose(&baton->signature); + git_buf_dispose(&baton->signed_data); + + free(baton->field); + + delete baton; +} + +void GitCommit::ExtractSignatureWorker::HandleOKCallback() +{ + if (baton->error_code == GIT_OK) + { + Local result = Nan::New(); + Nan::Set( + result, + Nan::New("signature").ToLocalChecked(), + Nan::New(baton->signature.ptr, baton->signature.size).ToLocalChecked() + ); + Nan::Set( + result, + Nan::New("signedData").ToLocalChecked(), + Nan::New(baton->signed_data.ptr, baton->signed_data.size).ToLocalChecked() + ); + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Extract Signature has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Commit.extractSignature").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + git_buf_dispose(&baton->signature); + git_buf_dispose(&baton->signed_data); + + if (baton->field != NULL) { + free((void *)baton->field); + } + + delete baton; +} diff --git a/generate/templates/manual/filter_list/load.cc b/generate/templates/manual/filter_list/load.cc new file mode 100644 index 0000000000..22e2f1f4f3 --- /dev/null +++ b/generate/templates/manual/filter_list/load.cc @@ -0,0 +1,227 @@ +// NOTE you may need to occasionally rebuild this method by calling the generators +// if major changes are made to the templates / generator. + +// git_filter_list_load has a more complex ownership pattern than is currently available +// in the generator. This is because it not only has to get the repo as an owner, +// but it also needs to discover which custom filters, a git_filter, it is bound to, if any. +// We must enforce that the custom filters are not freed before a git_filter_list is freed, +// but a git_filter_list also has pointers to the repo in it. + +// TODO In the future, it would be awesome if we could instead of writing a manual method like this, provide +// custom ownership methods that can be injected into the HandleOKCallback. + +/* + * @param Repository repo + * @param Blob blob + * @param String path + * @param Number mode + * @param Number flags + * @param FilterList callback + */ +NAN_METHOD(GitFilterList::Load) { + if (info.Length() == 0 || !info[0]->IsObject()) { + return Nan::ThrowError("Repository repo is required."); + } + + if (info.Length() == 2 || !info[2]->IsString()) { + return Nan::ThrowError("String path is required."); + } + + if (info.Length() == 3 || !info[3]->IsNumber()) { + return Nan::ThrowError("Number mode is required."); + } + + if (info.Length() == 4 || !info[4]->IsNumber()) { + return Nan::ThrowError("Number flags is required."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + LoadBaton *baton = new LoadBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + + // start convert_from_v8 block + git_repository *from_repo = NULL; + from_repo = + Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); + // end convert_from_v8 block + baton->repo = from_repo; + // start convert_from_v8 block + git_blob *from_blob = NULL; + if (info[1]->IsObject()) { + from_blob = + Nan::ObjectWrap::Unwrap(Nan::To(info[1]).ToLocalChecked())->GetValue(); + } else { + from_blob = 0; + } + // end convert_from_v8 block + baton->blob = from_blob; + // start convert_from_v8 block + const char *from_path = NULL; + + Nan::Utf8String path(Nan::To(info[2]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character + // C-strings expect: + from_path = (const char *)malloc(path.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead + // of strdup or strcpy because nulls in the middle of strings are valid coming + // from nodejs): + memcpy((void *)from_path, *path, path.length()); + // ensure the final byte of our new string is null, extra casts added to + // ensure compatibility with various C types used in the nodejs binding + // generation: + memset((void *)(((char *)from_path) + path.length()), 0, 1); + // end convert_from_v8 block + baton->path = from_path; + // start convert_from_v8 block + git_filter_mode_t from_mode; + from_mode = (git_filter_mode_t)(int)info[3].As()->Value(); + // end convert_from_v8 block + baton->mode = from_mode; + // start convert_from_v8 block + uint32_t from_flags; + from_flags = (uint32_t)info[4].As()->Value(); + // end convert_from_v8 block + baton->flags = from_flags; + + Nan::Callback *callback = + new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + LoadWorker *worker = new LoadWorker(baton, callback, cleanupHandles); + + worker->Reference("repo", info[0]); + worker->Reference("blob", info[1]); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitFilterList::LoadWorker::AcquireLocks() { + nodegit::LockMaster lockMaster( + true, + baton->repo, + baton->blob, + baton->path + ); + return lockMaster; +} + +void GitFilterList::LoadWorker::Execute() { + git_error_clear(); + + int result = git_filter_list_load(&baton->filters, baton->repo, baton->blob, + baton->path, baton->mode, baton->flags); + + baton->error_code = result; + + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitFilterList::LoadWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_filter_list_free(baton->filters); + + free((void *)baton->path); + + delete baton; +} + +void GitFilterList::LoadWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + v8::Local to; + // start convert_to_v8 block + + if (baton->filters != NULL) { + // GitFilterList baton->filters + v8::Local owners = Nan::New(0); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + + Nan::Set( + owners, + Nan::New(0), + Nan::To(this->GetFromPersistent("repo")).ToLocalChecked() + ); + + to = GitFilterList::New(baton->filters, true, Nan::To(owners).ToLocalChecked()); + auto filterListWrapper = Nan::ObjectWrap::Unwrap(to.As()); + auto filterRegistryCleanupHandles = static_pointer_cast(nodegit::Context::GetCurrentContext()->GetCleanupHandle("filterRegistry")); + std::for_each( + filterRegistryCleanupHandles->registeredFilters.begin(), + filterRegistryCleanupHandles->registeredFilters.end(), + [this, &filterListWrapper](std::pair> filterCleanupHandle) { + if (git_filter_list_contains(baton->filters, filterCleanupHandle.first.c_str())) { + filterListWrapper->SaveCleanupHandle(filterCleanupHandle.second); + } + } + ); + } else { + to = Nan::Null(); + } + + // end convert_to_v8 block + v8::Local result = to; + + v8::Local argv[2] = {Nan::Null(), result}; + callback->Call(2, argv, async_resource); + } else { + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method load has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterList.load").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } else if (baton->error_code < 0) { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) { + v8::Local err = + Nan::To(Nan::Error("Method load has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), + Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterList.load").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + } + } else { + callback->Call(0, NULL, async_resource); + } + } + + free((void *)baton->path); + + delete baton; +} diff --git a/generate/templates/manual/filter_source/repo.cc b/generate/templates/manual/filter_source/repo.cc new file mode 100644 index 0000000000..78903d86b6 --- /dev/null +++ b/generate/templates/manual/filter_source/repo.cc @@ -0,0 +1,107 @@ +// NOTE you may need to occasionally rebuild this method by calling the generators +// if major changes are made to the templates / generator. + +// Due to some garbage collection issues related to submodules and git_filters, we need to clone the repository +// pointer before giving it to a user. + +/* + * @param Repository callback + */ +NAN_METHOD(GitFilterSource::Repo) { + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + RepoBaton *baton = new RepoBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->src = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + RepoWorker *worker = new RepoWorker(baton, callback, cleanupHandles); + + worker->Reference("src", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitFilterSource::RepoWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->src); + return lockMaster; +} + +void GitFilterSource::RepoWorker::Execute() { + git_error_clear(); + + git_repository *repo = git_filter_source_repo(baton->src); + baton->error_code = git_repository_open(&repo, git_repository_path(repo)); + + if (baton->error_code == GIT_OK) { + baton->out = repo; + } else if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitFilterSource::RepoWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + git_repository_free(baton->out); + + delete baton; +} + +void GitFilterSource::RepoWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + v8::Local to; + + if (baton->out != NULL) { + to = GitRepository::New(baton->out, true); + } else { + to = Nan::Null(); + } + + v8::Local argv[2] = {Nan::Null(), to}; + callback->Call(2, argv, async_resource); + } else { + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method repo has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterSource.repo").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } else if (baton->error_code < 0) { + v8::Local err = + Nan::To(Nan::Error("Method repo has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), + Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), + Nan::New("FilterSource.repo").ToLocalChecked()); + v8::Local argv[1] = {err}; + callback->Call(1, argv, async_resource); + } else { + callback->Call(0, NULL, async_resource); + } + } + + delete baton; +} diff --git a/generate/templates/manual/include/async_baton.h b/generate/templates/manual/include/async_baton.h new file mode 100644 index 0000000000..33da4a4520 --- /dev/null +++ b/generate/templates/manual/include/async_baton.h @@ -0,0 +1,78 @@ +#ifndef ASYNC_BATON +#define ASYNC_BATON + +#include +#include +#include +#include + +#include "lock_master.h" +#include "nodegit.h" +#include "thread_pool.h" + +namespace nodegit { + // Base class for Batons used for callbacks (for example, + // JS functions passed as callback parameters, + // or field properties of configuration objects whose values are callbacks) + class AsyncBaton { + public: + typedef std::function AsyncCallback; + typedef std::function CompletionCallback; + + AsyncBaton(); + AsyncBaton(const AsyncBaton &) = delete; + AsyncBaton(AsyncBaton &&) = delete; + AsyncBaton &operator=(const AsyncBaton &) = delete; + AsyncBaton &operator=(AsyncBaton &&) = delete; + + virtual ~AsyncBaton() {} + + void Done(); + + Nan::AsyncResource *GetAsyncResource(); + + void SetCallbackError(v8::Local error); + + protected: + void ExecuteAsyncPerform(AsyncCallback asyncCallback, AsyncCallback asyncCancelCb, CompletionCallback onCompletion); + + private: + void SignalCompletion(); + void WaitForCompletion(); + + Nan::AsyncResource *asyncResource; + Nan::Global &callbackErrorHandle; + ThreadPool::Callback onCompletion; + std::unique_ptr completedMutex; + std::condition_variable completedCondition; + bool hasCompleted; + }; + + void deleteBaton(AsyncBaton *baton); + + template + class AsyncBatonWithResult : public AsyncBaton { + public: + ResultT defaultResult; // result returned if the callback doesn't return anything valid + ResultT result; + + AsyncBatonWithResult(const ResultT &defaultResult) + : defaultResult(defaultResult) { + } + + ResultT ExecuteAsync(AsyncBaton::AsyncCallback asyncCallback, AsyncBaton::AsyncCallback asyncCancelCb, AsyncBaton::CompletionCallback onCompletion = nullptr) { + result = 0; + ExecuteAsyncPerform(asyncCallback, asyncCancelCb, onCompletion); + return result; + } + }; + + class AsyncBatonWithNoResult : public AsyncBaton { + public: + void ExecuteAsync(AsyncBaton::AsyncCallback asyncCallback, AsyncBaton::AsyncCallback asyncCancelCb, AsyncBaton::CompletionCallback onCompletion = nullptr) { + ExecuteAsyncPerform(asyncCallback, asyncCancelCb, onCompletion); + } + }; +} + +#endif diff --git a/generate/templates/manual/include/async_worker.h b/generate/templates/manual/include/async_worker.h new file mode 100644 index 0000000000..b8f2909901 --- /dev/null +++ b/generate/templates/manual/include/async_worker.h @@ -0,0 +1,91 @@ +#ifndef NODEGIT_ASYNC_WORKER +#define NODEGIT_ASYNC_WORKER + +#include +#include +#include +#include +#include "lock_master.h" +#include "cleanup_handle.h" + +namespace nodegit { + class AsyncWorker : public Nan::AsyncWorker { + public: + AsyncWorker(Nan::Callback *callback, const char *resourceName, std::map> &cleanupHandles); + AsyncWorker(Nan::Callback *callback, const char *resourceName); + AsyncWorker(const AsyncWorker &) = delete; + AsyncWorker(AsyncWorker &&) = delete; + AsyncWorker &operator=(const AsyncWorker &) = delete; + AsyncWorker &operator=(AsyncWorker &&) = delete; + + // This must be implemented by every async worker + // so that the thread pool can lock separately + // from the execute method in the AsyncWorker + virtual nodegit::LockMaster AcquireLocks() = 0; + + // Ensure that the `HandleErrorCallback` will be called + // when the AsyncWork is complete + void Cancel(); + + // Retrieves the async resource attached to this AsyncWorker + // This is used to inform libgit2 callbacks what asyncResource + // they should use when working with any javascript + Nan::AsyncResource *GetAsyncResource(); + + Nan::Global *GetCallbackErrorHandle(); + + bool GetIsCancelled() const; + + void Destroy() override; + + void RegisterCleanupCall(std::function cleanupCall); + + template + void Reference(v8::Local item) { + if (item->IsFunction() || item->IsString() || item->IsNull() || item->IsUndefined()) { + return; + } + + auto objectWrapPointer = Nan::ObjectWrap::Unwrap(item.As()); + objectWrapPointer->Reference(); + RegisterCleanupCall([objectWrapPointer]() { + objectWrapPointer->Unreference(); + }); + } + + template + inline void Reference(const char *label, v8::Local item) { + SaveToPersistent(label, item); + Reference(item); + } + + template + inline void Reference(const char *label, v8::Local item) { + SaveToPersistent(label, item); + Reference(item); + } + + template + inline void Reference(const char *label, v8::Local array) { + SaveToPersistent(label, array); + for (uint32_t i = 0; i < array->Length(); ++i) { + Reference(Nan::Get(array, i).ToLocalChecked()); + } + } + + inline void Reference(const char *label, v8::Local item) { + SaveToPersistent(label, item); + } + + protected: + std::map> cleanupHandles; + Nan::Global callbackErrorHandle; + + private: + std::vector> cleanupCalls; + bool isCancelled = false; + + }; +} + +#endif diff --git a/generate/templates/manual/include/callback_wrapper.h b/generate/templates/manual/include/callback_wrapper.h index e02182f096..d50b976105 100644 --- a/generate/templates/manual/include/callback_wrapper.h +++ b/generate/templates/manual/include/callback_wrapper.h @@ -1,17 +1,65 @@ #ifndef CALLBACK_WRAPPER_H #define CALLBACK_WRAPPER_H -#include -#include - -#include "nan.h" +#include +#include +#include using namespace v8; using namespace node; -struct CallbackWrapper { - NanCallback* jsCallback; - void * payload; +class CallbackWrapper { + std::unique_ptr jsCallback; + + // throttling data, used for callbacks that need to be throttled + uint32_t throttle; // in milliseconds - if > 0, calls to the JS callback will be throttled + uint64_t lastCallTime; + + // false will trigger the callback and not wait for the callback to finish + // in this case, the underlying libgit2 function will immediately be given + // the default result + bool waitForResult; + +public: + CallbackWrapper(): jsCallback(nullptr), throttle(0), lastCallTime(0) {} + + CallbackWrapper(const CallbackWrapper &) = delete; + CallbackWrapper(CallbackWrapper &&) = delete; + CallbackWrapper &operator=(const CallbackWrapper &) = delete; + CallbackWrapper &operator=(CallbackWrapper &&) = delete; + + bool HasCallback() { + return jsCallback != nullptr; + } + + Nan::Callback* GetCallback() { + return jsCallback.get(); + } + + void SetCallback(std::unique_ptr callback, uint32_t throttle = 0, bool waitForResult = true) { + jsCallback = std::move(callback); + this->throttle = throttle; + this->waitForResult = waitForResult; + } + + bool ShouldWaitForResult() { + return waitForResult; + } + + bool WillBeThrottled() { + if(!throttle) { + return false; + } + // throttle if needed + uint64_t now = uv_hrtime(); + if(lastCallTime > 0 && now < lastCallTime + throttle * (uint64_t)1000000) { + // throttled + return true; + } else { + lastCallTime = now; + return false; + } + } }; #endif diff --git a/generate/templates/manual/include/cleanup_handle.h b/generate/templates/manual/include/cleanup_handle.h new file mode 100644 index 0000000000..5eca8cf70d --- /dev/null +++ b/generate/templates/manual/include/cleanup_handle.h @@ -0,0 +1,21 @@ +#ifndef NODEGIT_CLEANUP_HANDLE_H +#define NODEGIT_CLEANUP_HANDLE_H + +#include +#include +#include + +namespace nodegit { + class CleanupHandle { + public: + CleanupHandle(); + virtual ~CleanupHandle(); + }; + + class FilterRegistryCleanupHandles : public CleanupHandle { + public: + std::map> registeredFilters; + }; +} + +#endif diff --git a/generate/templates/manual/include/configurable_class_wrapper.h b/generate/templates/manual/include/configurable_class_wrapper.h new file mode 100644 index 0000000000..ff83a3176d --- /dev/null +++ b/generate/templates/manual/include/configurable_class_wrapper.h @@ -0,0 +1,59 @@ +#ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H +#define CALLER_CONFIGURABLE_CLASS_WRAPPER_H + +#include +#include +#include + +#include "cleanup_handle.h" + +namespace nodegit { + class Context; + + template + class ConfigurableClassWrapper : public CleanupHandle { + public: + typedef typename Traits::cType cType; + typedef typename Traits::configurableCppClass configurableCppClass; + + struct v8ConversionResult { + v8ConversionResult(std::string _error) + : error(std::move(_error)), result(nullptr) + {} + + v8ConversionResult(std::shared_ptr _result) + : result(std::move(_result)) + {} + + std::string error; + std::shared_ptr result; + }; + + // We copy the entity + ConfigurableClassWrapper(nodegit::Context *_nodeGitContext) + : nodegitContext(_nodeGitContext), raw(nullptr) {} + + ConfigurableClassWrapper(const ConfigurableClassWrapper &) = delete; + ConfigurableClassWrapper(ConfigurableClassWrapper &&) = delete; + ConfigurableClassWrapper &operator=(const ConfigurableClassWrapper &) = delete; + ConfigurableClassWrapper &operator=(ConfigurableClassWrapper &&) = delete; + + virtual ~ConfigurableClassWrapper() { + if (raw != nullptr) { + free(raw); + raw = nullptr; + } + } + + const Context *nodegitContext = nullptr; + cType *GetValue() { + return raw; + } + + protected: + cType *raw; + std::vector> childCleanupVector; + }; +} + +#endif diff --git a/generate/templates/manual/include/context.h b/generate/templates/manual/include/context.h new file mode 100644 index 0000000000..11e8b93f8a --- /dev/null +++ b/generate/templates/manual/include/context.h @@ -0,0 +1,90 @@ +#ifndef NODEGIT_CONTEXT +#define NODEGIT_CONTEXT + +#include +#include +#include +#include +#include +#include + +#include "async_worker.h" +#include "cleanup_handle.h" +#include "thread_pool.h" +#include "tracker_wrap.h" + +namespace nodegit { + class AsyncContextCleanupHandle; + class Context { + public: + Context(v8::Isolate *isolate); + Context(const Context &) = delete; + Context(Context &&) = delete; + Context &operator=(const Context &) = delete; + Context &operator=(Context &&) = delete; + + ~Context(); + + static Context *GetCurrentContext(); + + v8::Local GetFromPersistent(std::string key); + + void QueueWorker(nodegit::AsyncWorker *worker); + + void SaveToPersistent(std::string key, const v8::Local &value); + + void SaveCleanupHandle(std::string key, std::shared_ptr cleanupHandle); + + std::shared_ptr GetCleanupHandle(std::string key); + + std::shared_ptr RemoveCleanupHandle(std::string key); + + void ShutdownThreadPool(std::unique_ptr cleanupHandle); + + inline void LinkTrackerList(nodegit::TrackerWrap::TrackerList *list) { + list->Link(&trackerList); + } + + inline int TrackerListSize() { + return nodegit::TrackerWrap::SizeFromList(&trackerList); + } + + private: + v8::Isolate *isolate; + + ThreadPool threadPool; + + // This map contains persistent handles that need to be cleaned up + // after the context has been torn down. + // Often this is used as a context-aware storage cell for `*::InitializeComponent` + // to store function templates on them. + Nan::Global persistentStorage; + + std::map> cleanupHandles; + + nodegit::TrackerWrap::TrackerList trackerList; + + static std::map contexts; + }; + + class AsyncContextCleanupHandle { + public: + AsyncContextCleanupHandle(const AsyncContextCleanupHandle &) = delete; + AsyncContextCleanupHandle(AsyncContextCleanupHandle &&) = delete; + AsyncContextCleanupHandle &operator=(const AsyncContextCleanupHandle &) = delete; + AsyncContextCleanupHandle &operator=(AsyncContextCleanupHandle &&) = delete; + ~AsyncContextCleanupHandle(); + + private: + static void AsyncCleanupContext(void *data, void (*uvCallback)(void *), void *uvCallbackData); + + friend class Context; + AsyncContextCleanupHandle(v8::Isolate *isolate, Context *context); + Context *context; + node::AsyncCleanupHookHandle handle; + void (*doneCallback)(void *); + void *doneData; + }; +} + +#endif diff --git a/generate/templates/manual/include/convenient_hunk.h b/generate/templates/manual/include/convenient_hunk.h new file mode 100644 index 0000000000..c45da7368f --- /dev/null +++ b/generate/templates/manual/include/convenient_hunk.h @@ -0,0 +1,89 @@ +#ifndef CONVENIENTHUNK_H +#define CONVENIENTHUNK_H +// generated from class_header.h +#include +#include + +#include "async_baton.h" +#include "async_worker.h" +#include "lock_master.h" +#include "promise_completion.h" + +extern "C" { +#include +} + +#include "../include/typedefs.h" + +struct HunkData { + git_diff_hunk hunk; + std::vector *lines; + size_t numLines; +}; + +void HunkDataFree(HunkData *hunk); + +using namespace node; +using namespace v8; + +class ConvenientHunk : public Nan::ObjectWrap { + public: + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); + + static v8::Local New(void *raw); + + HunkData *GetValue(); + char *GetHeader(); + size_t GetSize(); + + void Reference(); + void Unreference(); + + private: + ConvenientHunk(HunkData *hunk); + ConvenientHunk(const ConvenientHunk &) = delete; + ConvenientHunk(ConvenientHunk &&) = delete; + ConvenientHunk &operator=(const ConvenientHunk &) = delete; + ConvenientHunk &operator=(ConvenientHunk &&) = delete; + ~ConvenientHunk(); + + HunkData *hunk; + + static NAN_METHOD(JSNewFunction); + static NAN_METHOD(Size); + + static NAN_METHOD(OldStart); + static NAN_METHOD(OldLines); + static NAN_METHOD(NewStart); + static NAN_METHOD(NewLines); + static NAN_METHOD(HeaderLen); + static NAN_METHOD(Header); + + struct LinesBaton { + HunkData *hunk; + std::vector *lines; + }; + class LinesWorker : public nodegit::AsyncWorker { + public: + LinesWorker( + LinesBaton *_baton, + Nan::Callback *callback + ) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:ConvenientHunk:Lines") + , baton(_baton) {}; + LinesWorker(const LinesWorker &) = delete; + LinesWorker(LinesWorker &&) = delete; + LinesWorker &operator=(const LinesWorker &) = delete; + LinesWorker &operator=(LinesWorker &&) = delete; + ~LinesWorker(){}; + void Execute(); + void HandleErrorCallback(); + void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); + + private: + LinesBaton *baton; + }; + static NAN_METHOD(Lines); +}; + +#endif diff --git a/generate/templates/manual/include/convenient_patch.h b/generate/templates/manual/include/convenient_patch.h new file mode 100644 index 0000000000..a894765694 --- /dev/null +++ b/generate/templates/manual/include/convenient_patch.h @@ -0,0 +1,123 @@ +#ifndef CONVENIENTPATCH_H +#define CONVENIENTPATCH_H +// generated from class_header.h +#include +#include + +#include "async_baton.h" +#include "async_worker.h" +#include "lock_master.h" +#include "promise_completion.h" + +extern "C" { +#include +} + +#include "../include/typedefs.h" +#include "../include/convenient_hunk.h" + +struct ConvenientLineStats { + size_t context; + size_t additions; + size_t deletions; +}; + +struct PatchData { + ConvenientLineStats lineStats; + git_delta_t status; + git_diff_file new_file; + git_diff_file old_file; + std::vector *hunks; + size_t numHunks; +}; + +PatchData *createFromRaw(git_patch *raw); +void PatchDataFree(PatchData *patch); + +using namespace node; +using namespace v8; + +class ConvenientPatch : public Nan::ObjectWrap { + public: + ConvenientPatch(const ConvenientPatch &) = delete; + ConvenientPatch(ConvenientPatch &&) = delete; + ConvenientPatch &operator=(const ConvenientPatch &) = delete; + ConvenientPatch &operator=(ConvenientPatch &&) = delete; + + static void InitializeComponent(v8::Local target, nodegit::Context *nodegitContext); + + static v8::Local New(void *raw); + + ConvenientLineStats GetLineStats(); + git_delta_t GetStatus(); + git_diff_file GetOldFile(); + git_diff_file GetNewFile(); + size_t GetNumHunks(); + PatchData *GetValue(); + + void Reference(); + void Unreference(); + + private: + ConvenientPatch(PatchData *raw); + ~ConvenientPatch(); + + PatchData *patch; + + static NAN_METHOD(JSNewFunction); + + // patch methods + static NAN_METHOD(LineStats); + + // hunk methods + static NAN_METHOD(Size); + + struct HunksBaton { + PatchData *patch; + std::vector *hunks; + }; + class HunksWorker : public nodegit::AsyncWorker { + public: + HunksWorker( + HunksBaton *_baton, + Nan::Callback *callback + ) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:ConvenientPatch:Hunks") + , baton(_baton) {}; + HunksWorker(const HunksWorker &) = delete; + HunksWorker(HunksWorker &&) = delete; + HunksWorker &operator=(const HunksWorker &) = delete; + HunksWorker &operator=(HunksWorker &&) = delete; + ~HunksWorker(){}; + void Execute(); + void HandleErrorCallback(); + void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); + + private: + HunksBaton *baton; + }; + + static NAN_METHOD(Hunks); + + // delta methods + static NAN_METHOD(OldFile); + static NAN_METHOD(NewFile); + + // convenient status methods + static NAN_METHOD(Status); + static NAN_METHOD(IsUnmodified); + static NAN_METHOD(IsAdded); + static NAN_METHOD(IsDeleted); + static NAN_METHOD(IsModified); + static NAN_METHOD(IsRenamed); + static NAN_METHOD(IsCopied); + static NAN_METHOD(IsIgnored); + static NAN_METHOD(IsUntracked); + static NAN_METHOD(IsTypeChange); + static NAN_METHOD(IsUnreadable); + static NAN_METHOD(IsConflicted); + + // Hunk methods +}; + +#endif diff --git a/generate/templates/manual/include/filter_registry.h b/generate/templates/manual/include/filter_registry.h new file mode 100644 index 0000000000..ca98d972e4 --- /dev/null +++ b/generate/templates/manual/include/filter_registry.h @@ -0,0 +1,88 @@ +#ifndef GITFILTERREGISTRY_H +#define GITFILTERREGISTRY_H +#include +#include +#include + +#include "async_baton.h" +#include "async_worker.h" +#include "cleanup_handle.h" +#include "context.h" +#include "lock_master.h" +#include "nodegit_wrapper.h" +#include "promise_completion.h" + +extern "C" { +#include +} + +#include "../include/typedefs.h" + +#include "../include/filter.h" + +using namespace node; +using namespace v8; + + +class GitFilterRegistry : public Nan::ObjectWrap { + public: + static void InitializeComponent(v8::Local target, nodegit::Context *nodegitContext); + + private: + + static NAN_METHOD(GitFilterRegister); + + static NAN_METHOD(GitFilterUnregister); + + struct FilterRegisterBaton { + const git_error *error; + git_filter *filter; + char *filter_name; + int filter_priority; + int error_code; + }; + + struct FilterUnregisterBaton { + const git_error *error; + char *filter_name; + int error_code; + }; + + class RegisterWorker : public nodegit::AsyncWorker { + public: + RegisterWorker(FilterRegisterBaton *_baton, Nan::Callback *callback, std::map> &cleanupHandles) + : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:FilterRegistry:Register", cleanupHandles), baton(_baton) {}; + RegisterWorker(const RegisterWorker &) = delete; + RegisterWorker(RegisterWorker &&) = delete; + RegisterWorker &operator=(const RegisterWorker &) = delete; + RegisterWorker &operator=(RegisterWorker &&) = delete; + ~RegisterWorker() {}; + void Execute(); + void HandleErrorCallback(); + void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); + + private: + FilterRegisterBaton *baton; + }; + + class UnregisterWorker : public nodegit::AsyncWorker { + public: + UnregisterWorker(FilterUnregisterBaton *_baton, Nan::Callback *callback) + : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:FilterRegistry:Unregister"), baton(_baton) {}; + UnregisterWorker(const UnregisterWorker &) = delete; + UnregisterWorker(UnregisterWorker &&) = delete; + UnregisterWorker &operator=(const UnregisterWorker &) = delete; + UnregisterWorker &operator=(UnregisterWorker &&) = delete; + ~UnregisterWorker() {}; + void Execute(); + void HandleErrorCallback(); + void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); + + private: + FilterUnregisterBaton *baton; + }; +}; + +#endif diff --git a/generate/templates/manual/include/functions/copy.h b/generate/templates/manual/include/functions/copy.h index 299d07fea1..9983e575af 100644 --- a/generate/templates/manual/include/functions/copy.h +++ b/generate/templates/manual/include/functions/copy.h @@ -14,5 +14,10 @@ const git_index_time *git_index_time_dup(const git_index_time *arg); const git_time *git_time_dup(const git_time *arg); const git_diff_delta *git_diff_delta_dup(const git_diff_delta *arg); const git_diff_file *git_diff_file_dup(const git_diff_file *arg); +git_remote_head *git_remote_head_dup(const git_remote_head *src); + + +void git_time_dup(git_time **out, const git_time *arg); +void git_transfer_progress_dup(git_transfer_progress **out, const git_transfer_progress *arg); #endif diff --git a/generate/templates/manual/include/functions/free.h b/generate/templates/manual/include/functions/free.h new file mode 100644 index 0000000000..873417b985 --- /dev/null +++ b/generate/templates/manual/include/functions/free.h @@ -0,0 +1,12 @@ +#include + +#include + +#include "git2.h" + +#ifndef NODEGIT_FREE_FUNCTIONS +#define NODEGIT_FREE_FUNCTIONS + +void git_remote_head_free(git_remote_head *remote_head); + +#endif diff --git a/generate/templates/manual/include/git_buf_converter.h b/generate/templates/manual/include/git_buf_converter.h new file mode 100644 index 0000000000..5671246298 --- /dev/null +++ b/generate/templates/manual/include/git_buf_converter.h @@ -0,0 +1,16 @@ +#ifndef STR_ARRAY_H +#define STR_ARRAY_H + +#include + +#include "nan.h" +#include "git2/buffer.h" + +using namespace v8; + +class GitBufConverter { + public: + static git_buf *Convert(v8::Local val); +}; + +#endif diff --git a/generate/templates/manual/include/init_ssh2.h b/generate/templates/manual/include/init_ssh2.h new file mode 100644 index 0000000000..d7f92b71a4 --- /dev/null +++ b/generate/templates/manual/include/init_ssh2.h @@ -0,0 +1,6 @@ +#ifndef INIT_SSH2 +#define INIT_SSH2 + +void init_ssh2(); + +#endif diff --git a/generate/templates/manual/include/lock_master.h b/generate/templates/manual/include/lock_master.h new file mode 100644 index 0000000000..0cd313b60d --- /dev/null +++ b/generate/templates/manual/include/lock_master.h @@ -0,0 +1,182 @@ +#ifndef LOCK_MASTER_H +#define LOCK_MASTER_H + +#include + +namespace nodegit { + class LockMasterImpl; + + class LockMaster { + private: + LockMasterImpl *impl; + + template + void AddLocks(const T *t) { + // by default, don't lock anything + } + + // base case for variadic template unwinding + void AddParameters() { + } + + // processes a single parameter, then calls recursively on the rest + template + void AddParameters(const T *t, const Types*... args) { + if(t) { + AddLocks(t); + } + AddParameters(args...); + } + + void ConstructorImpl(); + void DestructorImpl(); + void ObjectToLock(const void *); + void ObjectsToLockAdded(); + public: + + // we lock on construction + template LockMaster(bool asyncAction, const Types*... types) { + if(!asyncAction) { + impl = nullptr; + return; + } + + ConstructorImpl(); + AddParameters(types...); + ObjectsToLockAdded(); + } + + // we don't want this object to be copyable, there can only be one lock holder + LockMaster(const LockMaster &other) = delete; + + LockMaster &operator=(const LockMaster &other) = delete; + + // expose a move constructor so that LockMaster can be returned + LockMaster(LockMaster &&other); + + LockMaster &operator=(LockMaster &&other); + + // and unlock on destruction + ~LockMaster() { + if(!impl) { + return; + } + DestructorImpl(); + } + + // TemporaryUnlock unlocks the LockMaster currently registered on the thread, + // and re-locks it on destruction. + class TemporaryUnlock { + LockMasterImpl *impl; + + void ConstructorImpl(); + void DestructorImpl(); + public: + TemporaryUnlock() { + // We can't return here if disabled + // It's possible that a LockMaster was fully constructed and registered + // before the thread safety was disabled. + // So we rely on ConstructorImpl to abort if there is no registered LockMaster + ConstructorImpl(); + } + TemporaryUnlock(const TemporaryUnlock &) = delete; + TemporaryUnlock(TemporaryUnlock &&) = delete; + TemporaryUnlock &operator=(const TemporaryUnlock &) = delete; + TemporaryUnlock &operator=(TemporaryUnlock &&) = delete; + ~TemporaryUnlock() { + if(!impl) { + return; + } + DestructorImpl(); + } + }; + + static void InitializeGlobal(); + static void InitializeContext(); + }; + + + template<> inline void LockMaster::AddLocks(const git_repository *repo) { + // when using a repo, lock the repo + ObjectToLock(repo); + } + + template<> inline void LockMaster::AddLocks(const git_index *index) { + // when using an index, lock the repo, or if there isn't one lock the index + const void *owner = git_index_owner(index); + if(!owner) { + owner = index; + } + ObjectToLock(owner); + } + + template<> inline void LockMaster::AddLocks(const git_commit *commit) { + // when using a commit, lock the repo + const void *owner = git_commit_owner(commit); + ObjectToLock(owner); + } + + // ... more locking rules would go here. According to an analysis of idefs.json, + // the following types are passed as non-const * and may require locking + // (some likely, some probably not): + // 'git_annotated_commit', + // 'git_blame_options', + // 'git_blob', + // 'git_buf', + // 'git_checkout_options', + // 'git_cherrypick_options', + // 'git_clone_options', + // 'git_commit', + // 'git_config', + // 'git_diff', + // 'git_diff_perfdata', + // 'git_error', + // 'git_fetch_options', + // 'git_fetch_options', + // 'git_filter', + // 'git_filter_list', + // 'git_hashsig', + // 'git_index', + // 'git_merge_file_input', + // 'git_merge_options', + // 'git_merge_options', + // 'git_note', + // 'git_note_iterator', + // 'git_object', + // 'git_odb', + // 'git_odb_object', + // 'git_oid', + // 'git_oidarray', + // 'git_packbuilder', + // 'git_patch', + // 'git_pathspec', + // 'git_push_options', + // 'git_rebase', + // 'git_rebase_options', + // 'git_refdb', + // 'git_reference', + // 'git_reflog', + // 'git_remote', + // 'git_remote_callbacks', + // 'git_remote_callbacks', + // 'git_repository', + // 'git_repository_init_options', + // 'git_revwalk', + // 'git_signature', + // 'git_stash_apply_options', + // 'git_status_list', + // 'git_strarray', + // 'git_submodule', + // 'git_submodule_update_options', + // 'git_tag', + // 'git_transfer_progress', + // 'git_transport', + // 'git_tree', + // 'git_treebuilder', + // 'git_writestream' + // + // Other types are always passed as const * and perhaps don't require locking + // (it's not a guarantee though) +} + +#endif diff --git a/generate/templates/manual/include/macros.h b/generate/templates/manual/include/macros.h deleted file mode 100644 index 80e63ab045..0000000000 --- a/generate/templates/manual/include/macros.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef NODEGIT_PSUEDONAN_H_ -#if (NODE_MODULE_VERSION > 0x000B) -// Node 0.11+ (0.11.3 and below won't compile with these) -# define NodeGitPsueodoNanReturnEscapingValue(val) NanReturnValue(NanEscapeScope(val)) - -#else -// Node 0.8 and 0.10 -# define NodeGitPsueodoNanReturnEscapingValue(val) NanReturnValue(val) - -#endif - -#endif //NODEGIT_PSUEDONAN_H_ diff --git a/generate/templates/manual/include/nodegit.h b/generate/templates/manual/include/nodegit.h new file mode 100644 index 0000000000..bab3e4179b --- /dev/null +++ b/generate/templates/manual/include/nodegit.h @@ -0,0 +1,11 @@ +#ifndef NODEGIT_H +#define NODEGIT_H + +v8::Local GetPrivate(v8::Local object, + v8::Local key); + +void SetPrivate(v8::Local object, + v8::Local key, + v8::Local value); + +#endif diff --git a/generate/templates/manual/include/nodegit_wrapper.h b/generate/templates/manual/include/nodegit_wrapper.h new file mode 100644 index 0000000000..c72f29027d --- /dev/null +++ b/generate/templates/manual/include/nodegit_wrapper.h @@ -0,0 +1,94 @@ +#ifndef NODEGIT_WRAPPER_H +#define NODEGIT_WRAPPER_H + +#include +#include + +#include "tracker_wrap.h" +#include "cleanup_handle.h" + +// the Traits template parameter supplies: +// typename cppClass - the C++ type of the NodeGit wrapper (e.g. GitRepository) +// typename cType - the C type of the libgit2 object being wrapped (e.g. git_repository) +// +// static const bool isDuplicable +// static void duplicate(cType **dest, cType *src) - duplicates src using dupFunction or cpyFunction +// +// static const bool isFreeable +// static void free(cType *raw) - frees the object using freeFunctionName +// +// nodegit::TrackerWrap allows for cheap tracking of new objects, avoiding searchs +// in a container to remove the tracking of a specific object. + +namespace nodegit { + class Context; +} + +template +class NodeGitWrapper : public nodegit::TrackerWrap { +public: + // replicate Traits typedefs for ease of use + typedef typename Traits::cType cType; + typedef typename Traits::cppClass cppClass; + + // whether raw should be freed on destruction + // TODO: this should be protected but we have a few use cases that change this to + // false from the outside. I suspect it gets turned to false to avoid + // double-free problems in cases like when we pass cred objects to libgit2 + // and it frees them. We should probably be NULLing raw in that case + // (and through a method) instead of changing selfFreeing, but that's + // a separate issue. + bool selfFreeing; + + nodegit::Context *nodegitContext = nullptr; + +protected: + cType *raw; + std::vector> childCleanupVector; + + // owner of the object, in the memory management sense. only populated + // when using ownedByThis, and the type doesn't have a dupFunction + // CopyablePersistentTraits are used to get the reset-on-destruct behavior. + Nan::Persistent > owner; + + // diagnostic count of self-freeing object instances + thread_local static int SelfFreeingInstanceCount; + // diagnostic count of constructed non-self-freeing object instances + thread_local static int NonSelfFreeingConstructedCount; + + static void InitializeTemplate(v8::Local &tpl); + + NodeGitWrapper(cType *raw, bool selfFreeing, v8::Local owner); + NodeGitWrapper(const char *error); // calls ThrowError + NodeGitWrapper(const NodeGitWrapper &) = delete; + NodeGitWrapper(NodeGitWrapper &&) = delete; + NodeGitWrapper &operator=(const NodeGitWrapper &) = delete; + NodeGitWrapper &operator=(NodeGitWrapper &&) = delete; + ~NodeGitWrapper(); + + static NAN_METHOD(JSNewFunction); + + static NAN_METHOD(GetSelfFreeingInstanceCount); + static NAN_METHOD(GetNonSelfFreeingConstructedCount); + + void SetNativeOwners(v8::Local owners); + +public: + static v8::Local New(const cType *raw, bool selfFreeing, v8::Local owner = v8::Local()); + + void SaveCleanupHandle(std::shared_ptr cleanupHandle); + + void Reference(); + void Unreference(); + + void AddReferenceCallbacks(size_t, std::function, std::function); + + cType *GetValue(); + void ClearValue(); + +private: + std::unordered_map> referenceCallbacks; + std::unordered_map> unreferenceCallbacks; +}; + +#endif diff --git a/generate/templates/manual/include/promise_completion.h b/generate/templates/manual/include/promise_completion.h new file mode 100644 index 0000000000..da933b7de3 --- /dev/null +++ b/generate/templates/manual/include/promise_completion.h @@ -0,0 +1,42 @@ +#ifndef PROMISE_COMPLETION +#define PROMISE_COMPLETION + +#include + +#include "async_baton.h" +#include "context.h" + +// PromiseCompletion forwards either the resolved result or the rejection reason +// to the native layer, once the promise completes +// +// inherits ObjectWrap so it can be used in v8 and managed by the garbage collector +// it isn't wired up to be instantiated or accessed from the JS layer other than +// for the purpose of promise result forwarding +class PromiseCompletion : public Nan::ObjectWrap +{ + // callback type called when a promise completes + typedef void (*Callback) (bool isFulfilled, nodegit::AsyncBaton *baton, v8::Local resultOfPromise); + + static NAN_METHOD(New); + static NAN_METHOD(PromiseFulfilled); + static NAN_METHOD(PromiseRejected); + + static v8::Local Bind(v8::Local method, v8::Local object); + static void CallCallback(bool isFulfilled, const Nan::FunctionCallbackInfo &info); + + // callback and baton stored for the promise that this PromiseCompletion is + // attached to. when the promise completes, the callback will be called with + // the result, and the stored baton. + Callback callback; + nodegit::AsyncBaton *baton; + + void Setup(v8::Local thenFn, v8::Local result, nodegit::AsyncBaton *baton, Callback callback); +public: + // If result is a promise, this will instantiate a new PromiseCompletion + // and have it forward the promise result / reason via the baton and callback + static bool ForwardIfPromise(v8::Local result, nodegit::AsyncBaton *baton, Callback callback); + + static void InitializeComponent(nodegit::Context *nodegitContext); +}; + +#endif diff --git a/generate/templates/manual/include/reference_counter.h b/generate/templates/manual/include/reference_counter.h new file mode 100644 index 0000000000..2afa2310c7 --- /dev/null +++ b/generate/templates/manual/include/reference_counter.h @@ -0,0 +1,30 @@ +#ifndef REFERENCE_COUNTER_H +#define REFERENCE_COUNTER_H + +#include + +#include "lock_master.h" + +// There are certain instances in libgit2 which can be retrieved from multiple sources +// We need to make sure that we're counting how many times we've seen that pointer +// so that when we are performing free behavior, we don't free it until it is no longer +// referenced. The main example of this behavior is the repository instance, where +// after git_repository_open open (first instance) we can git_commit_lookup, followed by +// git_commit_owner (second instance). +// +// I was hoping that we could construct a Persistent handle, but that would interfere with +// GC. We want it to attmept to GC, and if this handle exists, the final repo will not +// free itself :(. +// +// Make sure to utilize LockMaster when incrementing or decrementing a reference count. +class ReferenceCounter { +public: + static void incrementCountForPointer(void *ptr); + + static unsigned long decrementCountForPointer(void *ptr); + +private: + static std::unordered_map referenceCountByPointer; +}; + +#endif diff --git a/generate/templates/manual/include/str_array_converter.h b/generate/templates/manual/include/str_array_converter.h index c0df65fc93..d5edd61872 100644 --- a/generate/templates/manual/include/str_array_converter.h +++ b/generate/templates/manual/include/str_array_converter.h @@ -11,11 +11,13 @@ using namespace v8; class StrArrayConverter { public: - static git_strarray *Convert (Handle val); + static git_strarray *Convert (v8::Local val); + static void ConvertInto(git_strarray *out, v8::Local val); + static void ConvertInto(git_strarray *out, v8::Local val); private: - static git_strarray *ConvertArray(Array *val); - static git_strarray *ConvertString(Handle val); + static git_strarray *ConvertArray(v8::Local val); + static git_strarray *ConvertString(v8::Local val); static git_strarray *AllocStrArray(const size_t count); static git_strarray *ConstructStrArray(int argc, char** argv); }; diff --git a/generate/templates/manual/include/thread_pool.h b/generate/templates/manual/include/thread_pool.h new file mode 100644 index 0000000000..4653e80795 --- /dev/null +++ b/generate/templates/manual/include/thread_pool.h @@ -0,0 +1,84 @@ +#ifndef THREAD_POOL_H +#define THREAD_POOL_H + +#include +#include +#include +#include + +#include "async_worker.h" + +// Temporary workaround for LFS checkout. Comment added to be reverted. +// With the threadpool rewrite, a Worker will execute its callbacks with +// objects temporary unlock (to prevent deadlocks), and we'll wait until +// the callback is done to lock them back again (to make sure it's thread-safe). +// LFS checkout lost performance after this, and the proper way to fix it is +// to integrate nodegit-lfs into nodegit. Until this is implemented, a +// temporary workaround has been applied, which affects only Workers leveraging +// threaded libgit2 functions (at the moment only checkout) and does the +// following: +// - do not wait for the current callback to end, so that it can send the +// next callback to the main JS thread. +// - do not temporary unlock the objects, since they would be locked back +// again before the callback is executed. + +namespace nodegit { + class Context; + class AsyncContextCleanupHandle; + class ThreadPoolImpl; + + class ThreadPool { + public: + typedef std::function Callback; + typedef std::function QueueCallbackFn; + // Temporary workaround for LFS checkout. Code modified to be reverted. + // typedef std::function OnPostCallbackFn; + typedef std::function OnPostCallbackFn; + + // Initializes thread pool and spins up the requested number of threads + // The provided loop will be used for completion callbacks, whenever + // queued work is completed + ThreadPool(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context); + + ThreadPool(const ThreadPool &) = delete; + ThreadPool(ThreadPool &&) = delete; + ThreadPool &operator=(const ThreadPool &) = delete; + ThreadPool &operator=(ThreadPool &&) = delete; + + ~ThreadPool(); + + // Queues work on the thread pool, followed by completion call scheduled + // on the loop provided in the constructor. + // QueueWork should be called on the loop provided in the constructor. + void QueueWorker(nodegit::AsyncWorker *worker); + + // When an AsyncWorker is being executed, the threads involved in executing + // will ensure that this is set to the AsyncResource belonging to the AsyncWorker. + // This ensures that any callbacks from libgit2 take the correct AsyncResource + // when scheduling work on the JS thread. + static Nan::AsyncResource *GetCurrentAsyncResource(); + + // Same as GetCurrentAsyncResource, except used to ensure callbacks occur + // in the correct context. + static const nodegit::Context *GetCurrentContext(); + + // Same as GetCurrentAsyncResource, except used for callbacks to store errors + // for use after completion of async work + static Nan::Global *GetCurrentCallbackErrorHandle(); + + // Queues a callback on the loop provided in the constructor + static void PostCallbackEvent(OnPostCallbackFn onPostCallback); + + // Called once at libgit2 initialization to setup contracts with libgit2 + static void InitializeGlobal(); + + // Will asynchronously shutdown the thread pool + // It will also clean up any resources that the thread pool is keeping alive + void Shutdown(std::unique_ptr cleanupHandle); + + private: + std::unique_ptr impl; + }; +} + +#endif diff --git a/generate/templates/manual/include/tracker_wrap.h b/generate/templates/manual/include/tracker_wrap.h new file mode 100644 index 0000000000..3b15eba424 --- /dev/null +++ b/generate/templates/manual/include/tracker_wrap.h @@ -0,0 +1,76 @@ +#ifndef TRACKERWRAP_H +#define TRACKERWRAP_H + +#include +#include +#include + +namespace nodegit { + // Base class used to track wrapped objects, so that we can + // free the objects that were not freed at the time of context + // closing (because their WeakCallback didn't trigger. See + // https://github.com/nodejs/help/issues/3297). + // Implementation based on node.js's class RefTracker (napi). + class TrackerWrap : public Nan::ObjectWrap { + public: + TrackerWrap() = default; + virtual ~TrackerWrap() = default; + TrackerWrap(const TrackerWrap &other) = delete; + TrackerWrap(TrackerWrap &&other) = delete; + TrackerWrap& operator=(const TrackerWrap &other) = delete; + TrackerWrap& operator=(TrackerWrap &&other) = delete; + + // aliases: + // 'TrackerList': used in functionality related to a list. + // 'TrackerWrap' used in functionality not related to a list. + using TrackerList = TrackerWrap; + + // Links 'this' right after 'listStart' + inline void Link(TrackerList* listStart) { + m_prev = listStart; + m_next = listStart->m_next; + if (m_next != nullptr) { + m_next->m_prev = this; + } + listStart->m_next = this; + } + + // Unlinks itself from the list it's linked to + inline TrackerWrap* Unlink() { + if (m_prev != nullptr) { + m_prev->m_next = m_next; + } + if (m_next != nullptr) { + m_next->m_prev = m_prev; + } + m_prev = nullptr; + m_next = nullptr; + return this; + } + + inline void SetTrackerWrapOwners(std::unique_ptr< std::vector > &&owners) { + m_owners = std::move(owners); + } + + inline const std::vector* GetTrackerWrapOwners() const { + return m_owners.get(); + } + + // Unlinks and returns the first item of 'listStart' + static TrackerWrap* UnlinkFirst(TrackerList *listStart); + + // Returns number of items following 'listStart' + static int SizeFromList(TrackerList *listStart); + + // Deletes items following 'listStart', but not 'listStart' itself + static void DeleteFromList(TrackerList *listStart); + + private: + TrackerList* m_next {}; + TrackerList* m_prev {}; + // m_owners will store pointers to native objects + std::unique_ptr< std::vector > m_owners {}; + }; +} + +#endif diff --git a/generate/templates/manual/include/typedefs.h b/generate/templates/manual/include/typedefs.h new file mode 100644 index 0000000000..a1fe6311cf --- /dev/null +++ b/generate/templates/manual/include/typedefs.h @@ -0,0 +1,8 @@ +#ifndef TYPEDEFS_H +#define TYPEDEFS_H + +#include "git2/submodule.h" + +typedef int (*git_submodule_cb)(git_submodule *sm, const char *name, void *payload); + +#endif diff --git a/generate/templates/manual/include/v8_helpers.h b/generate/templates/manual/include/v8_helpers.h new file mode 100644 index 0000000000..184b8d31b1 --- /dev/null +++ b/generate/templates/manual/include/v8_helpers.h @@ -0,0 +1,10 @@ +#ifndef NODEGIT_V8_HELPERS_H +#define NODEGIT_V8_HELPERS_H + +#include + +namespace nodegit { + v8::Local safeGetField(v8::Local &containerObj, std::string fieldName); +} + +#endif diff --git a/generate/templates/manual/include/worker_pool.h b/generate/templates/manual/include/worker_pool.h new file mode 100644 index 0000000000..3380c87060 --- /dev/null +++ b/generate/templates/manual/include/worker_pool.h @@ -0,0 +1,180 @@ +#ifndef WORK_POOL_H +#define WORK_POOL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * \class WorkItem + * Abstract class for work items in the WorkerPool. + */ +class WorkItem +{ +public: + WorkItem() = default; + virtual ~WorkItem() = default; + WorkItem(const WorkItem &other) = default; + WorkItem(WorkItem &&other) = default; + WorkItem& operator=(const WorkItem &other) = default; + WorkItem& operator=(WorkItem &&other) = default; +}; + +/** + * \class Worker + * Interface for Workers in the WorkerPool. + */ +class IWorker +{ +public: + IWorker() = default; + virtual ~IWorker() = default; + IWorker(const IWorker &other) = delete; + IWorker(IWorker &&other) = delete; + IWorker& operator=(const IWorker &other) = delete; + IWorker& operator=(IWorker &&other) = delete; + + virtual bool Initialize() = 0; + virtual bool Execute(std::unique_ptr &&work) = 0; +}; + +/* Enumeration describing the Worker Pool Status: +* - kOk: everything ok. +* - kInitializeFailed: a worker thread failed when calling Initialize(). +* - kExecuteFailed: a worker thread failed when calling Execute(). +* - kShutdownEarly: InsertWork() was called but the worker pool was stopped. +*/ +enum class WPStatus {kOk, kInitializeFailed, kExecuteFailed, kShutdownEarly}; + +/** + * \class WorkerPool + * To leverage this class, a Worker must inherit from IWorker. + * WorkItem is an abstract class from which to inherit too. + */ +template +class WorkerPool { +public: + WorkerPool(); + ~WorkerPool() = default; + WorkerPool(const WorkerPool &other) = delete; + WorkerPool(WorkerPool &&other) = delete; + WorkerPool& operator=(const WorkerPool &other) = delete; + WorkerPool& operator=(WorkerPool &&other) = delete; + + void Init(std::vector< std::shared_ptr > workers); + void InsertWork(std::unique_ptr &&work); + void Shutdown(); + WPStatus Status() { return m_atomicWPStatus; } + +private: + void DoWork(std::shared_ptr worker); + + std::mutex m_mutex {}; // locks m_workQueue and m_stop + std::condition_variable m_condition {}; + std::queue< std::unique_ptr > m_workQueue {}; + bool m_stop {true}; // initially the workpool has no worker threads + std::vector> m_threads {}; + std::atomic m_atomicWPStatus {WPStatus::kOk}; +}; + + +template +WorkerPool::WorkerPool() { + static_assert(std::is_base_of::value, "Worker must inherit from IWorker"); +} + +// launches the worker threads, if they hadn't been launched already +template +void WorkerPool::Init(std::vector< std::shared_ptr > workers) +{ + { + std::lock_guard lock(m_mutex); + if (!m_stop) + return; + m_stop = false; + } + + std::for_each (workers.begin(), workers.end(), [this](std::shared_ptr worker) { + m_threads.emplace_back(std::make_unique(std::bind(&WorkerPool::DoWork, this, worker))); + }); +} + +// queues work, or sets WPStatus::kShutdownEarly +template +void WorkerPool::InsertWork(std::unique_ptr &&work) +{ + { + std::lock_guard lock(m_mutex); + if (m_stop) { + m_atomicWPStatus = WPStatus::kShutdownEarly; + return; + } + m_workQueue.emplace(std::move(work)); + } + m_condition.notify_one(); +} + +template +void WorkerPool::Shutdown() +{ + { + std::lock_guard lock(m_mutex); + if (m_stop) { + return; + } + m_stop = true; + } + m_condition.notify_all(); + + std::for_each (m_threads.begin(), m_threads.end(), [](std::unique_ptr &wt) { + if (wt->joinable()) { + wt->join(); + } + }); +} + +template +void WorkerPool::DoWork(std::shared_ptr worker) +{ + if (!worker->Initialize()) { + m_atomicWPStatus = WPStatus::kInitializeFailed; + return; + } + + while (true) { + std::unique_ptr work {}; + { + std::unique_lock lock(m_mutex); + m_condition.wait(lock, [this] { + return this->m_stop || !this->m_workQueue.empty(); + }); + + // stop all workers if any of them failed on Initialize() or Execute() + // or the workerPool shutdown early + if (Status() != WPStatus::kOk) { + return; + } + + if (m_stop && m_workQueue.empty()) { + return; + } + + work = std::move(m_workQueue.front()); + m_workQueue.pop(); + } + + if (!worker->Execute(std::move(work))) { + m_atomicWPStatus = WPStatus::kExecuteFailed; + return; + } + } +} + +#endif // WORK_POOL_H + diff --git a/generate/templates/manual/include/wrapper.h b/generate/templates/manual/include/wrapper.h index f429defbd7..f24ce800ba 100644 --- a/generate/templates/manual/include/wrapper.h +++ b/generate/templates/manual/include/wrapper.h @@ -9,18 +9,17 @@ #include #include "nan.h" +#include "context.h" using namespace node; using namespace v8; -class Wrapper : public ObjectWrap { +class Wrapper : public Nan::ObjectWrap { public: - - static Persistent constructor_template; - static void InitializeComponent (Handle target); + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); void *GetValue(); - static Handle New(void *raw); + static v8::Local New(const void *raw); private: Wrapper(void *raw); diff --git a/generate/templates/manual/libgit2/opts.cc b/generate/templates/manual/libgit2/opts.cc new file mode 100644 index 0000000000..5829adc6cd --- /dev/null +++ b/generate/templates/manual/libgit2/opts.cc @@ -0,0 +1,117 @@ +NAN_METHOD(GitLibgit2::Opts) +{ + Nan::EscapableHandleScope scope; + + if (info.Length() == 0 || !info[0]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + + const int from_option = (int)info[0].As()->Value(); + + git_error_clear(); + + v8::Local to = Nan::Undefined(); + switch (from_option) { + // GET size_t + case GIT_OPT_GET_MWINDOW_SIZE: + case GIT_OPT_GET_MWINDOW_MAPPED_LIMIT: + case GIT_OPT_GET_PACK_MAX_OBJECTS: { + size_t option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET int + case GIT_OPT_GET_OWNER_VALIDATION: { + int option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET unsigned long + case GIT_OPT_GET_WINDOWS_SHAREMODE: { + unsigned long option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET ssize_t + case GIT_OPT_GET_CACHED_MEMORY: { + ssize_t option_value; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value); + break; + } + // GET git_buf + case GIT_OPT_GET_TEMPLATE_PATH: + case GIT_OPT_GET_USER_AGENT: { + git_buf option_value = { 0 }; + if (git_libgit2_opts(from_option, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value.ptr, option_value.size) + .ToLocalChecked(); + git_buf_dispose(&option_value); + break; + } + case GIT_OPT_GET_SEARCH_PATH: { + git_buf option_value = { 0 }; + if (info.Length() < 2 || !info[1]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + const int level = (int)info[1].As()->Value(); + if (git_libgit2_opts(from_option, level, &option_value)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + to = Nan::New(option_value.ptr, option_value.size) + .ToLocalChecked(); + git_buf_dispose(&option_value); + break; + } + // SET int + case GIT_OPT_ENABLE_CACHING: + case GIT_OPT_ENABLE_STRICT_OBJECT_CREATION: + case GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION: + case GIT_OPT_ENABLE_OFS_DELTA: + case GIT_OPT_ENABLE_FSYNC_GITDIR: + case GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION: + case GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY: + case GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS: + case GIT_OPT_SET_OWNER_VALIDATION: { + if (info.Length() < 2 || !info[1]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + const int option_arg = (int)info[1].As()->Value(); + if (git_libgit2_opts(from_option, option_arg)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + break; + } + // SET size_t + case GIT_OPT_SET_MWINDOW_SIZE: + case GIT_OPT_SET_MWINDOW_MAPPED_LIMIT: + case GIT_OPT_SET_PACK_MAX_OBJECTS: { + if (info.Length() < 2 || !info[1]->IsNumber()) { + return Nan::ThrowError("Number option is required."); + } + const size_t option_arg = (size_t)info[1].As()->Value(); + if (git_libgit2_opts(from_option, option_arg)) { + return Nan::ThrowError("git_libgit2_opts failed"); + } + break; + } + default: { + return Nan::ThrowError("Unsupported option"); + } + } + + return info.GetReturnValue().Set(scope.Escape(to)); +} diff --git a/generate/templates/manual/patches/convenient_patches.cc b/generate/templates/manual/patches/convenient_patches.cc new file mode 100644 index 0000000000..8873fe07c8 --- /dev/null +++ b/generate/templates/manual/patches/convenient_patches.cc @@ -0,0 +1,205 @@ +NAN_METHOD(GitPatch::ConvenientFromDiff) { + if (info.Length() == 0 || !info[0]->IsObject()) { + return Nan::ThrowError("Diff diff is required."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + ConvenientFromDiffBaton *baton = new ConvenientFromDiffBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + + baton->diff = Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked())->GetValue(); + + if (info[1]->IsArray()) { + v8::Local context = Nan::GetCurrentContext(); + const v8::Local indexesArray = info[1].As(); + const uint32_t numIndexes = indexesArray->Length(); + + for (uint32_t i = 0; i < numIndexes; ++i) { + v8::Local value = indexesArray->Get(context, i).ToLocalChecked(); + int idx = value.As()->Value(); + baton->indexes.push_back(idx); + } + } + + baton->out = new std::vector; + baton->out->reserve(git_diff_num_deltas(baton->diff)); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + ConvenientFromDiffWorker *worker = new ConvenientFromDiffWorker(baton, callback, cleanupHandles); + + worker->Reference("diff", info[0]); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitPatch::ConvenientFromDiffWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->diff); + return lockMaster; +} + +void GitPatch::ConvenientFromDiffWorker::Execute() { + git_error_clear(); + + std::vector patchesToBeFreed; + + if (baton->indexes.size() > 0) { + for (int idx : baton->indexes) { + git_patch *nextPatch; + int result = git_patch_from_diff(&nextPatch, baton->diff, idx); + + if (result) { + while (!patchesToBeFreed.empty()) + { + git_patch_free(patchesToBeFreed.back()); + patchesToBeFreed.pop_back(); + } + + while (!baton->out->empty()) { + PatchDataFree(baton->out->back()); + baton->out->pop_back(); + } + + baton->error_code = result; + + if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + + delete baton->out; + baton->out = NULL; + + return; + } + + if (nextPatch != NULL) { + baton->out->push_back(createFromRaw(nextPatch)); + patchesToBeFreed.push_back(nextPatch); + } + } + } else { + for (std::size_t i = 0; i < git_diff_num_deltas(baton->diff); ++i) { + git_patch *nextPatch; + int result = git_patch_from_diff(&nextPatch, baton->diff, i); + + if (result) { + while (!patchesToBeFreed.empty()) + { + git_patch_free(patchesToBeFreed.back()); + patchesToBeFreed.pop_back(); + } + + while (!baton->out->empty()) { + PatchDataFree(baton->out->back()); + baton->out->pop_back(); + } + + baton->error_code = result; + + if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + + delete baton->out; + baton->out = NULL; + + return; + } + + if (nextPatch != NULL) { + baton->out->push_back(createFromRaw(nextPatch)); + patchesToBeFreed.push_back(nextPatch); + } + } + } + + while (!patchesToBeFreed.empty()) + { + git_patch_free(patchesToBeFreed.back()); + patchesToBeFreed.pop_back(); + } +} + +void GitPatch::ConvenientFromDiffWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while (!baton->out->empty()) { + PatchDataFree(baton->out->back()); + baton->out->pop_back(); + } + + delete baton->out; + + delete baton; +} + +void GitPatch::ConvenientFromDiffWorker::HandleOKCallback() { + if (baton->out != NULL) { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + + for (unsigned int i = 0; i < size; ++i) { + Nan::Set(result, Nan::New(i), ConvenientPatch::New((void *)baton->out->at(i))); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + + return; + } + + if (baton->error) { + Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method convenientFromDiff has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + + return; + } + + if (baton->error_code < 0) { + Local err = Nan::To(Nan::Error("method convenientFromDiff has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Patch.convenientFromDiff").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + + return; + } + + Nan::Call(*callback, 0, NULL); +} diff --git a/generate/templates/manual/remote/ls.cc b/generate/templates/manual/remote/ls.cc new file mode 100644 index 0000000000..97c801c629 --- /dev/null +++ b/generate/templates/manual/remote/ls.cc @@ -0,0 +1,116 @@ +NAN_METHOD(GitRemote::ReferenceList) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + ReferenceListBaton* baton = new ReferenceListBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->remote = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + ReferenceListWorker *worker = new ReferenceListWorker(baton, callback, cleanupHandles); + worker->Reference("remote", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRemote::ReferenceListWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->remote); + return lockMaster; +} + +void GitRemote::ReferenceListWorker::Execute() +{ + git_error_clear(); + + const git_remote_head **remote_heads; + size_t num_remote_heads; + baton->error_code = git_remote_ls( + &remote_heads, + &num_remote_heads, + baton->remote + ); + + if (baton->error_code != GIT_OK) { + baton->error = git_error_dup(git_error_last()); + delete baton->out; + baton->out = NULL; + return; + } + + baton->out->reserve(num_remote_heads); + + for (size_t head_index = 0; head_index < num_remote_heads; ++head_index) { + git_remote_head *remote_head = git_remote_head_dup(remote_heads[head_index]); + baton->out->push_back(remote_head); + } +} + +void GitRemote::ReferenceListWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + delete baton->out; + + delete baton; +} + +void GitRemote::ReferenceListWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + Nan::Set(result, Nan::New(i), GitRemoteHead::New(baton->out->at(i), true)); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Reference List has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Remote.referenceList").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/get_references.cc b/generate/templates/manual/repository/get_references.cc new file mode 100644 index 0000000000..56bc12ac34 --- /dev/null +++ b/generate/templates/manual/repository/get_references.cc @@ -0,0 +1,162 @@ +NAN_METHOD(GitRepository::GetReferences) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetReferencesBaton* baton = new GetReferencesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetReferencesWorker *worker = new GetReferencesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::GetReferencesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitRepository::GetReferencesWorker::Execute() +{ + giterr_clear(); + + git_repository *repo = baton->repo; + + git_strarray reference_names; + baton->error_code = git_reference_list(&reference_names, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete baton->out; + baton->out = NULL; + return; + } + + for (size_t reference_index = 0; reference_index < reference_names.count; ++reference_index) { + git_reference *reference; + baton->error_code = git_reference_lookup(&reference, repo, reference_names.strings[reference_index]); + + // stop execution and return if there is an error + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + // unwind and return + while (baton->out->size()) { + git_reference *referenceToFree = baton->out->back(); + baton->out->pop_back(); + git_reference_free(referenceToFree); + } + + git_strarray_free(&reference_names); + delete baton->out; + baton->out = NULL; + return; + } + + if (git_reference_type(reference) == GIT_REF_SYMBOLIC) { + git_reference *resolved_reference; + int resolve_result = git_reference_resolve(&resolved_reference, reference); + git_reference_free(reference); + + // if we can't resolve the ref, then just ignore it + if (resolve_result == GIT_OK) { + baton->out->push_back(resolved_reference); + } + } else { + baton->out->push_back(reference); + } + } + + git_strarray_free(&reference_names); +} + +void GitRepository::GetReferencesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while (baton->out->size()) { + git_reference *referenceToFree = baton->out->back(); + baton->out->pop_back(); + git_reference_free(referenceToFree); + } + + delete baton->out; + + delete baton; +} + +void GitRepository::GetReferencesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_reference *reference = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitRefs::New( + reference, + true, + Nan::To(GitRepository::New(git_reference_owner(reference), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository getReferences has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.getReferences").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/get_remotes.cc b/generate/templates/manual/repository/get_remotes.cc new file mode 100644 index 0000000000..a7c316bb0e --- /dev/null +++ b/generate/templates/manual/repository/get_remotes.cc @@ -0,0 +1,161 @@ +NAN_METHOD(GitRepository::GetRemotes) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetRemotesBaton* baton = new GetRemotesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetRemotesWorker *worker = new GetRemotesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::GetRemotesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + +void GitRepository::GetRemotesWorker::Execute() +{ + giterr_clear(); + + git_repository *repo = baton->repo; + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete baton->out; + baton->out = NULL; + return; + } + + git_strarray remote_names; + baton->error_code = git_remote_list(&remote_names, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + delete baton->out; + baton->out = NULL; + return; + } + + for (size_t remote_index = 0; remote_index < remote_names.count; ++remote_index) { + git_remote *remote; + baton->error_code = git_remote_lookup(&remote, repo, remote_names.strings[remote_index]); + + // stop execution and return if there is an error + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + // unwind and return + while (baton->out->size()) { + git_remote *remoteToFree = baton->out->back(); + baton->out->pop_back(); + git_remote_free(remoteToFree); + } + + git_strarray_free(&remote_names); + delete baton->out; + baton->out = NULL; + return; + } + + baton->out->push_back(remote); + } + + git_strarray_free(&remote_names); +} + +void GitRepository::GetRemotesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while (baton->out->size()) { + git_remote *remoteToFree = baton->out->back(); + baton->out->pop_back(); + git_remote_free(remoteToFree); + } + + delete baton->out; + + delete baton; +} + +void GitRepository::GetRemotesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_remote *remote = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitRemote::New( + remote, + true, + Nan::To(GitRepository::New(git_remote_owner(remote), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository refreshRemotes has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.refreshRemotes").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/get_submodules.cc b/generate/templates/manual/repository/get_submodules.cc new file mode 100644 index 0000000000..069f6bdbc8 --- /dev/null +++ b/generate/templates/manual/repository/get_submodules.cc @@ -0,0 +1,141 @@ +NAN_METHOD(GitRepository::GetSubmodules) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetSubmodulesBaton* baton = new GetSubmodulesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = new std::vector; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetSubmodulesWorker *worker = new GetSubmodulesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +struct submodule_foreach_payload { + git_repository *repo; + std::vector *out; +}; + +int foreachSubmoduleCB(git_submodule *submodule, const char *name, void *void_payload) { + submodule_foreach_payload *payload = (submodule_foreach_payload *)void_payload; + git_submodule *out; + + int result = git_submodule_lookup(&out, payload->repo, name); + if (result == GIT_OK) { + payload->out->push_back(out); + } + + return result; +} + +nodegit::LockMaster GitRepository::GetSubmodulesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitRepository::GetSubmodulesWorker::Execute() +{ + giterr_clear(); + + submodule_foreach_payload payload { baton->repo, baton->out }; + baton->error_code = git_submodule_foreach(baton->repo, foreachSubmoduleCB, (void *)&payload); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (baton->out->size()) { + git_submodule_free(baton->out->back()); + baton->out->pop_back(); + } + delete baton->out; + baton->out = NULL; + } +} + +void GitRepository::GetSubmodulesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while (baton->out->size()) { + git_submodule_free(baton->out->back()); + baton->out->pop_back(); + } + + delete baton->out; + + delete baton; +} + +void GitRepository::GetSubmodulesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + git_submodule *submodule = baton->out->at(i); + Nan::Set( + result, + Nan::New(i), + GitSubmodule::New( + submodule, + true, + Nan::To(GitRepository::New(git_submodule_owner(submodule), true)).ToLocalChecked() + ) + ); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository getSubmodules has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.getSubmodules").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/refresh_references.cc b/generate/templates/manual/repository/refresh_references.cc new file mode 100644 index 0000000000..5194f1c48c --- /dev/null +++ b/generate/templates/manual/repository/refresh_references.cc @@ -0,0 +1,712 @@ +int getOidOfReferenceCommit(git_oid *commitOid, git_reference *ref) { + git_object *commitObject; + int result = git_reference_peel(&commitObject, ref, GIT_OBJ_COMMIT); + + if (result != GIT_OK) { + return result; + } + + git_oid_cpy(commitOid, git_object_id(commitObject)); + git_object_free(commitObject); + return result; +} + +int asDirectReference(git_reference **out, git_reference *ref) { + if (git_reference_type(ref) != GIT_REF_SYMBOLIC) { + return git_reference_dup(out, ref); + } + + int error = git_reference_resolve(out, ref); + if (error != GIT_OK) { + *out = NULL; + } + + return GIT_OK; +} + +int lookupDirectReferenceByShorthand(git_reference **out, git_repository *repo, const char *shorthand) { + git_reference *ref = NULL; + int result = git_reference_dwim(&ref, repo, shorthand); + + if (result != GIT_OK) { + return result; + } + + result = asDirectReference(out, ref); + git_reference_free(ref); + return result; +} + +int lookupDirectReferenceByFullName(git_reference **out, git_repository *repo, const char *fullName) { + git_reference *ref = NULL; + int result = git_reference_lookup(&ref, repo, fullName); + + if (result != GIT_OK) { + return result; + } + + result = asDirectReference(out, ref); + git_reference_free(ref); + return result; +} + +char *getRemoteNameOfReference(git_reference *remoteReference) { + return strtok(strdup(git_reference_shorthand(remoteReference)), "/"); +} + +bool gitStrArrayContains(git_strarray *strarray, const char *string) { + for (size_t i = 0; i < strarray->count; ++i) { + if (strcmp(strarray->strings[i], string) == 0) { + return true; + } + } + return false; +} + +class RefreshedRefModel { +public: + RefreshedRefModel(git_reference *ref): + fullName(strdup(git_reference_name(ref))), + message(NULL), + sha(new char[GIT_OID_HEXSZ + 1]), + shorthand(strdup(git_reference_shorthand(ref))), + tagOdbBuffer(NULL), + tagOdbBufferLength(0), + type(NULL) + { + if (git_reference_is_branch(ref)) { + type = "branch"; + } else if (git_reference_is_remote(ref)) { + type = "remote"; + } else { + type = "tag"; + } + } + + RefreshedRefModel(const RefreshedRefModel &) = delete; + RefreshedRefModel(RefreshedRefModel &&) = delete; + RefreshedRefModel &operator=(const RefreshedRefModel &) = delete; + RefreshedRefModel &operator=(RefreshedRefModel &&) = delete; + + static int fromReference(RefreshedRefModel **out, git_reference *ref, git_odb *odb) { + RefreshedRefModel *refModel = new RefreshedRefModel(ref); + const git_oid *referencedTargetOid = git_reference_target(ref); + + if (!git_reference_is_tag(ref)) { + git_oid_tostr(refModel->sha, GIT_OID_HEXSZ + 1, referencedTargetOid); + + *out = refModel; + return GIT_OK; + } + git_repository *repo = git_reference_owner(ref); + + git_tag *referencedTag; + if (git_tag_lookup(&referencedTag, repo, referencedTargetOid) == GIT_OK) { + const char *tagMessage = git_tag_message(referencedTag); + refModel->message = tagMessage ? strdup(tagMessage) : NULL; + + git_odb_object *tagOdbObject; + if (git_odb_read(&tagOdbObject, odb, git_tag_id(referencedTag)) == GIT_OK) { + refModel->tagOdbBufferLength = git_odb_object_size(tagOdbObject); + refModel->tagOdbBuffer = new char[refModel->tagOdbBufferLength]; + std::memcpy(refModel->tagOdbBuffer, git_odb_object_data(tagOdbObject), refModel->tagOdbBufferLength); + git_odb_object_free(tagOdbObject); + } + + git_tag_free(referencedTag); + } + + git_oid peeledReferencedTargetOid; + int error = getOidOfReferenceCommit(&peeledReferencedTargetOid, ref); + if (error != GIT_OK) { + delete refModel; + return error; + } + + git_oid_tostr(refModel->sha, GIT_OID_HEXSZ + 1, &peeledReferencedTargetOid); + + *out = refModel; + return GIT_OK; + } + + static void ensureSignatureRegexes() { + if (!signatureRegexesBySignatureType.IsEmpty()) { + return; + } + + v8::Local gpgsigArray = Nan::New(2), + x509Array = Nan::New(1); + + Nan::Set( + gpgsigArray, + Nan::New(0), + Nan::New( + Nan::New("-----BEGIN PGP SIGNATURE-----[\\s\\S]+?-----END PGP SIGNATURE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + Nan::Set( + gpgsigArray, + Nan::New(1), + Nan::New( + Nan::New("-----BEGIN PGP MESSAGE-----[\\s\\S]+?-----END PGP MESSAGE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + Nan::Set( + x509Array, + Nan::New(0), + Nan::New( + Nan::New("-----BEGIN SIGNED MESSAGE-----[\\s\\S]+?-----END SIGNED MESSAGE-----").ToLocalChecked(), + static_cast(v8::RegExp::Flags::kGlobal | v8::RegExp::Flags::kMultiline) + ).ToLocalChecked() + ); + + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("gpgsig").ToLocalChecked(), gpgsigArray); + Nan::Set(result, Nan::New("x509").ToLocalChecked(), x509Array); + + signatureRegexesBySignatureType.Reset(result); + } + + v8::Local toJavascript(v8::Local signatureType) { + v8::Local result = Nan::New(); + + v8::Local jsFullName; + if (fullName == NULL) { + jsFullName = Nan::Null(); + } else { + jsFullName = Nan::New(fullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("fullName").ToLocalChecked(), jsFullName); + + v8::Local jsMessage; + if (message == NULL) { + jsMessage = Nan::Null(); + } else { + jsMessage = Nan::New(message).ToLocalChecked(); + } + Nan::Set(result, Nan::New("message").ToLocalChecked(), jsMessage); + + Nan::Set( + result, + Nan::New("sha").ToLocalChecked(), + Nan::New(sha).ToLocalChecked() + ); + + v8::Local jsShorthand; + if (shorthand == NULL) { + jsShorthand = Nan::Null(); + } else { + jsShorthand = Nan::New(shorthand).ToLocalChecked(); + } + Nan::Set(result, Nan::New("shorthand").ToLocalChecked(), jsShorthand); + + v8::Local jsTagSignature = Nan::Null(); + if (tagOdbBuffer != NULL && tagOdbBufferLength != 0) { + // tagOdbBuffer is already a copy, so we'd like to use NewBuffer instead, + // but we were getting segfaults and couldn't easily figure out why. :( + // We tried passing the tagOdbBuffer directly to NewBuffer and then nullifying tagOdbBuffer so that + // the destructor didn't double free, but that still segfaulted internally in Node. + v8::Local buffer = Nan::CopyBuffer(tagOdbBuffer, tagOdbBufferLength).ToLocalChecked(); + v8::Local toStringProp = Nan::Get(buffer, Nan::New("toString").ToLocalChecked()).ToLocalChecked(); + v8::Local jsTagOdbObjectString = Nan::To(Nan::CallAsFunction(Nan::To(toStringProp).ToLocalChecked(), buffer, 0, NULL).ToLocalChecked()).ToLocalChecked(); + + v8::Local _signatureRegexesBySignatureType = Nan::New(signatureRegexesBySignatureType); + v8::Local signatureRegexes = v8::Local::Cast(Nan::Get(_signatureRegexesBySignatureType, signatureType).ToLocalChecked()); + + for (uint32_t i = 0; i < signatureRegexes->Length(); ++i) { + v8::Local argv[] = { + Nan::Get(signatureRegexes, Nan::New(i)).ToLocalChecked() + }; + + v8::Local matchProp = Nan::Get(jsTagOdbObjectString, Nan::New("match").ToLocalChecked()).ToLocalChecked(); + v8::Local match = Nan::CallAsFunction(Nan::To(matchProp).ToLocalChecked(), jsTagOdbObjectString, 1, argv).ToLocalChecked(); + if (match->IsArray()) { + jsTagSignature = Nan::Get(Nan::To(match).ToLocalChecked(), 0).ToLocalChecked(); + break; + } + } + } + Nan::Set(result, Nan::New("tagSignature").ToLocalChecked(), jsTagSignature); + + v8::Local jsType; + if (type == NULL) { + jsType = Nan::Null(); + } else { + jsType = Nan::New(type).ToLocalChecked(); + } + Nan::Set(result, Nan::New("type").ToLocalChecked(), jsType); + + return result; + } + + ~RefreshedRefModel() { + if (fullName != NULL) { free(fullName); } + if (message != NULL) { free(message); } + delete[] sha; + if (shorthand != NULL) { free(shorthand); } + if (tagOdbBuffer != NULL) { delete[] tagOdbBuffer; } + } + + char *fullName, *message, *sha, *shorthand, *tagOdbBuffer; + size_t tagOdbBufferLength; + const char *type; + static Nan::Persistent signatureRegexesBySignatureType; +}; + +Nan::Persistent RefreshedRefModel::signatureRegexesBySignatureType; + +class UpstreamModel { +public: + UpstreamModel(const char *inputDownstreamFullName, const char *inputUpstreamFullName): + downstreamFullName((char *)strdup(inputDownstreamFullName)), + upstreamFullName((char *)strdup(inputUpstreamFullName)), + ahead(0), + behind(0) {} + + UpstreamModel(const UpstreamModel &) = delete; + UpstreamModel(UpstreamModel &&) = delete; + UpstreamModel &operator=(const UpstreamModel &) = delete; + UpstreamModel &operator=(UpstreamModel &&) = delete; + + static bool fromReference(UpstreamModel **out, git_reference *ref) { + if (!git_reference_is_branch(ref)) { + return false; + } + + git_reference *upstream; + int result = git_branch_upstream(&upstream, ref); + if (result != GIT_OK) { + return false; + } + + UpstreamModel *upstreamModel = new UpstreamModel( + git_reference_name(ref), + git_reference_name(upstream) + ); + + git_oid localCommitOid; + result = getOidOfReferenceCommit(&localCommitOid, ref); + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + git_oid upstreamCommitOid; + result = getOidOfReferenceCommit(&upstreamCommitOid, upstream); + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + result = git_graph_ahead_behind( + &upstreamModel->ahead, + &upstreamModel->behind, + git_reference_owner(ref), + &localCommitOid, + &upstreamCommitOid + ); + + if (result != GIT_OK) { + delete upstreamModel; + return false; + } + + *out = upstreamModel; + return true; + } + + v8::Local toJavascript() { + v8::Local result = Nan::New(); + + v8::Local jsDownstreamFullName; + if (downstreamFullName == NULL) { + jsDownstreamFullName = Nan::Null(); + } else { + jsDownstreamFullName = Nan::New(downstreamFullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("downstreamFullName").ToLocalChecked(), jsDownstreamFullName); + + v8::Local jsUpstreamFullName; + if (upstreamFullName == NULL) { + jsUpstreamFullName = Nan::Null(); + } else { + jsUpstreamFullName = Nan::New(upstreamFullName).ToLocalChecked(); + } + Nan::Set(result, Nan::New("upstreamFullName").ToLocalChecked(), jsUpstreamFullName); + + Nan::Set(result, Nan::New("ahead").ToLocalChecked(), Nan::New(ahead)); + Nan::Set(result, Nan::New("behind").ToLocalChecked(), Nan::New(behind)); + return result; + } + + ~UpstreamModel() { + if (downstreamFullName != NULL) { free(downstreamFullName); } + if (upstreamFullName != NULL) { free(upstreamFullName); } + } + + char *downstreamFullName; + char *upstreamFullName; + size_t ahead; + size_t behind; +}; + +class RefreshReferencesData { +public: + RefreshReferencesData(): + headRefFullName(NULL), + cherrypick(NULL), + merge(NULL) {} + + RefreshReferencesData(const RefreshReferencesData &) = delete; + RefreshReferencesData(RefreshReferencesData &&) = delete; + RefreshReferencesData &operator=(const RefreshReferencesData &) = delete; + RefreshReferencesData &operator=(RefreshReferencesData &&) = delete; + + ~RefreshReferencesData() { + while(refs.size()) { + delete refs.back(); + refs.pop_back(); + } + while(upstreamInfo.size()) { + delete upstreamInfo.back(); + upstreamInfo.pop_back(); + } + if (headRefFullName != NULL) { free(headRefFullName); } + if (cherrypick != NULL) { delete cherrypick; } + if (merge != NULL) { delete merge; } + } + + std::vector refs; + std::vector upstreamInfo; + char *headRefFullName; + RefreshedRefModel *cherrypick; + RefreshedRefModel *merge; +}; + +NAN_METHOD(GitRepository::RefreshReferences) +{ + v8::Local signatureType; + if (info.Length() == 2) { + if (!info[0]->IsString()) { + return Nan::ThrowError("Signature type must be \"gpgsig\" or \"x509\"."); + } + + v8::Local signatureTypeParam = Nan::To(info[0]).ToLocalChecked(); + if ( + Nan::Equals(signatureTypeParam, Nan::New("gpgsig").ToLocalChecked()) != Nan::Just(true) + && Nan::Equals(signatureTypeParam, Nan::New("x509").ToLocalChecked()) != Nan::Just(true) + ) { + return Nan::ThrowError("Signature type must be \"gpgsig\" or \"x509\"."); + } + signatureType = signatureTypeParam; + } else { + signatureType = Nan::New("gpgsig").ToLocalChecked(); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + RefreshReferencesBaton* baton = new RefreshReferencesBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->out = (void *)new RefreshReferencesData(); + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + RefreshReferencesWorker *worker = new RefreshReferencesWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + worker->Reference("signatureType", signatureType); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::RefreshReferencesWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->repo); + return lockMaster; +} + +void GitRepository::RefreshReferencesWorker::Execute() +{ + giterr_clear(); + + git_repository *repo = baton->repo; + RefreshReferencesData *refreshData = (RefreshReferencesData *)baton->out; + git_odb *odb; + + baton->error_code = git_repository_odb(&odb, repo); + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete refreshData; + baton->out = NULL; + return; + } + + // START Refresh HEAD + git_reference *headRef = NULL; + baton->error_code = lookupDirectReferenceByShorthand(&headRef, repo, "HEAD"); + + if (baton->error_code != GIT_OK || headRef == NULL) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + RefreshedRefModel *headModel; + baton->error_code = RefreshedRefModel::fromReference(&headModel, headRef, odb); + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + git_reference_free(headRef); + delete refreshData; + baton->out = NULL; + return; + } + refreshData->refs.push_back(headModel); + + refreshData->headRefFullName = strdup(git_reference_name(headRef)); + git_reference_free(headRef); + // END Refresh HEAD + + // START Refresh CHERRY_PICK_HEAD + git_reference *cherrypickRef = NULL; + if (lookupDirectReferenceByShorthand(&cherrypickRef, repo, "CHERRY_PICK_HEAD") == GIT_OK && cherrypickRef != NULL) { + baton->error_code = RefreshedRefModel::fromReference(&refreshData->cherrypick, cherrypickRef, odb); + git_reference_free(cherrypickRef); + } else { + cherrypickRef = NULL; + } + // END Refresh CHERRY_PICK_HEAD + + // START Refresh MERGE_HEAD + git_reference *mergeRef = NULL; + // fall through if cherry pick failed + if (baton->error_code == GIT_OK && lookupDirectReferenceByShorthand(&mergeRef, repo, "MERGE_HEAD") == GIT_OK && mergeRef != NULL) { + baton->error_code = RefreshedRefModel::fromReference(&refreshData->merge, mergeRef, odb); + git_reference_free(mergeRef); + } else { + mergeRef = NULL; + } + // END Refresh MERGE_HEAD + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + // Retrieve reference models and upstream info for each reference + git_strarray referenceNames; + baton->error_code = git_reference_list(&referenceNames, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + delete refreshData; + baton->out = NULL; + return; + } + + git_strarray remoteNames; + baton->error_code = git_remote_list(&remoteNames, repo); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + git_odb_free(odb); + git_strarray_free(&referenceNames); + delete refreshData; + baton->out = NULL; + return; + } + + for (size_t referenceIndex = 0; referenceIndex < referenceNames.count; ++referenceIndex) { + git_reference *reference; + baton->error_code = lookupDirectReferenceByFullName(&reference, repo, referenceNames.strings[referenceIndex]); + + if (baton->error_code != GIT_OK) { + break; + } + if (reference == NULL) { + // lookup found the reference but failed to resolve it directly + continue; + } + + UpstreamModel *upstreamModel; + if (UpstreamModel::fromReference(&upstreamModel, reference)) { + refreshData->upstreamInfo.push_back(upstreamModel); + } + + bool isBranch = git_reference_is_branch(reference); + bool isRemote = git_reference_is_remote(reference); + bool isTag = git_reference_is_tag(reference); + if ( + strcmp(referenceNames.strings[referenceIndex], headModel->fullName) == 0 + || (!isBranch && !isRemote && !isTag) + ) { + git_reference_free(reference); + continue; + } + + if (isRemote) { + char *remoteNameOfRef = getRemoteNameOfReference(reference); + bool isFromExistingRemote = gitStrArrayContains(&remoteNames, remoteNameOfRef); + free(remoteNameOfRef); + if (!isFromExistingRemote) { + git_reference_free(reference); + continue; + } + } + + RefreshedRefModel *refreshedRefModel; + baton->error_code = RefreshedRefModel::fromReference(&refreshedRefModel, reference, odb); + git_reference_free(reference); + + if (baton->error_code == GIT_OK) { + refreshData->refs.push_back(refreshedRefModel); + } else { + baton->error_code = GIT_OK; + } + } + + git_odb_free(odb); + git_strarray_free(&remoteNames); + git_strarray_free(&referenceNames); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + delete refreshData; + baton->out = NULL; + return; + } +} + +void GitRepository::RefreshReferencesWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + RefreshReferencesData *refreshData = (RefreshReferencesData *)baton->out; + delete refreshData; + + delete baton; +} + +void GitRepository::RefreshReferencesWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + RefreshedRefModel::ensureSignatureRegexes(); + auto refreshData = (RefreshReferencesData *)baton->out; + v8::Local result = Nan::New(); + + Nan::Set( + result, + Nan::New("headRefFullName").ToLocalChecked(), + Nan::New(refreshData->headRefFullName).ToLocalChecked() + ); + + v8::Local signatureType = Nan::To(GetFromPersistent("signatureType")).ToLocalChecked(); + + unsigned int numRefs = refreshData->refs.size(); + v8::Local refs = Nan::New(numRefs); + for (unsigned int i = 0; i < numRefs; ++i) { + RefreshedRefModel *refreshedRefModel = refreshData->refs[i]; + Nan::Set(refs, Nan::New(i), refreshedRefModel->toJavascript(signatureType)); + } + Nan::Set(result, Nan::New("refs").ToLocalChecked(), refs); + + unsigned int numUpstreamInfo = refreshData->upstreamInfo.size(); + v8::Local upstreamInfo = Nan::New(numUpstreamInfo); + for (unsigned int i = 0; i < numUpstreamInfo; ++i) { + UpstreamModel *upstreamModel = refreshData->upstreamInfo[i]; + Nan::Set(upstreamInfo, Nan::New(i), upstreamModel->toJavascript()); + } + Nan::Set(result, Nan::New("upstreamInfo").ToLocalChecked(), upstreamInfo); + + if (refreshData->cherrypick != NULL) { + Nan::Set( + result, + Nan::New("cherrypick").ToLocalChecked(), + refreshData->cherrypick->toJavascript(signatureType) + ); + } else { + Nan::Set(result, Nan::New("cherrypick").ToLocalChecked(), Nan::Null()); + } + + if (refreshData->merge != NULL) { + Nan::Set( + result, + Nan::New("merge").ToLocalChecked(), + refreshData->merge->toJavascript(signatureType) + ); + } else { + Nan::Set(result, Nan::New("merge").ToLocalChecked(), Nan::Null()); + } + + delete refreshData; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Repository refreshReferences has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Repository.refreshReferences").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/repository/statistics.cc b/generate/templates/manual/repository/statistics.cc new file mode 100644 index 0000000000..f438bb5f8d --- /dev/null +++ b/generate/templates/manual/repository/statistics.cc @@ -0,0 +1,1892 @@ +/** + * \struct CommitsGraphNode + */ +struct CommitsGraphNode +{ + CommitsGraphNode(uint32_t aParentsLeft) : parentsLeft(aParentsLeft) {} + CommitsGraphNode() = default; + ~CommitsGraphNode() = default; + CommitsGraphNode(const CommitsGraphNode &other) = delete; + CommitsGraphNode(CommitsGraphNode &&other) = delete; + CommitsGraphNode& operator=(const CommitsGraphNode &other) = delete; + CommitsGraphNode& operator=(CommitsGraphNode &&other) = delete; + + std::vector children {}; + uint32_t parentsLeft {0}; // used when calculating the maximum history depth +}; + +/** + * \class CommitsGraph + */ +class CommitsGraph +{ +public: + CommitsGraph() = default; + ~CommitsGraph() = default; + CommitsGraph(const CommitsGraph &other) = delete; + CommitsGraph(CommitsGraph &&other) = delete; + CommitsGraph& operator=(const CommitsGraph &other) = delete; + CommitsGraph& operator=(CommitsGraph &&other) = delete; + + using CommitsGraphMap = std::unordered_map>; + + void AddNode(const std::string &oidStr, const std::vector &parents); + uint32_t CalculateMaxDepth(); + +private: + void addParentNode(const std::string &oidParentStr, CommitsGraphNode *child); + + CommitsGraphMap m_mapOidNode {}; + std::vector m_roots {}; +}; + +/** + * CommitsGraph::AddNode + * + * \param oidStr oid of the commit object to add. + * \param parents oids of the commit's parents. + */ +void CommitsGraph::AddNode(const std::string &oidStr, const std::vector &parents) +{ + const uint32_t numParents = static_cast(parents.size()); + + auto emplacePair = m_mapOidNode.emplace(std::make_pair( + oidStr, std::make_unique(numParents))); + + CommitsGraphMap::iterator itNode = emplacePair.first; + + // if this node already added by a child, update its parentsLeft + if (emplacePair.second == false) { + itNode->second.get()->parentsLeft = numParents; + } + + // set roots + if (numParents == 0) { + m_roots.emplace_back(itNode->second.get()); + } + + // add parents + for (unsigned int i = 0; i < numParents; ++i) { + addParentNode(parents.at(i), itNode->second.get()); + } +} + +/** + * CommitsGraph::CalculateMaxDepth + * \return Calculated maximum depth of the tree. + * + * Uses iterative algorithm to count levels. + * Considers multiple initial commits. + * Considers that children of one level can have multiple parents, hence we insert unique children + * at each level. + * Considers that same child can be in different levels. Here to prevent counting the same child + * multiple times, we only add a child when the last parent (parentsLeft) inserts it. This is + * actually what makes the algorithm fast. + * Recursive algorithm avoided to prevent stack overflow in case of excessive levels in the tree. + * + * Explanation of the algorithm: + * once the graph is built with the commit history, `CalculateMaxDepth()` counts the maximum number + * of levels from any of the roots to any of the leaves, which gives us the maximum depth + * (`historyStructure.maxDepth` in the final result). + * Inside `CalculateMaxDepth()`, to count levels, we add in an iterative way for each level and + * starting at the roots level, all the children from that level, but only if each child is the last + * time we'll consider it in the algorithm (for example if a child node 'C' has 2 parents 'P1' and + * 'P2', and 'P1' has already been considered before in the algorithm as parent of 'C', and now we are + * processing 'C' as a child from 'P2', which will be the last time, as 'C' has no more parents left). + * This way we prevent counting 'C' multiple times. + */ +uint32_t CommitsGraph::CalculateMaxDepth() +{ + uint32_t maxDepth {0}; + std::unordered_set parents {}; + std::unordered_set children {}; + + // start from the root commmits + for (CommitsGraphNode *root : m_roots) { + children.insert(root); + } + + while (!children.empty()) { + ++maxDepth; + parents = std::move(children); + + // add unique children of next level, and only if from the last parent + for (CommitsGraphNode *parent : parents) { + for (CommitsGraphNode *child : parent->children) { + if (--child->parentsLeft == 0) { + children.insert(child); + } + } + } + } + + return maxDepth; +} + +/** + * CommitsGraph::addParentNode + * + * \param oidParentStr oid of the parent commit to add. + * \param child Child of the parent commit being added. + */ +void CommitsGraph::addParentNode(const std::string &oidParentStr, CommitsGraphNode *child) +{ + CommitsGraphMap::iterator itParentNode = m_mapOidNode.emplace(std::make_pair( + oidParentStr, std::make_unique())).first; + + // add child to parent + itParentNode->second->children.emplace_back(child); +} + +/** + * \struct TreeStatistics + * Structure to store statistics for a git tree object. + */ +struct TreeStatistics +{ + TreeStatistics() = default; + ~TreeStatistics() = default; + TreeStatistics(const TreeStatistics &other) = delete; + TreeStatistics(TreeStatistics &&other) = default; + TreeStatistics& operator=(const TreeStatistics &other) = delete; + TreeStatistics& operator=(TreeStatistics &&other) = default; + + size_t numDirectories{0}; + size_t maxPathDepth {0}; + size_t maxPathLength {0}; + size_t numFiles {0}; + size_t totalFileSize {0}; + size_t numSymlinks {0}; + size_t numSubmodules {0}; +}; + +/** + * \struct Statistics + * Stores statistics of the analyzed repository. + */ +struct Statistics +{ + Statistics() = default; + ~Statistics() = default; + Statistics(const Statistics &other) = delete; + Statistics(Statistics &&other) = delete; + Statistics& operator=(const Statistics &other) = delete; + Statistics& operator=(Statistics &&other) = delete; + + struct { + struct { size_t count {0}; size_t size {0}; } commits; + struct { size_t count {0}; size_t size {0}; size_t entries {0}; } trees; + struct { size_t count {0}; size_t size {0}; } blobs; + struct { size_t count {0}; } annotatedTags; + struct { size_t count {0}; } references; + } repositorySize {}; + + struct { + struct { size_t maxSize {0}; size_t maxParents {0}; } commits; + struct { size_t maxEntries {0}; } trees; + struct { size_t maxSize {0}; } blobs; + } biggestObjects {}; + + struct { + uint32_t maxDepth {0}; + uint32_t maxTagDepth {0}; + } historyStructure {}; + + TreeStatistics biggestCheckouts {}; +}; + +/** + * \struct OdbObjectsData + * Structure to store, for each object read from the repository: + * - its information (size, parents for a commit, etc.) + * - different data needed to obtain the resulting statistics + */ +struct OdbObjectsData +{ + static constexpr uint32_t kUnreachable = 0; + + struct CommitInfo { + std::string oidTree {}; + size_t size {0}; + std::vector parents {}; + // number of sources from which a commit can be reached: + // a child commit, a tag, or a direct git reference + uint32_t reachability {kUnreachable}; + }; + + struct TreeInfoAndStats { + size_t size {0}; + size_t numEntries {0}; + std::vector entryBlobs {}; + std::vector< std::pair > entryTreesNameLen {}; + // number of sources from which a tree can be reached: + // a commit, another tree's entry, or a tag + uint32_t reachability {kUnreachable}; + TreeStatistics stats {}; + bool statsDone {false}; + }; + + struct BlobInfo { + size_t size {0}; + // number of sources from which a blob can be reached: + // a tree's entry, or a tag + uint32_t reachability {kUnreachable}; + }; + + struct TagInfo { + static constexpr uint32_t kUnsetDepth = 0; + + std::string oidTarget {}; + git_object_t typeTarget {GIT_OBJECT_INVALID}; + uint32_t depth {kUnsetDepth}; + // number of sources from which a tag can be reached: + // a reference, or another tag + uint32_t reachability {kUnreachable}; + }; + + OdbObjectsData() = default; + ~OdbObjectsData() = default; + OdbObjectsData(const OdbObjectsData &other) = delete; + OdbObjectsData(OdbObjectsData &&other) = delete; + OdbObjectsData& operator=(const OdbObjectsData &other) = delete; + OdbObjectsData& operator=(OdbObjectsData &&other) = delete; + + struct { + std::unordered_map info {}; + std::unordered_set unreachables {}; + // Tree of commits (graph) to be built after having read the object + // database, and pruned unreachable objects. + // Used to calculate the maximum history depth. + CommitsGraph graph {}; + size_t totalSize {0}; + size_t maxSize {0}; + size_t maxParents {0}; + } commits {}; + + struct { + std::unordered_map info; + std::unordered_set unreachables {}; + size_t totalSize {0}; + size_t totalEntries {0}; + size_t maxEntries {0}; + } trees {}; + + struct { + std::unordered_map info {}; + std::unordered_set unreachables {}; + size_t totalSize {0}; + size_t maxSize {0}; + } blobs {}; + + struct { + std::unordered_map info; + std::unordered_set unreachables {}; + } tags {}; + + struct { + std::mutex commits {}; + std::mutex trees {}; + std::mutex blobs {}; + std::mutex tags {}; + } infoMutex; + + using iterCommitInfo = std::unordered_map::iterator; + using iterUnreachable = std::unordered_set::iterator; + using iterTreeInfo = std::unordered_map::iterator; + using iterBlobInfo = std::unordered_map::iterator; + using iterTagInfo = std::unordered_map::iterator; +}; + +/** + * \class WorkItemOid + * WorkItem storing odb oids for the WorkPool. + */ +class WorkItemOid : public WorkItem { +public: + WorkItemOid(const git_oid &oid) + : m_oid(oid) {} + ~WorkItemOid() = default; + WorkItemOid(const WorkItemOid &other) = delete; + WorkItemOid(WorkItemOid &&other) = delete; + WorkItemOid& operator=(const WorkItemOid &other) = delete; + WorkItemOid& operator=(WorkItemOid &&other) = delete; + + const git_oid& GetOid() const { return m_oid; } + +private: + git_oid m_oid {}; +}; + +/** + * \class WorkerStoreOdbData + * Worker for the WorkPool to store odb object data. + */ +class WorkerStoreOdbData : public IWorker +{ +public: + WorkerStoreOdbData(const std::string &repoPath, OdbObjectsData *odbObjectsData) + : m_repoPath(repoPath), m_odbObjectsData(odbObjectsData) {} + ~WorkerStoreOdbData(); + WorkerStoreOdbData(const WorkerStoreOdbData &other) = delete; + WorkerStoreOdbData(WorkerStoreOdbData &&other) = delete; + WorkerStoreOdbData& operator=(const WorkerStoreOdbData &other) = delete; + WorkerStoreOdbData& operator=(WorkerStoreOdbData &&other) = delete; + + bool Initialize(); + bool Execute(std::unique_ptr &&work); + +private: + OdbObjectsData::TreeInfoAndStats thisTreeInfoAndStats(const git_tree *tree, size_t size, size_t numEntries); + + std::string m_repoPath {}; + git_repository *m_repo {nullptr}; + git_odb *m_odb {nullptr}; + OdbObjectsData *m_odbObjectsData {nullptr}; +}; + +/** + * WorkerStoreOdbData::~WorkerStoreOdbData + */ +WorkerStoreOdbData::~WorkerStoreOdbData() { + if (m_odb) { + git_odb_free(m_odb); + } + if (m_repo) { + git_repository_free(m_repo); + } +} + +/** + * WorkerStoreOdbData::Initialize + */ +bool WorkerStoreOdbData::Initialize() { + if (m_repo != nullptr) { // if already initialized + return true; + } + + return !m_repoPath.empty() && + git_repository_open(&m_repo, m_repoPath.c_str()) == GIT_OK && + git_repository_odb(&m_odb, m_repo) == GIT_OK; +} + +/** + * WorkerStoreOdbData::Execute + */ +bool WorkerStoreOdbData::Execute(std::unique_ptr &&work) +{ + std::unique_ptr wi {static_cast(work.release())}; + const git_oid &oid = wi->GetOid(); + + // NOTE about PERFORMANCE (May 2021): + // git_object_lookup() is as expensive as git_odb_read(). + // They give access to different information from the libgit2 API. + // Try to call only one of them if possible. + + git_object *target {nullptr}; + if (git_object_lookup(&target, m_repo, &oid, GIT_OBJECT_ANY) != GIT_OK) { + return false; + } + + switch (git_object_type(target)) + { + case GIT_OBJECT_COMMIT: + { + git_commit *commit = (git_commit*)target; + // NOTE about PERFORMANCE (May 2021): + // calling git_odb_object_size() was slightly faster than calculating header size + message size + 1 with GK repo + + // obtain size + git_odb_object *obj {nullptr}; + if (git_odb_read(&obj, m_odb, &oid) != GIT_OK) { + git_object_free(target); + return false; + } + const size_t size = git_odb_object_size(obj); + git_odb_object_free(obj); + + // obtain CommitInfo + const unsigned int numParents = git_commit_parentcount(commit); + std::vector parents {}; + for (unsigned int i = 0; i < numParents; ++i) { + parents.emplace_back(reinterpret_cast(git_commit_parent_id(commit, i)->id), + GIT_OID_RAWSZ); + } + + OdbObjectsData::CommitInfo commitInfo { + std::string(reinterpret_cast(git_commit_tree_id(commit)->id), GIT_OID_RAWSZ), + size, + std::move(parents), + OdbObjectsData::kUnreachable}; + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.commits); + + m_odbObjectsData->commits.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(commitInfo))); + } + } + break; + + case GIT_OBJECT_TREE: + { + git_tree *tree = (git_tree*)target; + + // do not count empty trees, like git's empty tree "4b825dc642cb6eb9a060e54bf8d69288fbee4904" + const size_t numEntries = git_tree_entrycount(tree); + if (numEntries == 0) { + git_object_free(target); + return true; + } + + // obtain size + git_odb_object *obj {nullptr}; + if (git_odb_read(&obj, m_odb, &oid) != GIT_OK) { + git_object_free(target); + return false; + } + const size_t size = git_odb_object_size(obj); + git_odb_object_free(obj); + + // obtain tree data and calculate statistics for only this tree (not recursively) + OdbObjectsData::TreeInfoAndStats treeInfoAndStats = thisTreeInfoAndStats(tree, size, numEntries); + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + + m_odbObjectsData->trees.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(treeInfoAndStats))); + } + } + break; + + case GIT_OBJECT_BLOB: + { + git_blob *blob = (git_blob*)target; + const size_t size = git_blob_rawsize(blob); + OdbObjectsData::BlobInfo blobInfo {size, OdbObjectsData::kUnreachable}; + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.blobs); + + m_odbObjectsData->blobs.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(blobInfo))); + } + } + break; + + case GIT_OBJECT_TAG: + { + // obtain TagInfo + git_tag *tag = (git_tag*)target; + const git_oid *oid_target = git_tag_target_id(tag); + OdbObjectsData::TagInfo tagInfo { + std::string(reinterpret_cast(oid_target->id), GIT_OID_RAWSZ), + git_tag_target_type(tag), + OdbObjectsData::TagInfo::kUnsetDepth, + OdbObjectsData::kUnreachable}; + + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.tags); + m_odbObjectsData->tags.info.emplace(std::make_pair( + std::string(reinterpret_cast(oid.id), GIT_OID_RAWSZ), + std::move(tagInfo))); + } + } + break; + + default: + break; + } + + git_object_free(target); + + return true; +} + +/** + * WorkerStoreOdbData::thisTreeInfoAndStats + * + * Obtain tree data and calculate the part of this tree's statistics that each thread can do. + * + * \param tree tree to get data from and calculate partial statistics of. + * \param size tree size, to be added to the final result. + * \param numEntries number of entries of this tree. + * \return this tree's data and partial statistics. + */ +OdbObjectsData::TreeInfoAndStats WorkerStoreOdbData::thisTreeInfoAndStats(const git_tree *tree, size_t size, + size_t numEntries) +{ + OdbObjectsData::TreeInfoAndStats treeInfoAndStats {}; + treeInfoAndStats.size = size; + treeInfoAndStats.numEntries = numEntries; + + for (size_t i = 0; i < numEntries; ++i) + { + const git_tree_entry *te = git_tree_entry_byindex(tree, i); + if (te == nullptr) { + continue; + } + const git_object_t te_type = git_tree_entry_type(te); + const char *teName {nullptr}; + size_t teNameLen {0}; + const git_oid *te_oid {nullptr}; + + switch (te_type) + { + // count submodules + case GIT_OBJECT_COMMIT: + if (git_tree_entry_filemode(te) == GIT_FILEMODE_COMMIT) { + ++treeInfoAndStats.stats.numSubmodules; + } + break; + + case GIT_OBJECT_BLOB: + { + // count symbolic links, but don't add them as blob entries + if (git_tree_entry_filemode(te) == GIT_FILEMODE_LINK) { + ++treeInfoAndStats.stats.numSymlinks; + } + else { + ++treeInfoAndStats.stats.numFiles; + teName = git_tree_entry_name(te); + teNameLen = std::char_traits::length(teName); + treeInfoAndStats.stats.maxPathLength = + std::max(treeInfoAndStats.stats.maxPathLength, teNameLen); + } + // store both types of files (symbolic links and non symbolic links) as entryBlob + te_oid = git_tree_entry_id(te); + treeInfoAndStats.entryBlobs.emplace_back( + reinterpret_cast(te_oid->id), GIT_OID_RAWSZ); + } + break; + + case GIT_OBJECT_TREE: + { + // We store tree's name length to compare in posterior stage, after threads work + teName = git_tree_entry_name(te); + teNameLen = std::char_traits::length(teName); + + te_oid = git_tree_entry_id(te); + treeInfoAndStats.entryTreesNameLen.emplace_back(std::make_pair( + std::string(reinterpret_cast(te_oid->id), GIT_OID_RAWSZ), + teNameLen)); + } + break; + + default: + break; + } + } + + return treeInfoAndStats; +} + +/** + * \class WorkItemOidStrType + * WorkItem storing pointers to object info structs for the WorkPool. + */ +class WorkItemOidStrType : public WorkItem { +public: + WorkItemOidStrType(void *objectInfo, git_object_t type) + : m_objectInfo(objectInfo), m_oid_type(type) {} + ~WorkItemOidStrType() = default; + WorkItemOidStrType(const WorkItemOidStrType &other) = delete; + WorkItemOidStrType(WorkItemOidStrType &&other) = delete; + WorkItemOidStrType& operator=(const WorkItemOidStrType &other) = delete; + WorkItemOidStrType& operator=(WorkItemOidStrType &&other) = delete; + + void* GetObjectInfo() const { return m_objectInfo; } + const git_object_t& GetOidType() const { return m_oid_type; } + +private: + void *m_objectInfo {nullptr}; + git_object_t m_oid_type {}; +}; + +/** + * \class WorkerReachCounter + * Worker for the WorkPool to count reachability of each object. + */ +class WorkerReachCounter : public IWorker +{ +public: + WorkerReachCounter(OdbObjectsData *odbObjectsData) + : m_odbObjectsData(odbObjectsData) {} + ~WorkerReachCounter() = default; + WorkerReachCounter(const WorkerReachCounter &other) = delete; + WorkerReachCounter(WorkerReachCounter &&other) = delete; + WorkerReachCounter& operator=(const WorkerReachCounter &other) = delete; + WorkerReachCounter& operator=(WorkerReachCounter &&other) = delete; + + bool Initialize() { return true; } + bool Execute(std::unique_ptr &&work); + +private: + void setReachabilityFromTags(void *objectInfo); + void setReachabilityFromCommits(void *objectInfo); + void setReachabilityFromTrees(void *objectInfo); + + OdbObjectsData *m_odbObjectsData {nullptr}; +}; + +/** + * WorkerReachCounter::Execute + */ +bool WorkerReachCounter::Execute(std::unique_ptr &&work) +{ + std::unique_ptr wi {static_cast(work.release())}; + void *objectInfo = wi->GetObjectInfo(); + const git_object_t &oid_type = wi->GetOidType(); + + switch (oid_type) { + case GIT_OBJECT_TAG: + setReachabilityFromTags(objectInfo); + break; + case GIT_OBJECT_COMMIT: + setReachabilityFromCommits(objectInfo); + break; + case GIT_OBJECT_TREE: + setReachabilityFromTrees(objectInfo); + break; + case GIT_OBJECT_BLOB: + // do not process blobs in this stage + break; + default: + break; + } + + return true; +} + +/** + * WorkerReachCounter::setReachabilityFromTags + * Adds reachability counter where tags point (any type of object). + */ +void WorkerReachCounter::setReachabilityFromTags(void *objectInfo) +{ + const OdbObjectsData::TagInfo *tagInfo = static_cast(objectInfo); + + switch (tagInfo->typeTarget) { + case GIT_OBJECT_COMMIT: + { + OdbObjectsData::iterCommitInfo itCommitInfo = + m_odbObjectsData->commits.info.find(tagInfo->oidTarget); + + if (itCommitInfo != m_odbObjectsData->commits.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.commits); + ++itCommitInfo->second.reachability; + } + } + } + break; + + case GIT_OBJECT_TREE: + { + OdbObjectsData::iterTreeInfo itTreeInfo = + m_odbObjectsData->trees.info.find(tagInfo->oidTarget); + + if (itTreeInfo != m_odbObjectsData->trees.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + ++itTreeInfo->second.reachability; + } + } + } + + case GIT_OBJECT_BLOB: + { + OdbObjectsData::iterBlobInfo itBlobInfo = + m_odbObjectsData->blobs.info.find(tagInfo->oidTarget); + + if (itBlobInfo != m_odbObjectsData->blobs.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.blobs); + ++itBlobInfo->second.reachability; + } + } + } + + case GIT_OBJECT_TAG: + { + OdbObjectsData::iterTagInfo itTargetTagInfo = + m_odbObjectsData->tags.info.find(tagInfo->oidTarget); + + if (itTargetTagInfo != m_odbObjectsData->tags.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.tags); + ++itTargetTagInfo->second.reachability; + } + } + } + default: + break; + } +} + +/** + * WorkerReachCounter::setReachabilityFromCommits + * Adds reachability counter where commits point (parents and tree). + */ +void WorkerReachCounter::setReachabilityFromCommits(void *objectInfo) +{ + const OdbObjectsData::CommitInfo *commitInfo = + static_cast(objectInfo); + const size_t numParents = commitInfo->parents.size(); + + // set parents' reachability + for (size_t i = 0; i < numParents; ++i) { + OdbObjectsData::iterCommitInfo itParentCommitInfo = + m_odbObjectsData->commits.info.find(commitInfo->parents.at(i)); + + if (itParentCommitInfo != m_odbObjectsData->commits.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.commits); + ++itParentCommitInfo->second.reachability; + } + } + } + + // add 1 to its tree's reachability + OdbObjectsData::iterTreeInfo itCommitTreeInfo = + m_odbObjectsData->trees.info.find(commitInfo->oidTree); + + if (itCommitTreeInfo != m_odbObjectsData->trees.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + ++itCommitTreeInfo->second.reachability; + } + } +} + +/** + * WorkerReachCounter::setReachabilityFromTrees + * Adds reachability counter where tree entries point (blobs and other trees). + */ +void WorkerReachCounter::setReachabilityFromTrees(void *objectInfo) +{ + const OdbObjectsData::TreeInfoAndStats *treeInfo = + static_cast(objectInfo); + + // set entry blobs' reachability + for (auto &blob : treeInfo->entryBlobs) { + OdbObjectsData::iterBlobInfo itBlobInfo = m_odbObjectsData->blobs.info.find(blob); + + if (itBlobInfo != m_odbObjectsData->blobs.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.blobs); + ++itBlobInfo->second.reachability; + } + } + } + + // set entry trees' reachability + for (auto &treeNameLen : treeInfo->entryTreesNameLen) { + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData->trees.info.find(treeNameLen.first); + + if (itTreeInfo != m_odbObjectsData->trees.info.end()) { + { // lock + std::lock_guard lock(m_odbObjectsData->infoMutex.trees); + ++itTreeInfo->second.reachability; + } + } + } +} + +/** + * forEachOdbCb. Callback for git_odb_foreach. + * Returns GIT_OK on success; GIT_EUSER otherwise + */ +static int forEachOdbCb(const git_oid *oid, void *payloadToCast) +{ + WorkerPool *workerPool = + static_cast*>(payloadToCast); + + // Must insert copies of oid, since the pointers might not survive until worker thread picks it up + workerPool->InsertWork(std::make_unique(*oid)); + + // check there were no problems inserting work + if (workerPool->Status() != WPStatus::kOk) { + return GIT_EUSER; + } + + return GIT_OK; +} + +/** + * \class RepoAnalysis + * Class to analyse and hold repository statistics + */ +class RepoAnalysis +{ +public: + static constexpr unsigned int kMinThreads = 4; + + explicit RepoAnalysis(git_repository *repo) + : m_repo(repo) {} + ~RepoAnalysis() = default; + RepoAnalysis(const RepoAnalysis &other) = delete; + RepoAnalysis(RepoAnalysis &&other) = delete; + RepoAnalysis& operator=(const RepoAnalysis &other) = delete; + RepoAnalysis& operator=(RepoAnalysis &&other) = delete; + + int Analyze(); + v8::Local StatisticsToJS() const; + +private: + // stage 1 methods: store data from repository (with threads) + int storeObjectsInfo(); + int storeAndCountRefs(); + // stage 2 methods: count reachability of each object (with threads) + // NOTE: we need this stage, since so far libgit2 doesn't provide unreachable objects + bool setObjectsReachability(); + void setReachabilityFromRefs(); + void setUnreachables(); + // stage 3 methods: prune unreachable oids + void pruneUnreachables(); + void pruneUnreachableTags(); + void pruneUnreachableCommits(); + void pruneUnreachableTrees(); + void pruneUnreachableBlobs(); + // stage 4 methods: repositorySize and biggestObjects + void statsCountAndMax(); + // stage 5 methods: historyStructure and biggestCheckouts + bool statsHistoryAndBiggestCheckouts(); + bool calculateBiggestCheckouts(); + OdbObjectsData::iterTreeInfo calculateTreeStatistics(const std::string &oidTree); + bool calculateMaxTagDepth(); + OdbObjectsData::iterTagInfo calculateTagDepth(const std::string &oidTag); + // methods to return the statistics calculated + void fillOutStatistics(); + v8::Local repositorySizeToJS() const; + v8::Local biggestObjectsToJS() const; + v8::Local historyStructureToJS() const; + v8::Local biggestCheckoutsToJS() const; + + git_repository *m_repo {nullptr}; + Statistics m_statistics {}; + // odb objects info to build while reading the object database by each thread + OdbObjectsData m_odbObjectsData {}; + // oid and type of peeled references + std::unordered_map m_peeledRefs {}; +}; + +/** + * RepoAnalysis::Analyze + * To obtain the final result, the whole process is run in different stages. + * If a stage leverages threads via a worker pool, the worker pool is created + * and we wait until all the threads are done to continue with the next stage. + */ +int RepoAnalysis::Analyze() +{ + int errorCode {GIT_OK}; + + // stage 1 + if ((errorCode = storeObjectsInfo() != GIT_OK)) { + return errorCode; + } + + // stage 2 + if (!setObjectsReachability()) { + return GIT_EUSER; + } + + // stage 3 + pruneUnreachables(); + + // stage 4 + statsCountAndMax(); + + // stage 5 + if (!statsHistoryAndBiggestCheckouts()) { + return GIT_EUSER; + } + + fillOutStatistics(); + + return errorCode; +} + +/** + * RepoAnalysis::StatisticsToJS + */ +v8::Local RepoAnalysis::StatisticsToJS() const +{ + v8::Local result = Nan::New(); + + v8::Local repositorySize = repositorySizeToJS(); + Nan::Set(result, Nan::New("repositorySize").ToLocalChecked(), repositorySize); + + v8::Local biggestObjects = biggestObjectsToJS(); + Nan::Set(result, Nan::New("biggestObjects").ToLocalChecked(), biggestObjects); + + v8::Local historyStructure = historyStructureToJS(); + Nan::Set(result, Nan::New("historyStructure").ToLocalChecked(), historyStructure); + + v8::Local biggestCheckouts = biggestCheckoutsToJS(); + Nan::Set(result, Nan::New("biggestCheckouts").ToLocalChecked(), biggestCheckouts); + + return result; +} + +/** + * RepoAnalysis::storeObjectsInfo + * Store information from read odb objects. + * Starts building a container which eventually will hold only reachable objects. + * Leverages threads via a worker pool . + */ +int RepoAnalysis::storeObjectsInfo() +{ + int errorCode {GIT_OK}; + + // get the objects database + git_odb *odb {nullptr}; + if ((errorCode = git_repository_odb(&odb, m_repo)) != GIT_OK) { + return errorCode; + } + + // initialize workers for the worker pool + const std::string repoPath = git_repository_path(m_repo); + const unsigned int numThreads = + std::max(std::thread::hardware_concurrency(), static_cast(kMinThreads)); + + std::vector< std::shared_ptr > workers {}; + for (unsigned int i = 0; i < numThreads; ++i) { + workers.emplace_back(std::make_shared(repoPath, &m_odbObjectsData)); + } + + // initialize worker pool + WorkerPool workerPool {}; + workerPool.Init(workers); + + if ((errorCode = git_odb_foreach(odb, forEachOdbCb, &workerPool)) != GIT_OK) { + workerPool.Shutdown(); + git_odb_free(odb); + return errorCode; + } + + // main thread will work on the refs while waiting for the threads to finish + if ((errorCode = storeAndCountRefs() != GIT_OK)) { + workerPool.Shutdown(); + git_odb_free(odb); + return errorCode; + } + + // wait for the threads to finish and shutdown the work pool + workerPool.Shutdown(); + + // check there were no problems during execution + if (workerPool.Status() != WPStatus::kOk) { + git_odb_free(odb); + return GIT_EUSER; + } + + git_odb_free(odb); + + return errorCode; +} + +/** + * RepoAnalysis::storeAndCountRefs + * Stores the oid and type of peeled references. + * Also counts total references. + */ +int RepoAnalysis::storeAndCountRefs() +{ + int errorCode {GIT_OK}; + git_strarray ref_list; + + // count refs + if ((errorCode = git_reference_list(&ref_list, m_repo)) != GIT_OK) { + return errorCode; + } + m_statistics.repositorySize.references.count = ref_list.count; + + // store refs info + for (size_t i = 0; i < ref_list.count; ++i) + { + // lookup ref + git_reference *ref {nullptr}; + const int refLookupError = git_reference_lookup(&ref, m_repo, ref_list.strings[i]); + if (refLookupError == GIT_ENOTFOUND || refLookupError == GIT_EINVALIDSPEC) { + continue; + } + else if (refLookupError != GIT_OK) { + git_strarray_dispose(&ref_list); + return refLookupError; + } + + // obtain peeled oid of the reference + bool found_oid = false; + git_oid oid_ref; + switch (git_reference_type(ref)) + { + case GIT_REFERENCE_DIRECT: + git_oid_cpy(&oid_ref, git_reference_target(ref)); + found_oid = true; + break; + + case GIT_REFERENCE_SYMBOLIC: + { + git_reference *ref_resolved {nullptr}; + if ((errorCode = git_reference_resolve(&ref_resolved, ref)) != GIT_OK) { + git_reference_free(ref); + git_strarray_dispose(&ref_list); + return errorCode; + } + git_oid_cpy(&oid_ref, git_reference_target(ref_resolved)); + found_oid = true; + git_reference_free(ref_resolved); + } + break; + + default: + break; + } + + // store object's oid and type + if (found_oid) + { + git_object *target {nullptr}; + if ((errorCode = git_object_lookup(&target, m_repo, &oid_ref, GIT_OBJECT_ANY)) != GIT_OK) { + git_reference_free(ref); + git_strarray_dispose(&ref_list); + return errorCode; + } + + m_peeledRefs.emplace(std::make_pair( + std::string(reinterpret_cast(oid_ref.id), GIT_OID_RAWSZ), + git_object_type(target))); + + git_object_free(target); + } + git_reference_free(ref); + } + git_strarray_dispose(&ref_list); + + return errorCode; +} + +/** + * RepoAnalysis::setObjectsReachability + * Leverages threads via a worker pool to + * set reachability from tags, commits, and trees. + * NOTE: the worker pool leveraged in this method runs at a different stage than the + * worker pool leveraged in previous stages, meaning they do not run at the same time, hence + * access to 'm_odbObjectsData->....info' won't suffer from a data race. + * NOTE: performance didn't improve leveraging threads for adding objects to unreachables container. + * \return false if the workerPool finished with errors; true otherwise + */ +bool RepoAnalysis::setObjectsReachability() +{ + // references are not objects, hence they won't be sent to the worker threads + setReachabilityFromRefs(); + + const unsigned int numThreads = + std::max(std::thread::hardware_concurrency(), static_cast(kMinThreads)); + std::vector< std::shared_ptr > workers {}; + for (unsigned int i = 0; i < numThreads; ++i) { + workers.emplace_back(std::make_shared(&m_odbObjectsData)); + } + + // initialize worker pool + WorkerPool workerPool {}; + workerPool.Init(workers); + + // NOTE: avoid queueing same type of objects in a row, so that different mutex can be used concurrently + uint8_t workInserted {0}; + OdbObjectsData::iterTagInfo itTagInfo = m_odbObjectsData.tags.info.begin(); + OdbObjectsData::iterCommitInfo itCommitInfo = m_odbObjectsData.commits.info.begin(); + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.begin(); + do { + workInserted = 0; + // insert tag + if (itTagInfo != m_odbObjectsData.tags.info.end()) { + workerPool.InsertWork(std::make_unique(&itTagInfo->second, GIT_OBJECT_TAG)); + ++itTagInfo; + ++workInserted; + } + // insert commmit + if (itCommitInfo != m_odbObjectsData.commits.info.end()) { + workerPool.InsertWork(std::make_unique(&itCommitInfo->second, GIT_OBJECT_COMMIT)); + ++itCommitInfo; + ++workInserted; + } + // insert tree + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + workerPool.InsertWork(std::make_unique(&itTreeInfo->second, GIT_OBJECT_TREE)); + ++itTreeInfo; + ++workInserted; + } + // blobs do not reach to any other object, hence no need to process them + } while (workInserted); + + // wait for the threads to finish and shutdown the work pool + workerPool.Shutdown(); + + // check there were no problems during execution + if (workerPool.Status() != WPStatus::kOk) { + return false; + } + + setUnreachables(); + + return true; +} + +/** + * RepoAnalysis::setReachabilityFromRefs + * Adds reachability counter where peeled refs point (normally a commit or a tag). + */ +void RepoAnalysis::setReachabilityFromRefs() +{ + for (const auto &ref : m_peeledRefs) { + switch (ref.second) { + case GIT_OBJECT_COMMIT: + { + OdbObjectsData::iterCommitInfo itCommitInfo = + m_odbObjectsData.commits.info.find(ref.first); + + if (itCommitInfo != m_odbObjectsData.commits.info.end()) { + ++itCommitInfo->second.reachability; + } + } + break; + case GIT_OBJECT_TREE: + { + OdbObjectsData::iterTreeInfo itTreeInfo = + m_odbObjectsData.trees.info.find(ref.first); + + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + ++itTreeInfo->second.reachability; + } + } + break; + case GIT_OBJECT_BLOB: + { + OdbObjectsData::iterBlobInfo itBlobInfo = + m_odbObjectsData.blobs.info.find(ref.first); + + if (itBlobInfo != m_odbObjectsData.blobs.info.end()) { + ++itBlobInfo->second.reachability; + } + } + break; + case GIT_OBJECT_TAG: + { + OdbObjectsData::iterTagInfo itTagInfo = + m_odbObjectsData.tags.info.find(ref.first); + + if (itTagInfo != m_odbObjectsData.tags.info.end()) { + ++itTagInfo->second.reachability; + } + } + break; + default: + break; + } + } +} + +/** + * RepoAnalysis::setUnreachables + * After setting reachability, we add the unreached objects to their unreachables container. + */ +void RepoAnalysis::setUnreachables() +{ + for (const auto &tag : m_odbObjectsData.tags.info) { + if (!tag.second.reachability) { + m_odbObjectsData.tags.unreachables.emplace(tag.first); + } + } + for (const auto &commit : m_odbObjectsData.commits.info) { + if (!commit.second.reachability) { + m_odbObjectsData.commits.unreachables.emplace(commit.first); + } + } + for (const auto &tree : m_odbObjectsData.trees.info) { + if (!tree.second.reachability) { + m_odbObjectsData.trees.unreachables.emplace(tree.first); + } + } + for (const auto &blob : m_odbObjectsData.blobs.info) { + if (!blob.second.reachability) { + m_odbObjectsData.blobs.unreachables.emplace(blob.first); + } + } +} + +/** + * RepoAnalysis::pruneUnreachables + * Removes from their containers the unreachable objects. + * Decreases reachability of the objects they can reach. + */ +void RepoAnalysis::pruneUnreachables() +{ + // NOTE: order is important here, since each method prunes its own objects, but + // only decreases reachability of the objects connected to it; and those + // connected objects will be checked and pruned afterwards. + pruneUnreachableTags(); + pruneUnreachableCommits(); + pruneUnreachableTrees(); + pruneUnreachableBlobs(); +} + +/** + * RepoAnalysis::pruneUnreachableTags + * Prune tags and their chained tags if they become unreachable. + * Also decreases reachability of targets. + */ +void RepoAnalysis::pruneUnreachableTags() +{ + while (!m_odbObjectsData.tags.unreachables.empty()) { + std::unordered_set newUnreachables {}; + + // erase unreachable tags + for (OdbObjectsData::iterUnreachable itTagUnrch = m_odbObjectsData.tags.unreachables.begin(); + itTagUnrch != m_odbObjectsData.tags.unreachables.end(); ++itTagUnrch) + { + OdbObjectsData::iterTagInfo itTagInfo = m_odbObjectsData.tags.info.find(*itTagUnrch); + + if (itTagInfo != m_odbObjectsData.tags.info.end()) { + const std::string &oidTarget = itTagInfo->second.oidTarget; + switch (itTagInfo->second.typeTarget) { + case GIT_OBJECT_TAG: + { + // if target is another tag, add it to newUnreachables + OdbObjectsData::iterTagInfo itTargetTagInfo = m_odbObjectsData.tags.info.find(oidTarget); + if (itTargetTagInfo != m_odbObjectsData.tags.info.end()) { + if (--itTargetTagInfo->second.reachability == OdbObjectsData::kUnreachable) { + newUnreachables.emplace(itTargetTagInfo->first); + } + } + } + break; + case GIT_OBJECT_COMMIT: + { + OdbObjectsData::iterCommitInfo itCommitInfo = m_odbObjectsData.commits.info.find(oidTarget); + if (itCommitInfo != m_odbObjectsData.commits.info.end()) { + if (--itCommitInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.commits.unreachables.emplace(itCommitInfo->first); + } + } + } + break; + case GIT_OBJECT_TREE: + { + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.find(oidTarget); + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + if (--itTreeInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.trees.unreachables.emplace(itTreeInfo->first); + } + } + } + break; + case GIT_OBJECT_BLOB: + { + OdbObjectsData::iterBlobInfo itBlobInfo = m_odbObjectsData.blobs.info.find(oidTarget); + if (itBlobInfo != m_odbObjectsData.blobs.info.end()) { + if (--itBlobInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.blobs.unreachables.emplace(itBlobInfo->first); + } + } + } + break; + default: + break; + } + // erase tag from the tag's container + m_odbObjectsData.tags.info.erase(itTagInfo); + } + } + // set new unreachable tags + m_odbObjectsData.tags.unreachables = std::move(newUnreachables); + } +} + +/** + * RepoAnalysis::pruneUnreachableCommits + * Prune commits and decrease reachability of their associated trees. + */ +void RepoAnalysis::pruneUnreachableCommits() +{ + while (!m_odbObjectsData.commits.unreachables.empty()) { + std::unordered_set newUnreachables {}; + + // erase unreachable commits + for (OdbObjectsData::iterUnreachable itCommitUnrch = m_odbObjectsData.commits.unreachables.begin(); + itCommitUnrch != m_odbObjectsData.commits.unreachables.end(); ++itCommitUnrch) + { + OdbObjectsData::iterCommitInfo itCommitInfo = m_odbObjectsData.commits.info.find(*itCommitUnrch); + + if (itCommitInfo != m_odbObjectsData.commits.info.end()) + { + // decrease commit's parents reachability and add them as newUnreachable + const size_t numParents = itCommitInfo->second.parents.size(); + for (size_t i = 0; i < numParents; ++i) { + OdbObjectsData::iterCommitInfo itParentCommitInfo = + m_odbObjectsData.commits.info.find(itCommitInfo->second.parents.at(i)); + + if (itParentCommitInfo != m_odbObjectsData.commits.info.end()) { + if (--itParentCommitInfo->second.reachability == OdbObjectsData::kUnreachable) { + newUnreachables.emplace(itParentCommitInfo->first); + } + } + } + // decrease reachability of the commit's tree + OdbObjectsData::iterTreeInfo itTreeInfo = + m_odbObjectsData.trees.info.find(itCommitInfo->second.oidTree); + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + if (--itTreeInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.trees.unreachables.emplace(itTreeInfo->first); + } + } + // erase commit from the commit's container + m_odbObjectsData.commits.info.erase(itCommitInfo); + } + } + // set new unreachable commits + m_odbObjectsData.commits.unreachables = std::move(newUnreachables); + } +} + +/** + * RepoAnalysis::pruneUnreachableTrees + * Prune unreachable trees and decrement reachability of their entries. + */ +void RepoAnalysis::pruneUnreachableTrees() +{ + while (!m_odbObjectsData.trees.unreachables.empty()) { + std::unordered_set newUnreachables {}; + + // erase unreachable trees + for (OdbObjectsData::iterUnreachable itTreeUnrch = m_odbObjectsData.trees.unreachables.begin(); + itTreeUnrch != m_odbObjectsData.trees.unreachables.end(); ++itTreeUnrch) + { + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.find(*itTreeUnrch); + + if (itTreeInfo != m_odbObjectsData.trees.info.end()) { + // decrease reachability of the entry blobs + for (auto &blob : itTreeInfo->second.entryBlobs) { + OdbObjectsData::iterBlobInfo itEntryBlobInfo = m_odbObjectsData.blobs.info.find(blob); + if (itEntryBlobInfo != m_odbObjectsData.blobs.info.end()) { + if (--itEntryBlobInfo->second.reachability == OdbObjectsData::kUnreachable) { + m_odbObjectsData.blobs.unreachables.emplace(blob); + } + } + } + // decrease reachability of the entry trees and add them as newUnreachables + for (auto &treeNameLen : itTreeInfo->second.entryTreesNameLen) { + OdbObjectsData::iterTreeInfo itEntryTreeInfo = + m_odbObjectsData.trees.info.find(treeNameLen.first); + if (itEntryTreeInfo != m_odbObjectsData.trees.info.end()) { + if (--itEntryTreeInfo->second.reachability == OdbObjectsData::kUnreachable) { + newUnreachables.emplace(treeNameLen.first); + } + } + } + // erase tree from the tree's container + m_odbObjectsData.trees.info.erase(itTreeInfo); + } + } + // set new unreachable trees + m_odbObjectsData.trees.unreachables = std::move(newUnreachables); + } +} + +/** + * RepoAnalysis::pruneUnreachableBlobs + * Rremoves unreachable blobs from their container. + */ +void RepoAnalysis::pruneUnreachableBlobs() +{ + for (OdbObjectsData::iterUnreachable itBlobUnrch = m_odbObjectsData.blobs.unreachables.begin(); + itBlobUnrch != m_odbObjectsData.blobs.unreachables.end(); ++itBlobUnrch) + { + m_odbObjectsData.blobs.info.erase(*itBlobUnrch); + } +} + +/** + * RepoAnalysis::statsCountAndMax + * Statistics for repositorySize (count objects) and biggestObjects (get maximum of them). + * Also builds the commits graph. + * NOTE: better results achieved not leveraging threads. + */ +void RepoAnalysis::statsCountAndMax() +{ + // commits + for (auto &info : m_odbObjectsData.commits.info) { + OdbObjectsData::CommitInfo &commitInfo = info.second; + const size_t objectSize = commitInfo.size; + + m_odbObjectsData.commits.totalSize += objectSize; + m_odbObjectsData.commits.maxSize = std::max(m_odbObjectsData.commits.maxSize, objectSize); + m_odbObjectsData.commits.maxParents = std::max( + m_odbObjectsData.commits.maxParents, commitInfo.parents.size()); + + // build commit's graph + m_odbObjectsData.commits.graph.AddNode(info.first, commitInfo.parents); + } + // trees + for (auto &info : m_odbObjectsData.trees.info) { + OdbObjectsData::TreeInfoAndStats &treeInfo = info.second; + const size_t numEntries = treeInfo.numEntries; + const size_t objectSize = treeInfo.size; + + m_odbObjectsData.trees.totalSize += objectSize; + m_odbObjectsData.trees.totalEntries += numEntries; + m_odbObjectsData.trees.maxEntries = std::max(m_odbObjectsData.trees.maxEntries, numEntries); + } + // blobs + for (auto &info : m_odbObjectsData.blobs.info) { + OdbObjectsData::BlobInfo &blobInfo = info.second; + const size_t objectSize = blobInfo.size; + + m_odbObjectsData.blobs.totalSize += objectSize; + m_odbObjectsData.blobs.maxSize = std::max(m_odbObjectsData.blobs.maxSize, objectSize); + } + // no need to process tags here (we already have the count) +} + +/** + * RepoAnalysis::statsHistoryAndBiggestCheckouts + * Statistics for historyStructure and biggestCheckouts. + * \return true if success; false if something went wrong. + */ +bool RepoAnalysis::statsHistoryAndBiggestCheckouts() +{ + if (!calculateBiggestCheckouts()) { + return false; + } + + if (!calculateMaxTagDepth()) { + return false; + } + + // calculate max commit history depth + m_statistics.historyStructure.maxDepth = m_odbObjectsData.commits.graph.CalculateMaxDepth(); + + return true; +} + +/** + * RepoAnalysis::calculateBiggestCheckouts + * + * Once threads have collected data from objects and unreachable objects + * have been pruned, biggest checkouts can be calculated. + * Threads have already collected partial non-recursive tree statistics. + * \return true if success; false if something went wrong. + */ +bool RepoAnalysis::calculateBiggestCheckouts() +{ + for (auto &commitInfo : m_odbObjectsData.commits.info) + { + // calculate this commit's data + const std::string &commitOidTree = commitInfo.second.oidTree; + + OdbObjectsData::iterTreeInfo itTreeInfo {}; + if ((itTreeInfo = calculateTreeStatistics(commitOidTree)) == m_odbObjectsData.trees.info.end()) { + return false; + } + + // update biggestCheckouts data + OdbObjectsData::TreeInfoAndStats &treeInfoAndStats = itTreeInfo->second; + m_statistics.biggestCheckouts.numDirectories = std::max( + m_statistics.biggestCheckouts.numDirectories, treeInfoAndStats.stats.numDirectories); + m_statistics.biggestCheckouts.totalFileSize = std::max( + m_statistics.biggestCheckouts.totalFileSize, treeInfoAndStats.stats.totalFileSize); + m_statistics.biggestCheckouts.maxPathDepth = std::max( + m_statistics.biggestCheckouts.maxPathDepth, treeInfoAndStats.stats.maxPathDepth); + m_statistics.biggestCheckouts.numFiles = std::max( + m_statistics.biggestCheckouts.numFiles, treeInfoAndStats.stats.numFiles); + m_statistics.biggestCheckouts.maxPathLength = std::max( + m_statistics.biggestCheckouts.maxPathLength, treeInfoAndStats.stats.maxPathLength); + m_statistics.biggestCheckouts.numSymlinks = std::max( + m_statistics.biggestCheckouts.numSymlinks, treeInfoAndStats.stats.numSymlinks); + m_statistics.biggestCheckouts.numSubmodules = std::max( + m_statistics.biggestCheckouts.numSubmodules, treeInfoAndStats.stats.numSubmodules); + } + + return true; +} + +/** + * RepoAnalysis::calculateTreeStatistics + * + * Calculates tree statistics recursively, considering individual tree's statistics + * have already been calculated. + * The maximum number of recursive calls depend directly on the maximum path depth of + * the repository. For instance, the linux repository have a maximum path depth of 13, + * so it should be safe against stack overflow. + * Returns an iterator to the tree info container, or to end if something went wrong. + */ +OdbObjectsData::iterTreeInfo RepoAnalysis::calculateTreeStatistics(const std::string &oidTree) +{ + OdbObjectsData::iterTreeInfo itTreeInfo = m_odbObjectsData.trees.info.find(oidTree); + if (itTreeInfo == m_odbObjectsData.trees.info.end()) { + return itTreeInfo; + } + + OdbObjectsData::TreeInfoAndStats &treeInfoAndStats = itTreeInfo->second; + + // prune recursivity + if (treeInfoAndStats.statsDone) { + return itTreeInfo; + } + + ++treeInfoAndStats.stats.numDirectories; + ++treeInfoAndStats.stats.maxPathDepth; + // the following partial statistics have also been calculated in previous stage with threads: + // - treeInfoAndStats.stats.numFiles + // - treeInfoAndStats.stats.maxPathLength + // - treeInfoAndStats.stats.numSymLinks + // - treeInfoAndStats.stats.numSubmodules + + // totalFileSize + OdbObjectsData::iterBlobInfo itBlobInfo {}; + for (auto &oidBlob : treeInfoAndStats.entryBlobs) + { + if ((itBlobInfo = m_odbObjectsData.blobs.info.find(oidBlob)) == m_odbObjectsData.blobs.info.end()) { + return m_odbObjectsData.trees.info.end(); // to let the caller know that something went wrong + } + + treeInfoAndStats.stats.totalFileSize += itBlobInfo->second.size; + } + + // recursively into subtrees + for (const auto &subTreeNameLen : treeInfoAndStats.entryTreesNameLen) + { + OdbObjectsData::iterTreeInfo itSubTreeInfo {}; + if ((itSubTreeInfo = calculateTreeStatistics(subTreeNameLen.first)) == + m_odbObjectsData.trees.info.end()) { + return itSubTreeInfo; + } + + OdbObjectsData::TreeInfoAndStats &subTreeInfoAndStats = itSubTreeInfo->second; + treeInfoAndStats.stats.numDirectories += subTreeInfoAndStats.stats.numDirectories; + treeInfoAndStats.stats.maxPathDepth = std::max(treeInfoAndStats.stats.maxPathDepth, + subTreeInfoAndStats.stats.maxPathDepth + 1); + treeInfoAndStats.stats.maxPathLength = std::max(treeInfoAndStats.stats.maxPathLength, + subTreeNameLen.second + 1 + subTreeInfoAndStats.stats.maxPathLength); + treeInfoAndStats.stats.numFiles += subTreeInfoAndStats.stats.numFiles; + treeInfoAndStats.stats.totalFileSize += subTreeInfoAndStats.stats.totalFileSize; + treeInfoAndStats.stats.numSymlinks += subTreeInfoAndStats.stats.numSymlinks; + treeInfoAndStats.stats.numSubmodules += subTreeInfoAndStats.stats.numSubmodules; + } + + treeInfoAndStats.statsDone = true; + + return itTreeInfo; +} + +/** + * RepoAnalysis::calculateMaxTagDepth + * \return true if success; false if something went wrong. + */ +bool RepoAnalysis::calculateMaxTagDepth() +{ + for (auto &tag : m_odbObjectsData.tags.info) + { + OdbObjectsData::iterTagInfo itTagInfo {}; + if ((itTagInfo = calculateTagDepth(tag.first)) == m_odbObjectsData.tags.info.end()) { + return false; + } + + // update maxTagDepth + OdbObjectsData::TagInfo &tagInfo = itTagInfo->second; + m_statistics.historyStructure.maxTagDepth = std::max( + m_statistics.historyStructure.maxTagDepth, tagInfo.depth); + } + + return true; +} + +/** + * RepoAnalysis::calculateTagDepth + * + * Calculates recursively the tag depth of the oidTag passed as a parameter. + * Returns an iterator to the tag info container, or to end if something went wrong. + */ +OdbObjectsData::iterTagInfo RepoAnalysis::calculateTagDepth(const std::string &oidTag) +{ + OdbObjectsData::iterTagInfo itTagInfo = m_odbObjectsData.tags.info.find(oidTag); + if (itTagInfo == m_odbObjectsData.tags.info.end()) { + return itTagInfo; + } + + OdbObjectsData::TagInfo &tagInfo = itTagInfo->second; + + // prune recursivity + if (tagInfo.depth != OdbObjectsData::TagInfo::kUnsetDepth) { + return itTagInfo; + } + + ++tagInfo.depth; + + if (tagInfo.typeTarget == GIT_OBJECT_TAG) + { + OdbObjectsData::iterTagInfo itChainedTagInfo {}; + if ((itChainedTagInfo = calculateTagDepth(tagInfo.oidTarget)) == m_odbObjectsData.tags.info.end()) { + return itChainedTagInfo; + } + + OdbObjectsData::TagInfo &chainedTagInfo = itChainedTagInfo->second; + tagInfo.depth += chainedTagInfo.depth; + } + + return itTagInfo; +} + +/** + * RepoAnalysis::fillOutStatistics + */ +void RepoAnalysis::fillOutStatistics() +{ + m_statistics.repositorySize.commits.count = m_odbObjectsData.commits.info.size(); + m_statistics.repositorySize.commits.size = m_odbObjectsData.commits.totalSize; + m_statistics.repositorySize.trees.count = m_odbObjectsData.trees.info.size(); + m_statistics.repositorySize.trees.size = m_odbObjectsData.trees.totalSize; + m_statistics.repositorySize.trees.entries = m_odbObjectsData.trees.totalEntries; + m_statistics.repositorySize.blobs.count = m_odbObjectsData.blobs.info.size(); + m_statistics.repositorySize.blobs.size = m_odbObjectsData.blobs.totalSize; + m_statistics.repositorySize.annotatedTags.count = m_odbObjectsData.tags.info.size(); + + m_statistics.biggestObjects.commits.maxSize = m_odbObjectsData.commits.maxSize; + m_statistics.biggestObjects.commits.maxParents = m_odbObjectsData.commits.maxParents; + m_statistics.biggestObjects.trees.maxEntries = m_odbObjectsData.trees.maxEntries; + m_statistics.biggestObjects.blobs.maxSize = m_odbObjectsData.blobs.maxSize; + + // m_statistics.biggestCheckouts have already been filled out while running +} + +/** + * RepoAnalysis::repositorySizeToJS + */ +v8::Local RepoAnalysis::repositorySizeToJS() const +{ + v8::Local commits = Nan::New(); + Nan::Set(commits, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.commits.count)); + Nan::Set(commits, Nan::New("size").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.commits.size)); + + v8::Local trees = Nan::New(); + Nan::Set(trees, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.trees.count)); + Nan::Set(trees, Nan::New("size").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.trees.size)); + Nan::Set(trees, Nan::New("entries").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.trees.entries)); + + v8::Local blobs = Nan::New(); + Nan::Set(blobs, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.blobs.count)); + Nan::Set(blobs, Nan::New("size").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.blobs.size)); + + v8::Local annotatedTags = Nan::New(); + Nan::Set(annotatedTags, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.annotatedTags.count)); + + v8::Local references = Nan::New(); + Nan::Set(references, Nan::New("count").ToLocalChecked(), + Nan::New(m_statistics.repositorySize.references.count)); + + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("commits").ToLocalChecked(), commits); + Nan::Set(result, Nan::New("trees").ToLocalChecked(), trees); + Nan::Set(result, Nan::New("blobs").ToLocalChecked(), blobs); + Nan::Set(result, Nan::New("annotatedTags").ToLocalChecked(), annotatedTags); + Nan::Set(result, Nan::New("references").ToLocalChecked(), references); + + return result; +} + +/** + * RepoAnalysis::biggestObjectsToJS + */ +v8::Local RepoAnalysis::biggestObjectsToJS() const +{ + v8::Local commits = Nan::New(); + Nan::Set(commits, Nan::New("maxSize").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.commits.maxSize)); + Nan::Set(commits, Nan::New("maxParents").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.commits.maxParents)); + + v8::Local trees = Nan::New(); + Nan::Set(trees, Nan::New("maxEntries").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.trees.maxEntries)); + + v8::Local blobs = Nan::New(); + Nan::Set(blobs, Nan::New("maxSize").ToLocalChecked(), + Nan::New(m_statistics.biggestObjects.blobs.maxSize)); + + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("commits").ToLocalChecked(), commits); + Nan::Set(result, Nan::New("trees").ToLocalChecked(), trees); + Nan::Set(result, Nan::New("blobs").ToLocalChecked(), blobs); + + return result; +} + +/** + * RepoAnalysis::historyStructureToJS + */ +v8::Local RepoAnalysis::historyStructureToJS() const +{ + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("maxDepth").ToLocalChecked(), + Nan::New(m_statistics.historyStructure.maxDepth)); + Nan::Set(result, Nan::New("maxTagDepth").ToLocalChecked(), + Nan::New(m_statistics.historyStructure.maxTagDepth)); + + return result; +} + +/** + * RepoAnalysis::biggestCheckoutsToJS + */ +v8::Local RepoAnalysis::biggestCheckoutsToJS() const +{ + v8::Local result = Nan::New(); + Nan::Set(result, Nan::New("numDirectories").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numDirectories)); + Nan::Set(result, Nan::New("maxPathDepth").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.maxPathDepth)); + Nan::Set(result, Nan::New("maxPathLength").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.maxPathLength)); + Nan::Set(result, Nan::New("numFiles").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numFiles)); + Nan::Set(result, Nan::New("totalFileSize").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.totalFileSize)); + Nan::Set(result, Nan::New("numSymlinks").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numSymlinks)); + Nan::Set(result, Nan::New("numSubmodules").ToLocalChecked(), + Nan::New(m_statistics.biggestCheckouts.numSubmodules)); + + return result; +} + +NAN_METHOD(GitRepository::Statistics) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + StatisticsBaton* baton = new StatisticsBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->repo = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->out = static_cast(new RepoAnalysis(baton->repo)); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + StatisticsWorker *worker = new StatisticsWorker(baton, callback, cleanupHandles); + worker->Reference("repo", info.This()); + nodegit::Context *nodegitContext = + reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRepository::StatisticsWorker::AcquireLocks() +{ + nodegit::LockMaster lockMaster(true, baton->repo); + + return lockMaster; +} + +void GitRepository::StatisticsWorker::Execute() +{ + git_error_clear(); + + RepoAnalysis *repoAnalysis = static_cast(baton->out); + if ((baton->error_code = repoAnalysis->Analyze()) != GIT_OK) + { + if (git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + + delete repoAnalysis; + baton->out = nullptr; + } +} + +void GitRepository::StatisticsWorker::HandleErrorCallback() +{ + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + RepoAnalysis *repoAnalysis = static_cast(baton->out); + if (repoAnalysis) { + delete repoAnalysis; + } + + delete baton; +} + +void GitRepository::StatisticsWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + RepoAnalysis *repoAnalysis = static_cast(baton->out); + Local result = repoAnalysis->StatisticsToJS(); + + delete repoAnalysis; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) + { + Local err; + + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method statistics has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("GitRepository.statistics").ToLocalChecked()); + Local argv[1] = { + err + }; + + callback->Call(1, argv, async_resource); + + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + Local err = Nan::To(Nan::Error("Method statistics has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("GitRepository.statistics").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else + { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} \ No newline at end of file diff --git a/generate/templates/manual/revwalk/commit_walk.cc b/generate/templates/manual/revwalk/commit_walk.cc new file mode 100644 index 0000000000..4fe60de9e1 --- /dev/null +++ b/generate/templates/manual/revwalk/commit_walk.cc @@ -0,0 +1,275 @@ +#define SET_ON_OBJECT(obj, field, data) Nan::Set(obj, Nan::New(field).ToLocalChecked(), data) + +v8::Local signatureToJavascript(const git_signature *signature) { + v8::Local signatureObject = Nan::New(); + SET_ON_OBJECT(signatureObject, "name", Nan::New(signature->name).ToLocalChecked()); + SET_ON_OBJECT(signatureObject, "email", Nan::New(signature->email).ToLocalChecked()); + SET_ON_OBJECT(signatureObject, "date", Nan::New(signature->when.time * 1000)); + std::stringstream fullSignature; + fullSignature << signature->name << " <" << signature << ">"; + SET_ON_OBJECT(signatureObject, "full", Nan::New(fullSignature.str()).ToLocalChecked()); + return signatureObject; +} + +#include +class CommitModel { +public: + CommitModel(git_commit *commit, bool fetchSignature): + commit(commit), + fetchSignature(fetchSignature), + signature({ 0, 0, 0 }), + signedData({ 0, 0, 0 }) + { + if (fetchSignature) { + const int error = git_commit_extract_signature( + &signature, + &signedData, + git_commit_owner(commit), + const_cast(git_commit_id(commit)), + NULL + ); + if (error != GIT_ENOTFOUND) { + assert(error == GIT_OK); + } + } + + const size_t parentCount = git_commit_parentcount(commit); + parentIds.reserve(parentCount); + for (size_t parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + parentIds.push_back(git_oid_tostr_s(git_commit_parent_id(commit, parentIndex))); + } + } + + CommitModel(const CommitModel &) = delete; + CommitModel(CommitModel &&) = delete; + CommitModel &operator=(const CommitModel &) = delete; + CommitModel &operator=(CommitModel &&) = delete; + + v8::Local toJavascript() { + if (!fetchSignature) { + v8::Local commitObject = GitCommit::New( + commit, + true, + Nan::To(GitRepository::New( + git_commit_owner(commit), + true + )).ToLocalChecked() + ); + commit = NULL; + return commitObject; + } + + v8::Local commitModel = Nan::New(); + SET_ON_OBJECT(commitModel, "sha", Nan::New(git_oid_tostr_s(git_commit_id(commit))).ToLocalChecked()); + SET_ON_OBJECT(commitModel, "message", Nan::New(git_commit_message(commit)).ToLocalChecked()); + SET_ON_OBJECT(commitModel, "author", signatureToJavascript(git_commit_author(commit))); + SET_ON_OBJECT(commitModel, "committer", signatureToJavascript(git_commit_committer(commit))); + + size_t parentCount = parentIds.size(); + v8::Local parents = Nan::New(parentCount); + for (size_t parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + Nan::Set(parents, Nan::New(parentIndex), Nan::New(parentIds[parentIndex]).ToLocalChecked()); + } + SET_ON_OBJECT(commitModel, "parents", parents); + + if (signature.size != 0 || signedData.size != 0) { + v8::Local gpgSignature = Nan::New(); + if (signature.size != 0) { + SET_ON_OBJECT(gpgSignature, "signature", Nan::New(signature.ptr).ToLocalChecked()); + } else { + SET_ON_OBJECT(gpgSignature, "signature", Nan::Null()); + } + + if (signedData.size != 0) { + SET_ON_OBJECT(gpgSignature, "signedData", Nan::New(signedData.ptr).ToLocalChecked()); + } else { + SET_ON_OBJECT(gpgSignature, "signedData", Nan::Null()); + } + + SET_ON_OBJECT(commitModel, "gpgSignature", gpgSignature); + } + + return commitModel; + } + + ~CommitModel() { + git_buf_dispose(&signature); + git_buf_dispose(&signedData); + if (commit) { + git_commit_free(commit); + } + } + +private: + git_commit *commit; + bool fetchSignature; + git_buf signature, signedData; + std::vector parentIds; +}; + +NAN_METHOD(GitRevwalk::CommitWalk) { + if (info.Length() == 0 || !info[0]->IsNumber()) { + return Nan::ThrowError("Max count is required and must be a number."); + } + + if (info.Length() >= 3 && !info[1]->IsNull() && !info[1]->IsUndefined() && !info[1]->IsObject()) { + return Nan::ThrowError("Options must be an object, null, or undefined."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + CommitWalkBaton* baton = new CommitWalkBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->max_count = Nan::To(info[0]).FromJust(); + std::vector *out = new std::vector; + out->reserve(baton->max_count); + baton->out = static_cast(out); + if (info.Length() == 3 && info[1]->IsObject()) { + v8::Local options = Nan::To(info[1]).ToLocalChecked(); + v8::Local propName = Nan::New("returnPlainObjects").ToLocalChecked(); + if (Nan::Has(options, propName).FromJust()) { + baton->returnPlainObjects = Nan::Get(options, propName).ToLocalChecked()->IsTrue(); + } else { + baton->returnPlainObjects = false; + } + } else { + baton->returnPlainObjects = false; + } + baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + CommitWalkWorker *worker = new CommitWalkWorker(baton, callback, cleanupHandles); + worker->Reference("commitWalk", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRevwalk::CommitWalkWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + +void GitRevwalk::CommitWalkWorker::Execute() { + giterr_clear(); + + std::vector *out = static_cast *>(baton->out); + for (int i = 0; i < baton->max_count; i++) { + git_oid next_commit_id; + baton->error_code = git_revwalk_next(&next_commit_id, baton->walk); + + if (baton->error_code == GIT_ITEROVER) { + baton->error_code = GIT_OK; + return; + } + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (out->size()) { + delete out->back(); + out->pop_back(); + } + + delete out; + baton->out = NULL; + + return; + } + + git_commit *commit; + baton->error_code = git_commit_lookup(&commit, git_revwalk_repository(baton->walk), &next_commit_id); + + if (baton->error_code != GIT_OK) { + if (giterr_last() != NULL) { + baton->error = git_error_dup(giterr_last()); + } + + while (out->size()) { + delete out->back(); + out->pop_back(); + } + + delete out; + baton->out = NULL; + + return; + } + + out->push_back(new CommitModel(commit, baton->returnPlainObjects)); + } +} + +void GitRevwalk::CommitWalkWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + auto out = static_cast *>(baton->out); + while (out->size()) { + delete out->back(); + out->pop_back(); + } + + delete out; + + delete baton; +} + +void GitRevwalk::CommitWalkWorker::HandleOKCallback() { + if (baton->out != NULL) { + std::vector *out = static_cast *>(baton->out); + const unsigned int size = out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + CommitModel *commitModel = out->at(i); + Nan::Set( + result, + Nan::New(i), + commitModel->toJavascript() + ); + delete commitModel; + } + + delete out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } else if (baton->error) { + Local argv[1] = { + Nan::Error(baton->error->message) + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } else if (baton->error_code < 0) { + Local err = Nan::To(Nan::Error("Revwalk commitWalk has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.commitWalk").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } else { + callback->Call(0, NULL, async_resource); + } + + delete baton; +} diff --git a/generate/templates/manual/revwalk/fast_walk.cc b/generate/templates/manual/revwalk/fast_walk.cc new file mode 100644 index 0000000000..ce2d05a2d3 --- /dev/null +++ b/generate/templates/manual/revwalk/fast_walk.cc @@ -0,0 +1,168 @@ +NAN_METHOD(GitRevwalk::FastWalk) +{ + if (info.Length() == 0 || !info[0]->IsNumber()) { + return Nan::ThrowError("Max count is required and must be a number."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + FastWalkBaton* baton = new FastWalkBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->max_count = Nan::To(info[0]).FromJust(); + baton->out = new std::vector; + baton->out->reserve(baton->max_count); + baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + FastWalkWorker *worker = new FastWalkWorker(baton, callback, cleanupHandles); + worker->Reference("fastWalk", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRevwalk::FastWalkWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + +void GitRevwalk::FastWalkWorker::Execute() +{ + for (int i = 0; i < baton->max_count; i++) + { + git_oid *nextCommit = (git_oid *)malloc(sizeof(git_oid)); + git_error_clear(); + baton->error_code = git_revwalk_next(nextCommit, baton->walk); + + if (baton->error_code != GIT_OK) + { + // We couldn't get a commit out of the revwalk. It's either in + // an error state or there aren't anymore commits in the revwalk. + free(nextCommit); + + if (baton->error_code != GIT_ITEROVER) { + baton->error = git_error_dup(git_error_last()); + + while(!baton->out->empty()) + { + // part of me wants to #define shoot free so we can take the + // baton out back and shoot the oids + git_oid *oidToFree = baton->out->back(); + free(oidToFree); + baton->out->pop_back(); + } + + delete baton->out; + + baton->out = NULL; + } + else { + baton->error_code = GIT_OK; + } + + break; + } + + baton->out->push_back(nextCommit); + } +} + +void GitRevwalk::FastWalkWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + while(!baton->out->empty()) { + free(baton->out->back()); + baton->out->pop_back(); + } + + delete baton->out; + + delete baton; +} + +void GitRevwalk::FastWalkWorker::HandleOKCallback() +{ + if (baton->out != NULL) + { + unsigned int size = baton->out->size(); + Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + Nan::Set(result, Nan::New(i), GitOid::New(baton->out->at(i), true)); + } + + delete baton->out; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else + { + if (baton->error) + { + Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method fastWalk has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) + { + Local err = Nan::To(Nan::Error("Method next has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fastWalk").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + } + else + { + callback->Call(0, NULL, async_resource); + } + } + + delete baton; +} diff --git a/generate/templates/manual/revwalk/file_history_walk.cc b/generate/templates/manual/revwalk/file_history_walk.cc new file mode 100644 index 0000000000..569bb022dc --- /dev/null +++ b/generate/templates/manual/revwalk/file_history_walk.cc @@ -0,0 +1,520 @@ +// Note: commit is not owned by this class (must be freed elsewhere) +class FileHistoryEvent { +public: + FileHistoryEvent( + git_delta_t inputType, + bool inputExistsInCurrentTree, + bool inputIsMergeCommit, + git_commit *inputCommit, + const char *inputFrom, + const char *inputTo + ): + type(inputType), + existsInCurrentTree(inputExistsInCurrentTree), + isMergeCommit(inputIsMergeCommit), + from(inputFrom == NULL ? NULL : strdup(inputFrom)), + to(inputTo == NULL ? NULL : strdup(inputTo)), + commit(inputCommit) + { + if (inputCommit != NULL) { + const int error = git_commit_dup(&commit, inputCommit); + assert(error == GIT_OK); + } + } + + FileHistoryEvent(const FileHistoryEvent &) = delete; + FileHistoryEvent(FileHistoryEvent &&) = delete; + FileHistoryEvent &operator=(const FileHistoryEvent &) = delete; + FileHistoryEvent &operator=(FileHistoryEvent &&) = delete; + + ~FileHistoryEvent() { + if (commit != NULL) { + git_commit_free(commit); + } + + if(from != NULL) { + free((void *)from); + } + + if(to != NULL) { + free((void *)to); + } + } + + v8::Local toJavascript() { + v8::Local historyEntry = Nan::New(); + v8::Local owners = Nan::New(0); + Nan::Set( + owners, + Nan::New(owners->Length()), + Nan::To(GitRepository::New( + git_commit_owner(commit), + true + )).ToLocalChecked() + ); + Nan::Set(historyEntry, Nan::New("commit").ToLocalChecked(), GitCommit::New(commit, true, owners)); + commit = NULL; + Nan::Set(historyEntry, Nan::New("status").ToLocalChecked(), Nan::New(type)); + Nan::Set(historyEntry, Nan::New("isMergeCommit").ToLocalChecked(), Nan::New(isMergeCommit)); + if (type == GIT_DELTA_RENAMED) { + if (from != NULL) { + Nan::Set(historyEntry, Nan::New("oldName").ToLocalChecked(), Nan::New(from).ToLocalChecked()); + } + if (to != NULL) { + Nan::Set(historyEntry, Nan::New("newName").ToLocalChecked(), Nan::New(to).ToLocalChecked()); + } + } + return historyEntry; + } + + static int buildHistoryEvent( + FileHistoryEvent **fileHistoryEvent, + git_repository *repo, + git_commit *currentCommit, + git_tree *currentTree, + git_tree *parentTree, + const char *filePath + ) { + int errorCode; + git_tree_entry *currentEntry; + if (git_tree_entry_bypath(¤tEntry, currentTree, filePath) != GIT_OK) { + currentEntry = NULL; + } + git_tree_entry *parentEntry; + if (git_tree_entry_bypath(&parentEntry, parentTree, filePath) != GIT_OK) { + parentEntry = NULL; + } + + if (!currentEntry && !parentEntry) { + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_UNMODIFIED, false, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + // The filePath was added + if (currentEntry && !parentEntry) { + git_diff *diff; + if ((errorCode = git_diff_tree_to_tree(&diff, repo, parentTree, currentTree, NULL)) != GIT_OK) { + git_tree_entry_free(currentEntry); + return errorCode; + } + if ((errorCode = git_diff_find_similar(diff, NULL)) != GIT_OK) { + git_diff_free(diff); + git_tree_entry_free(currentEntry); + return errorCode; + } + const size_t numDeltas = git_diff_num_deltas(diff); + for (size_t i = 0; i < numDeltas; ++i) { + const git_diff_delta *delta = git_diff_get_delta(diff, i); + if (delta->new_file.path != NULL && std::strcmp(delta->new_file.path, filePath) == 0) { + if (delta->status == GIT_DELTA_RENAMED + || (delta->old_file.path != NULL && std::strcmp(delta->old_file.path, filePath) != 0)) { + *fileHistoryEvent = new FileHistoryEvent( + GIT_DELTA_RENAMED, + true, + false, + currentCommit, + delta->old_file.path, + delta->new_file.path + ); + git_diff_free(diff); + git_tree_entry_free(currentEntry); + return GIT_OK; + } + break; + } + } + git_diff_free(diff); + git_tree_entry_free(currentEntry); + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_ADDED, true, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + // The filePath was deleted + if (!currentEntry && parentEntry) { + git_diff *diff; + if ((errorCode = git_diff_tree_to_tree(&diff, repo, parentTree, currentTree, NULL)) != GIT_OK) { + git_tree_entry_free(parentEntry); + return errorCode; + } + if ((errorCode = git_diff_find_similar(diff, NULL)) != GIT_OK) { + git_diff_free(diff); + git_tree_entry_free(parentEntry); + return errorCode; + } + const size_t numDeltas = git_diff_num_deltas(diff); + for (size_t i = 0; i < numDeltas; ++i) { + const git_diff_delta *delta = git_diff_get_delta(diff, i); + if (delta->old_file.path != NULL && std::strcmp(delta->old_file.path, filePath) == 0) { + if (delta->status == GIT_DELTA_RENAMED + || (delta->new_file.path != NULL && std::strcmp(delta->new_file.path, filePath) != 0)) { + *fileHistoryEvent = new FileHistoryEvent( + GIT_DELTA_RENAMED, + false, + false, + currentCommit, + delta->old_file.path, + delta->new_file.path + ); + git_diff_free(diff); + git_tree_entry_free(parentEntry); + return GIT_OK; + } + break; + } + } + git_diff_free(diff); + git_tree_entry_free(parentEntry); + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_DELETED, false, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + if (git_oid_cmp(git_tree_entry_id(currentEntry), git_tree_entry_id(parentEntry)) != 0 + || git_tree_entry_filemode(currentEntry) != git_tree_entry_filemode(parentEntry) + ) { + git_tree_entry_free(parentEntry); + git_tree_entry_free(currentEntry); + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_MODIFIED, true, false, currentCommit, NULL, NULL); + return GIT_OK; + } + + *fileHistoryEvent = new FileHistoryEvent(GIT_DELTA_UNMODIFIED, true, false, currentCommit, NULL, NULL); + git_tree_entry_free(parentEntry); + git_tree_entry_free(currentEntry); + return GIT_OK; + } + + git_delta_t type; + bool existsInCurrentTree, isMergeCommit; + const char *from, *to; + git_commit *commit; +}; + +NAN_METHOD(GitRevwalk::FileHistoryWalk) +{ + if (info.Length() == 0 || !info[0]->IsString()) { + return Nan::ThrowError("File path to get the history is required."); + } + + if (info.Length() == 1 || !info[1]->IsNumber()) { + return Nan::ThrowError("Max count is required and must be a number."); + } + + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + FileHistoryWalkBaton* baton = new FileHistoryWalkBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + Nan::Utf8String from_js_file_path(Nan::To(info[0]).ToLocalChecked()); + baton->file_path = strdup(*from_js_file_path); + baton->max_count = Nan::To(info[1]).FromJust(); + baton->out = new std::vector; + baton->out->reserve(baton->max_count); + baton->walk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + FileHistoryWalkWorker *worker = new FileHistoryWalkWorker(baton, callback, cleanupHandles); + worker->Reference("fileHistoryWalk", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitRevwalk::FileHistoryWalkWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true); + return lockMaster; +} + +void GitRevwalk::FileHistoryWalkWorker::Execute() +{ + git_repository *repo = git_revwalk_repository(baton->walk); + git_oid currentOid; + git_error_clear(); + for ( + unsigned int revwalkIterations = 0; + revwalkIterations < baton->max_count && (baton->error_code = git_revwalk_next(¤tOid, baton->walk)) == GIT_OK; + ++revwalkIterations + ) { + git_commit *currentCommit; + if ((baton->error_code = git_commit_lookup(¤tCommit, repo, ¤tOid)) != GIT_OK) { + break; + } + + git_tree *currentTree; + if ((baton->error_code = git_commit_tree(¤tTree, currentCommit)) != GIT_OK) { + git_commit_free(currentCommit); + break; + } + + const unsigned int parentCount = git_commit_parentcount(currentCommit); + if (parentCount == 0) { + git_tree_entry* entry; + if (git_tree_entry_bypath(&entry, currentTree, baton->file_path) == GIT_OK) { + baton->out->push_back(new FileHistoryEvent(GIT_DELTA_ADDED, false, false, currentCommit, NULL, NULL)); + git_tree_entry_free(entry); + } + git_commit_free(currentCommit); + git_tree_free(currentTree); + continue; + } + + if (parentCount == 1) { + git_commit *parentCommit; + if ((baton->error_code = git_commit_parent(&parentCommit, currentCommit, 0)) != GIT_OK) { + git_commit_free(currentCommit); + git_tree_free(currentTree); + break; + } + + git_tree *parentTree; + if ((baton->error_code = git_commit_tree(&parentTree, parentCommit)) != GIT_OK) { + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); + break; + } + + + FileHistoryEvent *fileHistoryEvent; + if ((baton->error_code = FileHistoryEvent::buildHistoryEvent( + &fileHistoryEvent, + repo, + currentCommit, + currentTree, + parentTree, + baton->file_path + )) != GIT_OK) { + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); + git_tree_free(parentTree); + break; + } + + if (fileHistoryEvent->type != GIT_DELTA_UNMODIFIED) { + baton->out->push_back(fileHistoryEvent); + } + + git_commit_free(currentCommit); + git_commit_free(parentCommit); + git_tree_free(currentTree); + git_tree_free(parentTree); + continue; + } + + std::pair firstMatchingParentIndex(false, 0); + bool fileExistsInCurrent = false, fileExistsInSomeParent = false; + for (unsigned int parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + git_commit *parentCommit; + if ((baton->error_code = git_commit_parent(&parentCommit, currentCommit, parentIndex)) != GIT_OK) { + break; + } + + git_tree *parentTree; + if ((baton->error_code = git_commit_tree(&parentTree, parentCommit)) != GIT_OK) { + git_commit_free(parentCommit); + break; + } + + FileHistoryEvent *fileHistoryEvent; + if ((baton->error_code = FileHistoryEvent::buildHistoryEvent( + &fileHistoryEvent, + repo, + currentCommit, + currentTree, + parentTree, + baton->file_path + )) != GIT_OK) { + git_tree_free(parentTree); + git_commit_free(parentCommit); + break; + } + + switch (fileHistoryEvent->type) { + case GIT_DELTA_ADDED: { + fileExistsInCurrent = true; + break; + } + case GIT_DELTA_MODIFIED: { + fileExistsInCurrent = true; + fileExistsInSomeParent = true; + break; + } + case GIT_DELTA_DELETED: { + fileExistsInSomeParent = true; + break; + } + case GIT_DELTA_RENAMED: { + if (fileHistoryEvent->existsInCurrentTree) { + fileExistsInCurrent = true; + } else { + fileExistsInSomeParent = true; + } + break; + } + case GIT_DELTA_UNMODIFIED: { + if (fileHistoryEvent->existsInCurrentTree) { + fileExistsInCurrent = true; + fileExistsInSomeParent = true; + } + firstMatchingParentIndex = std::make_pair(true, parentIndex); + break; + } + default: { + break; + } + } + + delete fileHistoryEvent; + git_commit_free(parentCommit); + git_tree_free(parentTree); + + if (firstMatchingParentIndex.first) { + break; + } + } + + if (baton->error_code != GIT_OK) { + git_tree_free(currentTree); + git_commit_free(currentCommit); + break; + } + + if (!firstMatchingParentIndex.first) { + assert(fileExistsInCurrent || fileExistsInSomeParent); + git_delta_t mergeType = GIT_DELTA_UNREADABLE; // It will never result in this case because of the assertion above. + if (fileExistsInCurrent && fileExistsInSomeParent) { + mergeType = GIT_DELTA_MODIFIED; + } else if (fileExistsInCurrent) { + mergeType = GIT_DELTA_ADDED; + } else if (fileExistsInSomeParent) { + mergeType = GIT_DELTA_DELETED; + } + + FileHistoryEvent *fileHistoryEvent = new FileHistoryEvent( + mergeType, + mergeType != GIT_DELTA_DELETED, + true, + currentCommit, + NULL, + NULL + ); + baton->out->push_back(fileHistoryEvent); + git_tree_free(currentTree); + git_commit_free(currentCommit); + continue; + } + + assert(firstMatchingParentIndex.first); + for (unsigned int parentIndex = 0; parentIndex < parentCount; ++parentIndex) { + if (parentIndex == firstMatchingParentIndex.second) { + continue; + } + + const git_oid *parentOid = git_commit_parent_id(currentCommit, parentIndex); + assert(parentOid != NULL); + git_revwalk_hide(baton->walk, parentOid); + } + git_commit_free(currentCommit); + git_tree_free(currentTree); + } + + if (baton->error_code != GIT_OK && baton->error_code != GIT_ITEROVER) { + // Something went wrong in our loop, discard everything in the async worker + for (unsigned int i = 0; i < baton->out->size(); ++i) { + delete static_cast(baton->out->at(i)); + } + delete baton->out; + baton->out = NULL; + baton->error = git_error_dup(git_error_last()); + } + free((void *)baton->file_path); + baton->file_path = NULL; +} + +void GitRevwalk::FileHistoryWalkWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + for (unsigned int i = 0; i < baton->out->size(); ++i) { + delete static_cast(baton->out->at(i)); + } + + delete baton->out; + + free((void *)baton->file_path); + + delete baton; +} + +void GitRevwalk::FileHistoryWalkWorker::HandleOKCallback() +{ + if (baton->out != NULL) { + const unsigned int size = baton->out->size(); + v8::Local result = Nan::New(size); + for (unsigned int i = 0; i < size; i++) { + FileHistoryEvent *batonResult = static_cast(baton->out->at(i)); + Nan::Set(result, Nan::New(i), batonResult->toJavascript()); + delete batonResult; + } + + Nan::Set(result, Nan::New("reachedEndOfHistory").ToLocalChecked(), Nan::New(baton->error_code == GIT_ITEROVER)); + + v8::Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + + delete baton->out; + return; + } + + if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method fileHistoryWalk has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + return; + } + + if (baton->error_code < 0) { + v8::Local err = Nan::To(Nan::Error("Method next has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.fileHistoryWalk").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + return; + } + + callback->Call(0, NULL, async_resource); + + delete baton; +} diff --git a/generate/templates/manual/src/async_baton.cc b/generate/templates/manual/src/async_baton.cc new file mode 100644 index 0000000000..56694f33f1 --- /dev/null +++ b/generate/templates/manual/src/async_baton.cc @@ -0,0 +1,89 @@ +#include "../include/async_baton.h" + +namespace nodegit { + void deleteBaton(AsyncBaton *baton) { + delete baton; + } + + AsyncBaton::AsyncBaton() + : asyncResource(ThreadPool::GetCurrentAsyncResource()), + callbackErrorHandle(*ThreadPool::GetCurrentCallbackErrorHandle()), + completedMutex(new std::mutex), + hasCompleted(false) + {} + + void AsyncBaton::SignalCompletion() { + std::lock_guard lock(*completedMutex); + hasCompleted = true; + completedCondition.notify_one(); + } + + void AsyncBaton::Done() { + onCompletion(); + } + + Nan::AsyncResource *AsyncBaton::GetAsyncResource() { + return asyncResource; + } + + void AsyncBaton::SetCallbackError(v8::Local error) { + callbackErrorHandle.Reset(error); + } + + void AsyncBaton::ExecuteAsyncPerform(AsyncCallback asyncCallback, AsyncCallback asyncCancelCb, CompletionCallback onCompletion) { + auto jsCallback = [asyncCallback, this]() { + asyncCallback(this); + }; + auto cancelCallback = [asyncCancelCb, this]() { + asyncCancelCb(this); + }; + + if (onCompletion) { + this->onCompletion = [this, onCompletion]() { + onCompletion(this); + }; + + ThreadPool::PostCallbackEvent( + [jsCallback, cancelCallback]( + ThreadPool::QueueCallbackFn queueCallback, + ThreadPool::Callback callbackCompleted, + bool isThreaded // Temporary workaround for LFS checkout. Code added to be reverted. + ) -> ThreadPool::Callback { + queueCallback(jsCallback, cancelCallback); + callbackCompleted(); + + return []() {}; + } + ); + } else { + ThreadPool::PostCallbackEvent( + [this, jsCallback, cancelCallback]( + ThreadPool::QueueCallbackFn queueCallback, + ThreadPool::Callback callbackCompleted, + bool isThreaded // Temporary workaround for LFS checkout. Code added to be reverted. + ) -> ThreadPool::Callback { + // Temporary workaround for LFS checkout. Code modified to be reverted. + if (!isThreaded) { + this->onCompletion = callbackCompleted; + + queueCallback(jsCallback, cancelCallback); + + return std::bind(&AsyncBaton::SignalCompletion, this); + } + else { + this->onCompletion = std::bind(&AsyncBaton::SignalCompletion, this); + queueCallback(jsCallback, cancelCallback); + return []() {}; + } + } + ); + + WaitForCompletion(); + } + } + + void AsyncBaton::WaitForCompletion() { + std::unique_lock lock(*completedMutex); + while (!hasCompleted) completedCondition.wait(lock); + } +} diff --git a/generate/templates/manual/src/async_worker.cc b/generate/templates/manual/src/async_worker.cc new file mode 100644 index 0000000000..709e8a1e83 --- /dev/null +++ b/generate/templates/manual/src/async_worker.cc @@ -0,0 +1,43 @@ +#include "../include/async_worker.h" + +namespace nodegit { + AsyncWorker::AsyncWorker(Nan::Callback *callback, const char *resourceName, std::map> &_cleanupHandles) + : Nan::AsyncWorker(callback, resourceName), cleanupHandles(_cleanupHandles) + {} + + AsyncWorker::AsyncWorker(Nan::Callback *callback, const char *resourceName) + : Nan::AsyncWorker(callback, resourceName) + {} + + void AsyncWorker::Cancel() { + isCancelled = true; + + // We use Nan::AsyncWorker's ErrorMessage flow + // to trigger `HandleErrorCallback` for cancellation + // of AsyncWork + SetErrorMessage("SHUTTING DOWN"); + } + + Nan::AsyncResource *AsyncWorker::GetAsyncResource() { + return async_resource; + } + + Nan::Global *AsyncWorker::GetCallbackErrorHandle() { + return &callbackErrorHandle; + } + + bool AsyncWorker::GetIsCancelled() const { + return isCancelled; + } + + void AsyncWorker::Destroy() { + std::for_each(cleanupCalls.begin(), cleanupCalls.end(), [](std::function cleanupCall) { + cleanupCall(); + }); + Nan::AsyncWorker::Destroy(); + } + + void AsyncWorker::RegisterCleanupCall(std::function cleanupCall) { + cleanupCalls.push_back(cleanupCall); + } +} diff --git a/generate/templates/manual/src/cleanup_handle.cc b/generate/templates/manual/src/cleanup_handle.cc new file mode 100644 index 0000000000..b243d4f0e0 --- /dev/null +++ b/generate/templates/manual/src/cleanup_handle.cc @@ -0,0 +1,6 @@ +#include "../include/cleanup_handle.h" + +namespace nodegit { + CleanupHandle::CleanupHandle() {} + CleanupHandle::~CleanupHandle() {} +} diff --git a/generate/templates/manual/src/context.cc b/generate/templates/manual/src/context.cc new file mode 100644 index 0000000000..a4c9483dc7 --- /dev/null +++ b/generate/templates/manual/src/context.cc @@ -0,0 +1,84 @@ +#include "../include/context.h" + +namespace nodegit { + std::map Context::contexts; + + AsyncContextCleanupHandle::AsyncContextCleanupHandle(v8::Isolate *isolate, Context *context) + : context(context), + handle(node::AddEnvironmentCleanupHook(isolate, AsyncCleanupContext, this)) + {} + + AsyncContextCleanupHandle::~AsyncContextCleanupHandle() { + delete context; + doneCallback(doneData); + } + + void AsyncContextCleanupHandle::AsyncCleanupContext(void *data, void(*uvCallback)(void*), void *uvCallbackData) { + std::unique_ptr cleanupHandle(static_cast(data)); + cleanupHandle->doneCallback = uvCallback; + cleanupHandle->doneData = uvCallbackData; + // the ordering of std::move and the call to Context::ShutdownThreadPool prohibits + // us from referring to context on cleanupHandle if we're also intending to move + // the unique_ptr into the method. + Context *context = cleanupHandle->context; + context->ShutdownThreadPool(std::move(cleanupHandle)); + } + + Context::Context(v8::Isolate *isolate) + : isolate(isolate) + , threadPool(10, node::GetCurrentEventLoop(isolate), this) + { + Nan::HandleScope scopoe; + v8::Local storage = Nan::New(); + persistentStorage.Reset(storage); + contexts[isolate] = this; + new AsyncContextCleanupHandle(isolate, this); + } + + Context::~Context() { + nodegit::TrackerWrap::DeleteFromList(&trackerList); + contexts.erase(isolate); + } + + std::shared_ptr Context::GetCleanupHandle(std::string key) { + return cleanupHandles[key]; + } + + Context *Context::GetCurrentContext() { + Nan::HandleScope scope; + v8::Local context = Nan::GetCurrentContext(); + v8::Isolate *isolate = context->GetIsolate(); + return contexts[isolate]; + } + + v8::Local Context::GetFromPersistent(std::string key) { + Nan::EscapableHandleScope scope; + v8::Local storage = Nan::New(persistentStorage); + Nan::MaybeLocal value = Nan::Get(storage, Nan::New(key).ToLocalChecked()); + return scope.Escape(value.ToLocalChecked()); + } + + void Context::QueueWorker(nodegit::AsyncWorker *worker) { + threadPool.QueueWorker(worker); + } + + std::shared_ptr Context::RemoveCleanupHandle(std::string key) { + std::shared_ptr cleanupItem = cleanupHandles[key]; + cleanupHandles.erase(key); + return cleanupItem; + } + + void Context::SaveToPersistent(std::string key, const v8::Local &value) { + Nan::HandleScope scope; + v8::Local storage = Nan::New(persistentStorage); + Nan::Set(storage, Nan::New(key).ToLocalChecked(), value); + } + + void Context::SaveCleanupHandle(std::string key, std::shared_ptr cleanupItem) { + cleanupHandles[key] = cleanupItem; + } + + void Context::ShutdownThreadPool(std::unique_ptr cleanupHandle) { + threadPool.Shutdown(std::move(cleanupHandle)); + } +} diff --git a/generate/templates/manual/src/convenient_hunk.cc b/generate/templates/manual/src/convenient_hunk.cc new file mode 100644 index 0000000000..2d33e50b66 --- /dev/null +++ b/generate/templates/manual/src/convenient_hunk.cc @@ -0,0 +1,211 @@ +#include +#include + +extern "C" { + #include +} + +#include "../include/context.h" +#include "../include/functions/copy.h" +#include "../include/convenient_hunk.h" +#include "../include/diff_line.h" + +using namespace std; +using namespace v8; +using namespace node; + +void HunkDataFree(HunkData *hunk) { + while (!hunk->lines->empty()) { + git_diff_line *line = hunk->lines->back(); + hunk->lines->pop_back(); + free((void *)line->content); + free((void *)line); + } + delete hunk->lines; + delete hunk; +} + +ConvenientHunk::ConvenientHunk(HunkData *raw) { + this->hunk = raw; +} + +ConvenientHunk::~ConvenientHunk() { + HunkDataFree(this->hunk); +} + +void ConvenientHunk::InitializeComponent(Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); + + tpl->InstanceTemplate()->SetInternalFieldCount(2); + tpl->SetClassName(Nan::New("ConvenientHunk").ToLocalChecked()); + + Nan::SetPrototypeMethod(tpl, "size", Size, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "lines", Lines, nodegitExternal); + + Nan::SetPrototypeMethod(tpl, "oldStart", OldStart, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "oldLines", OldLines, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "newStart", NewStart, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "newLines", NewLines, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "headerLen", HeaderLen, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "header", Header, nodegitExternal); + + Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("ConvenientHunk::Template", constructor_template); + Nan::Set(target, Nan::New("ConvenientHunk").ToLocalChecked(), constructor_template); +} + +NAN_METHOD(ConvenientHunk::JSNewFunction) { + + if (info.Length() == 0 || !info[0]->IsExternal()) { + return Nan::ThrowError("A new ConvenientHunk cannot be instantiated."); + } + + ConvenientHunk* object = new ConvenientHunk(static_cast(Local::Cast(info[0])->Value())); + object->Wrap(info.This()); + + info.GetReturnValue().Set(info.This()); +} + +Local ConvenientHunk::New(void *raw) { + Nan::EscapableHandleScope scope; + Local argv[1] = { Nan::New((void *)raw) }; + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent("ConvenientHunk::Template").As(); + return scope.Escape(Nan::NewInstance(constructor_template, 1, argv).ToLocalChecked()); +} + +HunkData *ConvenientHunk::GetValue() { + return this->hunk; +} + +size_t ConvenientHunk::GetSize() { + return this->hunk->numLines; +} + +NAN_METHOD(ConvenientHunk::Size) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetSize()); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientHunk::Lines) { + if (info.Length() == 0 || !info[0]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + LinesBaton *baton = new LinesBaton(); + + baton->hunk = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->lines = new std::vector; + baton->lines->reserve(baton->hunk->numLines); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); + LinesWorker *worker = new LinesWorker(baton, callback); + + worker->Reference("hunk", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster ConvenientHunk::LinesWorker::AcquireLocks() { + return nodegit::LockMaster(true); +} + +void ConvenientHunk::LinesWorker::Execute() { + for (unsigned int i = 0; i < baton->hunk->numLines; ++i) { + git_diff_line *storeLine = (git_diff_line *)malloc(sizeof(git_diff_line)); + storeLine->origin = baton->hunk->lines->at(i)->origin; + storeLine->old_lineno = baton->hunk->lines->at(i)->old_lineno; + storeLine->new_lineno = baton->hunk->lines->at(i)->new_lineno; + storeLine->num_lines = baton->hunk->lines->at(i)->num_lines; + storeLine->content_len = baton->hunk->lines->at(i)->content_len; + storeLine->content_offset = baton->hunk->lines->at(i)->content_offset; + storeLine->content = strdup(baton->hunk->lines->at(i)->content); + baton->lines->push_back(storeLine); + } +} + +void ConvenientHunk::LinesWorker::HandleErrorCallback() { + while (!baton->lines->empty()) { + free(baton->lines->back()); + baton->lines->pop_back(); + } + + delete baton->lines; +} + +void ConvenientHunk::LinesWorker::HandleOKCallback() { + unsigned int size = baton->lines->size(); + Local result = Nan::New(size); + + for(unsigned int i = 0; i < size; ++i) { + Nan::Set(result, Nan::New(i), GitDiffLine::New(baton->lines->at(i), true)); + } + + delete baton->lines; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + + delete baton; +} + +NAN_METHOD(ConvenientHunk::OldStart) { + Local to; + int old_start = Nan::ObjectWrap::Unwrap(info.This())->GetValue()->hunk.old_start; + info.GetReturnValue().Set(Nan::New(old_start)); +} + + +NAN_METHOD(ConvenientHunk::OldLines) { + Local to; + int old_lines = Nan::ObjectWrap::Unwrap(info.This())->GetValue()->hunk.old_lines; + info.GetReturnValue().Set(Nan::New(old_lines)); +} + +NAN_METHOD(ConvenientHunk::NewStart) { + Local to; + int new_start = Nan::ObjectWrap::Unwrap(info.This())->GetValue()->hunk.new_start; + info.GetReturnValue().Set(Nan::New(new_start)); +} + +NAN_METHOD(ConvenientHunk::NewLines) { + Local to; + int new_lines = Nan::ObjectWrap::Unwrap(info.This())->GetValue()->hunk.new_lines; + info.GetReturnValue().Set(Nan::New(new_lines)); +} + +NAN_METHOD(ConvenientHunk::HeaderLen) { + Local to; + size_t header_len = Nan::ObjectWrap::Unwrap(info.This())->GetValue()->hunk.header_len; + info.GetReturnValue().Set(Nan::New(header_len)); +} + +NAN_METHOD(ConvenientHunk::Header) { + Local to; + + char *header = Nan::ObjectWrap::Unwrap(info.This())->GetValue()->hunk.header; + if (header) { + to = Nan::New(header).ToLocalChecked(); + } else { + to = Nan::Null(); + } + + info.GetReturnValue().Set(to); +} + +void ConvenientHunk::Reference() { + Ref(); +} + +void ConvenientHunk::Unreference() { + Unref(); +} diff --git a/generate/templates/manual/src/convenient_patch.cc b/generate/templates/manual/src/convenient_patch.cc new file mode 100644 index 0000000000..22e6e6b49b --- /dev/null +++ b/generate/templates/manual/src/convenient_patch.cc @@ -0,0 +1,430 @@ +#include +#include + +extern "C" { + #include +} + +#include "../include/context.h" +#include "../include/convenient_hunk.h" +#include "../include/convenient_patch.h" +#include "../include/functions/copy.h" +#include "../include/diff_file.h" + +using namespace std; +using namespace v8; +using namespace node; + +void PatchDataFree(PatchData *patch) { + free((void *)patch->old_file.path); + free((void *)patch->new_file.path); + while(!patch->hunks->empty()) { + HunkData *hunk = patch->hunks->back(); + patch->hunks->pop_back(); + while (!hunk->lines->empty()) { + git_diff_line *line = hunk->lines->back(); + hunk->lines->pop_back(); + free((void *)line->content); + free((void *)line); + } + delete hunk; + } + delete patch; +} + +PatchData *createFromRaw(git_patch *raw) { + PatchData *patch = new PatchData(); + const git_diff_delta *delta = git_patch_get_delta(raw); + + patch->status = delta->status; + + patch->old_file = delta->old_file; + patch->old_file.path = strdup(delta->old_file.path); + + patch->new_file = delta->new_file; + patch->new_file.path = strdup(delta->new_file.path); + + git_patch_line_stats( + &patch->lineStats.context, + &patch->lineStats.additions, + &patch->lineStats.deletions, + raw + ); + + patch->numHunks = git_patch_num_hunks(raw); + patch->hunks = new std::vector; + patch->hunks->reserve(patch->numHunks); + + for (unsigned int i = 0; i < patch->numHunks; ++i) { + HunkData *hunkData = new HunkData(); + const git_diff_hunk *hunk = NULL; + int result = git_patch_get_hunk(&hunk, &hunkData->numLines, raw, i); + if (result != 0) { + continue; + } + + hunkData->hunk.old_start = hunk->old_start; + hunkData->hunk.old_lines = hunk->old_lines; + hunkData->hunk.new_start = hunk->new_start; + hunkData->hunk.new_lines = hunk->new_lines; + hunkData->hunk.header_len = hunk->header_len; + memcpy(&hunkData->hunk.header, &hunk->header, 128); + + hunkData->lines = new std::vector; + hunkData->lines->reserve(hunkData->numLines); + + static const int noNewlineStringLength = 29; + bool EOFFlag = false; + for (unsigned int j = 0; j < hunkData->numLines; ++j) { + git_diff_line *storeLine = (git_diff_line *)malloc(sizeof(git_diff_line)); + const git_diff_line *line = NULL; + int result = git_patch_get_line_in_hunk(&line, raw, i, j); + if (result != 0) { + continue; + } + + if (j == 0) { + int calculatedContentLength = line->content_len; + if ( + calculatedContentLength > noNewlineStringLength && + !strncmp( + &line->content[calculatedContentLength - noNewlineStringLength], + "\n\\ No newline at end of file\n", (std::min)(calculatedContentLength, noNewlineStringLength) + )) { + EOFFlag = true; + } + } + + storeLine->origin = line->origin; + storeLine->old_lineno = line->old_lineno; + storeLine->new_lineno = line->new_lineno; + storeLine->num_lines = line->num_lines; + storeLine->content_len = line->content_len; + storeLine->content_offset = line->content_offset; + char * transferContent; + if (EOFFlag) { + transferContent = (char *)malloc(storeLine->content_len + noNewlineStringLength + 1); + memcpy(transferContent, line->content, storeLine->content_len); + memcpy(transferContent + storeLine->content_len, "\n\\ No newline at end of file\n", noNewlineStringLength); + transferContent[storeLine->content_len + noNewlineStringLength] = '\0'; + } else { + transferContent = (char *)malloc(storeLine->content_len + 1); + memcpy(transferContent, line->content, storeLine->content_len); + transferContent[storeLine->content_len] = '\0'; + } + storeLine->content = strdup(transferContent); + free((void *)transferContent); + hunkData->lines->push_back(storeLine); + } + patch->hunks->push_back(hunkData); + } + + return patch; +} + +ConvenientPatch::ConvenientPatch(PatchData *raw) { + this->patch = raw; +} + +ConvenientPatch::~ConvenientPatch() { + PatchDataFree(this->patch); +} + +void ConvenientPatch::InitializeComponent(Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); + + tpl->InstanceTemplate()->SetInternalFieldCount(2); + tpl->SetClassName(Nan::New("ConvenientPatch").ToLocalChecked()); + + Nan::SetPrototypeMethod(tpl, "hunks", Hunks, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "lineStats", LineStats, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "size", Size, nodegitExternal); + + Nan::SetPrototypeMethod(tpl, "oldFile", OldFile, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "newFile", NewFile, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "status", Status, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isUnmodified", IsUnmodified, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isAdded", IsAdded, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isDeleted", IsDeleted, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isModified", IsModified, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isRenamed", IsRenamed, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isCopied", IsCopied, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isIgnored", IsIgnored, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isUntracked", IsUntracked, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isTypeChange", IsTypeChange, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isUnreadable", IsUnreadable, nodegitExternal); + Nan::SetPrototypeMethod(tpl, "isConflicted", IsConflicted, nodegitExternal); + + Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("ConvenientPatch::Template", constructor_template); + Nan::Set(target, Nan::New("ConvenientPatch").ToLocalChecked(), constructor_template); +} + +NAN_METHOD(ConvenientPatch::JSNewFunction) { + + if (info.Length() == 0 || !info[0]->IsExternal()) { + return Nan::ThrowError("A new ConvenientPatch cannot be instantiated."); + } + + ConvenientPatch* object = new ConvenientPatch(static_cast(Local::Cast(info[0])->Value())); + object->Wrap(info.This()); + + info.GetReturnValue().Set(info.This()); +} + +Local ConvenientPatch::New(void *raw) { + Nan::EscapableHandleScope scope; + Local argv[1] = { Nan::New((void *)raw) }; + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent("ConvenientPatch::Template").As(); + return scope.Escape(Nan::NewInstance(constructor_template, 1, argv).ToLocalChecked()); +} + +ConvenientLineStats ConvenientPatch::GetLineStats() { + return this->patch->lineStats; +} + +git_delta_t ConvenientPatch::GetStatus() { + return this->patch->status; +} + +git_diff_file ConvenientPatch::GetOldFile() { + return this->patch->old_file; +} + +git_diff_file ConvenientPatch::GetNewFile() { + return this->patch->new_file; +} + +size_t ConvenientPatch::GetNumHunks() { + return this->patch->numHunks; +} + +PatchData *ConvenientPatch::GetValue() { + return this->patch; +} + +NAN_METHOD(ConvenientPatch::Hunks) { + if (info.Length() == 0 || !info[0]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + HunksBaton *baton = new HunksBaton(); + + baton->patch = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->hunks = new std::vector; + baton->hunks->reserve(baton->patch->numHunks); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[0])); + HunksWorker *worker = new HunksWorker(baton, callback); + + worker->Reference("patch", info.This()); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster ConvenientPatch::HunksWorker::AcquireLocks() { + return nodegit::LockMaster(true); +} + +void ConvenientPatch::HunksWorker::Execute() { + // copy hunks + for (unsigned int i = 0; i < baton->patch->numHunks; ++i) { + HunkData *hunkData = new HunkData(); + hunkData->numLines = baton->patch->hunks->at(i)->numLines; + hunkData->hunk.old_start = baton->patch->hunks->at(i)->hunk.old_start; + hunkData->hunk.old_lines = baton->patch->hunks->at(i)->hunk.old_lines; + hunkData->hunk.new_start = baton->patch->hunks->at(i)->hunk.new_start; + hunkData->hunk.new_lines = baton->patch->hunks->at(i)->hunk.new_lines; + hunkData->hunk.header_len = baton->patch->hunks->at(i)->hunk.header_len; + memcpy(&hunkData->hunk.header, &baton->patch->hunks->at(i)->hunk.header, 128); + + hunkData->lines = new std::vector; + hunkData->lines->reserve(hunkData->numLines); + + for (unsigned int j = 0; j < hunkData->numLines; ++j) { + git_diff_line *storeLine = (git_diff_line *)malloc(sizeof(git_diff_line)); + storeLine->origin = baton->patch->hunks->at(i)->lines->at(j)->origin; + storeLine->old_lineno = baton->patch->hunks->at(i)->lines->at(j)->old_lineno; + storeLine->new_lineno = baton->patch->hunks->at(i)->lines->at(j)->new_lineno; + storeLine->num_lines = baton->patch->hunks->at(i)->lines->at(j)->num_lines; + storeLine->content_len = baton->patch->hunks->at(i)->lines->at(j)->content_len; + storeLine->content_offset = baton->patch->hunks->at(i)->lines->at(j)->content_offset; + storeLine->content = strdup(baton->patch->hunks->at(i)->lines->at(j)->content); + hunkData->lines->push_back(storeLine); + } + baton->hunks->push_back(hunkData); + } +} + +void ConvenientPatch::HunksWorker::HandleErrorCallback() { + while (!baton->hunks->empty()) { + HunkData *hunk = baton->hunks->back(); + baton->hunks->pop_back(); + + while (!hunk->lines->empty()) { + free(hunk->lines->back()); + hunk->lines->pop_back(); + } + } + + delete baton->hunks; +} + +void ConvenientPatch::HunksWorker::HandleOKCallback() { + unsigned int size = baton->hunks->size(); + Local result = Nan::New(size); + + for(unsigned int i = 0; i < size; ++i) { + Nan::Set(result, Nan::New(i), ConvenientHunk::New(baton->hunks->at(i))); + } + + delete baton->hunks; + + Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + + delete baton; +} + +NAN_METHOD(ConvenientPatch::LineStats) { + Nan::EscapableHandleScope scope; + + Local to; + Local toReturn = Nan::New(); + ConvenientLineStats stats = Nan::ObjectWrap::Unwrap(info.This())->GetLineStats(); + + to = Nan::New(stats.context); + Nan::Set(toReturn, Nan::New("total_context").ToLocalChecked(), to); + to = Nan::New(stats.additions); + Nan::Set(toReturn, Nan::New("total_additions").ToLocalChecked(), to); + to = Nan::New(stats.deletions); + Nan::Set(toReturn, Nan::New("total_deletions").ToLocalChecked(), to); + + return info.GetReturnValue().Set(scope.Escape(toReturn)); +} + +NAN_METHOD(ConvenientPatch::Size) { + Local to; + + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetNumHunks()); + + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::OldFile) { + Nan::EscapableHandleScope scope; + + Local to; + git_diff_file *old_file = (git_diff_file *)malloc(sizeof(git_diff_file)); + *old_file = Nan::ObjectWrap::Unwrap(info.This())->GetOldFile(); + + to = GitDiffFile::New(old_file, true); + + return info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::NewFile) { + Nan::EscapableHandleScope scope; + + Local to; + git_diff_file *new_file = (git_diff_file *)malloc(sizeof(git_diff_file)); + *new_file = Nan::ObjectWrap::Unwrap(info.This())->GetNewFile(); + if (new_file != NULL) { + to = GitDiffFile::New(new_file, true); + } else { + to = Nan::Null(); + } + + return info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::Status) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus()); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsUnmodified) { + Nan::EscapableHandleScope scope; + + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_UNMODIFIED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsAdded) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_ADDED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsDeleted) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_DELETED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsModified) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_MODIFIED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsRenamed) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_RENAMED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsCopied) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_COPIED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsIgnored) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_IGNORED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsUntracked) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_UNTRACKED); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsTypeChange) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_TYPECHANGE); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsUnreadable) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_UNREADABLE); + info.GetReturnValue().Set(to); +} + +NAN_METHOD(ConvenientPatch::IsConflicted) { + Local to; + to = Nan::New(Nan::ObjectWrap::Unwrap(info.This())->GetStatus() == GIT_DELTA_CONFLICTED); + info.GetReturnValue().Set(to); +} + +void ConvenientPatch::Reference() { + Ref(); +} + +void ConvenientPatch::Unreference() { + Unref(); +} diff --git a/generate/templates/manual/src/filter_registry.cc b/generate/templates/manual/src/filter_registry.cc new file mode 100644 index 0000000000..21a7cfbb86 --- /dev/null +++ b/generate/templates/manual/src/filter_registry.cc @@ -0,0 +1,270 @@ +#include +#include + +extern "C" { + #include +} + +#include "../include/nodegit.h" +#include "../include/cleanup_handle.h" +#include "../include/context.h" +#include "../include/lock_master.h" +#include "../include/functions/copy.h" +#include "../include/filter_registry.h" +#include "nodegit_wrapper.cc" + +#include "../include/filter.h" + +using namespace std; +using namespace v8; +using namespace node; + +void GitFilterRegistry::InitializeComponent(v8::Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + + v8::Local filterRegistry = Nan::New(); + + Local nodegitExternal = Nan::New(nodegitContext); + Nan::SetMethod(filterRegistry, "register", GitFilterRegister, nodegitExternal); + Nan::SetMethod(filterRegistry, "unregister", GitFilterUnregister, nodegitExternal); + + Nan::Set(target, Nan::New("FilterRegistry").ToLocalChecked(), filterRegistry); + nodegitContext->SaveToPersistent("FilterRegistry", filterRegistry); + std::shared_ptr filterRegistryCleanupHandles(new nodegit::FilterRegistryCleanupHandles); + nodegitContext->SaveCleanupHandle("filterRegistry", filterRegistryCleanupHandles); +} + +NAN_METHOD(GitFilterRegistry::GitFilterRegister) { + Nan::EscapableHandleScope scope; + + if (info.Length() == 0 || !info[0]->IsString()) { + return Nan::ThrowError("String name is required."); + } + + if (info.Length() == 1 || !info[1]->IsObject()) { + return Nan::ThrowError("Filter filter is required."); + } + + if (info.Length() == 2 || !info[2]->IsNumber()) { + return Nan::ThrowError("Number priority is required."); + } + + if (info.Length() == 3 || !info[3]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + FilterRegisterBaton *baton = new FilterRegisterBaton(); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + std::map> cleanupHandles; + + { + auto conversionResult = ConfigurableGitFilter::fromJavascript(nodegitContext, info[1]); + if (!conversionResult.result) { + delete baton; + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles["filter"] = convertedObject; + baton->filter = convertedObject->GetValue(); + } + + Nan::Utf8String name(Nan::To(info[0]).ToLocalChecked()); + + baton->filter_name = (char *)malloc(name.length() + 1); + memcpy((void *)baton->filter_name, *name, name.length()); + memset((void *)(((char *)baton->filter_name) + name.length()), 0, 1); + + baton->error_code = GIT_OK; + baton->filter_priority = Nan::To(info[2]).FromJust(); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[3])); + RegisterWorker *worker = new RegisterWorker(baton, callback, cleanupHandles); + + worker->Reference("filter_name", info[0]); + worker->Reference("filter_priority", info[2]); + + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitFilterRegistry::RegisterWorker::AcquireLocks() { + return nodegit::LockMaster(true, baton->filter_name, baton->filter); +} + +void GitFilterRegistry::RegisterWorker::Execute() { + git_error_clear(); + + { + int result = git_filter_register(baton->filter_name, baton->filter, baton->filter_priority); + baton->error_code = result; + + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + } +} + +void GitFilterRegistry::RegisterWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + free(baton->filter_name); + + delete baton; +} + +void GitFilterRegistry::RegisterWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + static_pointer_cast(nodegit::Context::GetCurrentContext()->GetCleanupHandle("filterRegistry"))->registeredFilters[baton->filter_name] = cleanupHandles["filter"]; + v8::Local result = Nan::New(baton->error_code); + v8::Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } + else if (baton->error_code < 0) { + v8::Local err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.register").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else { + callback->Call(0, NULL, async_resource); + } + + free(baton->filter_name); + + delete baton; +} + +NAN_METHOD(GitFilterRegistry::GitFilterUnregister) { + Nan::EscapableHandleScope scope; + + if (info.Length() == 0 || !info[0]->IsString()) { + return Nan::ThrowError("String name is required."); + } + + if (info.Length() == 1 || !info[1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + FilterUnregisterBaton *baton = new FilterUnregisterBaton(); + Nan::Utf8String name(Nan::To(info[0]).ToLocalChecked()); + + baton->filter_name = (char *)malloc(name.length() + 1); + memcpy((void *)baton->filter_name, *name, name.length()); + memset((void *)(((char *)baton->filter_name) + name.length()), 0, 1); + + baton->error_code = GIT_OK; + + /* Setting up Async Worker */ + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[1])); + UnregisterWorker *worker = new UnregisterWorker(baton, callback); + + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster GitFilterRegistry::UnregisterWorker::AcquireLocks() { + return nodegit::LockMaster(true, baton->filter_name); +} + +void GitFilterRegistry::UnregisterWorker::Execute() { + git_error_clear(); + + { + int result = git_filter_unregister(baton->filter_name); + baton->error_code = result; + + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + } +} + +void GitFilterRegistry::UnregisterWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + free(baton->filter_name); + + delete baton; +} + +void GitFilterRegistry::UnregisterWorker::HandleOKCallback() { + if (baton->error_code == GIT_OK) { + static_pointer_cast(nodegit::Context::GetCurrentContext()->GetCleanupHandle("filterRegistry"))->registeredFilters.erase(baton->filter_name); + v8::Local result = Nan::New(baton->error_code); + v8::Local argv[2] = { + Nan::Null(), + result + }; + callback->Call(2, argv, async_resource); + } + else if (baton->error) { + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method register has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + free((void *)baton->error->message); + free((void *)baton->error); + } + else if (baton->error_code < 0) { + v8::Local err = Nan::To(Nan::Error("Method unregister has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("FilterRegistry.unregister").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + else { + callback->Call(0, NULL, async_resource); + } + + free(baton->filter_name); + + delete baton; +} diff --git a/generate/templates/manual/src/functions/copy.cc b/generate/templates/manual/src/functions/copy.cc index a7b59c1990..90327650b0 100644 --- a/generate/templates/manual/src/functions/copy.cc +++ b/generate/templates/manual/src/functions/copy.cc @@ -2,6 +2,7 @@ #include #include "git2.h" +#include "git2/diff.h" const git_error *git_error_dup(const git_error *arg) { git_error *result = (git_error *)malloc(sizeof(git_error)); @@ -9,3 +10,28 @@ const git_error *git_error_dup(const git_error *arg) { result->message = strdup(arg->message); return result; } + +void git_time_dup(git_time **out, const git_time *arg) { + *out = (git_time *)malloc(sizeof(git_time)); + memcpy(*out, arg, sizeof(git_time)); +} + +void git_transfer_progress_dup(git_transfer_progress **out, const git_transfer_progress *arg) { + *out = (git_transfer_progress *)malloc(sizeof(git_transfer_progress)); + memcpy(*out, arg, sizeof(git_transfer_progress)); +} + +git_remote_head *git_remote_head_dup(const git_remote_head *src) { + git_remote_head *dest = (git_remote_head *)malloc(sizeof(git_remote_head)); + dest->local = src->local; + git_oid_cpy(&dest->oid, &src->oid); + git_oid_cpy(&dest->loid, &src->loid); + + dest->name = src->name + ? strdup(src->name) + : NULL; + dest->symref_target = src->symref_target + ? strdup(src->symref_target) + : NULL; + return dest; +} diff --git a/generate/templates/manual/src/functions/free.cc b/generate/templates/manual/src/functions/free.cc new file mode 100644 index 0000000000..a52a7016f7 --- /dev/null +++ b/generate/templates/manual/src/functions/free.cc @@ -0,0 +1,9 @@ +#include + +#include "git2.h" + +void git_remote_head_free(git_remote_head *remote_head) { + free(remote_head->name); + free(remote_head->symref_target); + free(remote_head); +} diff --git a/generate/templates/manual/src/git_buf_converter.cc b/generate/templates/manual/src/git_buf_converter.cc new file mode 100644 index 0000000000..da6f425f89 --- /dev/null +++ b/generate/templates/manual/src/git_buf_converter.cc @@ -0,0 +1,32 @@ +#include +#include +#include + +#include "../include/git_buf_converter.h" +#include "git2/buffer.h" + +using namespace v8; +using namespace node; + +git_buf *GitBufConverter::Convert(Local val) { + if (val->IsString() || val->IsStringObject()) { + Nan::Utf8String param1(Nan::To(val).ToLocalChecked()); + std::string v8String = std::string(*param1); + + const size_t size = sizeof(git_buf); + uint8_t* memory = reinterpret_cast(malloc(size)); + git_buf *result = reinterpret_cast(memory); + size_t stringLength = v8String.length(); + + memory = reinterpret_cast(malloc(stringLength)); + + memcpy(memory, v8String.c_str(), stringLength); + + result->reserved = stringLength; + result->size = stringLength; + result->ptr = reinterpret_cast(memory); + return result; + } else { + return NULL; + } +} diff --git a/generate/templates/manual/src/init_ssh2.cc b/generate/templates/manual/src/init_ssh2.cc new file mode 100644 index 0000000000..a8e2543c27 --- /dev/null +++ b/generate/templates/manual/src/init_ssh2.cc @@ -0,0 +1,12 @@ +// We are initializing libssh2 from a separate .cc file to avoid ssize_t +// redefinition conflicts caused by incliding both node.h and libssh2.h from +// the same file (e.g. nodegit.cc) +// +// The redefinition can also be avoided by #defines but that is risky in case +// the libraries depend on the different definitions. + +#include + +void init_ssh2() { + libssh2_init(0); +} diff --git a/generate/templates/manual/src/lock_master.cc b/generate/templates/manual/src/lock_master.cc new file mode 100644 index 0000000000..8ad33378f9 --- /dev/null +++ b/generate/templates/manual/src/lock_master.cc @@ -0,0 +1,239 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../include/lock_master.h" +namespace nodegit { + // information about a lockable object + // - the mutex used to lock it and the number of outstanding locks + struct ObjectInfo { + std::shared_ptr mutex; + unsigned useCount; + + ObjectInfo(unsigned useCount) + : mutex(new std::mutex), useCount(useCount) + {} + }; + + // LockMaster implementation details + // implemented in a separate class to keep LockMaster opaque + class LockMasterImpl { + // STATIC variables / methods + + // A map from objects that are locked (or were locked), to information on their mutex + static std::map mutexes; + // A mutex used for the mutexes map + static std::mutex mapMutex; + + // A thread local storage slot for the current thread-specific LockMasterImpl instance + thread_local static LockMasterImpl* currentLockMaster; + + // Cleans up any mutexes that are not currently used + static NAN_GC_CALLBACK(CleanupMutexes); + + public: + static void InitializeContext(); + + // INSTANCE variables / methods + + private: + // The set of objects this LockMaster is responsible for locking + std::set objectsToLock; + + // Mutexes locked by this LockMaster on construction and unlocked on destruction + std::vector> GetMutexes(int useCountDelta); + void Register(); + void Unregister(); + + public: + static LockMasterImpl *CurrentLockMasterImpl() { + return (LockMasterImpl *)currentLockMaster; + } + + LockMasterImpl() { + Register(); + } + + ~LockMasterImpl() { + Unregister(); + Unlock(true); + } + + void ObjectToLock(const void *objectToLock) { + objectsToLock.insert(objectToLock); + } + + void Lock(bool acquireMutexes); + void Unlock(bool releaseMutexes); + }; + + std::map LockMasterImpl::mutexes; + std::mutex LockMasterImpl::mapMutex; + thread_local LockMasterImpl* LockMasterImpl::currentLockMaster = nullptr; + + LockMaster::LockMaster(LockMaster &&other) { + impl = other.impl; + other.impl = nullptr; + } + + LockMaster &LockMaster::operator=(LockMaster &&other) { + if (&other == this) { + return *this; + } + + impl = other.impl; + other.impl = nullptr; + + return *this; + } + + void LockMasterImpl::InitializeContext() { + Nan::AddGCEpilogueCallback(CleanupMutexes); + } + + NAN_GC_CALLBACK(LockMasterImpl::CleanupMutexes) { + std::lock_guard lock(mapMutex); + + for (auto it = mutexes.begin(); it != mutexes.end(); ) + { + // if the mutex is not used by any LockMasters, + // we can destroy it + unsigned useCount = it->second.useCount; + if (!useCount) { + auto to_erase = it; + it++; + mutexes.erase(to_erase); + } else { + it++; + } + } + } + + void LockMaster::InitializeContext() { + LockMasterImpl::InitializeContext(); + } + + std::vector> LockMasterImpl::GetMutexes(int useCountDelta) { + std::vector> objectMutexes; + std::lock_guard lock(mapMutex); + + for (auto object : objectsToLock) { + if (object) { + // ensure we have an initialized mutex for each object + auto mutexIt = mutexes.find(object); + if (mutexIt == mutexes.end()) { + mutexIt = mutexes.insert( + std::make_pair( + object, + ObjectInfo(0U) + ) + ).first; + } + + objectMutexes.push_back(mutexIt->second.mutex); + mutexIt->second.useCount += useCountDelta; + } + } + + return objectMutexes; + } + + void LockMasterImpl::Register() { + currentLockMaster = this; + } + + void LockMasterImpl::Unregister() { + currentLockMaster = nullptr; + } + + void LockMasterImpl::Lock(bool acquireMutexes) { + std::vector> objectMutexes = GetMutexes(acquireMutexes * 1); + + auto alreadyLocked = objectMutexes.end(); + std::vector>::iterator it; + + // we will attempt to lock all the mutexes at the same time to avoid deadlocks + // note in most cases we are locking 0 or 1 mutexes. more than 1 implies + // passing objects with different repos/owners in the same call. + do { + // go through all the mutexes and try to lock them + for (it = objectMutexes.begin(); it != objectMutexes.end(); it++) { + // if we already locked this mutex in a previous pass via std::mutex::lock, + // we don't need to lock it again + if (it == alreadyLocked) { + continue; + } + + // first, try to lock (non-blocking) + bool success = (*it)->try_lock(); + if (!success) { + // we have failed to lock a mutex... unlock everything we have locked + std::for_each(objectMutexes.begin(), it, [](std::shared_ptr mutex) { + mutex->unlock(); + }); + + if (alreadyLocked > it && alreadyLocked != objectMutexes.end()) { + (*alreadyLocked)->unlock(); + } + + // now do a blocking lock on what we couldn't lock + (*it)->lock(); + // mark that we have already locked this one + // if there are more mutexes than this one, we will go back to locking everything + alreadyLocked = it; + break; + } + } + } while (it != objectMutexes.end()); + } + + void LockMasterImpl::Unlock(bool releaseMutexes) { + // Get the mutexes but don't decrement their use count until after we've + // unlocked them all. + std::vector> objectMutexes = GetMutexes(0); + + std::for_each(objectMutexes.begin(), objectMutexes.end(), [](std::shared_ptr mutex) { + mutex->unlock(); + }); + + GetMutexes(releaseMutexes * -1); + } + + // LockMaster + + void LockMaster::ConstructorImpl() { + impl = new LockMasterImpl(); + } + + void LockMaster::DestructorImpl() { + delete impl; + } + + void LockMaster::ObjectToLock(const void *objectToLock) { + impl->ObjectToLock(objectToLock); + } + + void LockMaster::ObjectsToLockAdded() { + impl->Lock(true); + } + + // LockMaster::TemporaryUnlock + + void LockMaster::TemporaryUnlock::ConstructorImpl() { + impl = LockMasterImpl::CurrentLockMasterImpl(); + if (impl) { + impl->Unlock(false); + } + } + + void LockMaster::TemporaryUnlock::DestructorImpl() { + impl->Lock(false); + } + +} diff --git a/generate/templates/manual/src/nodegit_wrapper.cc b/generate/templates/manual/src/nodegit_wrapper.cc new file mode 100644 index 0000000000..a790d7bc3c --- /dev/null +++ b/generate/templates/manual/src/nodegit_wrapper.cc @@ -0,0 +1,186 @@ +template +NodeGitWrapper::NodeGitWrapper(typename Traits::cType *raw, bool selfFreeing, v8::Local owner) + : nodegitContext(nodegit::Context::GetCurrentContext()) { + nodegitContext->LinkTrackerList(this); + if (Traits::isSingleton) { + ReferenceCounter::incrementCountForPointer((void *)raw); + this->raw = raw; + } else if (!owner.IsEmpty()) { + // if we have an owner, it could mean 2 things: + // 1. We are borrowed memory from another struct and should not be freed. We will keep a handle to the owner + // so that the owner isn't gc'd while we are using its memory. + // 2. We are borrowed memory from another struct and can be duplicated, so we should duplicate + // and become selfFreeing. + // 3. We are cached memory, potentially on the repo or config. + // Even though we have a handle in another objects cache, we are expected to call free, + // otherwise we are leaking memory. Cached objects are reference counted in libgit2, but will be leaked + // even if the cache is cleared if we haven't freed them. We will keep a handle on the owner, even though it + // is probably safe as we're reference counted. This should at worst just ensure that the cache owner is the + // last thing to be freed, and that is more safety than anything else. + if (Traits::isDuplicable) { + Traits::duplicate(&this->raw, raw); + selfFreeing = true; + } else { + SetNativeOwners(owner); + this->owner.Reset(owner); + this->raw = raw; + } + } else { + this->raw = raw; + } + this->selfFreeing = selfFreeing; + + if (selfFreeing) { + SelfFreeingInstanceCount++; + } else { + NonSelfFreeingConstructedCount++; + } +} + +template +NodeGitWrapper::NodeGitWrapper(const char *error) + : nodegitContext(nodegit::Context::GetCurrentContext()) { + selfFreeing = false; + raw = NULL; + Nan::ThrowError(error); +} + +template +NodeGitWrapper::~NodeGitWrapper() { + Unlink(); + if (Traits::isFreeable && selfFreeing) { + Traits::free(raw); + SelfFreeingInstanceCount--; + raw = NULL; + } + else if (!selfFreeing) { + --NonSelfFreeingConstructedCount; + } +} + +template +NAN_METHOD(NodeGitWrapper::JSNewFunction) { + cppClass * instance; + + if (info.Length() == 0 || !info[0]->IsExternal()) { + Nan::TryCatch tryCatch; + instance = new cppClass(); + // handle the case where the default constructor is not supported + if(tryCatch.HasCaught()) { + delete instance; + tryCatch.ReThrow(); + return; + } + } else { + instance = new cppClass(static_cast( + Local::Cast(info[0])->Value()), + Nan::To(info[1]).FromJust(), + info.Length() >= 3 && !info[2].IsEmpty() && info[2]->IsObject() ? Nan::To(info[2]).ToLocalChecked() : Local() + ); + } + + instance->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); +} + +template +void NodeGitWrapper::SetNativeOwners(v8::Local owners) { + assert(owners->IsArray() || owners->IsObject()); + Nan::HandleScope scope; + std::unique_ptr< std::vector > trackerOwners = + std::make_unique< std::vector >(); + + if (owners->IsArray()) { + v8::Local context = Nan::GetCurrentContext(); + const v8::Local ownersArray = owners.As(); + const uint32_t numOwners = ownersArray->Length(); + + for (uint32_t i = 0; i < numOwners; ++i) { + v8::Local value = ownersArray->Get(context, i).ToLocalChecked(); + const v8::Local object = value.As(); + Nan::ObjectWrap *objectWrap = Nan::ObjectWrap::Unwrap(object); + trackerOwners->push_back(static_cast(objectWrap)); + } + } + else if (owners->IsObject()) { + Nan::ObjectWrap *objectWrap = Nan::ObjectWrap::Unwrap(owners); + trackerOwners->push_back(static_cast(objectWrap)); + } + + SetTrackerWrapOwners(std::move(trackerOwners)); +} + +template +v8::Local NodeGitWrapper::New(const typename Traits::cType *raw, bool selfFreeing, v8::Local owner) { + Nan::EscapableHandleScope scope; + Local argv[3] = { Nan::New((void *)raw), Nan::New(selfFreeing), owner }; + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent( + std::string(Traits::className()) + "::Template" + ).As(); + return scope.Escape( + Nan::NewInstance( + constructor_template, + owner.IsEmpty() ? 2 : 3, // passing an empty handle as part of the arguments causes a crash + argv + ).ToLocalChecked()); +} + +template +typename Traits::cType *NodeGitWrapper::GetValue() { + return raw; +} + +template +void NodeGitWrapper::ClearValue() { + raw = NULL; +} + +template +thread_local int NodeGitWrapper::SelfFreeingInstanceCount; + +template +thread_local int NodeGitWrapper::NonSelfFreeingConstructedCount; + +template +NAN_METHOD(NodeGitWrapper::GetSelfFreeingInstanceCount) { + info.GetReturnValue().Set(SelfFreeingInstanceCount); +} + +template +NAN_METHOD(NodeGitWrapper::GetNonSelfFreeingConstructedCount) { + info.GetReturnValue().Set(NonSelfFreeingConstructedCount); +} + +template +void NodeGitWrapper::InitializeTemplate(v8::Local &tpl) { + Nan::SetMethod(tpl, "getSelfFreeingInstanceCount", GetSelfFreeingInstanceCount); + Nan::SetMethod(tpl, "getNonSelfFreeingConstructedCount", GetNonSelfFreeingConstructedCount); +} + +template +void NodeGitWrapper::Reference() { + Ref(); + for (auto &i : referenceCallbacks) { + i.second(); + } +} + +template +void NodeGitWrapper::Unreference() { + Unref(); + for (auto &i : unreferenceCallbacks) { + i.second(); + } +} + +template +void NodeGitWrapper::AddReferenceCallbacks(size_t fieldIndex, std::function refCb, std::function unrefCb) { + referenceCallbacks[fieldIndex] = refCb; + unreferenceCallbacks[fieldIndex] = unrefCb; +} + +template +void NodeGitWrapper::SaveCleanupHandle(std::shared_ptr cleanupHandle) { + childCleanupVector.push_back(cleanupHandle); +} diff --git a/generate/templates/manual/src/promise_completion.cc b/generate/templates/manual/src/promise_completion.cc new file mode 100644 index 0000000000..d3e4f4426e --- /dev/null +++ b/generate/templates/manual/src/promise_completion.cc @@ -0,0 +1,121 @@ +#include +#include "../include/promise_completion.h" + +// initializes the persistent handles for NAN_METHODs +void PromiseCompletion::InitializeComponent(nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + v8::Local nodegitExternal = Nan::New(nodegitContext); + v8::Local newTemplate = Nan::New(New, nodegitExternal); + newTemplate->InstanceTemplate()->SetInternalFieldCount(2); + + nodegitContext->SaveToPersistent( + "PromiseCompletion::Template", + Nan::GetFunction(newTemplate).ToLocalChecked() + ); + + v8::Local promiseFulfilled = Nan::GetFunction( + Nan::New(PromiseFulfilled, nodegitExternal) + ).ToLocalChecked(); + nodegitContext->SaveToPersistent("PromiseCompletion::PromiseFulfilled", promiseFulfilled); + + v8::Local promiseRejected = Nan::GetFunction( + Nan::New(PromiseRejected, nodegitExternal) + ).ToLocalChecked(); + nodegitContext->SaveToPersistent("PromiseCompletion::PromiseRejected", promiseRejected); +} + +bool PromiseCompletion::ForwardIfPromise(v8::Local result, nodegit::AsyncBaton *baton, Callback callback) +{ + Nan::HandleScope scope; + + // check if the result is a promise + if (!result.IsEmpty() && result->IsObject()) { + Nan::MaybeLocal maybeThenProp = Nan::Get(Nan::To(result).ToLocalChecked(), Nan::New("then").ToLocalChecked()); + if (!maybeThenProp.IsEmpty()) { + v8::Local thenProp = maybeThenProp.ToLocalChecked(); + if(thenProp->IsFunction()) { + // we can be reasonably certain that the result is a promise + + // create a new v8 instance of PromiseCompletion + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + v8::Local constructor_template = nodegitContext->GetFromPersistent("PromiseCompletion::Template") + .As(); + v8::Local object = Nan::NewInstance(constructor_template).ToLocalChecked(); + + // set up the native PromiseCompletion object + PromiseCompletion *promiseCompletion = ObjectWrap::Unwrap(object); + promiseCompletion->Setup(thenProp.As(), result, baton, callback); + + return true; + } + } + } + + return false; +} + +// creates a new instance of PromiseCompletion, wrapped in a v8 object +NAN_METHOD(PromiseCompletion::New) { + PromiseCompletion *promiseCompletion = new PromiseCompletion(); + promiseCompletion->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); +} + +// sets up a Promise to forward the promise result via the baton and callback +void PromiseCompletion::Setup(v8::Local thenFn, v8::Local result, nodegit::AsyncBaton *baton, Callback callback) { + this->callback = callback; + this->baton = baton; + + v8::Local promise = Nan::To(result).ToLocalChecked(); + + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + v8::Local thisHandle = handle(); + v8::Local promiseFulfilled = nodegitContext->GetFromPersistent("PromiseCompletion::PromiseFulfilled") + .As(); + v8::Local promiseRejected = nodegitContext->GetFromPersistent("PromiseCompletion::PromiseRejected") + .As(); + + v8::Local argv[2] = { + Bind(promiseFulfilled, thisHandle), + Bind(promiseRejected, thisHandle) + }; + + // call the promise's .then method with resolve and reject callbacks + Nan::Call(Nan::Callback(thenFn), promise, 2, argv); +} + +// binds an object to be the context of the function. +// there might be a better way to do this than calling Function.bind... +v8::Local PromiseCompletion::Bind(v8::Local function, v8::Local object) { + Nan::EscapableHandleScope scope; + + v8::Local bind = + Nan::Get(function, Nan::New("bind").ToLocalChecked()) + .ToLocalChecked().As(); + + v8::Local argv[1] = { object }; + + return scope.Escape(Nan::Call(bind, Nan::To(function).ToLocalChecked(), 1, argv).ToLocalChecked()); +} + +// calls the callback stored in the PromiseCompletion, passing the baton that +// was provided in construction +void PromiseCompletion::CallCallback(bool isFulfilled, const Nan::FunctionCallbackInfo &info) { + v8::Local resultOfPromise; + + if (info.Length() > 0) { + resultOfPromise = info[0]; + } + + PromiseCompletion *promiseCompletion = ObjectWrap::Unwrap(Nan::To(info.This()).ToLocalChecked()); + + (*promiseCompletion->callback)(isFulfilled, promiseCompletion->baton, resultOfPromise); +} + +NAN_METHOD(PromiseCompletion::PromiseFulfilled) { + CallCallback(true, info); +} + +NAN_METHOD(PromiseCompletion::PromiseRejected) { + CallCallback(false, info); +} diff --git a/generate/templates/manual/src/reference_counter.cc b/generate/templates/manual/src/reference_counter.cc new file mode 100644 index 0000000000..e3bc483a7a --- /dev/null +++ b/generate/templates/manual/src/reference_counter.cc @@ -0,0 +1,24 @@ +#include "../include/reference_counter.h" + +void ReferenceCounter::incrementCountForPointer(void *ptr) { + nodegit::LockMaster lm(true, &referenceCountByPointer); + if (referenceCountByPointer.find(ptr) == referenceCountByPointer.end()) { + referenceCountByPointer[ptr] = 1; + } else { + referenceCountByPointer[ptr] = referenceCountByPointer[ptr] + 1; + } +} + +unsigned long ReferenceCounter::decrementCountForPointer(void *ptr) { + nodegit::LockMaster lm(true, &referenceCountByPointer); + unsigned long referenceCount = referenceCountByPointer[ptr]; + if (referenceCount == 1) { + referenceCountByPointer.erase(ptr); + return 0; + } else { + referenceCountByPointer[ptr] = referenceCount - 1; + return referenceCountByPointer[ptr]; + } +} + +std::unordered_map ReferenceCounter::referenceCountByPointer; diff --git a/generate/templates/manual/src/str_array_converter.cc b/generate/templates/manual/src/str_array_converter.cc index bea3a2e31b..5d04c65622 100644 --- a/generate/templates/manual/src/str_array_converter.cc +++ b/generate/templates/manual/src/str_array_converter.cc @@ -9,15 +9,15 @@ using namespace v8; using namespace node; -git_strarray *StrArrayConverter::Convert(Handle val) { - if (!val->BooleanValue()) { +git_strarray *StrArrayConverter::Convert(v8::Local val) { + if (!Nan::To(val).FromJust()) { return NULL; } else if (val->IsArray()) { - return ConvertArray(Array::Cast(*val)); + return ConvertArray(v8::Local::Cast(val)); } else if (val->IsString() || val->IsStringObject()) { - return ConvertString(val->ToString()); + return ConvertString(Nan::To(val).ToLocalChecked()); } else { return NULL; @@ -33,20 +33,20 @@ git_strarray * StrArrayConverter::AllocStrArray(const size_t count) { return result; } -git_strarray *StrArrayConverter::ConvertArray(Array *val) { +git_strarray *StrArrayConverter::ConvertArray(v8::Local val) { git_strarray *result = AllocStrArray(val->Length()); for(size_t i = 0; i < result->count; i++) { - NanUtf8String entry(val->Get(i)); + Nan::Utf8String entry(Nan::Get(val, i).ToLocalChecked()); result->strings[i] = strdup(*entry); } return result; } -git_strarray* StrArrayConverter::ConvertString(Handle val) { +git_strarray* StrArrayConverter::ConvertString(v8::Local val) { char *strings[1]; - NanUtf8String utf8String(val); + Nan::Utf8String utf8String(val); strings[0] = *utf8String; @@ -62,3 +62,19 @@ git_strarray *StrArrayConverter::ConstructStrArray(int argc, char** argv) { return result; } + +void StrArrayConverter::ConvertInto(git_strarray *out, v8::Local val) { + out->count = val->Length(); + out->strings = (char**) malloc(out->count * sizeof(char*)); + for (uint32_t i = 0; i < out->count; ++i) { + Nan::Utf8String utf8String(Nan::Get(val, i).ToLocalChecked().As()); + out->strings[i] = strdup(*utf8String); + } +} + +void StrArrayConverter::ConvertInto(git_strarray *out, v8::Local val) { + Nan::Utf8String utf8String(val); + out->count = 1; + out->strings = (char**) malloc(out->count * sizeof(char*)); + out->strings[0] = strdup(*utf8String); +} diff --git a/generate/templates/manual/src/thread_pool.cc b/generate/templates/manual/src/thread_pool.cc new file mode 100644 index 0000000000..4cd5c095a3 --- /dev/null +++ b/generate/templates/manual/src/thread_pool.cc @@ -0,0 +1,808 @@ +#include +#include "../include/context.h" +#include "../include/thread_pool.h" + +#include +#include +#include +#include +#include +#include // Temporary workaround for LFS checkout. Code added to be reverted. + +extern "C" { + #include +} + +using namespace std::placeholders; + +namespace nodegit { + class Executor { + public: + struct Task { + enum Type { SHUTDOWN, WORK }; + + Task(Type initType) + : type(initType) + {} + Task(const Task &) = delete; + Task(Task &&) = delete; + Task &operator=(const Task &) = delete; + Task &operator=(Task &&) = delete; + + // We must define a virtual destructor so that derived classes are castable + virtual ~Task() {} + + Type type; + }; + + struct ShutdownTask : Task { + ShutdownTask() + : Task(SHUTDOWN) + {} + }; + + struct WorkTask : Task { + WorkTask(ThreadPool::Callback initCallback, Nan::AsyncResource *asyncResource, Nan::Global *callbackErrorHandle) + : Task(WORK), asyncResource(asyncResource), callbackErrorHandle(callbackErrorHandle), callback(initCallback) + {} + + Nan::AsyncResource *asyncResource; + Nan::Global *callbackErrorHandle; + ThreadPool::Callback callback; + }; + + typedef std::function PostCallbackEventToOrchestratorFn; + typedef std::function PostCompletedEventToOrchestratorFn; + typedef std::function()> TakeNextTaskFn; + + struct Event { + enum Type { COMPLETED, CALLBACK_TYPE }; + Event(Type initType) + : type(initType) + {} + Event(const Event &) = delete; + Event(Event &&) = delete; + Event &operator=(const Event &) = delete; + Event &operator=(Event &&) = delete; + + Type type; + + // We must define a virtual destructor so that derived classes are castable + virtual ~Event() {} + }; + + struct CompletedEvent : Event { + CompletedEvent() + : Event(COMPLETED) + {} + }; + + struct CallbackEvent : Event { + CallbackEvent(ThreadPool::OnPostCallbackFn initCallback) + : Event(CALLBACK_TYPE), callback(initCallback) + {} + + // Temporary workaround for LFS checkout. Code modified to be reverted. + // ThreadPool::Callback operator()(ThreadPool::QueueCallbackFn queueCb, ThreadPool::Callback completedCb) { + // return callback(queueCb, completedCb); + ThreadPool::Callback operator()(ThreadPool::QueueCallbackFn queueCb, ThreadPool::Callback completedCb, bool isThreaded) { + return callback(queueCb, completedCb, isThreaded); + } + + private: + ThreadPool::OnPostCallbackFn callback; + }; + + Executor( + PostCallbackEventToOrchestratorFn postCallbackEventToOrchestrator, + PostCompletedEventToOrchestratorFn postCompletedEventToOrchestrator, + TakeNextTaskFn takeNextTask, + nodegit::Context *context + ); + + void RunTaskLoop(); + + // Orchestrator needs to call this to ensure that the executor is done reading from + // the Orchestrator's memory + void WaitForThreadClose(); + + // Temporary workaround for LFS checkout. Code added to be reverted. + // Returns true if the task running spawned threads within libgit2 + bool IsGitThreaded() { return currentGitThreads > kInitialGitThreads; } + + static Nan::AsyncResource *GetCurrentAsyncResource(); + + static const nodegit::Context *GetCurrentContext(); + + static Nan::Global *GetCurrentCallbackErrorHandle(); + + static void PostCallbackEvent(ThreadPool::OnPostCallbackFn onPostCallback); + + // Libgit2 will call this before it spawns a child thread. + // That way we can decide what the TLS for that thread should be + // We will make sure that the context for the current async work + // is preserved on the child thread through this method + static void *RetrieveTLSForLibgit2ChildThread(); + + // Libgit2 will call this on a child thread with the pointer that was + // retrieved from RetrieveTLSForLibgit2ChildThread. That allows us + // to store the necessary thread local storage for the child thread + static void SetTLSForLibgit2ChildThread(void *vexecutor); + + // Called when a libgit2 child thread exits. This gives us the ability + // to teardown any TLS we set up for the child thread if we need to + static void TeardownTLSOnLibgit2ChildThread(); + + private: + Nan::AsyncResource *currentAsyncResource; + Nan::Global *currentCallbackErrorHandle; + nodegit::Context *currentContext; + + // We need to populate the executor on every thread that libgit2 + // could make a callback on so that it can correctly queue callbacks + // in the correct javascript context + thread_local static Executor *executor; + thread_local static bool isExecutorThread; + PostCallbackEventToOrchestratorFn postCallbackEventToOrchestrator; + PostCompletedEventToOrchestratorFn postCompletedEventToOrchestrator; + TakeNextTaskFn takeNextTask; + std::thread thread; + + // Temporary workaround for LFS checkout. Code added to be reverted. + static constexpr int kInitialGitThreads {0}; + // Number of threads spawned internally by libgit2 to deal with + // the task of this Executor instance. Defaults to kInitialGitThreads. + std::atomic currentGitThreads {kInitialGitThreads}; + }; + + Executor::Executor( + PostCallbackEventToOrchestratorFn postCallbackEventToOrchestrator, + PostCompletedEventToOrchestratorFn postCompletedEventToOrchestrator, + TakeNextTaskFn takeNextTask, + nodegit::Context *context + ) + : currentAsyncResource(nullptr), + currentCallbackErrorHandle(nullptr), + currentContext(context), + postCallbackEventToOrchestrator(postCallbackEventToOrchestrator), + postCompletedEventToOrchestrator(postCompletedEventToOrchestrator), + takeNextTask(takeNextTask), + thread(&Executor::RunTaskLoop, this) + {} + + void Executor::RunTaskLoop() { + // Set the thread local storage so that libgit2 can pick up the current executor + // for the thread. + isExecutorThread = true; + executor = this; + + for ( ; ; ) { + std::unique_ptr task = takeNextTask(); + if (task->type == Task::Type::SHUTDOWN) { + return; + } + + WorkTask *workTask = static_cast(task.get()); + + // Temporary workaround for LFS checkout. Code added to be reverted. + currentGitThreads = kInitialGitThreads; + + currentAsyncResource = workTask->asyncResource; + currentCallbackErrorHandle = workTask->callbackErrorHandle; + workTask->callback(); + currentCallbackErrorHandle = nullptr; + currentAsyncResource = nullptr; + + postCompletedEventToOrchestrator(); + } + } + + void Executor::WaitForThreadClose() { + thread.join(); + } + + Nan::AsyncResource *Executor::GetCurrentAsyncResource() { + if (executor) { + return executor->currentAsyncResource; + } + + // NOTE this should always be set when a libgit2 callback is running, + // so this case should not happen. + return nullptr; + } + + const nodegit::Context *Executor::GetCurrentContext() { + if (executor) { + return executor->currentContext; + } + + // NOTE this should always be set when a libgit2 callback is running, + // so this case should not happen. + return nullptr; + } + + Nan::Global *Executor::GetCurrentCallbackErrorHandle() { + if (executor) { + return executor->currentCallbackErrorHandle; + } + + // NOTE this should always be set when a libgit2 callback is running, + // so this case should not happen. + return nullptr; + } + + void Executor::PostCallbackEvent(ThreadPool::OnPostCallbackFn onPostCallback) { + if (executor) { + executor->postCallbackEventToOrchestrator(onPostCallback); + } + } + + void *Executor::RetrieveTLSForLibgit2ChildThread() { + // Temporary workaround for LFS checkout. Code added to be reverted. + ++Executor::executor->currentGitThreads; + return Executor::executor; + } + + void Executor::SetTLSForLibgit2ChildThread(void *vexecutor) { + Executor::executor = static_cast(vexecutor); + } + + void Executor::TeardownTLSOnLibgit2ChildThread() { + if (!isExecutorThread) { + // Temporary workaround for LFS checkout. Code added to be reverted. + --Executor::executor->currentGitThreads; + Executor::executor = nullptr; + } + } + + thread_local Executor *Executor::executor = nullptr; + thread_local bool Executor::isExecutorThread = false; + + class Orchestrator { + public: + struct Job { + enum Type { SHUTDOWN, ASYNC_WORK }; + Job(Type initType) + : type(initType) + {} + Job(const Job &) = delete; + Job(Job &&) = delete; + Job &operator=(const Job &) = delete; + Job &operator=(Job &&) = delete; + + virtual ~Job() {} + + Type type; + }; + + struct ShutdownJob : Job { + ShutdownJob() + : Job(SHUTDOWN) + {} + }; + + struct AsyncWorkJob : Job { + AsyncWorkJob(nodegit::AsyncWorker *initWorker) + : Job(ASYNC_WORK), worker(initWorker) + {} + + nodegit::AsyncWorker *worker; + }; + + typedef std::function QueueCallbackOnJSThreadFn; + typedef std::function()> TakeNextJobFn; + + private: + class OrchestratorImpl { + public: + OrchestratorImpl( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ); + + void RunJobLoop(); + + // The Executor will call this method to queue a CallbackEvent in Orchestrator's event loop + void PostCallbackEvent(ThreadPool::OnPostCallbackFn onPostCallback); + + // The Executor will call this method after completion its work. This should queue + // a CompletedEvent in Thread's event loop + void PostCompletedEvent(); + + // This will be used by Executor to take jobs that the Thread has picked up and run them. + std::unique_ptr TakeNextTask(); + + // This is used to wait for the Orchestrator's thread to shutdown after signaling shutdown + void WaitForThreadClose(); + + private: + // The only thread safe way to pull events from executorEventsQueue + std::shared_ptr TakeEventFromExecutor(); + + void ScheduleWorkTaskOnExecutor(ThreadPool::Callback callback, Nan::AsyncResource *asyncResource, Nan::Global *callbackErrorHandle); + + void ScheduleShutdownTaskOnExecutor(); + + std::condition_variable taskCondition; + std::unique_ptr taskMutex; + + std::queue> executorEventsQueue; + std::unique_ptr executorEventsMutex; + std::condition_variable executorEventsCondition; + + QueueCallbackOnJSThreadFn queueCallbackOnJSThread; + TakeNextJobFn takeNextJob; + std::unique_ptr task; + std::thread thread; + Executor executor; + }; + + std::unique_ptr impl; + + public: + Orchestrator( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ); + + void WaitForThreadClose(); + }; + + Orchestrator::OrchestratorImpl::OrchestratorImpl( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ) + : taskMutex(new std::mutex), + executorEventsMutex(new std::mutex), + queueCallbackOnJSThread(queueCallbackOnJSThread), + takeNextJob(takeNextJob), + task(nullptr), + thread(&Orchestrator::OrchestratorImpl::RunJobLoop, this), + executor( + std::bind(&Orchestrator::OrchestratorImpl::PostCallbackEvent, this, _1), + std::bind(&Orchestrator::OrchestratorImpl::PostCompletedEvent, this), + std::bind(&Orchestrator::OrchestratorImpl::TakeNextTask, this), + context + ) + {} + + void Orchestrator::OrchestratorImpl::RunJobLoop() { + for ( ; ; ) { + auto job = takeNextJob(); + switch (job->type) { + case Job::Type::SHUTDOWN: { + ScheduleShutdownTaskOnExecutor(); + executor.WaitForThreadClose(); + return; + } + + case Job::Type::ASYNC_WORK: { + std::shared_ptr asyncWorkJob = std::static_pointer_cast(job); + nodegit::AsyncWorker *worker = asyncWorkJob->worker; + // We lock at this level, because we temporarily unlock the lock master + // when a callback is fired. We need to be on the same thread to ensure + // the same thread that acquired the locks also releases them + nodegit::LockMaster lock = worker->AcquireLocks(); + ScheduleWorkTaskOnExecutor(std::bind(&nodegit::AsyncWorker::Execute, worker), worker->GetAsyncResource(), worker->GetCallbackErrorHandle()); + for ( ; ; ) { + std::shared_ptr event = TakeEventFromExecutor(); + if (event->type == Executor::Event::Type::COMPLETED) { + break; + } + + // We must have received a callback from libgit2 + auto callbackEvent = std::static_pointer_cast(event); + std::shared_ptr callbackMutex(new std::mutex); + std::shared_ptr callbackCondition(new std::condition_variable); + bool hasCompleted = false; + + // Temporary workaround for LFS checkout. Code removed to be reverted. + //LockMaster::TemporaryUnlock temporaryUnlock; + + // Temporary workaround for LFS checkout. Code added to be reverted. + bool isWorkerThreaded = executor.IsGitThreaded(); + ThreadPool::Callback callbackCompleted = []() {}; + if (!isWorkerThreaded) { + callbackCompleted = [callbackCondition, callbackMutex, &hasCompleted]() { + std::lock_guard lock(*callbackMutex); + hasCompleted = true; + callbackCondition->notify_one(); + }; + } + std::unique_ptr temporaryUnlock {nullptr}; + if (!isWorkerThreaded) { + temporaryUnlock = std::make_unique(); + } + + auto onCompletedCallback = (*callbackEvent)( + [this](ThreadPool::Callback callback, ThreadPool::Callback cancelCallback) { + queueCallbackOnJSThread(callback, cancelCallback, false); + }, + // Temporary workaround for LFS checkout. Code modified to be reverted. + /* + [callbackCondition, callbackMutex, &hasCompleted]() { + std::lock_guard lock(*callbackMutex); + hasCompleted = true; + callbackCondition->notify_one(); + } + */ + callbackCompleted, + isWorkerThreaded + ); + + // Temporary workaround for LFS checkout. Code modified to be reverted. + if (!isWorkerThreaded) { + std::unique_lock lock(*callbackMutex); + while (!hasCompleted) callbackCondition->wait(lock); + onCompletedCallback(); + } + } + + queueCallbackOnJSThread( + [worker]() { + worker->WorkComplete(); + worker->Destroy(); + }, + [worker]() { + worker->Cancel(); + worker->WorkComplete(); + worker->Destroy(); + }, + true + ); + } + } + } + } + + // TODO add a cancel callback to `OnPostCallbackFn` which can be used on nodegit terminate + void Orchestrator::OrchestratorImpl::PostCallbackEvent(ThreadPool::OnPostCallbackFn onPostCallback) { + std::lock_guard lock(*executorEventsMutex); + std::shared_ptr callbackEvent(new Executor::CallbackEvent(onPostCallback)); + executorEventsQueue.push(callbackEvent); + executorEventsCondition.notify_one(); + } + + void Orchestrator::OrchestratorImpl::PostCompletedEvent() { + std::lock_guard lock(*executorEventsMutex); + std::shared_ptr completedEvent(new Executor::CompletedEvent); + executorEventsQueue.push(completedEvent); + executorEventsCondition.notify_one(); + } + + std::shared_ptr Orchestrator::OrchestratorImpl::TakeEventFromExecutor() { + std::unique_lock lock(*executorEventsMutex); + while (executorEventsQueue.empty()) executorEventsCondition.wait(lock); + std::shared_ptr executorEvent = executorEventsQueue.front(); + executorEventsQueue.pop(); + return executorEvent; + } + + void Orchestrator::OrchestratorImpl::ScheduleShutdownTaskOnExecutor() { + std::lock_guard lock(*taskMutex); + task.reset(new Executor::ShutdownTask); + taskCondition.notify_one(); + } + + void Orchestrator::OrchestratorImpl::ScheduleWorkTaskOnExecutor(ThreadPool::Callback callback, Nan::AsyncResource *asyncResource, Nan::Global *callbackErrorHandle) { + std::lock_guard lock(*taskMutex); + task.reset(new Executor::WorkTask(callback, asyncResource, callbackErrorHandle)); + taskCondition.notify_one(); + } + + std::unique_ptr Orchestrator::OrchestratorImpl::TakeNextTask() { + std::unique_lock lock(*taskMutex); + while (!task) taskCondition.wait(lock); + return std::move(task); + } + + void Orchestrator::OrchestratorImpl::WaitForThreadClose() { + thread.join(); + } + + Orchestrator::Orchestrator( + QueueCallbackOnJSThreadFn queueCallbackOnJSThread, + TakeNextJobFn takeNextJob, + nodegit::Context *context + ) + : impl(new OrchestratorImpl(queueCallbackOnJSThread, takeNextJob, context)) + {} + + void Orchestrator::WaitForThreadClose() { + impl->WaitForThreadClose(); + } + + class ThreadPoolImpl { + public: + ThreadPoolImpl(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context); + + void QueueWorker(nodegit::AsyncWorker *worker); + + std::shared_ptr TakeNextJob(); + + void QueueCallbackOnJSThread(ThreadPool::Callback callback, ThreadPool::Callback cancelCallback, bool isWork); + + static void RunLoopCallbacks(uv_async_t *handle); + + void Shutdown(std::unique_ptr cleanupHandle); + + struct AsyncCallbackData { + AsyncCallbackData(ThreadPoolImpl *pool) + : pool(pool) + {} + + std::unique_ptr cleanupHandle; + ThreadPoolImpl *pool; + }; + + private: + bool isMarkedForDeletion; + + struct JSThreadCallback { + JSThreadCallback(ThreadPool::Callback callback, ThreadPool::Callback cancelCallback, bool isWork) + : isWork(isWork), callback(callback), cancelCallback(cancelCallback) + {} + + JSThreadCallback() + : isWork(false), callback(nullptr), cancelCallback(nullptr) + {} + + void performCallback() { + callback(); + } + + void cancel() { + cancelCallback(); + } + + bool isWork; + + private: + ThreadPool::Callback callback; + ThreadPool::Callback cancelCallback; + }; + + void RunLoopCallbacks(); + + std::queue> orchestratorJobQueue; + std::unique_ptr orchestratorJobMutex; + std::condition_variable orchestratorJobCondition; + size_t workInProgressCount; + + // completion and async callbacks to be performed on the loop + std::queue jsThreadCallbackQueue; + std::unique_ptr jsThreadCallbackMutex; + uv_async_t jsThreadCallbackAsync; + + std::vector orchestrators; + }; + + // context required to be passed to Orchestrators, but ThreadPoolImpl doesn't need to keep it + ThreadPoolImpl::ThreadPoolImpl(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context) + : isMarkedForDeletion(false), + orchestratorJobMutex(new std::mutex), + jsThreadCallbackMutex(new std::mutex) + { + uv_async_init(loop, &jsThreadCallbackAsync, RunLoopCallbacks); + jsThreadCallbackAsync.data = new AsyncCallbackData(this); + uv_unref((uv_handle_t *)&jsThreadCallbackAsync); + + workInProgressCount = 0; + + for (int i = 0; i < numberOfThreads; i++) { + orchestrators.emplace_back( + std::bind(&ThreadPoolImpl::QueueCallbackOnJSThread, this, _1, _2, _3), + std::bind(&ThreadPoolImpl::TakeNextJob, this), + context + ); + } + } + + void ThreadPoolImpl::QueueWorker(nodegit::AsyncWorker *worker) { + std::lock_guard lock(*orchestratorJobMutex); + // there is work on the thread pool - reference the handle so + // node doesn't terminate + uv_ref((uv_handle_t *)&jsThreadCallbackAsync); + orchestratorJobQueue.emplace(new Orchestrator::AsyncWorkJob(worker)); + workInProgressCount++; + orchestratorJobCondition.notify_one(); + } + + std::shared_ptr ThreadPoolImpl::TakeNextJob() { + std::unique_lock lock(*orchestratorJobMutex); + while (orchestratorJobQueue.empty()) orchestratorJobCondition.wait(lock); + auto orchestratorJob = orchestratorJobQueue.front(); + + // When the thread pool is shutting down, the thread pool will drain the work queue and replace it with + // a single shared_ptr to a shutdown job, so don't pop the queue when we're shutting down so + // everyone gets the signal + if (orchestratorJob->type != Orchestrator::Job::Type::SHUTDOWN) { + orchestratorJobQueue.pop(); + } + + return orchestratorJob; + } + + void ThreadPoolImpl::QueueCallbackOnJSThread(ThreadPool::Callback callback, ThreadPool::Callback cancelCallback, bool isWork) { + std::unique_lock lock(*jsThreadCallbackMutex); + // When the threadpool is shutting down, we want to free up the executors to also shutdown + // that means that we need to cancel all non-work callbacks as soon as we see them and + // we know that we are shutting down + if (isMarkedForDeletion && !isWork) { + // we don't know how long the cancelCallback will take, and it certainly doesn't need the lock + // while we're running it, so unlock it immediately. + lock.unlock(); + cancelCallback(); + return; + } + + bool queueWasEmpty = jsThreadCallbackQueue.empty(); + jsThreadCallbackQueue.emplace(callback, cancelCallback, isWork); + // we only trigger RunLoopCallbacks via the jsThreadCallbackAsync handle if the queue + // was empty. Otherwise, we depend on RunLoopCallbacks to re-trigger itself + if (queueWasEmpty) { + uv_async_send(&jsThreadCallbackAsync); + } + } + + void ThreadPoolImpl::RunLoopCallbacks(uv_async_t* handle) { + auto asyncCallbackData = static_cast(handle->data); + if (asyncCallbackData->pool) { + asyncCallbackData->pool->RunLoopCallbacks(); + } + } + + // NOTE this should theoretically never be triggered during a cleanup operation + void ThreadPoolImpl::RunLoopCallbacks() { + Nan::HandleScope scope; + v8::Local context = Nan::GetCurrentContext(); + node::CallbackScope callbackScope(context->GetIsolate(), Nan::New(), {0, 0}); + + std::unique_lock lock(*jsThreadCallbackMutex); + // get the next callback to run + JSThreadCallback jsThreadCallback = jsThreadCallbackQueue.front(); + jsThreadCallbackQueue.pop(); + + lock.unlock(); + jsThreadCallback.performCallback(); + lock.lock(); + + if (!jsThreadCallbackQueue.empty()) { + uv_async_send(&jsThreadCallbackAsync); + } + + // if there is no ongoing work / completion processing, node doesn't need + // to be prevented from terminating + if (jsThreadCallback.isWork) { + std::lock_guard orchestratorLock(*orchestratorJobMutex); + workInProgressCount--; + if (!workInProgressCount) { + uv_unref((uv_handle_t *)&jsThreadCallbackAsync); + } + } + } + + void ThreadPoolImpl::Shutdown(std::unique_ptr cleanupHandle) { + std::queue> cancelledJobs; + std::queue cancelledCallbacks; + { + std::unique_lock orchestratorLock(*orchestratorJobMutex, std::defer_lock); + std::unique_lock jsThreadLock(*jsThreadCallbackMutex, std::defer_lock); + std::lock(orchestratorLock, jsThreadLock); + + // Once we've marked for deletion, we will start cancelling all callbacks + // when an attempt to queue a callback is made + isMarkedForDeletion = true; + // We want to grab all of the jobs that have been queued and run their cancel routines + // so that we can clean up their resources + orchestratorJobQueue.swap(cancelledJobs); + // We also want to grab all callbacks that have been queued so that we can + // run their cancel routines, this will help terminate the async workers + // that are currently being executed complete so that the threads + // running them can exit cleanly + jsThreadCallbackQueue.swap(cancelledCallbacks); + // Pushing a ShutdownJob into the queue will instruct all threads + // to start their shutdown process when they see the job is available. + orchestratorJobQueue.emplace(new Orchestrator::ShutdownJob); + + if (workInProgressCount) { + // unref the jsThreadCallback for all work in progress + // it will not be used after this function has completed + while (workInProgressCount--) { + uv_unref((uv_handle_t *)&jsThreadCallbackAsync); + } + } + + orchestratorJobCondition.notify_all(); + } + + Nan::HandleScope scope; + v8::Local context = Nan::GetCurrentContext(); + node::CallbackScope callbackScope(context->GetIsolate(), Nan::New(), {0, 0}); + + while (cancelledJobs.size()) { + std::shared_ptr cancelledJob = cancelledJobs.front(); + std::shared_ptr asyncWorkJob = std::static_pointer_cast(cancelledJob); + + asyncWorkJob->worker->Cancel(); + asyncWorkJob->worker->WorkComplete(); + asyncWorkJob->worker->Destroy(); + + cancelledJobs.pop(); + } + + // We need to cancel all callbacks that were scheduled before the shutdown + // request went through. This will help finish any work any currently operating + // executors are undertaking + while (cancelledCallbacks.size()) { + JSThreadCallback cancelledCallback = cancelledCallbacks.front(); + cancelledCallback.cancel(); + cancelledCallbacks.pop(); + } + + std::for_each(orchestrators.begin(), orchestrators.end(), [](Orchestrator &orchestrator) { + orchestrator.WaitForThreadClose(); + }); + + // After we have completed waiting for all threads to close + // we will need to cleanup the rest of the completion callbacks + // from workers that were still running when the shutdown signal + // was sent + std::lock_guard jsThreadLock(*jsThreadCallbackMutex); + while (jsThreadCallbackQueue.size()) { + JSThreadCallback jsThreadCallback = jsThreadCallbackQueue.front(); + jsThreadCallback.cancel(); + jsThreadCallbackQueue.pop(); + } + + AsyncCallbackData *asyncCallbackData = static_cast(jsThreadCallbackAsync.data); + asyncCallbackData->cleanupHandle.swap(cleanupHandle); + asyncCallbackData->pool = nullptr; + + uv_close(reinterpret_cast(&jsThreadCallbackAsync), [](uv_handle_t *handle) { + auto asyncCallbackData = static_cast(handle->data); + delete asyncCallbackData; + }); + } + + ThreadPool::ThreadPool(int numberOfThreads, uv_loop_t *loop, nodegit::Context *context) + : impl(new ThreadPoolImpl(numberOfThreads, loop, context)) + {} + + ThreadPool::~ThreadPool() {} + + void ThreadPool::QueueWorker(nodegit::AsyncWorker *worker) { + impl->QueueWorker(worker); + } + + void ThreadPool::PostCallbackEvent(OnPostCallbackFn onPostCallback) { + Executor::PostCallbackEvent(onPostCallback); + } + + Nan::AsyncResource *ThreadPool::GetCurrentAsyncResource() { + return Executor::GetCurrentAsyncResource(); + } + + const nodegit::Context *ThreadPool::GetCurrentContext() { + return Executor::GetCurrentContext(); + } + + Nan::Global *ThreadPool::GetCurrentCallbackErrorHandle() { + return Executor::GetCurrentCallbackErrorHandle(); + } + + void ThreadPool::Shutdown(std::unique_ptr cleanupHandle) { + impl->Shutdown(std::move(cleanupHandle)); + } + + void ThreadPool::InitializeGlobal() { + git_custom_tls_set_callbacks( + Executor::RetrieveTLSForLibgit2ChildThread, + Executor::SetTLSForLibgit2ChildThread, + Executor::TeardownTLSOnLibgit2ChildThread + ); + } +} diff --git a/generate/templates/manual/src/tracker_wrap.cc b/generate/templates/manual/src/tracker_wrap.cc new file mode 100644 index 0000000000..85034d88de --- /dev/null +++ b/generate/templates/manual/src/tracker_wrap.cc @@ -0,0 +1,238 @@ +#include "../include/tracker_wrap.h" + +#include +#include + +namespace { + /** + * \class TrackerWrapTreeNode + * + * Parents of a TrackerWrapTreeNode will be the nodes holding TrackerWrap objects that + * are owners of the TrackerWrap object that this node holds. The same way for its children. + */ + class TrackerWrapTreeNode + { + public: + TrackerWrapTreeNode(nodegit::TrackerWrap *trackerWrap) : m_trackerWrap(trackerWrap) {} + TrackerWrapTreeNode() = delete; + ~TrackerWrapTreeNode(); + TrackerWrapTreeNode(const TrackerWrapTreeNode &other) = delete; + TrackerWrapTreeNode(TrackerWrapTreeNode &&other) = delete; + TrackerWrapTreeNode& operator=(const TrackerWrapTreeNode &other) = delete; + TrackerWrapTreeNode& operator=(TrackerWrapTreeNode &&other) = delete; + + inline const std::unordered_set& Children() const; + inline nodegit::TrackerWrap* TrackerWrap(); + inline void AddChild(TrackerWrapTreeNode *child); + + private: + std::unordered_set m_children {}; + nodegit::TrackerWrap *m_trackerWrap {}; + }; + + /** + * TrackerWrapTreeNode::~TrackerWrapTreeNode() + * Frees the memory of the TrackerWrap pointer it holds. + */ + TrackerWrapTreeNode::~TrackerWrapTreeNode() { + delete m_trackerWrap; + } + + /** + * TrackerWrapTreeNode::Children() + * + * Returns a reference to the children nodes of this. + */ + const std::unordered_set& TrackerWrapTreeNode::Children() const { + return m_children; + } + + /** + * TrackerWrapTreeNode::TrackerWrap() + * + * Returns a pointer to the node's TrackerWrap object. + */ + nodegit::TrackerWrap* TrackerWrapTreeNode::TrackerWrap() { + return m_trackerWrap; + } + + /** + * TrackerWrapTreeNode::AddChild() + */ + void TrackerWrapTreeNode::AddChild(TrackerWrapTreeNode *child) { + m_children.insert(child); + } + + /** + * \class TrackerWrapTrees + * + * Class containing a list of trees with nodes holding TrackerWrap objects. + * For a TrackerWrap object 'P' which owns another TrackerWrap object 'C', + * 'P' will be held in a node which will be the parent of the child node + * that holds 'C'. + * On destruction, nodes will be freed in a children-first way. + * + * NOTE: nodegit code previous to this change is prepared to manage an array of + * owners, so class TrackerWrapTrees considers multiple owners (parent nodes) too. + */ + class TrackerWrapTrees + { + public: + TrackerWrapTrees(nodegit::TrackerWrap::TrackerList *trackerList); + TrackerWrapTrees() = delete; + ~TrackerWrapTrees(); + TrackerWrapTrees(const TrackerWrapTrees &other) = delete; + TrackerWrapTrees(TrackerWrapTrees &&other) = delete; + TrackerWrapTrees& operator=(const TrackerWrapTrees &other) = delete; + TrackerWrapTrees& operator=(TrackerWrapTrees &&other) = delete; + + private: + void addNode(nodegit::TrackerWrap *trackerWrap); + void addParentNode(nodegit::TrackerWrap *owner, TrackerWrapTreeNode *child); + void deleteTree(TrackerWrapTreeNode *node); + void freeAllTreesChildrenFirst(); + + using TrackerWrapTreeNodeMap = std::unordered_map>; + + TrackerWrapTreeNodeMap m_mapTrackerWrapNode {}; + std::vector m_roots {}; + }; + + /** + * TrackerWrapTrees::TrackerWrapTrees(nodegit::TrackerWrap::TrackerList *trackerList) + * + * Unlinks items from trackerList and adds them to a tree. + * For each root (TrackerWrap item without owners), it adds a new tree root. + * + * \param trackerList TrackerList pointer from which the TrackerWrapTrees object will be created. + */ + TrackerWrapTrees::TrackerWrapTrees(nodegit::TrackerWrap::TrackerList *trackerList) + { + nodegit::TrackerWrap *trackerWrap {}; + while ((trackerWrap = nodegit::TrackerWrap::UnlinkFirst(trackerList)) != nullptr) { + addNode(trackerWrap); + } + } + + /* + * TrackerWrapTrees::~TrackerWrapTrees + */ + TrackerWrapTrees::~TrackerWrapTrees() { + freeAllTreesChildrenFirst(); + } + + /** + * TrackerWrapTrees::addNode + * + * \param trackerWrap pointer to the TrackerWrap object to add as a node in a tree. + */ + void TrackerWrapTrees::addNode(nodegit::TrackerWrap *trackerWrap) { + // add trackerWrap as a node + // NOTE: 'emplace' will create a temporal TrackerWrapTreeNode and will + // free it if trackerWrap already exists as a key. To prevent freeing + // the node at this moment we have to find it first. + auto addedNodeIter = m_mapTrackerWrapNode.find(trackerWrap); + if (addedNodeIter == m_mapTrackerWrapNode.end()) { + addedNodeIter = m_mapTrackerWrapNode.emplace(std::make_pair( + trackerWrap, std::make_unique(trackerWrap))).first; + } + TrackerWrapTreeNode *addedNode = addedNodeIter->second.get(); + + // if trackerWrap has no owners, add it as a root node + const std::vector *owners = trackerWrap->GetTrackerWrapOwners(); + if (owners == nullptr) { + m_roots.push_back(addedNode); + } + else { + // add addedNode's parents and link them with this child + for (nodegit::TrackerWrap *owner : *owners) { + addParentNode(owner, addedNode); + } + } + } + + /** + * TrackerWrapTrees::addParentNode + * + * \param owner TrackerWrap pointer for the new parent node to add. + * \param child TrackerWrapTreeNode pointer to be the child node of the new parent node to add. + */ + void TrackerWrapTrees::addParentNode(nodegit::TrackerWrap *owner, TrackerWrapTreeNode *child) + { + // adds a new parent node (holding the owner) + // NOTE: 'emplace' will create a temporal TrackerWrapTreeNode and will + // free it if trackerWrap already exists as a key. To prevent freeing + // the node at this moment we have to find it first. + auto addedParentNodeIter = m_mapTrackerWrapNode.find(owner); + if (addedParentNodeIter == m_mapTrackerWrapNode.end()) { + addedParentNodeIter = m_mapTrackerWrapNode.emplace(std::make_pair( + owner, std::make_unique(owner))).first; + } + TrackerWrapTreeNode *addedParentNode = addedParentNodeIter->second.get(); + + // links parent to child + addedParentNode->AddChild(child); + } + + /** + * TrackerWrapTrees::deleteTree + * + * Deletes the tree from the node passed as a parameter + * in a children-first way and recursively. + * + * \param node node from where to delete all its children and itself. + */ + void TrackerWrapTrees::deleteTree(TrackerWrapTreeNode *node) + { + // delete all node's children first + const std::unordered_set &children = node->Children(); + for (TrackerWrapTreeNode *child : children) { + // check that child hasn't been removed previously by another parent + if (m_mapTrackerWrapNode.find(child->TrackerWrap()) != m_mapTrackerWrapNode.end()) { + deleteTree(child); + } + } + + // then deletes itself from the container, which will + // actually free 'node' and the TrackerWrap object it holds + m_mapTrackerWrapNode.erase(node->TrackerWrap()); + } + + /** + * TrackerWrapTrees::freeAllTreesChildrenFirst + * + * Deletes all the trees held, in a children-first way. + */ + void TrackerWrapTrees::freeAllTreesChildrenFirst() { + for (TrackerWrapTreeNode *root : m_roots) { + deleteTree(root); + } + m_roots.clear(); + } +} // end anonymous namespace + + +namespace nodegit { + TrackerWrap* TrackerWrap::UnlinkFirst(TrackerList *listStart) { + assert(listStart != nullptr); + return listStart->m_next == nullptr ? nullptr : listStart->m_next->Unlink(); + } + + int TrackerWrap::SizeFromList(TrackerList *listStart) { + assert(listStart != nullptr); + TrackerList *t {listStart}; + int count {0}; + while (t->m_next != nullptr) { + ++count; + t = t->m_next; + } + return count; + } + + void TrackerWrap::DeleteFromList(TrackerList *listStart) { + assert(listStart != nullptr); + // creates an object TrackerWrapTrees, which will free + // the nodes of its trees in a children-first way + TrackerWrapTrees trackerWrapTrees(listStart); + } +} \ No newline at end of file diff --git a/generate/templates/manual/src/v8_helpers.cc b/generate/templates/manual/src/v8_helpers.cc new file mode 100644 index 0000000000..bd97fba34e --- /dev/null +++ b/generate/templates/manual/src/v8_helpers.cc @@ -0,0 +1,19 @@ +#include "../include/v8_helpers.h" + +namespace nodegit { + v8::Local safeGetField(v8::Local &containerObject, std::string field) { + auto maybeFieldName = Nan::New(field); + if (maybeFieldName.IsEmpty()) { + v8::Local emptyResult; + return emptyResult; + } + + auto maybeRetrievedField = Nan::Get(containerObject, maybeFieldName.ToLocalChecked()); + if (maybeRetrievedField.IsEmpty()) { + v8::Local emptyResult; + return emptyResult; + } + + return maybeRetrievedField.ToLocalChecked(); + } +} diff --git a/generate/templates/manual/src/wrapper.cc b/generate/templates/manual/src/wrapper.cc index 8966bb6fa7..3bad23c7d4 100644 --- a/generate/templates/manual/src/wrapper.cc +++ b/generate/templates/manual/src/wrapper.cc @@ -16,42 +16,44 @@ Wrapper::Wrapper(void *raw) { this->raw = raw; } -void Wrapper::InitializeComponent(Handle target) { - NanScope(); +void Wrapper::InitializeComponent(Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; - Local tpl = NanNew(JSNewFunction); + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); - tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->SetClassName(NanNew("Wrapper")); + tpl->InstanceTemplate()->SetInternalFieldCount(2); + tpl->SetClassName(Nan::New("Wrapper").ToLocalChecked()); - NODE_SET_PROTOTYPE_METHOD(tpl, "toBuffer", ToBuffer); + Nan::SetPrototypeMethod(tpl, "toBuffer", ToBuffer, nodegitExternal); - NanAssignPersistent(constructor_template, tpl); - target->Set(NanNew("Wrapper"), tpl->GetFunction()); + Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("Wrapper::Template", constructor_template); + Nan::Set(target, Nan::New("Wrapper").ToLocalChecked(), constructor_template); } NAN_METHOD(Wrapper::JSNewFunction) { - NanScope(); - if (args.Length() == 0 || !args[0]->IsExternal()) { - return NanThrowError("void * is required."); + if (info.Length() == 0 || !info[0]->IsExternal()) { + return Nan::ThrowError("void * is required."); } - Wrapper* object = new Wrapper(External::Cast(*args[0])->Value()); - object->Wrap(args.This()); + Wrapper* object = new Wrapper(External::Cast(*info[0])->Value()); + object->Wrap(info.This()); - NanReturnValue(args.This()); + info.GetReturnValue().Set(info.This()); } -Handle Wrapper::New(void *raw) { - NanEscapableScope(); +Local Wrapper::New(const void *raw) { + Nan::EscapableHandleScope scope; - Handle argv[1] = { NanNew((void *)raw) }; + Local argv[1] = { Nan::New((void *)raw) }; Local instance; - Local constructorHandle = NanNew(constructor_template); - instance = constructorHandle->GetFunction()->NewInstance(1, argv); + nodegit::Context *nodegitContext = nodegit::Context::GetCurrentContext(); + Local constructor_template = nodegitContext->GetFromPersistent("Wrapper::Template").As(); + instance = Nan::NewInstance(constructor_template, 1, argv).ToLocalChecked(); - return NanEscapeScope(instance); + return scope.Escape(instance); } void *Wrapper::GetValue() { @@ -59,24 +61,20 @@ void *Wrapper::GetValue() { } NAN_METHOD(Wrapper::ToBuffer) { - NanScope(); - if(args.Length() == 0 || !args[0]->IsNumber()) { - return NanThrowError("Number is required."); + if(info.Length() == 0 || !info[0]->IsNumber()) { + return Nan::ThrowError("Number is required."); } - int len = args[0]->ToNumber()->Value(); + int len = Nan::To(info[0]).FromJust(); Local bufferConstructor = Local::Cast( - NanGetCurrentContext()->Global()->Get(NanNew("Buffer"))); + Nan::Get(Nan::GetCurrentContext()->Global(), Nan::New("Buffer").ToLocalChecked()).ToLocalChecked()); - Handle constructorArgs[1] = { NanNew(len) }; - Local nodeBuffer = bufferConstructor->NewInstance(1, constructorArgs); + Local constructorArgs[1] = { Nan::New(len) }; + Local nodeBuffer = Nan::NewInstance(bufferConstructor, 1, constructorArgs).ToLocalChecked(); - std::memcpy(node::Buffer::Data(nodeBuffer), ObjectWrap::Unwrap(args.This())->GetValue(), len); + std::memcpy(node::Buffer::Data(nodeBuffer), Nan::ObjectWrap::Unwrap(info.This())->GetValue(), len); - NanReturnValue(nodeBuffer); + info.GetReturnValue().Set(nodeBuffer); } - - -Persistent Wrapper::constructor_template; diff --git a/generate/templates/manual/tree/get_all_filepaths.cc b/generate/templates/manual/tree/get_all_filepaths.cc new file mode 100644 index 0000000000..758383980a --- /dev/null +++ b/generate/templates/manual/tree/get_all_filepaths.cc @@ -0,0 +1,157 @@ + +namespace TreeFilepathsHelpers { + +int iterateTreePaths(git_repository *repo, git_tree *tree, std::vector *paths,std::string *buffer) { + size_t size = git_tree_entrycount(tree); + for (size_t i = 0; i < size; i++) { + const git_tree_entry *entry = git_tree_entry_byindex(tree, i); + const git_filemode_t filemode = git_tree_entry_filemode(entry); + if (filemode == GIT_FILEMODE_BLOB || filemode == GIT_FILEMODE_BLOB_EXECUTABLE) { + paths->push_back(*buffer + std::string(git_tree_entry_name(entry))); + } + else if (filemode == GIT_FILEMODE_TREE) { + git_tree *subtree; + int error = git_tree_lookup(&subtree, repo, git_tree_entry_id(entry)); + if (error == GIT_OK) { + size_t size = buffer->size(); + /* append the next entry to the path */ + buffer->append(git_tree_entry_name(entry)); + buffer->append("/"); + error = iterateTreePaths(repo, subtree, paths, buffer); + git_tree_free(subtree); + buffer->resize(size); + } + + if (error < 0 ) { + return error; + } + + } + } + return GIT_OK; +} + +} // end anonymous namespace + +NAN_METHOD(GitTree::GetAllFilepaths) +{ + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); + } + + GetAllFilepathsBaton* baton = new GetAllFilepathsBaton(); + + baton->error_code = GIT_OK; + baton->error = NULL; + baton->tree = Nan::ObjectWrap::Unwrap(info.This())->GetValue(); + baton->out = new std::vector; + baton->repo = git_tree_owner(baton->tree); + + Nan::Callback *callback = new Nan::Callback(Local::Cast(info[info.Length() - 1])); + std::map> cleanupHandles; + GetAllFilepathsWorker *worker = new GetAllFilepathsWorker(baton, callback, cleanupHandles); + worker->Reference("tree", info.This()); + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + nodegitContext->QueueWorker(worker); + + return; +} + +nodegit::LockMaster GitTree::GetAllFilepathsWorker::AcquireLocks() { + nodegit::LockMaster lockMaster(true, baton->tree, baton->repo); + return lockMaster; +} + +void GitTree::GetAllFilepathsWorker::Execute() +{ + std::string buffer; + buffer.reserve(4096); + baton->error_code = TreeFilepathsHelpers::iterateTreePaths(baton->repo, baton->tree, baton->out, &buffer); + if (baton->error_code != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } +} + +void GitTree::GetAllFilepathsWorker::HandleErrorCallback() { + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + + delete baton->out; + + delete baton; +} + +void GitTree::GetAllFilepathsWorker::HandleOKCallback() +{ + if (baton->error_code == GIT_OK) { + std::vector &paths = *(baton->out); + v8::Local result = Nan::New(paths.size()); + for (unsigned int i = 0; i < paths.size(); i++) { + Nan::Set(result, i, Nan::New(paths[i]).ToLocalChecked()); + } + + v8::Local argv[2] = {Nan::Null(), result}; + callback->Call(2, argv, async_resource); + } + else + { + if (baton->error) + { + Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method getAllFilepaths has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Tree.getAllFilepaths").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + if (baton->error->message) + { + free((void *)baton->error->message); + } + + free((void *)baton->error); + } + else if (baton->error_code < 0) + { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) + { + Local err = Nan::To(Nan::Error("Method getAllFilepaths has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("Revwalk.getAllFilepaths").ToLocalChecked()); + Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } + } + else + { + callback->Call(0, NULL, async_resource); + } + } + + delete baton->out; + delete baton; +} diff --git a/generate/templates/partials/async_function.cc b/generate/templates/partials/async_function.cc index 2ed5089c3f..d23ec7f609 100644 --- a/generate/templates/partials/async_function.cc +++ b/generate/templates/partials/async_function.cc @@ -1,189 +1,396 @@ {%partial doc .%} NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { - NanScope(); {%partial guardArguments .%} - if (args.Length() == {{args|jsArgsCount}} || !args[{{args|jsArgsCount}}]->IsFunction()) { - return NanThrowError("Callback is required and must be a Function."); + if (!info[info.Length() - 1]->IsFunction()) { + return Nan::ThrowError("Callback is required and must be a Function."); } - {{ cppFunctionName }}Baton* baton = new {{ cppFunctionName }}Baton; + {{ cppFunctionName }}Baton* baton = new {{ cppFunctionName }}Baton(); baton->error_code = GIT_OK; baton->error = NULL; {%each args|argsInfo as arg %} {%if arg.globalPayload %} - {{ cppFunctionName }}_globalPayload* globalPayload = new {{ cppFunctionName }}_globalPayload; + {{ cppFunctionName }}_globalPayload* globalPayload = new {{ cppFunctionName }}_globalPayload; {%endif%} {%endeach%} + nodegit::Context *nodegitContext = reinterpret_cast(info.Data().As()->Value()); + std::map> cleanupHandles; + {%each args|argsInfo as arg %} {%if not arg.isReturn %} {%if arg.isSelf %} - baton->{{ arg.name }} = ObjectWrap::Unwrap<{{ arg.cppClassName }}>(args.This())->GetValue(); + baton->{{ arg.name }} = Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue(); {%elsif arg.isCallbackFunction %} - if (!args[{{ arg.jsArg }}]->IsFunction()) { - baton->{{ arg.name }} = NULL; - {%if arg.payload.globalPayload %} - globalPayload->{{ arg.name }} = NULL; - {%else%} - baton->{{ arg.payload.name }} = NULL; - {%endif%} - } - else { - baton->{{ arg.name}} = {{ cppFunctionName }}_{{ arg.name }}_cppCallback; + if (!info[{{ arg.jsArg }}]->IsFunction()) { + baton->{{ arg.name }} = NULL; {%if arg.payload.globalPayload %} - globalPayload->{{ arg.name }} = new NanCallback(args[{{ arg.jsArg }}].As()); + globalPayload->{{ arg.name }} = NULL; {%else%} - baton->{{ arg.payload.name }} = new NanCallback(args[{{ arg.jsArg }}].As()); + // NOTE this is a dead path + baton->{{ arg.payload.name }} = NULL; {%endif%} - } + } + else { + baton->{{ arg.name}} = {{ cppFunctionName }}_{{ arg.name }}_cppCallback; + {%if arg.payload.globalPayload %} + globalPayload->{{ arg.name }} = new Nan::Callback(info[{{ arg.jsArg }}].As()); + {%else%} + // NOTE this is a dead path + baton->{{ arg.payload.name }} = new Nan::Callback(info[{{ arg.jsArg }}].As()); + {%endif%} + } {%elsif arg.payloadFor %} {%if arg.globalPayload %} - baton->{{ arg.name }} = globalPayload; + baton->{{ arg.name }} = globalPayload; {%endif%} + {% elsif arg.isStructType %} + {% if arg.isOptional %} + if (info[{{ arg.jsArg }}]->IsNull() || info[{{ arg.jsArg }}]->IsUndefined()) { + baton->{{ arg.name }} = nullptr; + } else + {% endif %} + {% if arg.cppClassName == 'Array' %} + { + v8::Local tempArray = v8::Local::Cast(info[{{ arg.jsArg }}]); + baton->{{ arg.name }} = ({{ arg.cType|unPointer }}*)malloc(sizeof({{ arg.cType|unPointer }}) * tempArray->Length()); + for (uint32_t i = 0; i < tempArray->Length(); ++i) { + auto conversionResult = Configurable{{ arg.arrayElementCppClassName }}::fromJavascript( + nodegitContext, + Nan::Get(tempArray, i).ToLocalChecked() + ); + + if (!conversionResult.result) { + // TODO free previously allocated memory + free(baton->{{ arg.name }}); + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles[std::string("{{ arg.name }}") + std::to_string(i)] = convertedObject; + baton->{{ arg.name }}[i] = *convertedObject->GetValue(); + } + } + {% else %} + { + auto conversionResult = Configurable{{ arg.cppClassName }}::fromJavascript(nodegitContext, info[{{ arg.jsArg }}]); + if (!conversionResult.result) { + return Nan::ThrowError(Nan::New(conversionResult.error).ToLocalChecked()); + } + + auto convertedObject = conversionResult.result; + cleanupHandles["{{ arg.name }}"] = convertedObject; + baton->{{ arg.name }} = convertedObject->GetValue(); + } + {% endif %} {%elsif arg.name %} - {%partial convertFromV8 arg%} + {%partial convertFromV8 arg%} {%if not arg.payloadFor %} - baton->{{ arg.name }} = from_{{ arg.name }}; + baton->{{ arg.name }} = from_{{ arg.name }}; {%if arg | isOid %} - baton->{{ arg.name }}NeedsFree = args[{{ arg.jsArg }}]->IsString(); + baton->{{ arg.name }}NeedsFree = info[{{ arg.jsArg }}]->IsString(); {%endif%} {%endif%} {%endif%} {%elsif arg.shouldAlloc %} - baton->{{ arg.name }} = ({{ arg.cType }})malloc(sizeof({{ arg.cType|replace '*' '' }})); + baton->{{arg.name}} = ({{ arg.cType }})malloc(sizeof({{ arg.cType|replace '*' '' }})); + {%if arg.cppClassName == "GitBuf" %} + baton->{{arg.name}}->ptr = NULL; + baton->{{arg.name}}->size = baton->{{arg.name}}->reserved = 0; + {%endif%} {%endif%} {%endeach%} - NanCallback *callback = new NanCallback(Local::Cast(args[{{args|jsArgsCount}}])); - {{ cppFunctionName }}Worker *worker = new {{ cppFunctionName }}Worker(baton, callback); + Nan::Callback *callback = new Nan::Callback(v8::Local::Cast(info[info.Length() - 1])); + {{ cppFunctionName }}Worker *worker = new {{ cppFunctionName }}Worker(baton, callback, cleanupHandles); + {%each args|argsInfo as arg %} {%if not arg.isReturn %} {%if arg.isSelf %} - worker->SaveToPersistent("{{ arg.name }}", args.This()); + worker->Reference<{{ arg.cppClassName }}>("{{ arg.name }}", info.This()); {%elsif not arg.isCallbackFunction %} - if (!args[{{ arg.jsArg }}]->IsUndefined() && !args[{{ arg.jsArg }}]->IsNull()) - worker->SaveToPersistent("{{ arg.name }}", args[{{ arg.jsArg }}]->ToObject()); + {%if arg.isUnwrappable %} + {% if arg.cppClassName == "Array" %} + if (info[{{ arg.jsArg }}]->IsArray()) { + worker->Reference<{{ arg.arrayElementCppClassName }}>("{{ arg.name }}", info[{{ arg.jsArg }}].As()); + } + {% else %} + worker->Reference<{{ arg.cppClassName }}>("{{ arg.name }}", info[{{ arg.jsArg }}]); + {% endif %} + {% else %} + worker->Reference("{{ arg.name }}", info[{{ arg.jsArg }}]); + {% endif %} {%endif%} {%endif%} {%endeach%} - NanAsyncQueueWorker(worker); - NanReturnUndefined(); + nodegitContext->QueueWorker(worker); + return; +} + +nodegit::LockMaster {{ cppClassName }}::{{ cppFunctionName }}Worker::AcquireLocks() { + nodegit::LockMaster lockMaster( + /*asyncAction: */true + {%each args|argsInfo as arg %} + {%if arg.cType|isPointer%} + {%if not arg.cType|isDoublePointer%} + ,baton->{{ arg.name }} + {%endif%} + {%endif%} + {%endeach%} + ); + + return lockMaster; } void {{ cppClassName }}::{{ cppFunctionName }}Worker::Execute() { + git_error_clear(); + {%if .|hasReturnType %} - {{ return.cType }} result = {{ cFunctionName }}( + {{ return.cType }} result = {{ cFunctionName }}( {%else%} - {{ cFunctionName }}( + {{ cFunctionName }}( {%endif%} {%-- Insert Function Arguments --%} {%each args|argsInfo as arg %} {%-- turn the pointer into a ref --%} - {%if arg.isReturn|and arg.cType|isDoublePointer %}&{%endif%}baton->{{ arg.name }}{%if not arg.lastArg %},{%endif%} - + {%if arg.isReturn|and arg.cType|isDoublePointer %}&{%endif%}baton->{{ arg.name }}{%if not arg.lastArg %},{%endif%} {%endeach%} - ); + ); + + {% if return.isResultOrError %} + baton->error_code = result; + if (result < GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } + + {% elsif return.isErrorCode %} + baton->error_code = result; + + if (result != GIT_OK && git_error_last()->klass != GIT_ERROR_NONE) { + baton->error = git_error_dup(git_error_last()); + } - {%if return.isErrorCode %} - baton->error_code = result; + {%elsif return.cType != 'void' %} - if (result != GIT_OK && giterr_last() != NULL) { - baton->error = git_error_dup(giterr_last()); + baton->result = result; + + {%endif%} +} + +void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleErrorCallback() { + if (!GetIsCancelled()) { + v8::Local err = Nan::To(Nan::Error(ErrorMessage())).ToLocalChecked(); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); } - {%elsif not return.cType == 'void' %} + if (baton->error) { + if (baton->error->message) { + free((void *)baton->error->message); + } - baton->result = result; + free((void *)baton->error); + } - {%endif%} + {%each args|argsInfo as arg %} + {%if arg.shouldAlloc %} + {%if not arg.isCppClassStringOrArray %} + {%elsif arg | isOid %} + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void*)baton->{{ arg.name }}); + } + {%elsif arg.isCallbackFunction %} + {%if not arg.payload.globalPayload %} + delete baton->{{ arg.payload.name }}; + {%endif%} + {%elsif arg.globalPayload %} + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + {%else%} + free((void*)baton->{{ arg.name }}); + {%endif%} + {%elsif arg.freeFunctionName|and arg.isReturn|and arg.selfFreeing %} + {{ arg.freeFunctionName }}(baton->{{ arg.name }}); + {%endif%} + {%endeach%} + + {%each args|argsInfo as arg %} + {%if arg.isCppClassStringOrArray %} + {%if arg.freeFunctionName %} + {%elsif not arg.isConst%} + free((void *)baton->{{ arg.name }}); + {%endif%} + {%elsif arg | isOid %} + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void *)baton->{{ arg.name }}); + } + {%elsif arg.isCallbackFunction %} + {%if not arg.payload.globalPayload %} + delete baton->{{ arg.payload.name }}; + {%endif%} + {%elsif arg.globalPayload %} + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + {%endif%} + {%if arg.cppClassName == "GitBuf" %} + {%if cppFunctionName == "Set" %} + {%else%} + git_buf_dispose(baton->{{ arg.name }}); + free((void *)baton->{{ arg.name }}); + {%endif%} + {%endif%} + {%endeach%} + + delete baton; } void {{ cppClassName }}::{{ cppFunctionName }}Worker::HandleOKCallback() { - TryCatch try_catch; + {%if return.isResultOrError %} + if (baton->error_code >= GIT_OK) { + {%else%} + if (baton->error_code == GIT_OK) { + {%endif%} + + {%if return.isResultOrError %} + v8::Local result = Nan::New(baton->error_code); - if (baton->error_code == GIT_OK) { - {%if not .|returnsCount %} - Handle result = NanUndefined(); - {%else%} - Handle to; + {%elsif not .|returnsCount %} + v8::Local result = Nan::Undefined(); + {%else%} + v8::Local v8ConversionSlot; + {%if .|returnsCount > 1 %} + v8::Local result = Nan::New(); + {%endif%} + {%each .|returnsInfo 0 1 as _return %} + {%partial convertToV8 _return %} {%if .|returnsCount > 1 %} - Handle result = NanNew(); - {%endif%} - {%each .|returnsInfo 0 1 as _return %} - {%partial convertToV8 _return %} - {%if .|returnsCount > 1 %} - result->Set(NanNew("{{ _return.returnNameOrName }}"), to); - {%endif%} - {%endeach%} - {%if .|returnsCount == 1 %} - Handle result = to; + Nan::Set(result, Nan::New("{{ _return.returnNameOrName }}").ToLocalChecked(), v8ConversionSlot); {%endif%} + {%endeach%} + {%if .|returnsCount == 1 %} + v8::Local result = v8ConversionSlot; {%endif%} - Handle argv[2] = { - NanNull(), + {%endif%} + + {% each args|argsInfo as arg %} + {% if not arg.ignore %} + {% if arg.isStructType %} + {% if arg.preserveOnThis %} + { + {% if args|thisInfo 'isReturn' %} + auto objWrap = Nan::ObjectWrap::Unwrap<{{ args|thisInfo 'cppClassName' }}>(result.As()); + {% else %} + auto objWrap = Nan::ObjectWrap::Unwrap<{{ args|thisInfo 'cppClassName' }}>(GetFromPersistent("{{ args|thisInfo 'name' }}").As()); + {% endif %} + objWrap->SaveCleanupHandle(cleanupHandles["{{ arg.name }}"]); + } + {% endif %} + {% endif %} + {% endif %} + {% endeach %} + + v8::Local argv[2] = { + Nan::Null(), result }; - callback->Call(2, argv); + callback->Call(2, argv, async_resource); } else { if (baton->error) { - Handle argv[1] = { - NanError(baton->error->message) + v8::Local err; + if (baton->error->message) { + err = Nan::To(Nan::Error(baton->error->message)).ToLocalChecked(); + } else { + err = Nan::To(Nan::Error("Method {{ jsFunctionName }} has thrown an error.")).ToLocalChecked(); + } + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); + v8::Local argv[1] = { + err }; - callback->Call(1, argv); + callback->Call(1, argv, async_resource); if (baton->error->message) free((void *)baton->error->message); free((void *)baton->error); + } else if (baton->error_code < 0) { + bool callbackFired = false; + if (!callbackErrorHandle.IsEmpty()) { + v8::Local maybeError = Nan::New(callbackErrorHandle); + if (!maybeError->IsNull() && !maybeError->IsUndefined()) { + v8::Local argv[1] = { + maybeError + }; + callback->Call(1, argv, async_resource); + callbackFired = true; + } + } + + if (!callbackFired) { + v8::Local err = Nan::To(Nan::Error("Method {{ jsFunctionName }} has thrown an error.")).ToLocalChecked(); + Nan::Set(err, Nan::New("errno").ToLocalChecked(), Nan::New(baton->error_code)); + Nan::Set(err, Nan::New("errorFunction").ToLocalChecked(), Nan::New("{{ jsClassName }}.{{ jsFunctionName }}").ToLocalChecked()); + v8::Local argv[1] = { + err + }; + callback->Call(1, argv, async_resource); + } } else { - callback->Call(0, NULL); + callback->Call(0, NULL, async_resource); } {%each args|argsInfo as arg %} {%if arg.shouldAlloc %} {%if not arg.isCppClassStringOrArray %} {%elsif arg | isOid %} - if (baton->{{ arg.name}}NeedsFree) { - baton->{{ arg.name}}NeedsFree = false; - free((void*)baton->{{ arg.name }}); - } + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void*)baton->{{ arg.name }}); + } {%elsif arg.isCallbackFunction %} {%if not arg.payload.globalPayload %} - delete baton->{{ arg.payload.name }}; + delete baton->{{ arg.payload.name }}; {%endif%} {%elsif arg.globalPayload %} - delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; {%else%} - free((void*)baton->{{ arg.name }}); + free((void*)baton->{{ arg.name }}); {%endif%} + {%elsif arg.freeFunctionName|and arg.isReturn|and arg.selfFreeing %} + {{ arg.freeFunctionName }}(baton->{{ arg.name }}); {%endif%} {%endeach%} } - if (try_catch.HasCaught()) { - node::FatalException(try_catch); - } - {%each args|argsInfo as arg %} {%if arg.isCppClassStringOrArray %} {%if arg.freeFunctionName %} - {{ arg.freeFunctionName }}(baton->{{ arg.name }}); - {%else%} - free((void *)baton->{{ arg.name }}); + {%elsif not arg.isConst%} + free((void *)baton->{{ arg.name }}); {%endif%} {%elsif arg | isOid %} - if (baton->{{ arg.name}}NeedsFree) { - baton->{{ arg.name}}NeedsFree = false; - free((void *)baton->{{ arg.name }}); - } + if (baton->{{ arg.name}}NeedsFree) { + baton->{{ arg.name}}NeedsFree = false; + free((void *)baton->{{ arg.name }}); + } {%elsif arg.isCallbackFunction %} {%if not arg.payload.globalPayload %} - delete baton->{{ arg.payload.name }}; + delete baton->{{ arg.payload.name }}; {%endif%} {%elsif arg.globalPayload %} - delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + delete ({{ cppFunctionName}}_globalPayload*)baton->{{ arg.name }}; + {%endif%} + {%if arg.cppClassName == "GitBuf" %} + {%if cppFunctionName == "Set" %} + {%else%} + git_buf_dispose(baton->{{ arg.name }}); + free((void *)baton->{{ arg.name }}); + {%endif%} {%endif%} {%endeach%} diff --git a/generate/templates/partials/callback_helpers.cc b/generate/templates/partials/callback_helpers.cc index 8c1d346513..5050350e41 100644 --- a/generate/templates/partials/callback_helpers.cc +++ b/generate/templates/partials/callback_helpers.cc @@ -6,85 +6,64 @@ {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %} {% endeach %} ) { - {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = new {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton(); + {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton baton({{ cbFunction.return.noResults }}); {% each cbFunction.args|argsInfo as arg %} - baton->{{ arg.name }} = {{ arg.name }}; + baton.{{ arg.name }} = {{ arg.name }}; {% endeach %} - baton->result = 0; - baton->req.data = baton; - baton->done = false; - - uv_async_init(uv_default_loop(), &baton->req, (uv_async_cb) {{ cppFunctionName }}_{{ cbFunction.name }}_async); - uv_async_send(&baton->req); - - while(!baton->done) { - this_thread::sleep_for(chrono::milliseconds(1)); - } - - {% each cbFunction|returnsInfo false true as _return %} - {% if _return.isOutParam %} - *{{ _return.name }} = *baton->{{ _return.name }}; - {% endif %} - {% endeach %} + return baton.ExecuteAsync({{ cppFunctionName }}_{{ cbFunction.name }}_async, {{ cppFunctionName }}_{{ cbFunction.name }}_cancelAsync); +} - return baton->result; +void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_cancelAsync(void *untypedBaton) { + {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(untypedBaton); + baton->result = {{ cbFunction.return.cancel }}; + baton->Done(); } -void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(uv_async_t* req, int status) { - NanScope(); +void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void *untypedBaton) { + Nan::HandleScope scope; - {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(req->data); + {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(untypedBaton); {% each cbFunction.args|argsInfo as arg %} {% if arg | isPayload %} {% if cbFunction.payload.globalPayload %} - NanCallback* callback = (({{ cppFunctionName }}_globalPayload*)baton->{{ arg.name }})->{{ cbFunction.name }}; + Nan::Callback* callback = (({{ cppFunctionName }}_globalPayload*)baton->{{ arg.name }})->{{ cbFunction.name }}; {% else %} - NanCallback* callback = (NanCallback *)baton->{{ arg.name }}; + Nan::Callback* callback = (Nan::Callback *)baton->{{ arg.name }}; {% endif %} {% endif %} {% endeach %} - Local argv[{{ cbFunction.args|jsArgsCount }}] = { - {% each cbFunction.args|argsInfo as arg %} - {% if arg | isPayload %} - {%-- payload is always the last arg --%} - // payload is null because we can use closure scope in javascript - NanUndefined() - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - NanNew((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - NanNew({{ arg.cppClassName }}::New((void *)baton->{{ arg.name }}, false)), - {% elsif arg.cType == "size_t" %} - // HACK: NAN should really have an overload for NanNew to support size_t - NanNew((unsigned int)baton->{{ arg.name }}), - {% else %} - NanNew(baton->{{ arg.name }}), - {% endif %} + v8::Local argv[{{ cbFunction.args|callbackArgsCount }}] = { + {% each cbFunction.args|callbackArgsInfo as arg %} + {% if not arg.firstArg %}, {% endif %} + {% if arg.isEnum %} + Nan::New((int)baton->{{ arg.name }}) + {% elsif arg.isLibgitType %} + {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false) + {% elsif arg.cType == "size_t" %} + // HACK: NAN should really have an overload for Nan::New to support size_t + Nan::New((unsigned int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == 'String' %} + Nan::New(baton->{{ arg.name }}).ToLocalChecked() + {% else %} + Nan::New(baton->{{ arg.name }}) {% endif %} {% endeach %} }; - TryCatch tryCatch; - Handle result = callback->Call({{ cbFunction.args|jsArgsCount }}, argv); - - if (result->IsObject() && result->ToObject()->Has(NanNew("then"))) { - Handle thenProp = result->ToObject()->Get(NanNew("then")); + Nan::TryCatch tryCatch; + Nan::MaybeLocal maybeResult = (*callback)(baton->GetAsyncResource(), {{ cbFunction.args|callbackArgsCount }}, argv); - if (thenProp->IsFunction()) { - // we can be reasonbly certain that the result is a promise - Local promise = result->ToObject(); - - NanAssignPersistent(baton->promise, promise); + v8::Local result; + if (!maybeResult.IsEmpty()) { + result = maybeResult.ToLocalChecked(); + } - uv_close((uv_handle_t*) &baton->req, NULL); - uv_async_init(uv_default_loop(), &baton->req, (uv_async_cb) {{ cppFunctionName }}_{{ cbFunction.name }}_asyncPromisePolling); - uv_async_send(&baton->req); - return; - } + if(PromiseCompletion::ForwardIfPromise(result, baton, {{ cppFunctionName }}_{{ cbFunction.name }}_promiseCompleted)) { + return; } {% each cbFunction|returnsInfo false true as _return %} @@ -93,83 +72,70 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(uv_as } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; - baton->{{ _return.name }} = wrapper->GetRefValue(); + *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ cbFunction.return.success }}; {% else %} if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); + baton->result = Nan::To(result).FromJust(); } else { - baton->result = {{ cbFunction.return.noResults }}; + baton->result = baton->defaultResult; } {% endif %} } else { - baton->result = {{ cbFunction.return.noResults }}; + baton->result = baton->defaultResult; } {% endeach %} - baton->done = true; - uv_close((uv_handle_t*) &baton->req, NULL); + baton->Done(); } -void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_asyncPromisePolling(uv_async_t* req, int status) { - NanScope(); +void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result) { + Nan::HandleScope scope; - {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(req->data); - Local promise = NanNew(baton->promise); - NanCallback* isPendingFn = new NanCallback(promise->Get(NanNew("isPending")).As()); - Local argv[1]; // MSBUILD won't assign an array of length 0 - Local isPending = isPendingFn->Call(promise, 0, argv)->ToBoolean(); - - if (isPending->Value()) { - uv_async_send(&baton->req); - return; - } - - NanCallback* isFulfilledFn = new NanCallback(promise->Get(NanNew("isFulfilled")).As()); - Local isFulfilled = isFulfilledFn->Call(promise, 0, argv)->ToBoolean(); - - if (isFulfilled->Value()) { - NanCallback* resultFn = new NanCallback(promise->Get(NanNew("value")).As()); - Handle result = resultFn->Call(promise, 0, argv); + {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(_baton); + if (isFulfilled) { {% each cbFunction|returnsInfo false true as _return %} if (result.IsEmpty() || result->IsNativeError()) { baton->result = {{ cbFunction.return.error }}; } else if (!result->IsNull() && !result->IsUndefined()) { {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); wrapper->selfFreeing = false; - baton->{{ _return.name }} = wrapper->GetRefValue(); + *baton->{{ _return.name }} = wrapper->GetValue(); baton->result = {{ cbFunction.return.success }}; {% else %} if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); + baton->result = Nan::To(result).FromJust(); } else { - baton->result = {{ cbFunction.return.noResults }}; + baton->result = baton->defaultResult; } {% endif %} } else { - baton->result = {{ cbFunction.return.noResults }}; + baton->result = baton->defaultResult; } {% endeach %} - baton->done = true; } else { // promise was rejected + {{ cppClassName }}* instance = static_cast<{{ cppClassName }}*>(baton->{% each cbFunction.args|argsInfo as arg %} + {% if arg.payload == true %}{{arg.name}}{% elsif arg.lastArg %}{{arg.name}}{% endif %} + {% endeach %}); + v8::Local parent = instance->handle(); + SetPrivate(parent, Nan::New("NodeGitPromiseError").ToLocalChecked(), result); + baton->result = {{ cbFunction.return.error }}; - baton->done = false; } - - uv_close((uv_handle_t*) &baton->req, NULL); + baton->Done(); } {%endif%} {%endeach%} diff --git a/generate/templates/partials/configurable_callbacks.cc b/generate/templates/partials/configurable_callbacks.cc new file mode 100644 index 0000000000..79eef554b8 --- /dev/null +++ b/generate/templates/partials/configurable_callbacks.cc @@ -0,0 +1,227 @@ +{% each fields|fieldsInfo as field %} + {% if not field.ignore %} + {% if field.isCallbackFunction %} + Configurable{{ cppClassName }}* Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_getInstanceFromBaton({{ field.name|titleCase }}Baton* baton) { + {% if isExtendedStruct %} + return static_cast((({{cType}}_extended *)baton->self)->payload); + {% else %} + return static_cast(baton-> + {% each field.args|argsInfo as arg %} + {% if arg.payload == true %} + {{arg.name}} + {% elsif arg.lastArg %} + {{arg.name}} + {% endif %} + {% endeach %}); + {% endif %} + } + + {{ field.return.type }} Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_cppCallback ( + {% each field.args|argsInfo as arg %} + {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %} + {% endeach %} + ) { + {{ field.name|titleCase }}Baton *baton = + new {{ field.name|titleCase }}Baton({{ field.return.noResults }}); + + {% each field.args|argsInfo as arg %} + baton->{{ arg.name }} = {{ arg.name }}; + {% endeach %} + + Configurable{{ cppClassName }}* instance = {{ field.jsFunctionName }}_getInstanceFromBaton(baton); + + {% if field.return.type == "void" %} + if (instance->nodegitContext != nodegit::ThreadPool::GetCurrentContext()) { + delete baton; + } else if (instance->{{ field.jsFunctionName }}.WillBeThrottled()) { + delete baton; + } else if (instance->{{ field.jsFunctionName }}.ShouldWaitForResult()) { + baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync); + delete baton; + } else { + baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync, nodegit::deleteBaton); + } + return; + {% else %} + {{ field.return.type }} result; + + if (instance->nodegitContext != nodegit::ThreadPool::GetCurrentContext()) { + result = baton->defaultResult; + delete baton; + } else if (instance->{{ field.jsFunctionName }}.WillBeThrottled()) { + result = baton->defaultResult; + delete baton; + } else if (instance->{{ field.jsFunctionName }}.ShouldWaitForResult()) { + result = baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync); + delete baton; + } else { + result = baton->defaultResult; + baton->ExecuteAsync({{ field.jsFunctionName }}_async, {{ field.jsFunctionName }}_cancelAsync, nodegit::deleteBaton); + } + return result; + {% endif %} + } + + void Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_cancelAsync(void *untypedBaton) { + {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(untypedBaton); + {% if field.return.type != "void" %} + baton->result = {{ field.return.cancel }}; + {% endif %} + baton->Done(); + } + + void Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_async(void *untypedBaton) { + Nan::HandleScope scope; + + {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(untypedBaton); + Configurable{{ cppClassName }}* instance = {{ field.jsFunctionName }}_getInstanceFromBaton(baton); + + if (instance->{{ field.jsFunctionName }}.GetCallback()->IsEmpty()) { + {% if field.return.type == "int" %} + baton->result = baton->defaultResult; // no results acquired + {% endif %} + baton->Done(); + return; + } + + {% each field.args|callbackArgsInfo as arg %} + {% if arg.cppClassName == "Array" %} + v8::Local _{{arg.name}}_array = Nan::New(baton->{{ arg.arrayLengthArgumentName }}); + for(uint32_t i = 0; i < _{{arg.name}}_array->Length(); i++) { + Nan::Set(_{{arg.name}}_array, i, {{arg.arrayElementCppClassName}}::New(baton->{{arg.name}}[i], false)); + } + {% endif %} + {% endeach %} + + {% if field.args|callbackArgsCount == 0 %} + v8::Local *argv = NULL; + {% else %} + v8::Local argv[{{ field.args|callbackArgsCount }}] = { + {% each field.args|callbackArgsInfo as arg %} + {% if not arg.firstArg %},{% endif %} + {% if arg.isEnum %} + Nan::New((int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == "Array" %} + _{{arg.name}}_array + {% elsif arg.isLibgitType %} + {{ arg.cppClassName }}::New(baton->{{ arg.name }}, false) + {% elsif arg.cType == "size_t" %} + // HACK: NAN should really have an overload for Nan::New to support size_t + Nan::New((unsigned int)baton->{{ arg.name }}) + {% elsif arg.cppClassName == "String" %} + baton->{{ arg.name }} == NULL + ? Nan::EmptyString() + : Nan::New({%if arg.cType | isDoublePointer %}*{% endif %}baton->{{ arg.name }}).ToLocalChecked() + {% else %} + Nan::New(baton->{{ arg.name }}) + {% endif %} + {% endeach %} + }; + {% endif %} + + Nan::TryCatch tryCatch; + + Nan::MaybeLocal maybeResult = (*(instance->{{ field.jsFunctionName }}.GetCallback()))( + baton->GetAsyncResource(), + {{ field.args|callbackArgsCount }}, + argv + ); + v8::Local result; + if (!maybeResult.IsEmpty()) { + result = maybeResult.ToLocalChecked(); + } + + if (PromiseCompletion::ForwardIfPromise(result, baton, Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_promiseCompleted)) { + return; + } + + {% if field.return.type == "void" %} + baton->Done(); + {% else %} + {% each field|returnsInfo false true as _return %} + if (result.IsEmpty() || result->IsNativeError()) { + baton->result = {{ field.return.error }}; + } + else if (!result->IsNull() && !result->IsUndefined()) { + {% if _return.isOutParam %} + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); + wrapper->selfFreeing = false; + + {% if _return.cppClassName == "GitOid" %} + git_oid_cpy(baton->{{ _return.name }}, wrapper->GetValue()); + {% else %} + *baton->{{ _return.name }} = wrapper->GetValue(); + {% endif %} + baton->result = {{ field.return.success }}; + {% else %} + if (result->IsNumber()) { + baton->result = Nan::To(result).FromJust(); + } + else { + baton->result = baton->defaultResult; + } + {% endif %} + } + else { + baton->result = baton->defaultResult; + } + {% endeach %} + baton->Done(); + {% endif %} + } + + void Configurable{{ cppClassName }}::{{ field.jsFunctionName }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result) { + Nan::HandleScope scope; + + {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(_baton); + {% if field.return.type == "void" %} + baton->Done(); + {% else %} + if (isFulfilled) { + {% each field|returnsInfo false true as _return %} + if (result.IsEmpty() || result->IsNativeError()) { + baton->result = {{ field.return.error }}; + } + else if (!result->IsNull() && !result->IsUndefined()) { + {% if _return.isOutParam %} + {{ _return.cppClassName }}* wrapper = Nan::ObjectWrap::Unwrap<{{ _return.cppClassName }}>(Nan::To(result).ToLocalChecked()); + wrapper->selfFreeing = false; + + {% if _return.cppClassName == "GitOid" %} + git_oid_cpy(baton->{{ _return.name }}, wrapper->GetValue()); + {% else %} + *baton->{{ _return.name }} = wrapper->GetValue(); + {% endif %} + baton->result = {{ field.return.success }}; + {% else %} + if (result->IsNumber()) { + baton->result = Nan::To(result).FromJust(); + } + else { + baton->result = baton->defaultResult; + } + {% endif %} + } + else { + baton->result = baton->defaultResult; + } + {% endeach %} + } + else { + // promise was rejected + {% if isExtendedStruct %} + Configurable{{ cppClassName }}* instance = static_cast((({{cType}}_extended *)baton->self)->payload); + {% else %} + Configurable{{ cppClassName }}* instance = static_cast(baton->{% each field.args|argsInfo as arg %} + {% if arg.payload == true %}{{arg.name}}{% elsif arg.lastArg %}{{arg.name}}{% endif %} + {% endeach %}); + {% endif %} + baton->SetCallbackError(result); + baton->result = {{ field.return.error }}; + } + baton->Done(); + {% endif %} + } + {% endif %} + {% endif %} +{% endeach %} diff --git a/generate/templates/partials/convert_from_v8.cc b/generate/templates/partials/convert_from_v8.cc index aef5b6a187..f33eddd0f6 100644 --- a/generate/templates/partials/convert_from_v8.cc +++ b/generate/templates/partials/convert_from_v8.cc @@ -1,57 +1,99 @@ {%if not isPayload %} // start convert_from_v8 block + {%if cType|isPointer %} + {{ cType }} from_{{ name }} = NULL; + {%elsif cType|isDoublePointer %} + {{ cType }} from_{{ name }} = NULL; + {%else%} {{ cType }} from_{{ name }}; + {%endif%} {%if isOptional | or isBoolean %} - {%if cppClassName != 'GitStrarray'%} - if (args[{{ jsArg }}]->Is{{ cppClassName|cppToV8 }}()) { + {%if cppClassName == 'GitStrarray'%} + {%-- Print nothing --%} + {% elsif cppClassName == 'GitBuf' %} + {%-- Print nothing --%} + {%else%} + if ((info.Length() - 1) > {{ jsArg }} && info[{{ jsArg }}]->Is{{ cppClassName|cppToV8 }}()) { + {%endif%} {%endif%} - {%endif%} {%if cppClassName == 'String'%} - String::Utf8Value {{ name }}(args[{{ jsArg }}]->ToString()); - from_{{ name }} = ({{ cType }}) strdup(*{{ name }}); + Nan::Utf8String {{ name }}(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character C-strings expect: + from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in + // the middle of strings are valid coming from nodejs): + memcpy((void *)from_{{ name }}, *{{ name }}, {{ name }}.length()); + // ensure the final byte of our new string is null, extra casts added to ensure compatibility with various C types + // used in the nodejs binding generation: + memset((void *)(((char *)from_{{ name }}) + {{ name }}.length()), 0, 1); {%elsif cppClassName == 'GitStrarray' %} - from_{{ name }} = StrArrayConverter::Convert(args[{{ jsArg }}]); + from_{{ name }} = StrArrayConverter::Convert(info[{{ jsArg }}]); + {%elsif cppClassName == 'GitBuf' %} + + from_{{ name }} = GitBufConverter::Convert(info[{{ jsArg }}]); {%elsif cppClassName == 'Wrapper'%} - String::Utf8Value {{ name }}(args[{{ jsArg }}]->ToString()); - from_{{ name }} = ({{ cType }}) strdup(*{{ name }}); + Nan::Utf8String {{ name }}(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); + // malloc with one extra byte so we can add the terminating null character C-strings expect: + from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1); + // copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in + // the middle of strings are valid coming from nodejs): + memcpy((void *)from_{{ name }}, *{{ name }}, {{ name }}.length()); + // ensure the final byte of our new string is null, extra casts added to ensure compatibility with various C types + // used in the nodejs binding generation: + memset((void *)(((char *)from_{{ name }}) + {{ name }}.length()), 0, 1); {%elsif cppClassName == 'Array'%} - Array *tmp_{{ name }} = Array::Cast(*args[{{ jsArg }}]); - from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|replace '**' '*' }})); - for (unsigned int i = 0; i < tmp_{{ name }}->Length(); i++) { + v8::Local tmp_{{ name }} = v8::Local::Cast(info[{{ jsArg }}]); + from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|unPointer }})); + for (unsigned int i = 0; i < tmp_{{ name }}->Length(); i++) { {%-- // FIXME: should recursively call convertFromv8. --%} - from_{{ name }}[i] = ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(tmp_{{ name }}->Get(NanNew(static_cast(i)))->ToObject())->GetValue(); + const v8::Local arrayVal = Nan::Get(tmp_{{ name }},i).ToLocalChecked(); + {%if arrayElementCppClassName == 'GitOid'%} + if (arrayVal->IsString()) { + // Try and parse in a string to a git_oid + Nan::Utf8String oidString(Nan::To(arrayVal).ToLocalChecked()); + + if (git_oid_fromstr(&from_{{ name }}[i], (const char *) strdup(*oidString)) != GIT_OK) { + return Nan::ThrowError(git_error_last()->message); + } } + else { + git_oid_cpy(&from_{{ name }}[i], Nan::ObjectWrap::Unwrap(Nan::To(arrayVal).ToLocalChecked())->GetValue()); + } + {%else%} + from_{{ name }}[i] = Nan::ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(Nan::To(arrayVal).ToLocalChecked())->GetValue(); + {%endif%} + } {%elsif cppClassName == 'Function'%} {%elsif cppClassName == 'Buffer'%} - from_{{ name }} = Buffer::Data(args[{{ jsArg }}]->ToObject()); + from_{{ name }} = Buffer::Data(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); {%elsif cppClassName|isV8Value %} {%if cType|isPointer %} - *from_{{ name }} = ({{ cType|unPointer }}) {{ cast }} {%if isEnum %}(int){%endif%} args[{{ jsArg }}]->To{{ cppClassName }}()->Value(); + *from_{{ name }} = ({{ cType|unPointer }}) {{ cast }} {%if isEnum %}(int){%endif%} info[{{ jsArg }}].As()->Value(); {%else%} - from_{{ name }} = ({{ cType }}) {{ cast }} {%if isEnum %}(int){%endif%} args[{{ jsArg }}]->To{{ cppClassName }}()->Value(); + from_{{ name }} = ({{ cType }}) {{ cast }} {%if isEnum %}(int){%endif%} info[{{ jsArg }}].As()->Value(); {%endif%} {%elsif cppClassName == 'GitOid'%} - if (args[{{ jsArg }}]->IsString()) { + if (info[{{ jsArg }}]->IsString()) { // Try and parse in a string to a git_oid - String::Utf8Value oidString(args[{{ jsArg }}]->ToString()); + Nan::Utf8String oidString(Nan::To(info[{{ jsArg }}]).ToLocalChecked()); git_oid *oidOut = (git_oid *)malloc(sizeof(git_oid)); if (git_oid_fromstr(oidOut, (const char *) strdup(*oidString)) != GIT_OK) { free(oidOut); - if (giterr_last()) { - return NanThrowError(giterr_last()->message); + if (git_error_last()->klass != GIT_ERROR_NONE) { + return Nan::ThrowError(git_error_last()->message); } else { - return NanThrowError("Unknown Error"); + return Nan::ThrowError("Unknown Error"); } } @@ -62,24 +104,16 @@ {%endif%} } else { - {%if cType|isDoublePointer %} - from_{{ name }} = ObjectWrap::Unwrap<{{ cppClassName }}>(args[{{ jsArg }}]->ToObject())->GetRefValue(); - {%else%} - from_{{ name }} = ObjectWrap::Unwrap<{{ cppClassName }}>(args[{{ jsArg }}]->ToObject())->GetValue(); - {%endif%} + {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(Nan::To(info[{{ jsArg }}]).ToLocalChecked())->GetValue(); } {%else%} - {%if cType|isDoublePointer %} - from_{{ name }} = ObjectWrap::Unwrap<{{ cppClassName }}>(args[{{ jsArg }}]->ToObject())->GetRefValue(); - {%else%} - from_{{ name }} = ObjectWrap::Unwrap<{{ cppClassName }}>(args[{{ jsArg }}]->ToObject())->GetValue(); - {%endif%} + {%if cType|isDoublePointer %}*{%endif%}from_{{ name }} = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(Nan::To(info[{{ jsArg }}]).ToLocalChecked())->GetValue(); {%endif%} {%if isBoolean %} } else { - from_{{ name }} = args[{{ jsArg }}]->IsTrue() ? 1 : 0; + from_{{ name }} = info[{{ jsArg }}]->IsTrue() ? 1 : 0; } {%elsif isOptional %} {%if cppClassName != 'GitStrarray'%} diff --git a/generate/templates/partials/convert_to_v8.cc b/generate/templates/partials/convert_to_v8.cc index aba2d9c976..ccba9b330f 100644 --- a/generate/templates/partials/convert_to_v8.cc +++ b/generate/templates/partials/convert_to_v8.cc @@ -2,15 +2,18 @@ {% if cppClassName == 'String' %} if ({{= parsedName =}}){ {% if size %} - to = NanNew({{= parsedName =}}, {{ size }}); + v8ConversionSlot = Nan::New({{= parsedName =}}, {{ size }}).ToLocalChecked(); {% elsif cType == 'char **' %} - to = NanNew(*{{= parsedName =}}); + v8ConversionSlot = Nan::New(*{{= parsedName =}}).ToLocalChecked(); + {% elsif cType == 'char' %} + char convertToNullTerminated[2] = { {{= parsedName =}}, '\0' }; + v8ConversionSlot = Nan::New(convertToNullTerminated).ToLocalChecked(); {% else %} - to = NanNew({{= parsedName =}}); + v8ConversionSlot = Nan::New({{= parsedName =}}).ToLocalChecked(); {% endif %} } else { - to = NanNull(); + v8ConversionSlot = Nan::Null(); } {% if freeFunctionName %} @@ -18,48 +21,119 @@ {% endif %} {% elsif cppClassName|isV8Value %} - - {% if isCppClassIntType %} - to = NanNew<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}); + {% if cType|isArrayType %} + v8::Local tmpArray = Nan::New({{ cType|toSizeOfArray }}); + for (unsigned int i = 0; i < {{ cType|toSizeOfArray }}; i++) { + v8::Local element; + {% if isCppClassIntType %} + element = Nan::New<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}[i]); + {% else %} + element = Nan::New<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}[i]); + {% endif %} + Nan::Set(tmpArray, Nan::New(i), element); + } + v8ConversionSlot = tmpArray; + {% elsif isCppClassIntType %} + v8ConversionSlot = Nan::New<{{ cppClassName }}>(({{ parsedClassName }}){{= parsedName =}}); {% else %} - to = NanNew<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}); + v8ConversionSlot = Nan::New<{{ cppClassName }}>({% if needsDereference %}*{% endif %}{{= parsedName =}}); {% endif %} {% elsif cppClassName == 'External' %} - to = NanNew((void *){{= parsedName =}}); + v8ConversionSlot = Nan::New((void *){{= parsedName =}}); {% elsif cppClassName == 'Array' %} {%-- // FIXME this is not general purpose enough. --%} {% if size %} - Local tmpArray = NanNew({{= parsedName =}}->{{ size }}); + v8::Local tmpArray = Nan::New({{= parsedName =}}->{{ size }}); for (unsigned int i = 0; i < {{= parsedName =}}->{{ size }}; i++) { - tmpArray->Set(NanNew(i), NanNew({{= parsedName =}}->{{ key }}[i])); + v8::Local element; + {% if arrayElementCppClassName %} + element = {{ arrayElementCppClassName }}::New( + {{ cType|asElementPointer parsedName }}->{{ key }}[i], + {{ selfFreeing|toBool }} + {% if hasOwner %} + , owners + {% endif %} + ); + {% else %} + element = Nan::New({{= parsedName =}}->{{ key }}[i]).ToLocalChecked(); + {% endif %} + Nan::Set(tmpArray, Nan::New(i), element); } {% else %} - Local tmpArray = NanNew({{= parsedName =}}); + v8::Local tmpArray = Nan::New({{= parsedName =}}); {% endif %} - to = tmpArray; + v8ConversionSlot = tmpArray; +{% elsif cppClassName == 'GitBuf' %} + {% if doNotConvert %} + v8ConversionSlot = Nan::Null(); + {% else %} + if ({{= parsedName =}}) { + v8ConversionSlot = Nan::New({{= parsedName =}}->ptr, {{= parsedName = }}->size).ToLocalChecked(); + } + else { + v8ConversionSlot = Nan::Null(); + } + {% endif %} {% else %} - {% if copy %} - if ({{= parsedName =}} != NULL) { - {{= parsedName =}} = ({{ cType|replace '**' '*' }} {% if not cType|isPointer %}*{% endif %}){{ copy }}({{= parsedName =}}); - } + {% if cType|isArrayType %} + v8::Local tmpArray = Nan::New({{ cType|toSizeOfArray }}); + for (unsigned int i = 0; i < {{ cType|toSizeOfArray }}; i++) { {% endif %} - - if ({{= parsedName =}} != NULL) { - // {{= cppClassName }} {{= parsedName }} + if ({{ cType|asElementPointer parsedName }} != NULL) { + {% if hasOwner %} + v8::Local owners = Nan::New(0); + {% if ownedBy %} + {% if isAsync %} + {% each ownedBy as owner %} + {%-- If the owner of this object is "this" in an async method, it will be stored in the persistent handle by name. --%} + Nan::Set(owners, Nan::New(owners->Length()), Nan::To(this->GetFromPersistent("{{= owner =}}")).ToLocalChecked()); + {% endeach %} + {% else %} + {% each ownedByIndices as ownedByIndex %} + Nan::Set(owners, Nan::New(owners->Length()), Nan::To(info[{{= ownedByIndex =}}]).ToLocalChecked()); + {% endeach %} + {% endif %} + {% endif %} + {%if isAsync %} + {% elsif ownedByThis %} + {%-- If the owner of this object is "this", it will be retrievable from the info object in a sync method. --%} + Nan::Set(owners, owners->Length(), info.This()); + {% endif %} + {% if ownerFn | toBool %} + Nan::Set( + owners, + Nan::New(owners->Length()), + Nan::To({{= ownerFn.singletonCppClassName =}}::New( + {{= ownerFn.name =}}({{ cType|asElementPointer parsedName }}), + true + )).ToLocalChecked() + ); + {% endif %} + {% endif %} {% if cppClassName == 'Wrapper' %} - to = {{ cppClassName }}::New((void *){{= parsedName =}}); + v8ConversionSlot = {{ cppClassName }}::New({{ cType|asElementPointer parsedName }}); {% else %} - to = {{ cppClassName }}::New((void *){{= parsedName =}}, false); + v8ConversionSlot = {{ cppClassName }}::New( + {{ cType|asElementPointer parsedName }}, + {{ selfFreeing|toBool }} + {% if hasOwner %} + , owners + {% endif %} + ); {% endif %} } else { - to = NanNull(); + v8ConversionSlot = Nan::Null(); } - + {% if cType|isArrayType %} + Nan::Set(tmpArray, Nan::New(i), v8ConversionSlot); + } + v8ConversionSlot = tmpArray; + {% endif %} {% endif %} // end convert_to_v8 block diff --git a/generate/templates/partials/field_accessors.cc b/generate/templates/partials/field_accessors.cc index 03131d6ba6..bcd5e5f870 100644 --- a/generate/templates/partials/field_accessors.cc +++ b/generate/templates/partials/field_accessors.cc @@ -1,71 +1,63 @@ {% each fields|fieldsInfo as field %} {% if not field.ignore %} NAN_GETTER({{ cppClassName }}::Get{{ field.cppFunctionName }}) { - NanScope(); - {{ cppClassName }} *wrapper = ObjectWrap::Unwrap<{{ cppClassName }}>(args.This()); + {{ cppClassName }} *wrapper = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This()); {% if field.isEnum %} - NanReturnValue(NanNew((int)wrapper->GetValue()->{{ field.name }})); + info.GetReturnValue().Set(Nan::New((int)wrapper->GetValue()->{{ field.name }})); - {% elsif field.isLibgitType | or field.payloadFor %} - NanReturnValue(wrapper->{{ field.name }}); - - {% elsif field.isCallbackFunction %} - NanReturnValue(wrapper->{{ field.name }}->GetFunction()); + {% elsif field.isLibgitType %} + info.GetReturnValue().Set(Nan::New(wrapper->{{ field.name }})); {% elsif field.cppClassName == 'String' %} if (wrapper->GetValue()->{{ field.name }}) { - NanReturnValue(NanNew(wrapper->GetValue()->{{ field.name }})); + info.GetReturnValue().Set(Nan::New(wrapper->GetValue()->{{ field.name }}).ToLocalChecked()); } else { - NanReturnUndefined(); + return; } {% elsif field.cppClassName|isV8Value %} - NanReturnValue(NanNew<{{ field.cppClassName }}>(wrapper->GetValue()->{{ field.name }})); + info.GetReturnValue().Set(Nan::New<{{ field.cppClassName }}>(wrapper->GetValue()->{{ field.name }})); {% endif %} } NAN_SETTER({{ cppClassName }}::Set{{ field.cppFunctionName }}) { - NanScope(); - - {{ cppClassName }} *wrapper = ObjectWrap::Unwrap<{{ cppClassName }}>(args.This()); + {{ cppClassName }} *wrapper = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This()); {% if field.isEnum %} if (value->IsNumber()) { - wrapper->GetValue()->{{ field.name }} = ({{ field.cType }}) value->Int32Value(); + wrapper->GetValue()->{{ field.name }} = ({{ field.cType }}) Nan::To(value).FromJust(); } {% elsif field.isLibgitType %} - Handle {{ field.name }}(value->ToObject()); - NanDisposePersistent(wrapper->{{ field.name }}); - - NanAssignPersistent(wrapper->{{ field.name }}, {{ field.name }}); - - wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}{% if field.cppClassName == 'GitStrarray' %}StrArrayConverter::Convert({{ field.name }}->ToObject()){% else %}ObjectWrap::Unwrap<{{ field.cppClassName }}>({{ field.name }}->ToObject())->GetValue(){% endif %}; - - {% elsif field.isCallbackFunction %} - if (wrapper->{{ field.name }} != NULL) { - delete wrapper->{{ field.name }}; - } - - if (value->IsFunction()) { - if (!wrapper->raw->{{ field.name }}) { - wrapper->raw->{{ field.name }} = ({{ field.cType }}){{ field.name }}_cppCallback; - } - - wrapper->{{ field.name }} = new NanCallback(value.As()); - } - - {% elsif field.payloadFor %} - NanAssignPersistent(wrapper->{{ field.name }}, value); + v8::Local {{ field.name }}(Nan::To(value).ToLocalChecked()); + + wrapper->{{ field.name }}.Reset({{ field.name }}); + + {% if field.cppClassName == 'GitStrarray' %} + wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}StrArrayConverter::Convert({{ field.name }}); + {% else %} + auto wrappedObject = Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>({{ field.name }}); + wrapper->raw->{{ field.name }} = {% if not field.cType | isPointer %}*{% endif %}wrappedObject->GetValue(); + {%-- We are assuming that users are responsible enough to not replace fields on their structs mid-operation, and would rather build out code to prevent that than be smarter here --%} + wrapper->AddReferenceCallbacks( + {{ field.index }}, + [wrappedObject]() { + wrappedObject->Reference(); + }, + [wrappedObject]() { + wrappedObject->Unreference(); + } + ); + {% endif %} {% elsif field.cppClassName == 'String' %} if (wrapper->GetValue()->{{ field.name }}) { } - String::Utf8Value str(value); + Nan::Utf8String str(value); wrapper->GetValue()->{{ field.name }} = strdup(*str); {% elsif field.isCppClassIntType %} @@ -75,194 +67,9 @@ {% else %} if (value->IsNumber()) { - wrapper->GetValue()->{{ field.name }} = ({{ field.cType }}) value->Int32Value(); + wrapper->GetValue()->{{ field.name }} = ({{ field.cType }}) Nan::To(value).FromJust(); } {% endif %} } - - {% if field.isCallbackFunction %} - {{ field.return.type }} {{ cppClassName }}::{{ field.name }}_cppCallback ( - {% each field.args|argsInfo as arg %} - {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %} - {% endeach %} - ) { - {{ field.name|titleCase }}Baton* baton = new {{ field.name|titleCase }}Baton(); - - {% each field.args|argsInfo as arg %} - baton->{{ arg.name }} = {{ arg.name }}; - {% endeach %} - - baton->result = 0; - baton->req.data = baton; - baton->done = false; - - uv_async_init(uv_default_loop(), &baton->req, (uv_async_cb) {{ field.name }}_async); - uv_async_send(&baton->req); - - while(!baton->done) { - this_thread::sleep_for(chrono::milliseconds(1)); - } - - {% each field|returnsInfo false true as _return %} - {% if _return.isOutParam %} - *{{ _return.name }} = *baton->{{ _return.name }}; - {% endif %} - {% endeach %} - - return baton->result; - } - - void {{ cppClassName }}::{{ field.name }}_async(uv_async_t* req, int status) { - NanScope(); - - {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(req->data); - {{ cppClassName }}* instance = static_cast<{{ cppClassName }}*>(baton->payload); - - if (instance->{{ field.name }}->IsEmpty()) { - {% if field.return.type == "int" %} - baton->result = {{ field.return.noResults }}; // no results acquired - {% endif %} - - baton->done = true; - return; - } - - {% each field.args|argsInfo as arg %} - {% if arg.name == "payload" %} - {%-- Do nothing --%} - {% elsif arg.isJsArg %} - if (baton->{{ arg.name }} == NULL) { - {% if arg.cType == "const char *" %} - baton->{{ arg.name }} = ""; - {% elsif arg.cType == "unsigned int" %} - baton->{{ arg.name }} = 0; - {% endif %} - } - {% endif %} - {% endeach %} - - Local argv[{{ field.args|jsArgsCount }}] = { - {% each field.args|argsInfo as arg %} - {% if arg.name == "payload" %} - {%-- payload is always the last arg --%} - NanNew(instance->{{ fields|payloadFor field.name }}) - {% elsif arg.isJsArg %} - {% if arg.isEnum %} - NanNew((int)baton->{{ arg.name }}), - {% elsif arg.isLibgitType %} - NanNew({{ arg.cppClassName }}::New((void *)baton->{{ arg.name }}, false)), - {% elsif arg.cType == "size_t" %} - // HACK: NAN should really have an overload for NanNew to support size_t - NanNew((unsigned int)baton->{{ arg.name }}), - {% else %} - NanNew(baton->{{ arg.name }}), - {% endif %} - {% endif %} - {% endeach %} - }; - - TryCatch tryCatch; - Handle result = instance->{{ field.name }}->Call({{ field.args|jsArgsCount }}, argv); - - if (result->IsObject() && result->ToObject()->Has(NanNew("then"))) { - Handle thenProp = result->ToObject()->Get(NanNew("then")); - - if (thenProp->IsFunction()) { - // we can be reasonbly certain that the result is a promise - Local promise = result->ToObject(); - - NanAssignPersistent(baton->promise, promise); - - uv_close((uv_handle_t*) &baton->req, NULL); - uv_async_init(uv_default_loop(), &baton->req, (uv_async_cb) {{ field.name }}_asyncPromisePolling); - uv_async_send(&baton->req); - return; - } - } - - {% each field|returnsInfo false true as _return %} - if (result.IsEmpty() || result->IsNativeError()) { - baton->result = {{ field.return.error }}; - } - else if (!result->IsNull() && !result->IsUndefined()) { - {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); - wrapper->selfFreeing = false; - - baton->{{ _return.name }} = wrapper->GetRefValue(); - baton->result = {{ field.return.success }}; - {% else %} - if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); - } - else { - baton->result = {{ field.return.noResults }}; - } - {% endif %} - } - else { - baton->result = {{ field.return.noResults }}; - } - {% endeach %} - baton->done = true; - uv_close((uv_handle_t*) &baton->req, NULL); - } - - void {{ cppClassName }}::{{ field.name }}_asyncPromisePolling(uv_async_t* req, int status) { - NanScope(); - - {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(req->data); - Local promise = NanNew(baton->promise); - NanCallback* isPendingFn = new NanCallback(promise->Get(NanNew("isPending")).As()); - Local argv[1]; // MSBUILD won't assign an array of length 0 - Local isPending = isPendingFn->Call(promise, 0, argv)->ToBoolean(); - - if (isPending->Value()) { - uv_async_send(&baton->req); - return; - } - - NanCallback* isFulfilledFn = new NanCallback(promise->Get(NanNew("isFulfilled")).As()); - Local isFulfilled = isFulfilledFn->Call(promise, 0, argv)->ToBoolean(); - - if (isFulfilled->Value()) { - NanCallback* resultFn = new NanCallback(promise->Get(NanNew("value")).As()); - Handle result = resultFn->Call(promise, 0, argv); - - {% each field|returnsInfo false true as _return %} - if (result.IsEmpty() || result->IsNativeError()) { - baton->result = {{ field.return.error }}; - } - else if (!result->IsNull() && !result->IsUndefined()) { - {% if _return.isOutParam %} - {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject()); - wrapper->selfFreeing = false; - - baton->{{ _return.name }} = wrapper->GetRefValue(); - baton->result = {{ field.return.success }}; - {% else %} - if (result->IsNumber()) { - baton->result = (int)result->ToNumber()->Value(); - } - else{ - baton->result = {{ field.return.noResults }}; - } - {% endif %} - } - else { - baton->result = {{ field.return.noResults }}; - } - {% endeach %} - baton->done = true; - } - else { - // promise was rejected - baton->result = {{ field.return.error }}; - baton->done = false; - } - - uv_close((uv_handle_t*) &baton->req, NULL); - } - {% endif %} {% endif %} {% endeach %} diff --git a/generate/templates/partials/fields.cc b/generate/templates/partials/fields.cc index 56dc04eff9..d9478549e5 100644 --- a/generate/templates/partials/fields.cc +++ b/generate/templates/partials/fields.cc @@ -1,29 +1,32 @@ {% each fields|fieldsInfo as field %} {% if not field.ignore %} + // start field block NAN_METHOD({{ cppClassName }}::{{ field.cppFunctionName }}) { - NanScope(); - Handle to; + v8::Local v8ConversionSlot; {% if field | isFixedLengthString %} - char* {{ field.name }} = (char *)ObjectWrap::Unwrap<{{ cppClassName }}>(args.This())->GetValue()->{{ field.name }}; + char* {{ field.name }} = (char *)Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue()->{{ field.name }}; {% else %} - {{ field.cType }} - {% if not field.cppClassName|isV8Value %} - {% if not field.cType|isPointer %} - * + {% if field.cType|isArrayType %} + {{ field.cType|arrayTypeToPlainType }} *{{ field.name }} = + {% else %} + {{ field.cType }} + {% if not field.cppClassName|isV8Value %} + {% if not field.cType|isPointer %}*{% endif %} {% endif %} - {% endif %} - {{ field.name }} = - {% if not field.cppClassName|isV8Value %} - {% if not field.cType|isPointer %} - & + {{ field.name }} = + {% if not field.cppClassName|isV8Value %} + {% if field.cType|isArrayType %}{% elsif not field.cType|isPointer %} + & + {% endif %} {% endif %} {% endif %} - ObjectWrap::Unwrap<{{ cppClassName }}>(args.This())->GetValue()->{{ field.name }}; + Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue()->{{ field.name }}; {% endif %} {% partial convertToV8 field %} - NanReturnValue(to); + info.GetReturnValue().Set(v8ConversionSlot); } + // end field block {% endif %} {% endeach %} diff --git a/generate/templates/partials/guard_arguments.cc b/generate/templates/partials/guard_arguments.cc index 9d3b21f0cb..bcfc332841 100644 --- a/generate/templates/partials/guard_arguments.cc +++ b/generate/templates/partials/guard_arguments.cc @@ -4,21 +4,21 @@ {%if not arg.isOptional%} {%if not arg.payloadFor %} {%if arg | isOid %} - if (args.Length() == {{arg.jsArg}} - || (!args[{{arg.jsArg}}]->IsObject() && !args[{{arg.jsArg}}]->IsString())) { - return NanThrowError("{{arg.jsClassName}} {{arg.name}} is required."); + if (info.Length() == {{arg.jsArg}} + || (!info[{{arg.jsArg}}]->IsObject() && !info[{{arg.jsArg}}]->IsString())) { + return Nan::ThrowError("{{arg.jsClassName}} {{arg.name}} is required."); } {%elsif arg.isCallbackFunction %} - if (args.Length() == {{arg.jsArg}} || !args[{{arg.jsArg}}]->IsFunction()) { - return NanThrowError("{{arg.jsClassName}} {{arg.name}} is required."); + if (info.Length() == {{arg.jsArg}} || !info[{{arg.jsArg}}]->IsFunction()) { + return Nan::ThrowError("{{arg.jsClassName}} {{arg.name}} is required."); } {%elsif arg.cppClassName == "GitStrarray" %} - if (args.Length() == {{arg.jsArg}} || !args[{{arg.jsArg}}]->BooleanValue()) { - return NanThrowError("Array, String Object, or string {{arg.name}} is required."); + if (info.Length() == {{arg.jsArg}} || !(Nan::To(info[{{arg.jsArg}}]).FromJust())) { + return Nan::ThrowError("Array, String Object, or string {{arg.name}} is required."); } {%else%} - if (args.Length() == {{arg.jsArg}} || !args[{{arg.jsArg}}]->Is{{arg.cppClassName|cppToV8}}()) { - return NanThrowError("{{arg.jsClassName}} {{arg.name}} is required."); + if (info.Length() == {{arg.jsArg}} || !info[{{arg.jsArg}}]->Is{{arg.cppClassName|cppToV8}}()) { + return Nan::ThrowError("{{arg.jsClassName}} {{arg.name}} is required."); } {%endif%} diff --git a/generate/templates/partials/sync_function.cc b/generate/templates/partials/sync_function.cc index cf9ab11f27..cf6febe67a 100644 --- a/generate/templates/partials/sync_function.cc +++ b/generate/templates/partials/sync_function.cc @@ -1,14 +1,14 @@ {%partial doc .%} NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { - NanEscapableScope(); + Nan::EscapableHandleScope scope; {%partial guardArguments .%} {%each .|returnsInfo 'true' as _return %} {%if _return.shouldAlloc %} - {{ _return.cType }}{{ _return.name }} = ({{ _return.cType }})malloc(sizeof({{ _return.cType|unPointer }})); + {{ _return.cType }}{{ _return.name }} = ({{ _return.cType }})malloc(sizeof({{ _return.cType|unPointer }})); {%else%} - {{ _return.cType|unPointer }} {{ _return.name }} = {{ _return.cType|unPointer|defaultValue }}; + {{ _return.cType|unPointer }} {{ _return.name }} = {{ _return.cType|unPointer|defaultValue }}; {%endif%} {%endeach%} @@ -17,100 +17,115 @@ NAN_METHOD({{ cppClassName }}::{{ cppFunctionName }}) { {%if not arg.isReturn %} {%partial convertFromV8 arg %} {%if arg.saveArg %} - Handle {{ arg.name }}(args[{{ arg.jsArg }}]->ToObject()); - {{ cppClassName }} *thisObj = ObjectWrap::Unwrap<{{ cppClassName }}>(args.This()); + v8::Local {{ arg.name }}(Nan::To(info[{{ arg.jsArg }}]).ToLocalChecked()); + {{ cppClassName }} *thisObj = Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This()); - NanDisposePersistent(thisObj->{{ cppFunctionName }}_{{ arg.name }}); - - NanAssignPersistent(thisObj->{{ cppFunctionName }}_{{ arg.name }}, {{ arg.name }}); + thisObj->{{ cppFunctionName }}_{{ arg.name }}.Reset({{ arg.name }}); {%endif%} {%endif%} {%endif%} {%endeach%} -{%each args|argsInfo as arg %} -{%endeach%} + {%-- Inside a free call, if the value is already free'd don't do it again.--%} + {%if cppFunctionName == "Free" %} + if (Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->GetValue() != NULL) { + {%endif%} -{%-- Inside a free call, if the value is already free'd don't do it again.--%} -{% if cppFunctionName == "Free" %} -if (ObjectWrap::Unwrap<{{ cppClassName }}>(args.This())->GetValue() != NULL) { -{% endif %} + git_error_clear(); -{%if .|hasReturnValue %} - {{ return.cType }} result = {%endif%}{{ cFunctionName }}( - {%each args|argsInfo as arg %} - {%if arg.isReturn %} - {%if not arg.shouldAlloc %}&{%endif%} - {%endif%} - {%if arg.isSelf %} -ObjectWrap::Unwrap<{{ arg.cppClassName }}>(args.This())->GetValue() - {%elsif arg.isReturn %} -{{ arg.name }} - {%else%} -from_{{ arg.name }} - {%endif%} - {%if not arg.lastArg %},{%endif%} - {%endeach%} - ); + { // lock master scope start + nodegit::LockMaster lockMaster( + /*asyncAction: */false + {%each args|argsInfo as arg %} + {%if arg.cType|isPointer%} + {%if not arg.isReturn%} + , + {%if arg.isSelf %} + Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue() + {%else%} + from_{{ arg.name }} + {%endif%} + {%endif%} + {%endif%} + {%endeach%} + ); -{%if .|hasReturnValue |and return.isErrorCode %} - if (result != GIT_OK) { - {%each args|argsInfo as arg %} - {%if arg.shouldAlloc %} - free({{ arg.name }}); - {%elsif arg | isOid %} - if (args[{{ arg.jsArg }}]->IsString()) { - free({{ arg.name }}); - } - {%endif%} - {%endeach%} + {%if .|hasReturnType %} {{ return.cType }} result = {%endif%} + {{ cFunctionName }}( + {%each args|argsInfo as arg %} + {%if arg.isReturn %} + {%if not arg.shouldAlloc %}&{%endif%} + {%endif%} + {%if arg.isSelf %} + Nan::ObjectWrap::Unwrap<{{ arg.cppClassName }}>(info.This())->GetValue() + {%elsif arg.isReturn %} + {{ arg.name }} + {%else%} + from_{{ arg.name }} + {%endif%} + {%if not arg.lastArg %},{%endif%} + {%endeach%} + ); - if (giterr_last()) { - return NanThrowError(giterr_last()->message); - } else { - return NanThrowError("Unknown Error"); - } - } -{%endif%} + {%if .|hasReturnType |and return.isErrorCode %} + if (result != GIT_OK) { + {%each args|argsInfo as arg %} + {%if arg | isOid %} + if (info[{{ arg.jsArg }}]->IsString()) { + free((void *)from_{{ arg.name }}); + } + {%elsif arg.shouldAlloc %} + free({{ arg.name }}); + {%endif%} + {%endeach%} -{% if cppFunctionName == "Free" %} - ObjectWrap::Unwrap<{{ cppClassName }}>(args.This())->ClearValue(); -} -{% endif %} + if (git_error_last()->klass != GIT_ERROR_NONE) { + return Nan::ThrowError(git_error_last()->message); + } else { + return Nan::ThrowError("Unknown Error"); + } + } // lock master scope end + {%endif%} + {%if cppFunctionName == "Free" %} + Nan::ObjectWrap::Unwrap<{{ cppClassName }}>(info.This())->ClearValue(); + } // lock master scope end + {%endif%} -{%each args|argsInfo as arg %} - {%if arg | isOid %} - if (args[{{ arg.jsArg }}]->IsString()) { - free((void *)from_{{ arg.name }}); - } - {%endif%} -{%endeach%} -{%if not .|returnsCount %} - NanReturnUndefined(); -{%else%} - {%if return.cType | isPointer %} - // null checks on pointers - if (!result) { - NodeGitPsueodoNanReturnEscapingValue(NanUndefined()); - } - {%endif%} + {%each args|argsInfo as arg %} + {%if arg | isOid %} + if (info[{{ arg.jsArg }}]->IsString()) { + free((void *)from_{{ arg.name }}); + } + {%endif%} + {%endeach%} - Handle to; - {%if .|returnsCount > 1 %} - Handle toReturn = NanNew(); - {%endif%} - {%each .|returnsInfo as _return %} - {%partial convertToV8 _return %} - {%if .|returnsCount > 1 %} - toReturn->Set(NanNew("{{ _return.returnNameOrName }}"), to); + {%if not .|returnsCount %} + return info.GetReturnValue().Set(scope.Escape(Nan::Undefined())); + {%else%} + {%if return.cType | isPointer %} + // null checks on pointers + if (!result) { + return info.GetReturnValue().Set(scope.Escape(Nan::Undefined())); + } + {%endif%} + + v8::Local v8ConversionSlot; + {%if .|returnsCount > 1 %} + v8::Local toReturn = Nan::New(); + {%endif%} + {%each .|returnsInfo as _return %} + {%partial convertToV8 _return %} + {%if .|returnsCount > 1 %} + Nan::Set(toReturn, Nan::New("{{ _return.returnNameOrName }}").ToLocalChecked(), v8ConversionSlot); + {%endif%} + {%endeach%} + {%if .|returnsCount == 1 %} + return info.GetReturnValue().Set(scope.Escape(v8ConversionSlot)); + {%else%} + return info.GetReturnValue().Set(scope.Escape(toReturn)); + {%endif%} {%endif%} - {%endeach%} - {%if .|returnsCount == 1 %} - NodeGitPsueodoNanReturnEscapingValue(to); - {%else%} - NodeGitPsueodoNanReturnEscapingValue(toReturn); - {%endif%} -{%endif%} + } } diff --git a/generate/templates/partials/traits.h b/generate/templates/partials/traits.h new file mode 100644 index 0000000000..9f1f2eed76 --- /dev/null +++ b/generate/templates/partials/traits.h @@ -0,0 +1,42 @@ +class {{ cppClassName }}; +{% if type == 'struct' %} +class Configurable{{ cppClassName }}; +{% endif %} + +struct {{ cppClassName }}Traits { + typedef {{ cppClassName }} cppClass; + typedef {{ cType }} cType; + {% if type == 'struct' %} + typedef Configurable{{ cppClassName }} configurableCppClass; + {% endif %} + + static const bool isDuplicable = {{ dupFunction|toBool |or cpyFunction|toBool}}; + static void duplicate({{ cType }} **dest, {{ cType }} *src) { + {% if dupFunction %} + {{ dupFunction }}(dest, src); + {% elsif cpyFunction %} + {{ cType }} *copy = ({{ cType }} *)malloc(sizeof({{ cType }})); + {{ cpyFunction }}(copy, src); + *dest = copy; + {% else %} + Nan::ThrowError("duplicate called on {{ cppClassName }} which cannot be duplicated"); + {% endif %} + } + + static std::string className() { return "{{ cppClassName }}"; }; + static const bool isSingleton = {{ isSingleton | toBool }}; + static const bool isFreeable = {{ freeFunctionName | toBool}}; + static void free({{ cType }} *raw) { + {% if freeFunctionName %} + unsigned long referenceCount = 0; + {% if isSingleton %} + referenceCount = ReferenceCounter::decrementCountForPointer((void *)raw); + {% endif %} + if (referenceCount == 0) { + ::{{ freeFunctionName }}(raw); // :: to avoid calling this free recursively + } + {% else %} + Nan::ThrowError("free called on {{ cppClassName }} which cannot be freed"); + {% endif %} + } +}; diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index ed13a69f8a..4476c9236d 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -1,23 +1,51 @@ -# // This is a generated file, modify: generate/templates/binding.gyp. - { + "variables": { + "variables": { + "target%": "none", + }, + "is_electron%": " #include -#include -#include extern "C" { #include @@ -11,9 +8,11 @@ extern "C" { {% endeach %} } +#include "../include/nodegit.h" +#include "../include/lock_master.h" #include "../include/functions/copy.h" -#include "../include/macros.h" #include "../include/{{ filename }}.h" +#include "nodegit_wrapper.cc" {% each dependencies as dependency %} #include "{{ dependency }}" @@ -26,19 +25,7 @@ using namespace v8; using namespace node; {% if cType %} - {{ cppClassName }}::{{ cppClassName }}({{ cType }} *raw, bool selfFreeing) { - this->raw = raw; - this->selfFreeing = selfFreeing; - } - {{ cppClassName }}::~{{ cppClassName }}() { - {% if freeFunctionName %} - if (this->selfFreeing) { - {{ freeFunctionName }}(this->raw); - this->raw = NULL; - } - {% endif %} - // this will cause an error if you have a non-self-freeing object that also needs // to save values. Since the object that will eventually free the object has no // way of knowing to free these values. @@ -47,100 +34,82 @@ using namespace node; {% each function.args as arg %} {% if arg.saveArg %} - NanDisposePersistent({{ function.cppFunctionName }}_{{ arg.name }}); + {{ function.cppFunctionName }}_{{ arg.name }}).Reset(); {% endif %} {% endeach %} {% endif %} {% endeach %} - } - void {{ cppClassName }}::InitializeComponent(Handle target) { - NanScope(); + void {{ cppClassName }}::InitializeComponent(v8::Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; - Local tpl = NanNew(JSNewFunction); + v8::Local nodegitExternal = Nan::New(nodegitContext); + v8::Local tpl = Nan::New(JSNewFunction, nodegitExternal); - tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->SetClassName(NanNew("{{ jsClassName }}")); + tpl->InstanceTemplate()->SetInternalFieldCount(2); + tpl->SetClassName(Nan::New("{{ jsClassName }}").ToLocalChecked()); {% each functions as function %} {% if not function.ignore %} {% if function.isPrototypeMethod %} - NODE_SET_PROTOTYPE_METHOD(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}); + Nan::SetPrototypeMethod(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}, nodegitExternal); {% else %} - NODE_SET_METHOD(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}); + Nan::SetMethod(tpl, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}, nodegitExternal); {% endif %} {% endif %} {% endeach %} {% each fields as field %} {% if not field.ignore %} - NODE_SET_PROTOTYPE_METHOD(tpl, "{{ field.jsFunctionName }}", {{ field.cppFunctionName }}); + Nan::SetPrototypeMethod(tpl, "{{ field.jsFunctionName }}", {{ field.cppFunctionName }}, nodegitExternal); {% endif %} {% endeach %} - Local _constructor_template = tpl->GetFunction(); - NanAssignPersistent(constructor_template, _constructor_template); - target->Set(NanNew("{{ jsClassName }}"), _constructor_template); - } - - NAN_METHOD({{ cppClassName }}::JSNewFunction) { - NanScope(); - - if (args.Length() == 0 || !args[0]->IsExternal()) { - {% if createFunctionName %} - return NanThrowError("A new {{ cppClassName }} cannot be instantiated. Use {{ jsCreateFunctionName }} instead."); - {% else %} - return NanThrowError("A new {{ cppClassName }} cannot be instantiated."); - {% endif %} - } - - {{ cppClassName }}* object = new {{ cppClassName }}(static_cast<{{ cType }} *>(Handle::Cast(args[0])->Value()), args[1]->BooleanValue()); - object->Wrap(args.This()); + InitializeTemplate(tpl); - NanReturnValue(args.This()); - } - - Handle {{ cppClassName }}::New(void *raw, bool selfFreeing) { - NanEscapableScope(); - Handle argv[2] = { NanNew((void *)raw), NanNew(selfFreeing) }; - return NanEscapeScope(NanNew({{ cppClassName }}::constructor_template)->NewInstance(2, argv)); - } - - {{ cType }} *{{ cppClassName }}::GetValue() { - return this->raw; - } - - {{ cType }} **{{ cppClassName }}::GetRefValue() { - return this->raw == NULL ? NULL : &this->raw; - } - - void {{ cppClassName }}::ClearValue() { - this->raw = NULL; + v8::Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("{{ cppClassName }}::Template", constructor_template); + Nan::Set(target, Nan::New("{{ jsClassName }}").ToLocalChecked(), constructor_template); } {% else %} - void {{ cppClassName }}::InitializeComponent(Handle target) { - NanScope(); + void {{ cppClassName }}::InitializeComponent(v8::Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + Local nodegitExternal = Nan::New(nodegitContext); - Local object = NanNew(); + {% if functions|hasFunctionOnRootProto %} + v8::Local object = Nan::New({{ functions|getCPPFunctionForRootProto }}, nodegitExternal); + {% else %} + v8::Local object = Nan::New(); + {% endif %} {% each functions as function %} {% if not function.ignore %} - NODE_SET_METHOD(object, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}); + Nan::SetMethod(object, "{{ function.jsFunctionName }}", {{ function.cppFunctionName }}, nodegitExternal); {% endif %} {% endeach %} - target->Set(NanNew("{{ jsClassName }}"), object); + Nan::Set( + target, + Nan::New("{{ jsClassName }}").ToLocalChecked(), + {% if functions|hasFunctionOnRootProto %} + Nan::GetFunction(object).ToLocalChecked() + {% else %} + object + {% endif %} + ); } {% endif %} {% each functions as function %} {% if not function.ignore %} - {% if function.isAsync %} + {% if function.isManual %} + {{= function.implementation =}} + {% elsif function.isAsync %} {% partial asyncFunction function %} {% else %} {% partial syncFunction function %} @@ -150,6 +119,8 @@ using namespace node; {% partial fields . %} -{% if not cTypeIsUndefined %} - Persistent {{ cppClassName }}::constructor_template; +{%if cType %} +// force base class template instantiation, to make sure we get all the +// methods, statics, etc. +template class NodeGitWrapper<{{ cppClassName }}Traits>; {% endif %} diff --git a/generate/templates/templates/class_header.h b/generate/templates/templates/class_header.h index d7f903f268..9112347825 100644 --- a/generate/templates/templates/class_header.h +++ b/generate/templates/templates/class_header.h @@ -1,16 +1,33 @@ #ifndef {{ cppClassName|upper }}_H #define {{ cppClassName|upper }}_H -// generated from class_header.h #include #include +#include +#include +#include +#include +#include + +#include "async_baton.h" +#include "async_worker.h" +#include "cleanup_handle.h" +#include "context.h" +#include "lock_master.h" +#include "nodegit_wrapper.h" +#include "promise_completion.h" +#include "reference_counter.h" +#include "worker_pool.h" extern "C" { #include +#include {%each cDependencies as dependency %} #include <{{ dependency }}> {%endeach%} } +#include "../include/typedefs.h" + {%each dependencies as dependency%} #include "{{ dependency }}" {%endeach%} @@ -29,20 +46,28 @@ struct {{ cType }} { using namespace node; using namespace v8; -class {{ cppClassName }} : public ObjectWrap { - public: +{%if cType %} +{%partial traits .%} +{%endif%} - static Persistent constructor_template; - static void InitializeComponent (Handle target); +class {{ cppClassName }} : public +{%if cType %} + NodeGitWrapper<{{ cppClassName }}Traits> +{%else%} + Nan::ObjectWrap +{%endif%} +{ + {%if cType %} + // grant full access to base class + friend class NodeGitWrapper<{{ cppClassName }}Traits>; + {%endif %} + public: + {{ cppClassName }}(const {{ cppClassName }} &) = delete; + {{ cppClassName }}({{ cppClassName }} &&) = delete; + {{ cppClassName }} &operator=(const {{ cppClassName }} &) = delete; + {{ cppClassName }} &operator=({{ cppClassName }} &&) = delete; - {%if cType%} - {{ cType }} *GetValue(); - {{ cType }} **GetRefValue(); - void ClearValue(); - - static Handle New(void *raw, bool selfFreeing); - {%endif%} - bool selfFreeing; + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); {% each functions as function %} {% if not function.ignore %} @@ -57,17 +82,19 @@ class {{ cppClassName }} : public ObjectWrap { {% endeach %} ); - static void {{ function.cppFunctionName }}_{{ arg.name }}_async(uv_async_t* req, int status); - static void {{ function.cppFunctionName }}_{{ arg.name }}_asyncPromisePolling(uv_async_t* req, int status); - struct {{ function.cppFunctionName }}_{{ arg.name|titleCase }}Baton { + static void {{ function.cppFunctionName }}_{{ arg.name }}_cancelAsync(void *baton); + static void {{ function.cppFunctionName }}_{{ arg.name }}_async(void *baton); + static void {{ function.cppFunctionName }}_{{ arg.name }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result); + class {{ function.cppFunctionName }}_{{ arg.name|titleCase }}Baton : public nodegit::AsyncBatonWithResult<{{ arg.return.type }}> { + public: {% each arg.args|argsInfo as cbArg %} {{ cbArg.cType }} {{ cbArg.name }}; {% endeach %} - uv_async_t req; - {{ arg.return.type }} result; - Persistent promise; - bool done; + + {{ function.cppFunctionName }}_{{ arg.name|titleCase }}Baton(const {{ arg.return.type }} &defaultResult) + : nodegit::AsyncBatonWithResult<{{ arg.return.type }}>(defaultResult) { + } }; {% endif %} {% endeach %} @@ -76,25 +103,22 @@ class {{ cppClassName }} : public ObjectWrap { private: - - {%if cType%} - {{ cppClassName }}({{ cType }} *raw, bool selfFreeing); + {{ cppClassName }}() + : NodeGitWrapper<{{ cppClassName }}Traits>( + {% if createFunctionName %} + "A new {{ cppClassName }} cannot be instantiated. Use {{ jsCreateFunctionName }} instead." + {% else %} + "A new {{ cppClassName }} cannot be instantiated." + {% endif %} + ) + {} + {{ cppClassName }}({{ cType }} *raw, bool selfFreeing, v8::Local owner = v8::Local()) + : NodeGitWrapper<{{ cppClassName }}Traits>(raw, selfFreeing, owner) + {} ~{{ cppClassName }}(); {%endif%} - {% each functions as function %} - {% if not function.ignore %} - {% each function.args as arg %} - {% if arg.saveArg %} - Persistent {{ function.cppFunctionName }}_{{ arg.name }}; - {% endif %} - {% endeach %} - {% endif %} - {% endeach %} - - static NAN_METHOD(JSNewFunction); - {%each fields as field%} {%if not field.ignore%} static NAN_METHOD({{ field.cppFunctionName }}); @@ -102,33 +126,45 @@ class {{ cppClassName }} : public ObjectWrap { {%endeach%} {%each functions as function%} - {%if not function.ignore%} - {%if function.isAsync%} + {%if not function.ignore %} + {%if function.isAsync %} struct {{ function.cppFunctionName }}Baton { int error_code; const git_error* error; {%each function.args as arg%} {%if arg.isReturn%} - {{ arg.cType|replace "**" "*" }} {{ arg.name }}; + {{= arg.cType|replace "**" "*" =}} {{ arg.name }}; {%else%} - {{ arg.cType }} {{ arg.name }}; + {{= arg.cType =}} {{ arg.name }}; {%if arg | isOid %} bool {{ arg.name }}NeedsFree; {%endif%} {%endif%} {%endeach%} + {% if function.return.isResultOrError %} + {% elsif function.return.isErrorCode %} + {% elsif function.return.cType != 'void' %} + {{ function.return.cType }} result; + {% endif %} }; - class {{ function.cppFunctionName }}Worker : public NanAsyncWorker { + class {{ function.cppFunctionName }}Worker : public nodegit::AsyncWorker { public: {{ function.cppFunctionName }}Worker( {{ function.cppFunctionName }}Baton *_baton, - NanCallback *callback - ) : NanAsyncWorker(callback) + Nan::Callback *callback, + std::map> &cleanupHandles + ) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:{{ cppClassName }}:{{ function.cppFunctionName }}", cleanupHandles) , baton(_baton) {}; + {{ function.cppFunctionName }}Worker(const {{ function.cppFunctionName }}Worker &) = delete; + {{ function.cppFunctionName }}Worker({{ function.cppFunctionName }}Worker &&) = delete; + {{ function.cppFunctionName }}Worker &operator=(const {{ function.cppFunctionName }}Worker &) = delete; + {{ function.cppFunctionName }}Worker &operator=({{ function.cppFunctionName }}Worker &&) = delete; ~{{ function.cppFunctionName }}Worker() {}; void Execute(); + void HandleErrorCallback(); void HandleOKCallback(); + nodegit::LockMaster AcquireLocks(); private: {{ function.cppFunctionName }}Baton *baton; @@ -146,7 +182,7 @@ class {{ cppClassName }} : public ObjectWrap { struct {{ function.cppFunctionName }}_globalPayload { {%each function.args as arg %} {%if arg.isCallbackFunction %} - NanCallback * {{ arg.name }}; + Nan::Callback * {{ arg.name }}; {%endif%} {%endeach%} @@ -158,6 +194,11 @@ class {{ cppClassName }} : public ObjectWrap { {%endeach%} } + {{ function.cppFunctionName }}_globalPayload(const {{ function.cppFunctionName }}_globalPayload &) = delete; + {{ function.cppFunctionName }}_globalPayload({{ function.cppFunctionName }}_globalPayload &&) = delete; + {{ function.cppFunctionName }}_globalPayload &operator=(const {{ function.cppFunctionName }}_globalPayload &) = delete; + {{ function.cppFunctionName }}_globalPayload &operator=({{ function.cppFunctionName }}_globalPayload &&) = delete; + ~{{ function.cppFunctionName }}_globalPayload() { {%each function.args as arg %} {%if arg.isCallbackFunction %} @@ -171,10 +212,6 @@ class {{ cppClassName }} : public ObjectWrap { {%endif%} {%endeach%} {%endeach%} - - {%if cType%} - {{ cType }} *raw; - {%endif%} }; #endif diff --git a/generate/templates/templates/nodegit.cc b/generate/templates/templates/nodegit.cc index 9bd2dd89b3..e43f8b2ae5 100644 --- a/generate/templates/templates/nodegit.cc +++ b/generate/templates/templates/nodegit.cc @@ -1,25 +1,128 @@ -// This is a generated file, modify: generate/templates/nodegit.cc. -#include #include +#include + #include +#include +#include +#include +#include +#include +#include "../include/init_ssh2.h" +#include "../include/lock_master.h" +#include "../include/nodegit.h" +#include "../include/context.h" #include "../include/wrapper.h" +#include "../include/promise_completion.h" #include "../include/functions/copy.h" {% each %} {% if type != "enum" %} #include "../include/{{ filename }}.h" {% endif %} {% endeach %} +#include "../include/convenient_patch.h" +#include "../include/convenient_hunk.h" +#include "../include/filter_registry.h" + +using namespace v8; + +Local GetPrivate(Local object, Local key) { + Local value; + Nan::Maybe result = Nan::HasPrivate(object, key); + if (!(result.IsJust() && result.FromJust())) + return Local(); + if (Nan::GetPrivate(object, key).ToLocal(&value)) + return value; + return Local(); +} + +void SetPrivate(Local object, Local key, Local value) { + if (value.IsEmpty()) + return; + Nan::SetPrivate(object, key, value); +} + +static uv_mutex_t *opensslMutexes; + +void OpenSSL_LockingCallback(int mode, int type, const char *, int) { + if (mode & CRYPTO_LOCK) { + uv_mutex_lock(&opensslMutexes[type]); + } else { + uv_mutex_unlock(&opensslMutexes[type]); + } +} + +void OpenSSL_IDCallback(CRYPTO_THREADID *id) { + CRYPTO_THREADID_set_numeric(id, (unsigned long)uv_thread_self()); +} -extern "C" void init(Handle target) { - NanScope(); +void OpenSSL_ThreadSetup() { + opensslMutexes=(uv_mutex_t *)malloc(CRYPTO_num_locks() * sizeof(uv_mutex_t)); - Wrapper::InitializeComponent(target); + for (int i=0; iTrackerListSize()); +} + +static std::once_flag libraryInitializedFlag; +static std::mutex libraryInitializationMutex; + +NAN_MODULE_INIT(init) { + { + // We only want to do initialization logic once, and we also want to prevent any thread from completely loading + // the module until initialization has occurred. + // All of this initialization logic ends up being shared. + const std::lock_guard lock(libraryInitializationMutex); + std::call_once(libraryInitializedFlag, []() { + // Initialize thread safety in openssl and libssh2 + OpenSSL_ThreadSetup(); + init_ssh2(); + // Initialize libgit2. + git_libgit2_init(); + + // Register thread pool with libgit2 + nodegit::ThreadPool::InitializeGlobal(); + }); + } + + // Exports function 'getNumberOfTrackedObjects' + Nan::Set(target + , Nan::New("getNumberOfTrackedObjects").ToLocalChecked() + , Nan::GetFunction(Nan::New(GetNumberOfTrackedObjects)).ToLocalChecked() + ); + + Nan::HandleScope scope; + Local context = Nan::GetCurrentContext(); + Isolate *isolate = context->GetIsolate(); + nodegit::Context *nodegitContext = new nodegit::Context(isolate); + + Wrapper::InitializeComponent(target, nodegitContext); + PromiseCompletion::InitializeComponent(nodegitContext); {% each %} - {% if type != "enum" %} - {{ cppClassName }}::InitializeComponent(target); + {% if type == 'class' %} + {{ cppClassName }}::InitializeComponent(target, nodegitContext); + {% elsif type == 'struct' %} + {% if isReturnable %} + {{ cppClassName }}::InitializeComponent(target, nodegitContext); + {% endif %} {% endif %} {% endeach %} + + ConvenientHunk::InitializeComponent(target, nodegitContext); + ConvenientPatch::InitializeComponent(target, nodegitContext); + GitFilterRegistry::InitializeComponent(target, nodegitContext); + + nodegit::LockMaster::InitializeContext(); } -NODE_MODULE(nodegit, init) +NAN_MODULE_WORKER_ENABLED(nodegit, init) diff --git a/generate/templates/templates/nodegit.js b/generate/templates/templates/nodegit.js index 99e2b4a0a4..43e7d9de02 100644 --- a/generate/templates/templates/nodegit.js +++ b/generate/templates/templates/nodegit.js @@ -1,11 +1,17 @@ -var Promise = require("nodegit-promise"); -var promisify = require("promisify-node"); +var _ = require("lodash"); +var util = require("util"); +var worker; + +try { + worker = require("worker_threads"); +} catch (e) {} + var rawApi; // Attempt to load the production release first, if it fails fall back to the // debug release. try { - rawApi = require("../build/Release/nodegit"); + rawApi = require("../build/Release/nodegit.node"); } catch (ex) { /* istanbul ignore next */ @@ -13,17 +19,34 @@ catch (ex) { throw ex; } - rawApi = require("../build/Debug/nodegit"); + rawApi = require("../build/Debug/nodegit.node"); } +var promisify = fn => fn && util.promisify(fn); // jshint ignore:line + +// For disccussion on why `cloneDeep` is required, see: +// https://github.com/facebook/jest/issues/3552 +// https://github.com/facebook/jest/issues/3550 +// https://github.com/nodejs/node/issues/5016 +rawApi = _.cloneDeep(rawApi); + // Native methods do not return an identifiable function, so we // have to override them here /* jshint ignore:start */ {% each . as idef %} + {% if idef.type == 'struct' %} + rawApi.{{ idef.jsClassName }} = util.deprecate(function {{ idef.jsClassName }}() { + try { + require("./deprecated/structs/{{ idef.jsClassName }}").call(this, rawApi); + } catch (error) {/* allow these to be undefined */} + }, "Instantiation of {{ idef.jsClassName }} is deprecated and will be removed in an upcoming version"); + {% endif %} {% if idef.type != "enum" %} - var _{{ idef.jsClassName }} - = rawApi.{{idef.jsClassName}}; + {% if idef.functions.length > 0 %} + var _{{ idef.jsClassName }} + = rawApi.{{ idef.jsClassName }}; + {% endif %} {% each idef.functions as fn %} {% if fn.isAsync %} @@ -49,6 +72,22 @@ catch (ex) { {% endif %} {% endeach %} + +var _ConvenientPatch = rawApi.ConvenientPatch; +var _ConvenientPatch_hunks = _ConvenientPatch.prototype.hunks; +_ConvenientPatch.prototype.hunks = promisify(_ConvenientPatch_hunks); + +var _ConvenientHunk = rawApi.ConvenientHunk; +var _ConvenientHunk_lines = _ConvenientHunk.prototype.lines; +_ConvenientHunk.prototype.lines = promisify(_ConvenientHunk_lines); + +var _FilterRegistry = rawApi.FilterRegistry; +var _FilterRegistry_register = _FilterRegistry.register; +_FilterRegistry.register = promisify(_FilterRegistry_register); + +var _FilterRegistry_unregister = _FilterRegistry.unregister; +_FilterRegistry.unregister = promisify(_FilterRegistry_unregister); + /* jshint ignore:end */ // Set the exports prototype to the raw API. @@ -68,16 +107,15 @@ var importExtension = function(name) { // Load up utils rawApi.Utils = {}; require("./utils/lookup_wrapper"); -require("./utils/normalize_options"); +require("./utils/shallow_clone"); // Load up extra types; -require("./convenient_line"); -require("./convenient_hunk"); -require("./convenient_patch"); require("./status_file"); require("./enums.js"); // Import extensions +// [Manual] extensions +importExtension("filter_registry"); {% each %} {% if type != "enum" %} importExtension("{{ filename }}"); @@ -98,7 +136,7 @@ require("./enums.js"); _{{ idef.jsClassName }}.prototype; // Assign the function as the root - rawApi.{{idef.jsClassName}} = + rawApi.{{ idef.jsClassName }} = _{{ idef.jsClassName }}.{{ fn.jsFunctionName }}; {% endif %} @@ -107,14 +145,8 @@ require("./enums.js"); {% endeach %} /* jshint ignore:end */ -// Wrap asynchronous methods to return promises. -promisify(exports); - // Set version. exports.version = require("../package").version; // Expose Promise implementation. exports.Promise = Promise; - -// Initialize libgit2. -exports.Libgit2.init(); diff --git a/generate/templates/templates/struct_content.cc b/generate/templates/templates/struct_content.cc index 4e7b862ba3..d7355d2a29 100644 --- a/generate/templates/templates/struct_content.cc +++ b/generate/templates/templates/struct_content.cc @@ -1,8 +1,11 @@ -// This is a generated file, modify: generate/templates/struct_content.cc. +// generated from struct_content.cc #include #include -#include -#include +#ifdef WIN32 +#include +#else +#include +#endif // win32 extern "C" { #include @@ -12,8 +15,11 @@ extern "C" { } #include +#include "../include/nodegit.h" +#include "../include/lock_master.h" #include "../include/functions/copy.h" #include "../include/{{ filename }}.h" +#include "nodegit_wrapper.cc" {% each dependencies as dependency %} #include "{{ dependency }}" @@ -23,130 +29,336 @@ using namespace v8; using namespace node; using namespace std; +{% if isReturnable %} + {{ cppClassName }}::{{ cppClassName }}() : NodeGitWrapper<{{ cppClassName }}Traits>(NULL, true, v8::Local()) + { + {% if ignoreInit == true %} + this->raw = new {{ cType }}; + {% else %} + {% if isExtendedStruct %} + {{ cType }}_extended wrappedValue = {{ cType|upper }}_INIT; + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }}_extended)); + memcpy(this->raw, &wrappedValue, sizeof({{ cType }}_extended)); + {% else %} + {{ cType }} wrappedValue = {{ cType|upper }}_INIT; + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }})); + memcpy(this->raw, &wrappedValue, sizeof({{ cType }})); + {% endif %} + {% endif %} -// generated from struct_content.cc -{{ cppClassName }}::{{ cppClassName }}() { - {% if ignoreInit == true %} - {{ cType }}* wrappedValue = new {{ cType }}; - {% else %} - {{ cType }} wrappedValue = {{ cType|upper }}_INIT; - {% endif %} - this->raw = ({{ cType }}*) malloc(sizeof({{ cType }})); - memcpy(this->raw, &wrappedValue, sizeof({{ cType }})); - - this->ConstructFields(); - this->selfFreeing = true; -} + this->ConstructFields(); + } -{{ cppClassName }}::{{ cppClassName }}({{ cType }}* raw, bool selfFreeing) { - this->raw = raw; - this->ConstructFields(); - this->selfFreeing = selfFreeing; -} + {{ cppClassName }}::{{ cppClassName }}({{ cType }}* raw, bool selfFreeing, v8::Local owner) + : NodeGitWrapper<{{ cppClassName }}Traits>(raw, selfFreeing, owner) + { + this->ConstructFields(); + } -{{ cppClassName }}::~{{ cppClassName }}() { - {% each fields|fieldsInfo as field %} - {% if not field.ignore %} - {% if not field.isEnum %} - {% if field.isCallbackFunction %} - if (this->{{ field.name }} != NULL) { - delete this->{{ field.name }}; - this->raw->{{ fields|payloadFor field.name }} = NULL; + {{ cppClassName }}::~{{ cppClassName }}() { + {% each fields|fieldsInfo as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isLibgitType %} + this->{{ field.name }}.Reset(); + {% endif %} + {% endif %} + {% endif %} + {% endeach %} } + + void {{ cppClassName }}::ConstructFields() { + {% each fields|fieldsInfo as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isLibgitType %} + v8::Local {{ field.name }}Temp = Nan::To({{ field.cppClassName }}::New( + {%if not field.cType|isPointer %}&{%endif%}this->raw->{{ field.name }}, + false + )).ToLocalChecked(); + this->{{ field.name }}.Reset({{ field.name }}Temp); + {% endif %} {% endif %} {% endif %} - {% endif %} - {% endeach %} + {% endeach %} + } + + void {{ cppClassName }}::InitializeComponent(Local target, nodegit::Context *nodegitContext) { + Nan::HandleScope scope; + + Local nodegitExternal = Nan::New(nodegitContext); + Local tpl = Nan::New(JSNewFunction, nodegitExternal); + + tpl->InstanceTemplate()->SetInternalFieldCount(2); + tpl->SetClassName(Nan::New("{{ jsClassName }}").ToLocalChecked()); - if (this->selfFreeing) { - free(this->raw); + {% each fields as field %} + {% if not field.ignore %} + {% if not field | isPayload %} + Nan::SetAccessor(tpl->InstanceTemplate(), Nan::New("{{ field.jsFunctionName }}").ToLocalChecked(), Get{{ field.cppFunctionName}}, Set{{ field.cppFunctionName}}, nodegitExternal); + {% endif %} + {% endif %} + {% endeach %} + + InitializeTemplate(tpl); + + v8::Local constructor_template = Nan::GetFunction(tpl).ToLocalChecked(); + nodegitContext->SaveToPersistent("{{ cppClassName }}::Template", constructor_template); } + + {% partial fieldAccessors . %} + + // force base class template instantiation, to make sure we get all the + // methods, statics, etc. + template class NodeGitWrapper<{{ cppClassName }}Traits>; + +{% endif %} + +Configurable{{ cppClassName }}::Configurable{{ cppClassName }}(nodegit::Context *nodegitContext) + : nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>(nodegitContext) +{ + {% if ignoreInit == true %} + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }})); + {% else %} + {{ cType }}{% if isExtendedStruct %}_extended{% endif %} wrappedValue = {{ cType|upper }}_INIT; + this->raw = ({{ cType }}*) malloc(sizeof({{ cType }}{% if isExtendedStruct %}_extended{% endif %})); + memcpy(this->raw, &wrappedValue, sizeof({{ cType }}{% if isExtendedStruct %}_extended{% endif %})); + {% endif %} } -void {{ cppClassName }}::ConstructFields() { +Configurable{{ cppClassName }}::~Configurable{{ cppClassName }}() { {% each fields|fieldsInfo as field %} {% if not field.ignore %} - {% if not field.isEnum %} - {% if field.hasConstructor |or field.isLibgitType %} - Local {{ field.name }}Temp = {{ field.cppClassName }}::New( - &this->raw->{{ field.name }}, - false - )->ToObject(); - NanAssignPersistent(this->{{ field.name }}, {{ field.name }}Temp); - - {% elsif field.isCallbackFunction %} - - // Set the static method call and set the payload for this function to be - // the current instance - this->raw->{{ field.name }} = NULL; - this->raw->{{ fields|payloadFor field.name }} = (void *)this; - this->{{ field.name }} = NULL; - {% elsif field.payloadFor %} - - Local {{ field.name }} = NanUndefined(); - NanAssignPersistent(this->{{ field.name }}, {{ field.name }}); - {% endif %} + {% if field.cppClassName == 'GitStrarray' %} + if (this->raw->{{ field.name }}.count) { + for (size_t i = 0; i < this->raw->{{ field.name }}.count; ++i) { + free(this->raw->{{ field.name }}.strings[i]); + } + free(this->raw->{{ field.name }}.strings); + } + {% elsif field.cppClassName == 'String' %} + free((void*)this->raw->{{ field.name }}); {% endif %} {% endif %} {% endeach %} } -void {{ cppClassName }}::InitializeComponent(Handle target) { - NanScope(); - - Local tpl = NanNew(JSNewFunction); +nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>::v8ConversionResult Configurable{{ cppClassName }}::fromJavascript(nodegit::Context *nodegitContext, v8::Local input) { + if (!input->IsObject()) { + return { + "Must pass object for Configurable{{ cppClassName }}" + }; + } - tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->SetClassName(NanNew("{{ jsClassName }}")); + Nan::HandleScope scope; + v8::Local inputObj = input.As(); + std::shared_ptr output(new Configurable{{ cppClassName }}(nodegitContext)); + // unpack the data into the correct fields {% each fields as field %} {% if not field.ignore %} - {% if not field | isPayload %} - tpl->InstanceTemplate()->SetAccessor(NanNew("{{ field.jsFunctionName }}"), Get{{ field.cppFunctionName}}, Set{{ field.cppFunctionName}}); - {% endif %} - {% endif %} - {% endeach %} + {% if field.isClassType %} + {% if field.cppClassName == 'GitOid' %} + { + v8::Local maybeOid = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeOid.IsEmpty() && !maybeOid->IsUndefined() && !maybeOid->IsNull()) { + if (maybeOid->IsString()) { + Nan::Utf8String oidString(maybeOid.As()); + if (git_oid_fromstr(&output->raw->{{ field.name }}, *oidString) != GIT_OK) { + return { + git_error_last()->message + }; + } + } else if (maybeOid->IsObject()) { + if (git_oid_cpy(&output->raw->{{ field.name }}, Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>(maybeOid.As())->GetValue()) != GIT_OK) { + return { + git_error_last()->message + }; + } + } else { + return { + "Must pass String or NodeGit.Oid to {{ field.jsFunctionName }}" + }; + } + } + } + {% elsif field.cppClassName == 'GitStrarray' %} + output->raw->{{ field.name }}.count = 0; + output->raw->{{ field.name }}.strings = nullptr; - Local _constructor_template = tpl->GetFunction(); - NanAssignPersistent(constructor_template, _constructor_template); - target->Set(NanNew("{{ jsClassName }}"), _constructor_template); -} + { + v8::Local maybeStrarray = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeStrarray.IsEmpty() && !maybeStrarray->IsUndefined() && !maybeStrarray->IsNull()) { + if (maybeStrarray->IsArray()) { + v8::Local strarrayValue = maybeStrarray.As(); + // validate the StrArray is indeed a list of strings + for (uint32_t i = 0; i < strarrayValue->Length(); ++i) { + // TODO confirm that sparse array at least boils down to undefined + v8::Local arrayValue = Nan::Get(strarrayValue, i).ToLocalChecked(); + if (!arrayValue->IsString()) { + return { + "Must pass String or Array of strings to {{ field.jsFunctionName }}" + }; + } + } -NAN_METHOD({{ cppClassName }}::JSNewFunction) { - NanScope(); - {{ cppClassName }}* instance; + StrArrayConverter::ConvertInto(&output->raw->{{ field.name }}, strarrayValue); + } else if (maybeStrarray->IsString()) { + v8::Local strarrayValue = maybeStrarray.As(); + StrArrayConverter::ConvertInto(&output->raw->{{ field.name }}, strarrayValue); + } else { + return { + "Must pass String or Array of strings to {{ field.jsFunctionName }}" + }; + } + } + } + {% else %} + { + v8::Local maybeObject = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeObject.IsEmpty() && !maybeObject->IsUndefined() && !maybeObject->IsNull()) { + if (!maybeObject->IsObject()) { + return { + "Must pass NodeGit.{{ field.jsClassName }} to {{ field.jsFunctionName }}" + }; + } - if (args.Length() == 0 || !args[0]->IsExternal()) { - instance = new {{ cppClassName }}(); - } - else { - instance = new {{ cppClassName }}(static_cast<{{ cType }}*>(Handle::Cast(args[0])->Value()), args[1]->BooleanValue()); - } + v8::Local objectValue = maybeObject.As(); + output->raw->{{ field.name }} = Nan::ObjectWrap::Unwrap<{{ field.cppClassName }}>(objectValue)->GetValue(); + output->{{ field.jsFunctionName }}.Reset(objectValue); + } + } + {% endif %} + {% elsif field.isCallbackFunction %} + { + v8::Local maybeCallback = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeCallback.IsEmpty() && !maybeCallback->IsUndefined() && !maybeCallback->IsNull()) { + if (!maybeCallback->IsFunction() && !maybeCallback->IsObject()) { + return { + "Must pass Function or CallbackSpecifier to {{ field.jsFunctionName}}" + }; + } - instance->Wrap(args.This()); + std::unique_ptr callback; + uint32_t throttle = {% if field.return.throttle %}{{ field.return.throttle }}{% else %}0{% endif %}; + bool waitForResult = true; - NanReturnValue(args.This()); -} + if (maybeCallback->IsFunction()) { + callback.reset(new Nan::Callback(maybeCallback.As())); + } else { + v8::Local callbackSpecifier = maybeCallback.As(); + v8::Local maybeCallback = nodegit::safeGetField(callbackSpecifier, "callback"); + if (maybeCallback.IsEmpty() || !maybeCallback->IsFunction()) { + return { + "Must pass callback to CallbackSpecifier" + }; + } -Handle {{ cppClassName }}::New(void* raw, bool selfFreeing) { - NanEscapableScope(); + callback.reset(new Nan::Callback(maybeCallback.As())); - Handle argv[2] = { NanNew((void *)raw), NanNew(selfFreeing) }; - return NanEscapeScope(NanNew({{ cppClassName }}::constructor_template)->NewInstance(2, argv)); -} + v8::Local maybeThrottle = nodegit::safeGetField(callbackSpecifier, "throttle"); + if (!maybeThrottle.IsEmpty() && !maybeThrottle->IsUndefined() && !maybeThrottle->IsNull()) { + if (!maybeThrottle->IsNumber()) { + return { + "Must pass zero or positive number as throttle to CallbackSpecifier" + }; + } -{{ cType }} *{{ cppClassName }}::GetValue() { - return this->raw; -} + throttle = maybeThrottle->Uint32Value(Nan::GetCurrentContext()).FromJust(); + } -{{ cType }} **{{ cppClassName }}::GetRefValue() { - return this->raw == NULL ? NULL : &this->raw; -} + v8::Local maybeWaitForResult = nodegit::safeGetField(callbackSpecifier, "waitForResult"); + if (!maybeWaitForResult.IsEmpty() && !maybeWaitForResult->IsUndefined() && !maybeWaitForResult->IsNull()) { + if (!maybeWaitForResult->IsBoolean()) { + return { + "Must pass a boolean as waitForResult to callbackSpecifier" + }; + } + + waitForResult = Nan::To(maybeWaitForResult).FromJust(); + } + } + + output->{{ field.jsFunctionName }}.SetCallback(std::move(callback), throttle, waitForResult); + output->raw->{{ field.name }} = ({{ field.cType }}){{ field.jsFunctionName }}_cppCallback; + } + } + {% elsif field.isStructType %} + { + v8::Local maybeNestedObject = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeNestedObject.IsEmpty() && !maybeNestedObject->IsUndefined() && !maybeNestedObject->IsNull()) { + auto conversionResult = Configurable{{ field.cppClassName }}::fromJavascript(nodegitContext, maybeNestedObject); + if (!conversionResult.result) { + std::string error = "Failed to set {{ field.jsFunctionName }}: "; + error += conversionResult.error; + return { + error + }; + } + + auto child = conversionResult.result; + output->childCleanupVector.push_back(child); + output->raw->{{ field.name }} = *child->GetValue(); + } + } + {% elsif field.payloadFor %} + output->raw->{{ field.name }} = (void *)output.get(); + {% elsif field.cppClassName == 'String' %} + output->raw->{{ field.name }} = nullptr; + { + v8::Local maybeString = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeString.IsEmpty() && !maybeString->IsUndefined() && !maybeString->IsNull()) { + if (!maybeString->IsString()) { + return { + "Must pass string to {{ field.jsFunctionName }}" + }; + } + + Nan::Utf8String utf8String(maybeString.As()); + output->raw->{{ field.name }} = strdup(*utf8String); + } + } + {% elsif field.isCppClassIntType %} + { + v8::Local maybeNumber = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeNumber.IsEmpty() && !maybeNumber->IsUndefined() && !maybeNumber->IsNull()) { + if (!maybeNumber->IsNumber()) { + return { + "Must pass {{ field.cppClassName }} to {{ field.jsFunctionName }}" + }; + } + + output->raw->{{ field.name }} = maybeNumber->{{ field.cppClassName }}Value(); + } + } + {% else %} + { + v8::Local maybeNumber = nodegit::safeGetField(inputObj, "{{ field.jsFunctionName }}"); + if (!maybeNumber.IsEmpty() && !maybeNumber->IsUndefined() && !maybeNumber->IsNull()) { + if (!maybeNumber->IsNumber()) { + return { + "Must pass Int32 to {{ field.jsFunctionName }}" + }; + } + + output->raw->{{ field.name }} = static_cast<{{ field.cType }}>(maybeNumber->Int32Value(Nan::GetCurrentContext()).FromJust()); + } + } + {% endif %} + {% endif %} + {% endeach %} + + {% if isExtendedStruct %} + (({{ cType }}_extended *)output->raw)->payload = (void *)output.get(); + {% endif %} -void {{ cppClassName }}::ClearValue() { - this->raw = NULL; + return { + output + }; } -{% partial fieldAccessors . %} +{% partial configurableCallbacks %} -Persistent {{ cppClassName }}::constructor_template; +// force base class template instantiation, to make sure we get all the +// methods, statics, etc. +template class nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>; diff --git a/generate/templates/templates/struct_header.h b/generate/templates/templates/struct_header.h index 471e6e31ef..ac05fb3543 100644 --- a/generate/templates/templates/struct_header.h +++ b/generate/templates/templates/struct_header.h @@ -1,11 +1,22 @@ +// generated from struct_header.h #ifndef {{ cppClassName|upper }}_H #define {{ cppClassName|upper }}_H -// generated from struct_header.h #include #include +#include + +#include "async_baton.h" +#include "async_worker.h" +#include "callback_wrapper.h" +#include "context.h" +#include "reference_counter.h" +#include "nodegit_wrapper.h" +#include "configurable_class_wrapper.h" +#include "v8_helpers.h" extern "C" { #include + #include {% each cDependencies as dependency %} #include <{{ dependency }}> {% endeach %} @@ -18,75 +29,127 @@ extern "C" { using namespace node; using namespace v8; -class {{ cppClassName }} : public ObjectWrap { - public: - {{ cppClassName }}({{ cType }}* raw, bool selfFreeing); - static Persistent constructor_template; - static void InitializeComponent (Handle target); - - {{ cType }} *GetValue(); - {{ cType }} **GetRefValue(); - void ClearValue(); - - static Handle New(void *raw, bool selfFreeing); +{%partial traits .%} +{% if isExtendedStruct %} +struct {{ cType }}_extended { + {{ cType }} raw; + void* payload; +}; +{% endif %} +{% if isReturnable %} + class {{ cppClassName }} : public NodeGitWrapper<{{ cppClassName }}Traits> { + // grant full access to base class + friend class NodeGitWrapper<{{ cppClassName }}Traits>; + + public: + {{ cppClassName }}({{ cType }}* raw, bool selfFreeing, v8::Local owner = v8::Local()); + {{ cppClassName }}(const {{ cppClassName }} &) = delete; + {{ cppClassName }}({{ cppClassName }} &&) = delete; + {{ cppClassName }} &operator=(const {{ cppClassName }} &) = delete; + {{ cppClassName }} &operator=({{ cppClassName }} &&) = delete; + static void InitializeComponent (v8::Local target, nodegit::Context *nodegitContext); + + private: + {{ cppClassName }}(); + ~{{ cppClassName }}(); + + void ConstructFields(); + + {% each fields as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isLibgitType %} + Nan::Global {{ field.name }}; + {% endif %} + {% endif %} - bool selfFreeing; + static NAN_GETTER(Get{{ field.cppFunctionName }}); + static NAN_SETTER(Set{{ field.cppFunctionName }}); - {% each fields as field %} - {% if not field.ignore %} - {% if field.isCallbackFunction %} - static {{ field.return.type }} {{ field.name }}_cppCallback ( + {% endif %} + {% endeach %} + }; +{% endif %} + +class Configurable{{ cppClassName }} : public nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits> { + friend class nodegit::ConfigurableClassWrapper<{{ cppClassName }}Traits>; + +public: + static v8ConversionResult fromJavascript(nodegit::Context *nodegitContext, v8::Local input); + ~Configurable{{ cppClassName }}(); + + Configurable{{ cppClassName }}(const Configurable{{ cppClassName }} &) = delete; + Configurable{{ cppClassName }}(Configurable{{ cppClassName }} &&) = delete; + Configurable{{ cppClassName }} &operator=(const Configurable{{ cppClassName }} &) = delete; + Configurable{{ cppClassName }} &operator=(Configurable{{ cppClassName }} &&) = delete; + + {% each fields as field %} + {% if not field.ignore %} + {% if field.isCallbackFunction %} + static {{ field.return.type }} {{ field.jsFunctionName }}_cppCallback ( + {% each field.args|argsInfo as arg %} + {{ arg.cType }} {{ arg.name}} + {% if not arg.lastArg %} + , + {% endif %} + {% endeach %} + ); + + static void {{ field.jsFunctionName }}_cancelAsync(void *baton); + static void {{ field.jsFunctionName }}_async(void *baton); + static void {{ field.jsFunctionName }}_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local result); + {% if field.return.type == 'void' %} + class {{ field.name|titleCase }}Baton : public nodegit::AsyncBatonWithNoResult { + public: {% each field.args|argsInfo as arg %} - {{ arg.cType }} {{ arg.name}} - {% if not arg.lastArg %} - , - {% endif %} + {{ arg.cType }} {{ arg.name }}; {% endeach %} - ); - static void {{ field.name }}_async(uv_async_t* req, int status); - static void {{ field.name }}_asyncPromisePolling(uv_async_t* req, int status); - struct {{ field.name|titleCase }}Baton { + {{ field.name|titleCase }}Baton() + : nodegit::AsyncBatonWithNoResult() { + } + }; + {% else %} + class {{ field.name|titleCase }}Baton : public nodegit::AsyncBatonWithResult<{{ field.return.type }}> { + public: {% each field.args|argsInfo as arg %} - {{ arg.cType }} {{ arg.name}}; + {{ arg.cType }} {{ arg.name }}; {% endeach %} - uv_async_t req; - {{ field.return.type }} result; - Persistent promise; - bool done; + {{ field.name|titleCase }}Baton(const {{ field.return.type }} &defaultResult) + : nodegit::AsyncBatonWithResult<{{ field.return.type }}>(defaultResult) { + } }; {% endif %} + static Configurable{{ cppClassName }} * {{ field.jsFunctionName }}_getInstanceFromBaton ( + {{ field.name|titleCase }}Baton *baton); {% endif %} - {% endeach %} - - private: - {{ cppClassName }}(); - ~{{ cppClassName }}(); - - void ConstructFields(); - - static NAN_METHOD(JSNewFunction); + {% endif %} + {% endeach %} - {% each fields as field %} - {% if not field.ignore %} - {% if not field.isEnum %} - {% if field.isLibgitType %} - Persistent {{ field.name }}; - {% elsif field.isCallbackFunction %} - NanCallback* {{ field.name }}; - {% elsif field.payloadFor %} - Persistent {{ field.name }}; +private: + Configurable{{ cppClassName }}(nodegit::Context *nodegitContext); + Configurable{{ cppClassName }}() = delete; + Nan::Global promiseError; + + {% each fields as field %} + {% if not field.ignore %} + {% if not field.isEnum %} + {% if field.isClassType %} + {% if field.cppClassName == 'GitOid' %} + {%-- We do not need to generate anything here --%} + {% elsif field.cppClassName == 'GitStrarray' %} + {%-- We do not need to generate anything here --%} + {% else %} + Nan::Global {{ field.jsFunctionName }}; {% endif %} + {% elsif field.isCallbackFunction %} + CallbackWrapper {{ field.jsFunctionName }}; {% endif %} - - static NAN_GETTER(Get{{ field.cppFunctionName }}); - static NAN_SETTER(Set{{ field.cppFunctionName }}); - {% endif %} - {% endeach %} + {% endif %} + {% endeach %} - {{ cType }} *raw; }; #endif diff --git a/guides/README.md b/guides/README.md index 8b827b8d03..3fda23c7b5 100644 --- a/guides/README.md +++ b/guides/README.md @@ -11,8 +11,7 @@ description: Learning NodeGit - [Basics](install/) - [From source](install/from-source) -- [Atom Shell](install/atom-shell/) -- [NW.js](install/nw.js/) +- [Electron](install/electron/) *** diff --git a/guides/cloning/README.md b/guides/cloning/README.md index f5bf533331..8b8390f236 100644 --- a/guides/cloning/README.md +++ b/guides/cloning/README.md @@ -83,8 +83,10 @@ to passthrough the certificate check. *Note: this is not a problem with Windows or Linux* ``` javascript -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; } +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; } + } }; ``` @@ -110,7 +112,7 @@ a function to attempt opening in this case. ``` javascript var errorAndAttemptOpen = function() { - return NodeGit.Repository.open(local); + return NodeGit.Repository.open(localPath); }; ``` diff --git a/guides/cloning/gh-two-factor/README.md b/guides/cloning/gh-two-factor/README.md index 11f6520fc9..a6d24d40dd 100644 --- a/guides/cloning/gh-two-factor/README.md +++ b/guides/cloning/gh-two-factor/README.md @@ -99,8 +99,10 @@ to passthrough the certificate check. *Note: this is not a problem with Windows or Linux* ``` javascript -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; } +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; } + } }; ``` @@ -112,13 +114,15 @@ callback that expects credentials to be passed. This function will be attached below the above `certificateCheck`, and will respond back with the OAuth token. -The `remoteCallbacks` object now looks like this: +The `fetchOpts` object now looks like this: ``` javascript -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; }, - credentials: function() { - return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; }, + credentials: function() { + return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); + } } }; ``` @@ -145,7 +149,7 @@ a function to attempt opening in this case. ``` javascript var errorAndAttemptOpen = function() { - return NodeGit.Repository.open(local); + return NodeGit.Repository.open(localPath); }; ``` diff --git a/guides/cloning/gh-two-factor/index.js b/guides/cloning/gh-two-factor/index.js index 113f3fe067..945aac3514 100644 --- a/guides/cloning/gh-two-factor/index.js +++ b/guides/cloning/gh-two-factor/index.js @@ -20,10 +20,12 @@ var cloneOptions = {}; // This is a required callback for OS X machines. There is a known issue // with libgit2 being able to verify certificates from GitHub. -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; }, - credentials: function() { - return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; }, + credentials: function() { + return NodeGit.Credential.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic"); + } } }; diff --git a/guides/cloning/index.js b/guides/cloning/index.js index 2b0d7c9ff5..ec455fbd7f 100644 --- a/guides/cloning/index.js +++ b/guides/cloning/index.js @@ -16,8 +16,10 @@ var cloneOptions = {}; // This is a required callback for OS X machines. There is a known issue // with libgit2 being able to verify certificates from GitHub. -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; } +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; } + } }; // Invoke the clone operation and store the returned Promise. diff --git a/guides/cloning/ssh-with-agent/README.md b/guides/cloning/ssh-with-agent/README.md index 9cc1110691..46a72b823a 100644 --- a/guides/cloning/ssh-with-agent/README.md +++ b/guides/cloning/ssh-with-agent/README.md @@ -81,8 +81,10 @@ to passthrough the certificate check. *Note: this is not a problem with Windows or Linux* ``` javascript -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; } +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; } + } }; ``` @@ -95,13 +97,15 @@ This function will be attached below the above `certificateCheck`, and will respond back with the credentials from the agent. You'll notice we handle the second argument passed to credentials, `userName`. -The `remoteCallbacks` object now looks like this: +The `fetchOpts` object now looks like this: ``` javascript -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; }, - credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; }, + credentials: function(url, userName) { + return NodeGit.Cred.sshKeyFromAgent(userName); + } } }; ``` @@ -133,7 +137,7 @@ a function to attempt opening in this case. ``` javascript var errorAndAttemptOpen = function() { - return NodeGit.Repository.open(local); + return NodeGit.Repository.open(localPath); }; ``` diff --git a/guides/cloning/ssh-with-agent/index.js b/guides/cloning/ssh-with-agent/index.js index a507ba789f..655f07e242 100644 --- a/guides/cloning/ssh-with-agent/index.js +++ b/guides/cloning/ssh-with-agent/index.js @@ -15,14 +15,16 @@ var cloneOptions = {}; // This is a required callback for OS X machines. There is a known issue // with libgit2 being able to verify certificates from GitHub. -cloneOptions.remoteCallbacks = { - certificateCheck: function() { return 1; }, - - // Credentials are passed two arguments, url and username. We forward the - // `userName` argument to the `sshKeyFromAgent` function to validate - // authentication. - credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); +cloneOptions.fetchOpts = { + callbacks: { + certificateCheck: function() { return 0; }, + + // Credentials are passed two arguments, url and username. We forward the + // `userName` argument to the `sshKeyFromAgent` function to validate + // authentication. + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyFromAgent(userName); + } } }; diff --git a/guides/install/atom-shell/README.md b/guides/install/atom-shell/README.md deleted file mode 100644 index cdf38772ed..0000000000 --- a/guides/install/atom-shell/README.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -layout: full -menu_item: guides -title: Atom Shell -description: How to install NodeGit with Atom Shell ---- - -[Return to all guides](../../) - -* * * - -Install for atom-shell ----------------------- - -For an application that is built using [atom-shell](https://github.com/atom/atom-shell) you'll need to have the `engines.atom-shell` set to the version of atom-shell that you are targeting in your root `package.json` file. - -For example if you have an atom-shell app that's targeting version 0.20.7 your package.json file would look something like - -```json -{ - "name": "as-app", - "displayName": "My Atom Shell app", - "version": "0.0.1", - "description": "", - "main": "main.js", - "author": "", - "engines": { - "atom-shell": "0.20.7" - } -} -``` - -And when doing an `npm install` or `apm install` inside of your atom-shell's root folder it will compile NodeGit targeting that version of atom-shell during the install. - -*NOTE: there are no pre-built binaries for atom-shell, you must rebuild NodeGit. Visit our [building guides](../from-source) for help* diff --git a/guides/install/electron/README.md b/guides/install/electron/README.md new file mode 100644 index 0000000000..99e67084a8 --- /dev/null +++ b/guides/install/electron/README.md @@ -0,0 +1,25 @@ +--- +layout: full +menu_item: guides +title: Electron +description: How to install NodeGit with Electron +--- + +[Return to all guides](../../) + +* * * + +Install for Electron +---------------------- + +Please see the official electron docs [here](https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md) + +For a slightly simpler version of the first method, use an `.npmrc` file. For example if you have an Electron app that's targeting version 1.2.8 your .npmrc file would look something like: +``` +runtime = electron +target = 1.2.8 +target_arch = x64 +disturl = https://atom.io/download/atom-shell +``` + +*NOTE: We try to provide prebuilt binaries for electron, but we don't always have them available for every version. If prebuilts are not available and you have trouble with local compilation, visit our [building guides](../from-source) for help* diff --git a/guides/install/from-source/README.md b/guides/install/from-source/README.md index c85e2e3faf..64bfce18b3 100644 --- a/guides/install/from-source/README.md +++ b/guides/install/from-source/README.md @@ -64,6 +64,16 @@ npm install nodegit --msvs_version=2013 # Or whatever version you've installed. ``` +### Electron and OpenSSL ### +A local version of OpenSSL is required when building for Electron. This is due to Electron using BoringSSL, as we are not able to link to it like we are OpenSSL in Node. + +`acquireOpenSSL.js` will attempt to download OpenSSL prebuilts from S3. If preferred, it can also be built locally by setting the environment variable `npm_config_openssl_bin_url=skip`. On macOS, this should Just Work(tm). On Windows, things are a little trickier. + +- We rely on the Visual Studio dev tools to be installed, specifically `vcvarsall.bat` to provide access to the tools. If this is not in the default location for VS2017, you'll need to `npm config set vcvarsall_path ` or set the environment variable `npm_config_vcvarsall_path` pointing to it. +- See [Compilation and Installation](https://wiki.openssl.org/index.php/Compilation_and_Installation#Windows) regarding required dependencies, specifically `Perl` (Strawberry Perl is known to work) and `NASM`. Make sure they're on the PATH. + +Alternatively, you can provide your own OpenSSL binaries and headers. These can either go in `vendor/openssl` (e.g. `/vendor/openssl/{lib,bin,include}` should exist) or in an external directory located by `npm config set openssl_dir ` or the environment variable `npm_config_openssl_dir`. Additionally, you can `npm config set openssl_bin_url ` or the environment variable `npm_config_openssl_bin_url` to download and extract prebuilt binaries (only supports tar.gz files). `npm config set openssl_bin_sha256 ` or the environment variable `npm_config_openssl_bin_sha256` can be set to verify the download. + ##### A note on environment variables in Windows ##### In many of the npm scripts (and examples above), things are run like `BUILD_ONLY=true npm install`. This sets the `BUILD_ONLY` environment variable @@ -76,7 +86,7 @@ See here for more details: ### Debug build: ### -In order to track down possible bugs, you will need a debug buid so you +In order to track down possible bugs, you will need a debug build so you can get a backtrace with [gdb](http://www.gnu.org/software/gdb/) or [lldb](http://lldb.llvm.org/). diff --git a/guides/install/nw.js/README.md b/guides/install/nw.js/README.md deleted file mode 100644 index 5eb978b3ab..0000000000 --- a/guides/install/nw.js/README.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -layout: full -menu_item: guides -title: NW.js -description: How to install NodeGit with NW.js ---- - -[Return to all guides](../../) - -* * * - -Install for nwjs ----------------- - -For an application that is built using [NW.js](https://github.com/nwjs/nw.js) you'll need to have the `engines['nw.js']` set to the version of NW.js that you are targeting in your root `package.json` file. - -For example if you have an NS.js app that's targeting version 0.12.0 your package.json file would look something like - -```json -{ - "name": "nw-app", - "displayName": "My NW.js app", - "version": "0.0.1", - "description": "", - "engines": { - "nw.js": "0.12.0" - } -} -``` - -And when doing an `npm install` inside of your NW.js app's root folder it will compile NodeGit targeting that version of NW.js during the install. - -*NOTE: there are no pre-built binaries for NW.js, you must rebuild NodeGit. Visit our [building guides](../from-source) for help* diff --git a/guides/repositories/README.md b/guides/repositories/README.md index 65cb063c2e..a436a24c93 100644 --- a/guides/repositories/README.md +++ b/guides/repositories/README.md @@ -85,7 +85,7 @@ You can pass a second function parameter to the `.then` method that will have the reason why a promise failed in it's first argument. ``` javascript -NodeGit.Repository.open(pathToRepo).then(function (sucessfulResult) { +NodeGit.Repository.open(pathToRepo).then(function (successfulResult) { // This is the first function of the then which contains the successfully // calculated result of the promise }, function (reasonForFailure) { @@ -100,7 +100,7 @@ You can also append a `.catch` to the end of a promise chain which will receive any promise failure that isn't previously caught ``` javascript -NodeGit.Repository.open(pathToRepo).then(function (sucessfulResult) { +NodeGit.Repository.open(pathToRepo).then(function (successfulResult) { // This is the first function of the then which contains the successfully // calculated result of the promise }) @@ -115,7 +115,7 @@ If you append a `.done` at the end of your chain, you will have any error that wasn't previously handled by the above 2 methods thrown. ``` javascript -NodeGit.Repository.open(pathToRepo).then(function (sucessfulResult) { +NodeGit.Repository.open(pathToRepo).then(function (successfulResult) { // This is the first function of the then which contains the successfully // calculated result of the promise }) diff --git a/lib/README.md b/lib/README.md new file mode 100644 index 0000000000..3d12686af6 --- /dev/null +++ b/lib/README.md @@ -0,0 +1,3 @@ +## /lib + + Contains javascript extensions for the generated NodeGit modules. Any additional behavior on top of the standard libgit2 behavior will be found here. diff --git a/lib/attr.js b/lib/attr.js new file mode 100644 index 0000000000..8ecdd5eeeb --- /dev/null +++ b/lib/attr.js @@ -0,0 +1,20 @@ +var util = require("util"); +var NodeGit = require("../"); + +NodeGit.Attr.STATES = {}; +var DEPRECATED_STATES = { + UNSPECIFIED_T: "UNSPECIFIED", + TRUE_T: "TRUE", + FALSE_T: "FALSE", + VALUE_T: "STRING" +}; + +Object.keys(DEPRECATED_STATES).forEach((key) => { + const newKey = DEPRECATED_STATES[key]; + Object.defineProperty(NodeGit.Attr.STATES, key, { + get: util.deprecate( + () => NodeGit.Attr.VALUE[newKey], + `Use NodeGit.Attr.VALUE.${newKey} instead of NodeGit.Attr.STATES.${key}.` + ) + }); +}); diff --git a/lib/blob.js b/lib/blob.js index f55ff27dab..be63312485 100644 --- a/lib/blob.js +++ b/lib/blob.js @@ -1,8 +1,10 @@ +var util = require("util"); var NodeGit = require("../"); var Blob = NodeGit.Blob; var LookupWrapper = NodeGit.Utils.lookupWrapper; var TreeEntry = NodeGit.TreeEntry; +var _filteredContent = Blob.filteredContent; /** * Retrieves the blob pointed to by the oid @@ -22,15 +24,6 @@ Blob.prototype.content = function() { return this.rawcontent().toBuffer(this.rawsize()); }; -/** - * Retrieve the Blob's content as String. - * - * @return {String} Contents as a string. - */ -Blob.prototype.toString = function() { - return this.content().toString(); -}; - /** * Retrieve the Blob's type. * @@ -41,3 +34,18 @@ Blob.prototype.filemode = function() { return this.isBinary() ? FileMode.EXECUTABLE : FileMode.BLOB; }; + +/** + * Retrieve the Blob's content as String. + * + * @return {String} Contents as a string. + */ +Blob.prototype.toString = function() { + return this.content().toString(); +}; + +Blob.filteredContent = util.deprecate( + _filteredContent, + "NodeGit.Blob.filteredContent is deprecated" + + " use NodeGit.Blob.prototype.filter instead." +); diff --git a/lib/branch.js b/lib/branch.js new file mode 100644 index 0000000000..bc4b234439 --- /dev/null +++ b/lib/branch.js @@ -0,0 +1,19 @@ +var NodeGit = require("../"); +var Branch = NodeGit.Branch; + +var _remoteName = Branch.remoteName; + +/** + * Retrieve the Branch's Remote Name as a String. + * + * @async + * @param {Repository} repo The repo to get the remote name from + * @param {String} the refname of the branch + * @return {String} remote name as a string. + */ +Branch.remoteName = function(repo, remoteRef) { + return _remoteName.call(this, repo, remoteRef) + .then(function(remoteNameBuffer) { + return remoteNameBuffer.toString(); + }); +}; diff --git a/lib/buf.js b/lib/buf.js new file mode 100644 index 0000000000..aec6ba693d --- /dev/null +++ b/lib/buf.js @@ -0,0 +1,43 @@ +var util = require("util"); +var NodeGit = require("../"); +var Buf = NodeGit.Buf; + +var _set = Buf.prototype.set; +var _grow = Buf.prototype.grow; +var _isBinary = Buf.prototype.isBinary; +var _containsNul = Buf.prototype.containsNul; + +/** + * Sets the content of a GitBuf to a string. + * @param {string} The utf8 value to set in the buffer. + * The string will be null terminated. + */ +var _setString = function(content) { + const buf = Buffer.from(content + "\0", "utf8"); + this.set(buf, buf.length); +}; + +Buf.prototype.set = util.deprecate( + _set, + "NodeGit.Buf.prototype.set is deprecated." +); + +Buf.prototype.setString = util.deprecate( + _setString, + "NodeGit.Buf.prototype.setString is deprecated." +); + +Buf.prototype.grow = util.deprecate( + _grow, + "NodeGit.Buf.prototype.grow is deprecated." +); + +Buf.prototype.isBinary = util.deprecate( + _isBinary, + "NodeGit.Buf.prototype.isBinary is deprecated." +); + +Buf.prototype.containsNul = util.deprecate( + _containsNul, + "NodeGit.Buf.prototype.containsNul is deprecated." +); \ No newline at end of file diff --git a/lib/checkout.js b/lib/checkout.js deleted file mode 100644 index 459ef9874a..0000000000 --- a/lib/checkout.js +++ /dev/null @@ -1,35 +0,0 @@ -var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var Checkout = NodeGit.Checkout; -var head = Checkout.head; -var tree = Checkout.tree; - -/** -* Patch head checkout to automatically coerce objects. -* -* @async -* @param {Repository} repo The repo to checkout head -* @param {CheckoutOptions} [options] Options for the checkout -* @return {Void} checkout complete -*/ -Checkout.head = function(url, options) { - options = normalizeOptions(options, NodeGit.CheckoutOptions); - - return head.call(this, url, options); -}; - -/** -* Patch tree checkout to automatically coerce objects. -* -* @async -* @param {Repository} repo -* @param {Oid|Tree|Commit|Reference} treeish -* @param {CheckoutOptions} [options] -* @return {Void} checkout complete -*/ -Checkout.tree = function(repo, treeish, options) { - options = normalizeOptions(options, NodeGit.CheckoutOptions); - - return tree.call(this, repo, treeish, options); -}; diff --git a/lib/clone.js b/lib/clone.js deleted file mode 100644 index 8efdae739a..0000000000 --- a/lib/clone.js +++ /dev/null @@ -1,48 +0,0 @@ -var NodeGit = require("../"); -var shallowClone = require("./utils/shallow_clone"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var Clone = NodeGit.Clone; -var clone = Clone.clone; - -/** - * Patch repository cloning to automatically coerce objects. - * - * @async - * @param {String} url url of the repository - * @param {String} local_path local path to store repository - * @param {CloneOptions} [options] - * @return {Repository} repo - */ -Clone.clone = function(url, local_path, options) { - var remoteCallbacks; - - if (options) { - options = shallowClone(options); - remoteCallbacks = options.remoteCallbacks; - delete options.remoteCallbacks; - } - - options = normalizeOptions(options, NodeGit.CloneOptions); - - if (remoteCallbacks) { - options.remoteCallbacks = - normalizeOptions(remoteCallbacks, NodeGit.RemoteCallbacks); - } - - // This is required to clean up after the clone to avoid file locking - // issues in Windows and potentially other issues we don't know about. - var freeRepository = function(repository) { - repository.free(); - }; - - // We want to provide a valid repository object, so reopen the repository - // after clone and cleanup. - var openRepository = function() { - return NodeGit.Repository.open(local_path); - }; - - return clone.call(this, url, local_path, options) - .then(freeRepository) - .then(openRepository); -}; diff --git a/lib/commit.js b/lib/commit.js index 3dbd792f3d..8eb561e585 100644 --- a/lib/commit.js +++ b/lib/commit.js @@ -1,9 +1,12 @@ var events = require("events"); -var Promise = require("nodegit-promise"); +var fp = require("lodash/fp"); var NodeGit = require("../"); var Commit = NodeGit.Commit; var LookupWrapper = NodeGit.Utils.lookupWrapper; +var _amend = Commit.prototype.amend; +var _parent = Commit.prototype.parent; + /** * Retrieves the commit pointed to by the oid * @async @@ -14,19 +17,213 @@ var LookupWrapper = NodeGit.Utils.lookupWrapper; Commit.lookup = LookupWrapper(Commit); /** - * Retrieve the SHA. - * @return {String} + * @async + * @param {Number} n + * @return {Commit} */ -Commit.prototype.sha = function() { - return this.id().toString(); +Commit.prototype.parent = function(n) { + var repo = this.repo; + return _parent.call(this, n).then(p => { + p.repo = repo; + return p; + }); }; /** - * Retrieve the commit time as a unix timestamp. - * @return {Number} + * Amend a commit + * @async + * @param {String} update_ref + * @param {Signature} author + * @param {Signature} committer + * @param {String} message_encoding + * @param {String} message + * @param {Tree|Oid} tree + * @return {Oid} */ -Commit.prototype.timeMs = function() { - return this.time() * 1000; +Commit.prototype.amend = function ( + updateRef, author, committer, message_encoding, message, tree) { + var repo = this.repo; + var _this = this; + var treePromise; + + if (tree instanceof NodeGit.Oid){ + treePromise = repo.getTree(tree); + } else { + treePromise = Promise.resolve(tree); + } + + return treePromise + .then(function(treeObject){ + return _amend.call(_this, + updateRef, + author, + committer, + message_encoding, + message, + treeObject + ); + }); +}; + +/** + * Amend a commit with the given signature + * @async + * @param {String} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {String} messageEncoding + * @param {String} message + * @param {Tree|Oid} tree + * @param {Function} onSignature Callback to be called with string to be signed + * @return {Oid} +*/ +Commit.prototype.amendWithSignature = function( + updateRef, + author, + committer, + messageEncoding, + message, + tree, + onSignature +) { + let repo = this.repo; + let parentOids = this.parents(); + let _this = this; + let promises = []; + + if (tree instanceof NodeGit.Oid) { + promises.push(repo.getTree(tree)); + } else { + promises.push(Promise.resolve(tree)); + } + + parentOids.forEach(function (parentOid) { + promises.push(repo.getCommit(parentOid)); + }); + + let treeObject; + let parents; + let commitContent; + let commit; + let skippedSigning; + let resolvedAuthor; + let resolvedCommitter; + let resolvedMessageEncoding; + let resolvedMessage; + let resolvedTree; + + let createCommitPromise = Promise.all(promises) + .then(function(results) { + treeObject = fp.head(results); + parents = fp.tail(results); + return _this.getTree(); + }) + .then(function(commitTreeResult) { + let commitTree = commitTreeResult; + + let truthyArgs = fp.omitBy( + fp.isNil, + { + author, + committer, + messageEncoding, + message, + tree: treeObject + } + ); + + let commitFields = { + author: _this.author(), + committer: _this.committer(), + messageEncoding: _this.messageEncoding(), + message: _this.message(), + tree: commitTree + }; + + ({ + author: resolvedAuthor, + committer: resolvedCommitter, + messageEncoding: resolvedMessageEncoding, + message: resolvedMessage, + tree: resolvedTree + } = fp.assign( + commitFields, + truthyArgs + )); + + return Commit.createBuffer( + repo, + resolvedAuthor, + resolvedCommitter, + resolvedMessageEncoding, + resolvedMessage, + resolvedTree, + parents.length, + parents + ); + }) + .then(function(commitContentResult) { + commitContent = commitContentResult; + if (!commitContent.endsWith("\n")) { + commitContent += "\n"; + } + return onSignature(commitContent); + }) + .then(function({ code, field, signedData }) { + switch (code) { + case NodeGit.Error.CODE.OK: + return Commit.createWithSignature( + repo, + commitContent, + signedData, + field + ); + case NodeGit.Error.CODE.PASSTHROUGH: + skippedSigning = true; + return Commit.create( + repo, + updateRef, + resolvedAuthor, + resolvedCommitter, + resolvedMessageEncoding, + resolvedMessage, + resolvedTree, + parents.length, + parents + ); + default: { + const error = new Error( + `Commit.amendWithSignature threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } + }); + + if (!updateRef) { + return createCommitPromise; + } + + return createCommitPromise + .then(function(commitOid) { + if (skippedSigning) { + return commitOid; + } + + return repo.getCommit(commitOid) + .then(function(commitResult) { + commit = commitResult; + return repo.getReference(updateRef); + }).then(function(ref) { + return ref.setTarget( + commitOid, + `commit (amend): ${commit.summary()}` + ); + }).then(function() { + return commitOid; + }); + }); }; /** @@ -38,13 +235,43 @@ Commit.prototype.date = function() { }; /** - * Get the tree associated with this commit. + * Generate an array of diff trees showing changes between this commit + * and its parent(s). * * @async - * @return {Tree} + * @return {Array} an array of diffs */ -Commit.prototype.getTree = function(callback) { - return this.repo.getTree(this.treeId(), callback); +Commit.prototype.getDiff = function() { + return this.getDiffWithOptions(null); +}; + +/** + * Generate an array of diff trees showing changes between this commit + * and its parent(s). + * + * @async + * @param {Object} options + * @return {Array} an array of diffs + */ +Commit.prototype.getDiffWithOptions = function(options) { + var commit = this; + + return commit.getTree().then(function(thisTree) { + return commit.getParents().then(function(parents) { + var diffs; + if (parents.length) { + diffs = parents.map(function(parent) { + return parent.getTree().then(function(parentTree) { + return thisTree.diffWithOptions(parentTree, options); + }); + }); + } else { + diffs = [thisTree.diffWithOptions(null, options)]; + } + + return Promise.all(diffs); + }); + }); }; /** @@ -55,18 +282,63 @@ Commit.prototype.getTree = function(callback) { * @param {String} path * @return {TreeEntry} */ -Commit.prototype.getEntry = function(path, callback) { +Commit.prototype.getEntry = function(path) { return this.getTree().then(function(tree) { - return tree.getEntry(path).then(function(entry) { - if (typeof callback === "function") { - callback(null, entry); - } + return tree.getEntry(path); + }); +}; - return entry; - }); - }, callback); +/** + * Retrieve the commit's parents as commit objects. + * + * @async + * @param {number} limit Optional amount of parents to return. + * @return {Array} array of commits + */ +Commit.prototype.getParents = function(limit) { + var parents = []; + + // If no limit was set, default to the maximum parents. + limit = typeof limit === "number" ? limit : this.parentcount(); + limit = Math.min(limit, this.parentcount()); + + for (var i = 0; i < limit; i++) { + var oid = this.parentId(i); + var parent = this.repo.getCommit(oid); + + parents.push(parent); + } + + // Wait for all parents to complete, before returning. + return Promise.all(parents); }; +/** + * @typedef extractedSignature + * @type {Object} + * @property {String} signature the signature of the commit + * @property {String} signedData the extracted signed data + */ + +/** + * Retrieve the signature and signed data for a commit. + * @param {String} field Optional field to get from the signature, + * defaults to gpgsig + * @return {extractedSignature} + */ +Commit.prototype.getSignature = function(field) { + return Commit.extractSignature(this.repo, this.id(), field); +}; + +/** + * Get the tree associated with this commit. + * + * @async + * @return {Tree} + */ +Commit.prototype.getTree = function() { + return this.repo.getTree(this.treeId()); +}; /** * Walk the history from this commit backwards. @@ -94,12 +366,12 @@ Commit.prototype.history = function() { event.start = function() { revwalk.walk(oid, function commitRevWalk(error, commit) { if (error) { - return event.emit("error", error); - } - - if (!commit) { - event.emit("end", commits); - return; + if (error.errno === NodeGit.Error.CODE.ITEROVER) { + event.emit("end", commits); + return; + } else { + return event.emit("error", error); + } } event.emit("commit", commit); @@ -110,49 +382,25 @@ Commit.prototype.history = function() { return event; }; - /** - * Retrieve the commit's parents as commit objects. + * Get the specified parent of the commit. * + * @param {number} the position of the parent, starting from 0 * @async - * @param {number} limit Optional amount of parents to return. - * @param {Function} callback - * @return {Array} array of commits + * @return {Commit} the parent commit at the specified position */ -Commit.prototype.getParents = function(limit, callback) { - var parents = []; - - // Shift arguments. - if (typeof limit === "function") { - callback = limit; - } - - // If no limit was set, default to the maximum parents. - limit = typeof limit === "number" ? limit : this.parentcount(); - limit = Math.min(limit, this.parentcount()); - - for (var i = 0; i < limit; i++) { - var oid = this.parentId(i); - var parent = this.repo.getCommit(oid); - - parents.push(parent); - } - - // Wait for all parents to complete, before returning. - return Promise.all(parents).then(function(parents) { - if (typeof callback === "function") { - callback(null, parents); - } - - return parents; - }, callback); +Commit.prototype.parent = function (id) { + var repository = this.repo; + return _parent.call(this, id).then(function(parent) { + parent.repo = repository; + return parent; + }); }; /** - * Retrieve the commit"s parent shas. + * Retrieve the commit's parent shas. * - * @param {Function} callback - * @return {Array} array of oids + * @return {Array} array of oids */ Commit.prototype.parents = function() { var result = []; @@ -165,38 +413,19 @@ Commit.prototype.parents = function() { }; /** - * Generate an array of diff trees showing changes between this commit - * and its parent(s). - * - * @async - * @param {Function} callback - * @return {Array} an array of diffs + * Retrieve the SHA. + * @return {String} */ -Commit.prototype.getDiff = function(callback) { - var commit = this; - - return commit.getTree().then(function(thisTree) { - return commit.getParents().then(function(parents) { - var diffs; - if (parents.length) { - diffs = parents.map(function(parent) { - return parent.getTree().then(function(parentTree) { - return thisTree.diff(parentTree); - }); - }); - } else { - diffs = [thisTree.diff(null)]; - } - - return Promise.all(diffs); - }); - }).then(function(diffs) { - if (typeof callback === "function") { - callback(null, diffs); - } +Commit.prototype.sha = function() { + return this.id().toString(); +}; - return diffs; - }, callback); +/** + * Retrieve the commit time as a unix timestamp. + * @return {Number} + */ +Commit.prototype.timeMs = function() { + return this.time() * 1000; }; /** diff --git a/lib/config.js b/lib/config.js new file mode 100644 index 0000000000..37b792da85 --- /dev/null +++ b/lib/config.js @@ -0,0 +1,48 @@ +var util = require("util"); +var NodeGit = require("../"); + +var Config = NodeGit.Config; + +var _getBool = Config.prototype.getBool; +var _setBool = Config.prototype.setBool; + +/** + * @async + * @param {String} name The variable's name + * @return {Boolean} The variable's value + */ +Config.prototype.getBool = function(name) { + return _getBool.call(this, name) + .then(result => Boolean(result)); +}; + +/** + * @async + * @param {String} name The variable's name + * @param {Boolean} name The variable's value + * @return {Number} 0 or an error code + */ +Config.prototype.setBool = function(name, value) { + return _setBool.call(this, name, value ? 1 : 0); +}; + +// Backwards compatibility. +Config.prototype.getString = function() { + return this.getStringBuf.apply(this, arguments); +}; + +NodeGit.Enums.CVAR = {}; +var DEPRECATED_CVAR_ENUMS = [ + "FALSE", + "TRUE", + "INT32", + "STRING" +]; +DEPRECATED_CVAR_ENUMS.forEach((key) => { + Object.defineProperty(NodeGit.Enums.CVAR, key, { + get: util.deprecate( + () => Config.MAP[key], + `Use NodeGit.Config.MAP.${key} instead of NodeGit.Enums.CVAR.${key}.` + ) + }); +}); diff --git a/lib/convenient_hunk.js b/lib/convenient_hunk.js deleted file mode 100644 index ca3d8f0e6c..0000000000 --- a/lib/convenient_hunk.js +++ /dev/null @@ -1,38 +0,0 @@ -var NodeGit = require("../"); -var ConvenientLine = NodeGit.ConvenientLine; - -function ConvenientHunk(raw, i) { - this.raw = raw; - this.i = i; -} - -/** - * Diff header string that represents the context of this hunk - * of the diff. Something like `@@ -169,14 +167,12 @@ ...` - * @return {String} - */ -ConvenientHunk.prototype.header = function() { - return this.raw.getHunk(this.i).hunk.header(); -}; - -/** - * Number of lines in this hunk - * @return {Number} - */ -ConvenientHunk.prototype.size = function() { - return this.raw.numLinesInHunk(this.i); -}; - -/** - * The lines in this hunk - * @return {[String]} array of strings - */ -ConvenientHunk.prototype.lines = function() { - var result = []; - for (var i = 0; i < this.size(); i++) { - result.push(new ConvenientLine(this.raw.getLineInHunk(this.i, i), i)); - } - return result; -}; - -NodeGit.ConvenientHunk = ConvenientHunk; diff --git a/lib/convenient_hunks.js b/lib/convenient_hunks.js new file mode 100644 index 0000000000..ef8070d061 --- /dev/null +++ b/lib/convenient_hunks.js @@ -0,0 +1,61 @@ +var NodeGit = require("../"); + +var ConvenientHunk = NodeGit.ConvenientHunk; + +var header = ConvenientHunk.prototype.header; + /** + * Diff header string that represents the context of this hunk + * of the diff. Something like `@@ -169,14 +167,12 @@ ...` + * @return {String} + */ +ConvenientHunk.prototype.header = header; + +var headerLen = ConvenientHunk.prototype.headerLen; +/** + * The length of the header + * @return {Number} + */ +ConvenientHunk.prototype.headerLen = headerLen; + +var lines = ConvenientHunk.prototype.lines; +/** + * The lines in this hunk + * @async + * @return {Array} + */ +ConvenientHunk.prototype.lines = lines; + +var newLines = ConvenientHunk.prototype.newLines; +/** + * The number of new lines in the hunk + * @return {Number} + */ +ConvenientHunk.prototype.newLines = newLines; + +var newStart = ConvenientHunk.prototype.newStart; +/** + * The starting offset of the first new line in the file + * @return {Number} + */ +ConvenientHunk.prototype.newStart = newStart; + +var oldLines = ConvenientHunk.prototype.oldLines; +/** + * The number of old lines in the hunk + * @return {Number} + */ +ConvenientHunk.prototype.oldLines = oldLines; + +var oldStart = ConvenientHunk.prototype.oldStart; +/** + * The starting offset of the first old line in the file + * @return {Number} + */ +ConvenientHunk.prototype.oldStart = oldStart; + +var size = ConvenientHunk.prototype.size; +/** + * Number of lines in this hunk + * @return {Number} + */ +ConvenientHunk.prototype.size = size; diff --git a/lib/convenient_line.js b/lib/convenient_line.js deleted file mode 100644 index 2d39f6501f..0000000000 --- a/lib/convenient_line.js +++ /dev/null @@ -1,73 +0,0 @@ -var NodeGit = require("../"); - -function ConvenientLine(raw, i) { - this.raw = raw; - this.i = i; -} - -/** -* The content of the line -* @return {String} -*/ -ConvenientLine.prototype.origin = function() { - return this.raw.origin(); -}; - -/** -* The content of the line -* @return {String} -*/ -ConvenientLine.prototype.oldLineno = function() { - return this.raw.oldLineno(); -}; - -/** -* The content of the line -* @return {String} -*/ -ConvenientLine.prototype.newLineno = function() { - return this.raw.newLineno(); -}; - -/** -* The content of the line -* @return {String} -*/ -ConvenientLine.prototype.numLines = function() { - return this.raw.numLines(); -}; - -/** -* The content of the line -* @return {String} -*/ -ConvenientLine.prototype.contentLen = function() { - return this.raw.contentLen(); -}; - - -/** -* The content of the line -* @return {String} -*/ -ConvenientLine.prototype.contentOffset = function() { - return this.raw.contentOffset(); -}; - -/** -* The content of the line -* @return {String} -*/ -ConvenientLine.prototype.rawContent = function() { - return this.raw.content(); -}; - -/** -* The relevant line -* @return {String} -*/ -ConvenientLine.prototype.content = function() { - return this.raw.content().substring(0, this.raw.contentLen() - 1); -}; - -NodeGit.ConvenientLine = ConvenientLine; diff --git a/lib/convenient_patch.js b/lib/convenient_patch.js index ce3f626886..1e825382b7 100644 --- a/lib/convenient_patch.js +++ b/lib/convenient_patch.js @@ -1,128 +1,131 @@ var NodeGit = require("../"); -var Diff = NodeGit.Diff; -var ConvenientHunk = NodeGit.ConvenientHunk; -function ConvenientPatch(delta, patch) { - this.delta = delta; - this.patch = patch; -} +var ConvenientPatch = NodeGit.ConvenientPatch; +var hunks = ConvenientPatch.prototype.hunks; /** - * Old name of the file - * @return {String} + * The hunks in this patch + * @async + * @return {Array} a promise that resolves to an array of + * ConvenientHunks */ -ConvenientPatch.prototype.oldFile = function() { - return this.delta.oldFile(); -}; +ConvenientPatch.prototype.hunks = hunks; +var isAdded = ConvenientPatch.prototype.isAdded; /** - * New name of the file - * @return {String} + * Is this an added patch? + * @return {Boolean} */ -ConvenientPatch.prototype.newFile = function() { - return this.delta.newFile(); -}; +ConvenientPatch.prototype.isAdded = isAdded; +var isConflicted = ConvenientPatch.prototype.isConflicted; /** - * The number of hunks in this patch - * @return {Number} + * Is this a conflicted patch? + * @return {Boolean} */ -ConvenientPatch.prototype.size = function() { - return this.patch.numHunks(); -}; +ConvenientPatch.prototype.isConflicted = isConflicted; +var isCopied = ConvenientPatch.prototype.isCopied; /** - * The hunks in this patch - * @return {[ConvenientHunk]} an array of ConvenientHunks + * Is this a copied patch? + * @return {Boolean} */ -ConvenientPatch.prototype.hunks = function() { - var result = []; - - for (var i = 0; i < this.size(); i++) { - result.push(new ConvenientHunk(this.patch, i)); - } - - return result; -}; +ConvenientPatch.prototype.isCopied = isCopied; +var isDeleted = ConvenientPatch.prototype.isDeleted; /** - * The status of this patch (unmodified, added, deleted) - * @return {Number} + * Is this a deleted patch? + * @return {Boolean} */ -ConvenientPatch.prototype.status = function() { - return this.delta.status(); -}; +ConvenientPatch.prototype.isDeleted = isDeleted; +var isIgnored = ConvenientPatch.prototype.isIgnored; /** - * Is this an unmodified patch? + * Is this an ignored patch? * @return {Boolean} */ -ConvenientPatch.prototype.isUnmodified = function() { - return this.status() == Diff.DELTA.UNMODIFIED; -}; +ConvenientPatch.prototype.isIgnored = isIgnored; +var isModified = ConvenientPatch.prototype.isModified; /** - * Is this an added patch? + * Is this an modified patch? * @return {Boolean} */ -ConvenientPatch.prototype.isAdded = function() { - return this.status() == Diff.DELTA.ADDED; -}; +ConvenientPatch.prototype.isModified = isModified; +var isRenamed = ConvenientPatch.prototype.isRenamed; /** - * Is this a deleted patch? + * Is this a renamed patch? * @return {Boolean} */ -ConvenientPatch.prototype.isDeleted = function() { - return this.status() == Diff.DELTA.DELETED; -}; +ConvenientPatch.prototype.isRenamed = isRenamed; +var isTypeChange = ConvenientPatch.prototype.isTypeChange; /** - * Is this an modified patch? + * Is this a type change? * @return {Boolean} */ -ConvenientPatch.prototype.isModified = function() { - return this.status() == Diff.DELTA.MODIFIED; -}; +ConvenientPatch.prototype.isTypeChange = isTypeChange; +var isUnmodified = ConvenientPatch.prototype.isUnmodified; /** - * Is this a renamed patch? + * Is this an unmodified patch? * @return {Boolean} */ -ConvenientPatch.prototype.isRenamed = function() { - return this.status() == Diff.DELTA.RENAMED; -}; +ConvenientPatch.prototype.isUnmodified = isUnmodified; +var isUnreadable = ConvenientPatch.prototype.isUnreadable; /** - * Is this a copied patch? + * Is this an undreadable patch? * @return {Boolean} */ -ConvenientPatch.prototype.isCopied = function() { - return this.status() == Diff.DELTA.COPIED; -}; +ConvenientPatch.prototype.isUnreadable = isUnreadable; +var isUntracked = ConvenientPatch.prototype.isUntracked; /** - * Is this an ignored patch? + * Is this an untracked patch? * @return {Boolean} */ -ConvenientPatch.prototype.isIgnored = function() { - return this.status() == Diff.DELTA.IGNORED; -}; +ConvenientPatch.prototype.isUntracked = isUntracked; /** - * Is this an untracked patch? - * @return {Boolean} + * @typedef lineStats + * @type {Object} + * @property {number} total_context # of contexts in the patch + * @property {number} total_additions # of lines added in the patch + * @property {number} total_deletions # of lines deleted in the patch + */ +var lineStats = ConvenientPatch.prototype.lineStats; +/** + * The line statistics of this patch (#contexts, #added, #deleted) + * @return {lineStats} */ -ConvenientPatch.prototype.isUntracked = function() { - return this.status() == Diff.DELTA.UNTRACKED; -}; +ConvenientPatch.prototype.lineStats = lineStats; +var newFile = ConvenientPatch.prototype.newFile; /** - * Is this a type change? - * @return {Boolean} + * New attributes of the file + * @return {DiffFile} */ -ConvenientPatch.prototype.isTypeChange = function() { - return this.status() == Diff.DELTA.TYPECHANGE; -}; +ConvenientPatch.prototype.newFile = newFile; -NodeGit.ConvenientPatch = ConvenientPatch; +var oldFile = ConvenientPatch.prototype.oldFile; +/** + * Old attributes of the file + * @return {DiffFile} + */ +ConvenientPatch.prototype.oldFile = oldFile; + +var size = ConvenientPatch.prototype.size; +/** + * The number of hunks in this patch + * @return {Number} + */ +ConvenientPatch.prototype.size = size; + +var status = ConvenientPatch.prototype.status; +/** + * The status of this patch (unmodified, added, deleted) + * @return {Number} + */ +ConvenientPatch.prototype.status = status; diff --git a/lib/credential.js b/lib/credential.js new file mode 100644 index 0000000000..af1a59125e --- /dev/null +++ b/lib/credential.js @@ -0,0 +1,34 @@ +var util = require("util"); +var NodeGit = require("../"); + +var Credential = NodeGit.Credential; + +var deprecatedFn = (method) => + util.deprecate( + Credential[method].bind(Credential), + `Use NodeGit.Credential.${method} instead of NodeGit.Cred.${method}` + ); + +var createCredTypeDeprecationMessage = type => + `Use NodeGit.Credential.TYPE.${type} instead of NodeGit.Cred.TYPE.${type}`; + +NodeGit.Cred = { + defaultNew: deprecatedFn("defaultNew"), + sshKeyFromAgent: deprecatedFn("sshKeyFromAgent"), + sshKeyNew: deprecatedFn("sshKeyNew"), + sshKeyMemoryNew: deprecatedFn("sshKeyMemoryNew"), + usernameNew: deprecatedFn("usernameNew"), + userpassPlaintextNew: deprecatedFn("userpassPlaintextNew"), + TYPE: Object.keys(Credential.TYPE).reduce( + (type, key) => { + Object.defineProperty(type, key, { + get: util.deprecate( + () => Credential.TYPE[key], + createCredTypeDeprecationMessage(type) + ) + }); + return type; + }, + {} + ) +}; diff --git a/lib/deprecated/structs/ApplyOptions.js b/lib/deprecated/structs/ApplyOptions.js new file mode 100644 index 0000000000..cd9f22ca07 --- /dev/null +++ b/lib/deprecated/structs/ApplyOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.flags = 0; +}; diff --git a/lib/deprecated/structs/BlameOptions.js b/lib/deprecated/structs/BlameOptions.js new file mode 100644 index 0000000000..8ffd415de9 --- /dev/null +++ b/lib/deprecated/structs/BlameOptions.js @@ -0,0 +1,6 @@ +module.exports = function() { + this.flags = 0; + this.minMatchCharacters = 0; + this.minLine = 0; + this.maxLine = 0; +}; diff --git a/lib/deprecated/structs/BlobFilterOptions.js b/lib/deprecated/structs/BlobFilterOptions.js new file mode 100644 index 0000000000..df9a3d762b --- /dev/null +++ b/lib/deprecated/structs/BlobFilterOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.flags = 1; +}; diff --git a/lib/deprecated/structs/CheckoutOptions.js b/lib/deprecated/structs/CheckoutOptions.js new file mode 100644 index 0000000000..89e28d0939 --- /dev/null +++ b/lib/deprecated/structs/CheckoutOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.checkoutStrategy = 1; + this.disableFilters = 0; + this.dirMode = 0; + this.fileMode = 0; + this.fileOpenFlags = 0; + this.notifyFlags = 0; +}; diff --git a/lib/deprecated/structs/CherrypickOptions.js b/lib/deprecated/structs/CherrypickOptions.js new file mode 100644 index 0000000000..fce5efa102 --- /dev/null +++ b/lib/deprecated/structs/CherrypickOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.mainline = 0; + this.mergeOpts = new NodeGit.MergeOptions(); +}; diff --git a/lib/deprecated/structs/CloneOptions.js b/lib/deprecated/structs/CloneOptions.js new file mode 100644 index 0000000000..84deb60da8 --- /dev/null +++ b/lib/deprecated/structs/CloneOptions.js @@ -0,0 +1,6 @@ +module.exports = function(NodeGit) { + this.bare = 0; + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.fetchOpts = new NodeGit.FetchOptions(); + this.local = 0; +}; diff --git a/lib/deprecated/structs/DescribeFormatOptions.js b/lib/deprecated/structs/DescribeFormatOptions.js new file mode 100644 index 0000000000..6e9d25031a --- /dev/null +++ b/lib/deprecated/structs/DescribeFormatOptions.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.abbreviatedSize = 7; + this.alwaysUseLongFormat = 0; +}; diff --git a/lib/deprecated/structs/DescribeOptions.js b/lib/deprecated/structs/DescribeOptions.js new file mode 100644 index 0000000000..a4c29a2a7b --- /dev/null +++ b/lib/deprecated/structs/DescribeOptions.js @@ -0,0 +1,6 @@ +module.exports = function() { + this.describeStrategy = 0; + this.maxCandidatesTags = 10; + this.onlyFollowFirstParent = 0; + this.showCommitOidAsFallback = 0; +}; diff --git a/lib/deprecated/structs/DiffFindOptions.js b/lib/deprecated/structs/DiffFindOptions.js new file mode 100644 index 0000000000..459bc0ac16 --- /dev/null +++ b/lib/deprecated/structs/DiffFindOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.breakRewriteThreshold = 0; + this.copyThreshold = 0; + this.flags = 0; + this.renameFromRewriteThreshold = 0; + this.renameLimit = 0; + this.renameThreshold = 0; +}; diff --git a/lib/deprecated/structs/DiffOptions.js b/lib/deprecated/structs/DiffOptions.js new file mode 100644 index 0000000000..eeb6c5c3a1 --- /dev/null +++ b/lib/deprecated/structs/DiffOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.contextLines = 3; + this.flags = 0; + this.idAbbrev = 0; + this.ignoreSubmodules = -1; + this.interhunkLines = 0; + this.maxSize = 0; +}; diff --git a/lib/deprecated/structs/FetchOptions.js b/lib/deprecated/structs/FetchOptions.js new file mode 100644 index 0000000000..cd3f890dc2 --- /dev/null +++ b/lib/deprecated/structs/FetchOptions.js @@ -0,0 +1,7 @@ +module.exports = function(NodeGit) { + this.callbacks = new NodeGit.RemoteCallbacks(); + this.downloadTags = 0; + this.proxyOpts = new NodeGit.ProxyOptions(); + this.prune = 0; + this.updateFetchhead = 1; +}; diff --git a/lib/deprecated/structs/MergeFileInput.js b/lib/deprecated/structs/MergeFileInput.js new file mode 100644 index 0000000000..0b77f13830 --- /dev/null +++ b/lib/deprecated/structs/MergeFileInput.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.mode = 0; + this.size = 0; +}; diff --git a/lib/deprecated/structs/MergeFileOptions.js b/lib/deprecated/structs/MergeFileOptions.js new file mode 100644 index 0000000000..fd7101514d --- /dev/null +++ b/lib/deprecated/structs/MergeFileOptions.js @@ -0,0 +1,5 @@ +module.exports = function() { + this.favor = 0; + this.flags = 0; + this.markerSize = 0; +}; diff --git a/lib/deprecated/structs/MergeOptions.js b/lib/deprecated/structs/MergeOptions.js new file mode 100644 index 0000000000..3c73243a27 --- /dev/null +++ b/lib/deprecated/structs/MergeOptions.js @@ -0,0 +1,8 @@ +module.exports = function() { + this.fileFavor = 0; + this.fileFlags = 0; + this.flags = 1; + this.recursionLimit = 0; + this.renameThreshold = 0; + this.targetLimit = 0; +}; diff --git a/lib/deprecated/structs/ProxyOptions.js b/lib/deprecated/structs/ProxyOptions.js new file mode 100644 index 0000000000..d1b3260bae --- /dev/null +++ b/lib/deprecated/structs/ProxyOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.type = 0; +}; diff --git a/lib/deprecated/structs/PushOptions.js b/lib/deprecated/structs/PushOptions.js new file mode 100644 index 0000000000..bab5bc14f9 --- /dev/null +++ b/lib/deprecated/structs/PushOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.callbacks = new NodeGit.RemoteCallbacks(); + this.pbParallelism = 1; + this.proxyOpts = new NodeGit.ProxyOptions(); +}; diff --git a/lib/deprecated/structs/RebaseOptions.js b/lib/deprecated/structs/RebaseOptions.js new file mode 100644 index 0000000000..414b296b5a --- /dev/null +++ b/lib/deprecated/structs/RebaseOptions.js @@ -0,0 +1,6 @@ +module.exports = function(NodeGit) { + this.checkoutOptions = new NodeGit.CheckoutOptions(); + this.inmemory = 0; + this.mergeOptions = new NodeGit.MergeOptions(); + this.quiet = 0; +}; diff --git a/lib/deprecated/structs/RemoteCreateOptions.js b/lib/deprecated/structs/RemoteCreateOptions.js new file mode 100644 index 0000000000..cd9f22ca07 --- /dev/null +++ b/lib/deprecated/structs/RemoteCreateOptions.js @@ -0,0 +1,3 @@ +module.exports = function() { + this.flags = 0; +}; diff --git a/lib/deprecated/structs/RepositoryInitOptions.js b/lib/deprecated/structs/RepositoryInitOptions.js new file mode 100644 index 0000000000..39657b17ea --- /dev/null +++ b/lib/deprecated/structs/RepositoryInitOptions.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.flags = 0; + this.mode = 0; +}; diff --git a/lib/deprecated/structs/RevertOptions.js b/lib/deprecated/structs/RevertOptions.js new file mode 100644 index 0000000000..fce5efa102 --- /dev/null +++ b/lib/deprecated/structs/RevertOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.mainline = 0; + this.mergeOpts = new NodeGit.MergeOptions(); +}; diff --git a/lib/deprecated/structs/StashApplyOptions.js b/lib/deprecated/structs/StashApplyOptions.js new file mode 100644 index 0000000000..a7a9fcc839 --- /dev/null +++ b/lib/deprecated/structs/StashApplyOptions.js @@ -0,0 +1,4 @@ +module.exports = function(NodeGit) { + this.checkoutOptions = new NodeGit.CheckoutOptions(); + this.flags = 0; +}; diff --git a/lib/deprecated/structs/StatusOptions.js b/lib/deprecated/structs/StatusOptions.js new file mode 100644 index 0000000000..d7c35c0f4d --- /dev/null +++ b/lib/deprecated/structs/StatusOptions.js @@ -0,0 +1,4 @@ +module.exports = function() { + this.flags = 0; + this.show = 0; +}; diff --git a/lib/deprecated/structs/SubmoduleUpdateOptions.js b/lib/deprecated/structs/SubmoduleUpdateOptions.js new file mode 100644 index 0000000000..8dad87f119 --- /dev/null +++ b/lib/deprecated/structs/SubmoduleUpdateOptions.js @@ -0,0 +1,5 @@ +module.exports = function(NodeGit) { + this.allowFetch = 1; + this.checkoutOpts = new NodeGit.CheckoutOptions(); + this.fetchOpts = new NodeGit.FetchOptions(); +}; diff --git a/lib/diff.js b/lib/diff.js index 91f72d1683..2ae41a62b6 100644 --- a/lib/diff.js +++ b/lib/diff.js @@ -1,69 +1,25 @@ var NodeGit = require("../"); var Diff = NodeGit.Diff; -var ConvenientPatch = NodeGit.ConvenientPatch; -var normalizeOptions = NodeGit.Utils.normalizeOptions; var Patch = NodeGit.Patch; +var _blobToBuffer = Diff.blobToBuffer; /** - * Retrieve patches in this difflist - * - * @return {[ConvenientPatch]} an array of ConvenientPatches + * Directly run a diff between a blob and a buffer. + * @async + * @param {Blob} old_blob Blob for old side of diff, or NULL for empty blob + * @param {String} old_as_path Treat old blob as if it had this filename; + * can be NULL + * @param {String} buffer Raw data for new side of diff, or NULL for empty + * @param {String} buffer_as_path Treat buffer as if it had this filename; + * can be NULL + * @param {DiffOptions} opts Options for diff, or NULL for default options + * @param {Function} file_cb Callback for "file"; made once if there is a diff; + * can be NULL + * @param {Function} binary_cb Callback for binary files; can be NULL + * @param {Function} hunk_cb Callback for each hunk in diff; can be NULL + * @param {Function} line_cb Callback for each line in diff; can be NULL */ -Diff.prototype.patches = function() { - var size = this.numDeltas(); - var result = []; - - for (var i = 0; i < size; i++) { - result.push(new ConvenientPatch(this.getDelta(i), Patch.fromDiff(this, i))); - } - - return result; -}; - -// Override Diff.indexToWorkdir to normalize opts -var indexToWorkdir = Diff.indexToWorkdir; -Diff.indexToWorkdir = function(repo, index, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return indexToWorkdir(repo, index, opts); -}; - -// Override Diff.treeToIndex to normalize opts -var treeToIndex = Diff.treeToIndex; -Diff.treeToIndex = function(repo, tree, index, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return treeToIndex(repo, tree, index, opts); -}; - -// Override Diff.treeToTree to normalize opts -var treeToTree = Diff.treeToTree; -Diff.treeToTree = function(repo, from_tree, to_tree, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return treeToTree(repo, from_tree, to_tree, opts); -}; - -// Override Diff.treeToWorkdir to normalize opts -var treeToWorkdir = Diff.treeToWorkdir; -Diff.treeToWorkdir = function(repo, tree, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return treeToWorkdir(repo, tree, opts); -}; - -// Override Diff.treeToWorkdir to normalize opts -var treeToWorkdirWithIndex = Diff.treeToWorkdirWithIndex; -Diff.treeToWorkdirWithIndex = function(repo, tree, opts) { - opts = normalizeOptions(opts, NodeGit.DiffOptions); - return treeToWorkdirWithIndex(repo, tree, opts); -}; - -// Override Diff.findSimilar to normalize opts -var findSimilar = Diff.prototype.findSimilar; -Diff.prototype.findSimilar = function(opts) { - opts = normalizeOptions(opts, NodeGit.DiffFindOptions); - return findSimilar.call(this, opts); -}; - -var blobToBuffer = Diff.blobToBuffer; Diff.blobToBuffer= function( old_blob, old_as_path, @@ -71,22 +27,41 @@ Diff.blobToBuffer= function( buffer_as_path, opts, file_cb, + binary_cb, hunk_cb, line_cb) { - var bufferLength = !buffer ? 0 : buffer.length; - - opts = normalizeOptions(opts, NodeGit.DiffOptions); + var bufferText; + var bufferLength; + if (buffer instanceof Buffer) { + bufferText = buffer.toString("utf8"); + bufferLength = Buffer.byteLength(buffer, "utf8"); + } else { + bufferText = buffer; + bufferLength = !buffer ? 0 : Buffer.byteLength(buffer, "utf8"); + } - return blobToBuffer.call( + return _blobToBuffer.call( this, old_blob, old_as_path, - buffer, + bufferText, bufferLength, buffer_as_path, opts, file_cb, + binary_cb, hunk_cb, line_cb, null); }; + +/** + * Retrieve patches in this difflist + * + * @async + * @return {Array} a promise that resolves to an array of + * ConvenientPatches + */ +Diff.prototype.patches = function(idxs) { + return Patch.convenientFromDiff(this, idxs); +}; diff --git a/lib/diff_file.js b/lib/diff_file.js new file mode 100644 index 0000000000..34ce315ce2 --- /dev/null +++ b/lib/diff_file.js @@ -0,0 +1,38 @@ +var NodeGit = require("../"); + +var DiffFile = NodeGit.DiffFile; + +var flags = DiffFile.prototype.flags; +/** + * Returns the file's flags + * @return {Number} + */ +DiffFile.prototype.flags = flags; + +var id = DiffFile.prototype.id; +/** + * Returns the file's Oid + * @return {Oid} + */ +DiffFile.prototype.id = id; + +var mode = DiffFile.prototype.mode; +/** + * Returns the file's mode + * @return {Number} + */ +DiffFile.prototype.mode = mode; + +var path = DiffFile.prototype.path; +/** + * Returns the file's path + * @return {String} + */ +DiffFile.prototype.path = path; + +var size = DiffFile.prototype.size; +/** + * Returns the file's size + * @return {Number} + */ +DiffFile.prototype.size = size; diff --git a/lib/diff_line.js b/lib/diff_line.js new file mode 100644 index 0000000000..f856f07c7d --- /dev/null +++ b/lib/diff_line.js @@ -0,0 +1,32 @@ +var NodeGit = require("../"); +var DiffLine = NodeGit.DiffLine; + +var _rawContent = DiffLine.prototype.content; + +/** +* The relevant line +* @return {String} +*/ +DiffLine.prototype.content = function() { + if (!this._cache) { + this._cache = {}; + } + + if (!this._cache.content) { + this._cache.content = Buffer.from(this.rawContent()) + .slice(0, this.contentLen()) + .toString("utf8"); + } + + return this._cache.content; +}; + +/** +* The non utf8 translated text +* @return {String} +*/ +DiffLine.prototype.rawContent = function() { + return _rawContent.call(this); +}; + +NodeGit.DiffLine = DiffLine; diff --git a/lib/error.js b/lib/error.js new file mode 100644 index 0000000000..819299681c --- /dev/null +++ b/lib/error.js @@ -0,0 +1,17 @@ +var util = require("util"); +var NodeGit = require("../"); + +// Deprecated ----------------------------------------------------------------- + +// In 0.28.0 git_error was majorly refactored to have better naming in libgit2 +// We will continue to support the old enum entries but with a deprecation +// warning as they will go away soon. +Object.keys(NodeGit.Error.CODE).forEach((key) => { + Object.defineProperty(NodeGit.Error.CODE, `GITERR_${key}`, { + get: util.deprecate( + () => NodeGit.Error.CODE[key], + `Use NodeGit.Error.CODE.${key} instead of ` + + `NodeGit.Error.CODE.GETERR_${key}.` + ) + }); +}); diff --git a/lib/filter_registry.js b/lib/filter_registry.js new file mode 100644 index 0000000000..cfa17415e0 --- /dev/null +++ b/lib/filter_registry.js @@ -0,0 +1,22 @@ +var NodeGit = require("../"); + +var FilterRegistry = NodeGit.FilterRegistry; + +var _register = FilterRegistry.register; + +// register should add filter by name to dict and return +// Override FilterRegistry.register to normalize Filter +FilterRegistry.register = function(name, filter, priority) { + // setting default value of attributes + if (filter.attributes === undefined) { + filter.attributes = ""; + } + + if (!filter.check || !filter.apply) { + return Promise.reject(new Error( + "ERROR: please provide check and apply callbacks for filter" + )); + } + + return _register(name, filter, priority); +}; diff --git a/lib/graph.js b/lib/graph.js new file mode 100644 index 0000000000..7371410076 --- /dev/null +++ b/lib/graph.js @@ -0,0 +1,15 @@ +var NodeGit = require("../"); + +var Graph = NodeGit.Graph; + +var _reachableFromAny = Graph.reachableFromAny; + +/** + * Determine if a commit is reachable from any of a list of commits by following parent edges. + * @param {repository} the repository where the commits exist + * @param {commit} a previously loaded commit + * @param {descendant_array} oids of the commits + */ +Graph.reachableFromAny = function(repository, commit, descendant_array) { + return _reachableFromAny(repository, commit, descendant_array, descendant_array.length); +}; diff --git a/lib/index.js b/lib/index.js index a7f41571e9..ad37cea782 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,8 +1,15 @@ +var util = require("util"); var NodeGit = require("../"); var Index = NodeGit.Index; -var Status = NodeGit.Status; -var Pathspec = NodeGit.Pathspec; + +var _addAll = Index.prototype.addAll; +var _removeAll = Index.prototype.removeAll; +var _updateAll = Index.prototype.updateAll; + +Index.prototype.addAll = function(pathspec, flags, matchedCallback) { + return _addAll.call(this, pathspec || "*", flags, matchedCallback, null); +}; /** * Return an array of the entries in this index. @@ -19,38 +26,78 @@ Index.prototype.entries = function() { return result; }; -var addAll = Index.prototype.addAll; -Index.prototype.addAll = function(pathspec, flags, matchedCallback) { - // This status path code is here to speedup addall, which currently is - // excessively slow due to adding every single unignored file to the index - // even if it has no changes. Remove this when it's fixed in libgit2 - // https://github.com/libgit2/libgit2/issues/2687 - var paths = []; - var repo = this.owner(); - var statusCB = function(path) { - paths.push(path); - }; - var idx = this; - var ps = Pathspec.create(pathspec || "*"); - - return Status.foreach(repo, statusCB) - .then(function() { - return paths; - }) - .then(function(paths) { - paths = paths.filter(function(path) { - return !!(ps.matchesPath(0, path)); - }); - return addAll.call(idx, paths, flags, matchedCallback, null); - }); -}; - -var removeAll = Index.prototype.removeAll; Index.prototype.removeAll = function(pathspec, matchedCallback) { - return removeAll.call(this, pathspec || "*", matchedCallback, null); + return _removeAll.call(this, pathspec || "*", matchedCallback, null); }; -var updateAll = Index.prototype.updateAll; Index.prototype.updateAll = function(pathspec, matchedCallback) { - return updateAll.call(this, pathspec || "*", matchedCallback, null); + return _updateAll.call(this, pathspec || "*", matchedCallback, null); +}; + +// Deprecated ----------------------------------------------------------------- + +NodeGit.Index.CAP = {}; +Object.keys(NodeGit.Index.CAPABILITY).forEach((key) => { + Object.defineProperty(NodeGit.Index.CAP, key, { + get: util.deprecate( + () => NodeGit.Index.CAPABILITY[key], + `Use NodeGit.Index.CAPABILITY.${key} instead of ` + + `NodeGit.Index.CAP.${key}.` + ) + }); +}); + +NodeGit.Enums.INDXENTRY_FLAG = {}; +Object.defineProperty(NodeGit.Enums.INDXENTRY_FLAG, "IDXENTRY_EXTENDED", { + get: util.deprecate( + () => NodeGit.Index.ENTRY_FLAG.ENTRY_EXTENDED, + "Use NodeGit.Index.ENTRY_FLAG.ENTRY_EXTENDED instead of " + + "NodeGit.Enums.INDXENTRY_FLAG.IDXENTRY_EXTENDED." + ) +}); +Object.defineProperty(NodeGit.Enums.INDXENTRY_FLAG, "IDXENTRY_VALID", { + get: util.deprecate( + () => NodeGit.Index.ENTRY_FLAG.ENTRY_VALID, + "Use NodeGit.Index.ENTRY_FLAG.ENTRY_VALID instead of " + + "NodeGit.Enums.INDXENTRY_FLAG.IDXENTRY_VALID." + ) +}); + +NodeGit.Enums.IDXENTRY_EXTENDED_FLAG = {}; +var EXTENDED_FLAGS_MAP = { + IDXENTRY_INTENT_TO_ADD: "ENTRY_INTENT_TO_ADD", + IDXENTRY_SKIP_WORKTREE: "ENTRY_SKIP_WORKTREE", + S: "S", + IDXENTRY_UPTODATE: "ENTRY_UPTODATE" +}; +Object.keys(EXTENDED_FLAGS_MAP).forEach((key) => { + const newKey = EXTENDED_FLAGS_MAP[key]; + Object.defineProperty(NodeGit.Enums.IDXENTRY_EXTENDED_FLAG, key, { + get: util.deprecate( + () => NodeGit.Index.ENTRY_EXTENDED_FLAG[newKey], + `Use NodeGit.Index.ENTRY_EXTENDED_FLAG.${newKey} instead of ` + + `NodeGit.Enums.IDXENTRY_EXTENDED_FLAG.${key}.` + ) + }); +}); + +var DEPRECATED_EXTENDED_FLAGS = { + IDXENTRY_EXTENDED2: 32768, + IDXENTRY_UPDATE: 1, + IDXENTRY_REMOVE: 2, + IDXENTRY_ADDED: 8, + IDXENTRY_HASHED: 16, + IDXENTRY_UNHASHED: 32, + IDXENTRY_WT_REMOVE: 64, + IDXENTRY_CONFLICTED: 128, + IDXENTRY_UNPACKED: 256, + IDXENTRY_NEW_SKIP_WORKTREE: 512, }; +Object.keys(DEPRECATED_EXTENDED_FLAGS).forEach((key) => { + Object.defineProperty(NodeGit.Enums.IDXENTRY_EXTENDED_FLAG, key, { + get: util.deprecate( + () => DEPRECATED_EXTENDED_FLAGS[key], + "LibGit2 has removed this flag for public usage." + ) + }); +}); diff --git a/lib/merge.js b/lib/merge.js index a7102aad86..549bbad919 100644 --- a/lib/merge.js +++ b/lib/merge.js @@ -1,9 +1,8 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; -var Promise = require("nodegit-promise"); var Merge = NodeGit.Merge; -var mergeCommits = Merge.commits; +var _commits = Merge.commits; +var _merge = Merge.merge; /** * Merge 2 commits together and create an new index that can @@ -15,12 +14,28 @@ var mergeCommits = Merge.commits; * @param {MergeOptions} [options] The merge tree options (null for default) */ Merge.commits = function(repo, ourCommit, theirCommit, options) { - options = normalizeOptions(options, NodeGit.MergeOptions); - return Promise.all([ repo.getCommit(ourCommit), repo.getCommit(theirCommit) ]).then(function(commits) { - return mergeCommits.call(this, repo, commits[0], commits[1], options); + return _commits.call(this, repo, commits[0], commits[1], options); }); }; + +/** + * Merge a commit into HEAD and writes the results to the working directory. + * + * @param {Repository} repo Repository that contains the given commits + * @param {AnnotatedCommit} theirHead The annotated commit to merge into HEAD + * @param {MergeOptions} [mergeOpts] The merge tree options (null for default) + * @param {CheckoutOptions} [checkoutOpts] The checkout options + * (null for default) + */ +Merge.merge = function(repo, theirHead, mergeOpts, checkoutOpts) { + // Even though git_merge takes an array of annotated_commits, it expects + // exactly one to have been passed in or it will throw an error... ÂŻ\_(ă„)_/ÂŻ + var theirHeads = [theirHead]; + + return _merge.call(this, repo, theirHeads, theirHeads.length, + mergeOpts, checkoutOpts); +}; diff --git a/lib/note.js b/lib/note.js index 4f3ff76bbb..8e46427cf6 100644 --- a/lib/note.js +++ b/lib/note.js @@ -2,8 +2,9 @@ var NodeGit = require("../"); var Note = NodeGit.Note; +var _foreach = Note.foreach; + // Override Note.foreach to eliminate the need to pass null payload -var foreach = Note.foreach; Note.foreach = function(repo, notesRef, callback) { function wrapperCallback(blobId, objectId) { // We need to copy the OID since libgit2 types are getting cleaned up @@ -12,5 +13,5 @@ Note.foreach = function(repo, notesRef, callback) { return callback(blobId.copy(), objectId.copy()); } - return foreach(repo, notesRef, wrapperCallback, null); + return _foreach(repo, notesRef, wrapperCallback, null); }; diff --git a/lib/object.js b/lib/object.js index 21938883fa..680aebd121 100644 --- a/lib/object.js +++ b/lib/object.js @@ -1,35 +1,45 @@ +var util = require("util"); var NodeGit = require("../"); var Obj = NodeGit.Object; /** - * Is this object a commit? + * Is this object a blob? * @return {Boolean} */ -Obj.prototype.isCommit = function() { - return this.type() == Obj.TYPE.COMMIT; +Obj.prototype.isBlob = function() { + return this.type() == Obj.TYPE.BLOB; }; /** - * Is this object a tree? + * Is this object a commit? * @return {Boolean} */ -Obj.prototype.isTree = function() { - return this.type() == Obj.TYPE.TREE; +Obj.prototype.isCommit = function() { + return this.type() == Obj.TYPE.COMMIT; }; /** - * Is this object a blob? + * Is this object a tag? * @return {Boolean} */ -Obj.prototype.isBlob = function() { - return this.type() == Obj.TYPE.BLOB; +Obj.prototype.isTag = function() { + return this.type() == Obj.TYPE.TAG; }; /** - * Is this object a tag? + * Is this object a tree? * @return {Boolean} */ -Obj.prototype.isTag = function() { - return this.type() == Obj.TYPE.TAG; +Obj.prototype.isTree = function() { + return this.type() == Obj.TYPE.TREE; }; + +// Deprecated ----------------------------------------------------------------- + +Object.defineProperty(Obj.TYPE, "BAD", { + get: util.deprecate( + () => Obj.TYPE.INVALID, + "Use NodeGit.Object.TYPE.INVALID instead of NodeGit.Object.TYPE.BAD." + ) +}); diff --git a/lib/odb.js b/lib/odb.js deleted file mode 100644 index 85a7649281..0000000000 --- a/lib/odb.js +++ /dev/null @@ -1,14 +0,0 @@ -var NodeGit = require("../"); - -var Odb = NodeGit.Odb; -var read = Odb.prototype.read; - -Odb.prototype.read = function(oid, callback) { - return read.call(this, oid).then(function(odbObject) { - if (typeof callback === "function") { - callback(null, odbObject); - } - - return odbObject; - }, callback); -}; diff --git a/lib/oid.js b/lib/oid.js index c3a84ecfb3..fcbf9b48f8 100644 --- a/lib/oid.js +++ b/lib/oid.js @@ -4,11 +4,11 @@ var Oid = NodeGit.Oid; // Backwards compatibility. Object.defineProperties(Oid.prototype, { - "toString": { + "allocfmt": { value: Oid.prototype.tostrS, enumerable: false }, - "allocfmt": { + "toString": { value: Oid.prototype.tostrS, enumerable: false } diff --git a/lib/rebase.js b/lib/rebase.js new file mode 100644 index 0000000000..821d470ddd --- /dev/null +++ b/lib/rebase.js @@ -0,0 +1,86 @@ +var NodeGit = require("../"); +var Rebase = NodeGit.Rebase; + +var _init = Rebase.init; +var _open = Rebase.open; + +function defaultRebaseOptions(repository, options, checkoutStrategy) { + if (options) { + // Ensure we don't modify the passed-in options object. + // This could lead to us recursing commitCreateCb if the same + // options object is later re-used. + options = Object.assign({}, options); + + if (options.signingCb && !options.commitCreateCb) { + console.warn("signingCb is deperecated, use commitCreateCb instead."); + + let signingCb = options.signingCb; + options.commitCreateCb = function ( + author, + committer, + message_encoding, + message, + tree, + parent_count, + parents + ) { + return repository.createCommitWithSignature( + null, + author, + committer, + message, + tree, + parents, + signingCb).then((oid) => { + return oid; + }); + }; + } + } else if (checkoutStrategy) { + options = { + checkoutOptions: { + checkoutStrategy: checkoutStrategy + } + }; + } + + return options; +} + +/** + * Initializes a rebase + * @async + * @param {Repository} repo The repository to perform the rebase + * @param {AnnotatedCommit} branch The terminal commit to rebase, or NULL to + * rebase the current branch + * @param {AnnotatedCommit} upstream The commit to begin rebasing from, or NULL + * to rebase all reachable commits + * @param {AnnotatedCommit} onto The branch to rebase onto, or NULL to rebase + * onto the given upstream + * @param {RebaseOptions} options Options to specify how rebase is performed, + * or NULL + * @return {Remote} + */ +Rebase.init = function(repository, branch, upstream, onto, options) { + return _init(repository, branch, upstream, onto, defaultRebaseOptions( + repository, + options, + NodeGit.Checkout.STRATEGY.FORCE + )); +}; + +/** + * Opens an existing rebase that was previously started by either an invocation + * of Rebase.open or by another client. + * @async + * @param {Repository} repo The repository that has a rebase in-progress + * @param {RebaseOptions} options Options to specify how rebase is performed + * @return {Remote} + */ +Rebase.open = function(repository, options) { + return _open(repository, defaultRebaseOptions( + repository, + options, + NodeGit.Checkout.STRATEGY.SAFE + )); +}; diff --git a/lib/reference.js b/lib/reference.js index d9b3b8c273..af3e006216 100644 --- a/lib/reference.js +++ b/lib/reference.js @@ -1,3 +1,4 @@ +var util = require("util"); var NodeGit = require("../"); var LookupWrapper = NodeGit.Utils.lookupWrapper; @@ -5,39 +6,39 @@ var Reference = NodeGit.Reference; var Branch = NodeGit.Branch; /** -* Retrieves the reference pointed to by the oid +* Retrieves the reference by it's short name * @async * @param {Repository} repo The repo that the reference lives in * @param {String|Reference} id The reference to lookup * @param {Function} callback * @return {Reference} */ -Reference.lookup = LookupWrapper(Reference); +Reference.dwim = LookupWrapper(Reference, Reference.dwim); /** -* Retrieves the reference by it's short name +* Retrieves the reference pointed to by the oid * @async * @param {Repository} repo The repo that the reference lives in * @param {String|Reference} id The reference to lookup * @param {Function} callback * @return {Reference} */ -Reference.dwim = LookupWrapper(Reference, Reference.dwim); +Reference.lookup = LookupWrapper(Reference); /** - * Returns true if this reference is valid + * Returns true if this reference is not symbolic * @return {Boolean} */ -Reference.prototype.isValid = function() { - return this.type() != Reference.TYPE.INVALID; +Reference.prototype.isConcrete = function() { + return this.type() == Reference.TYPE.DIRECT; }; /** - * Returns true if this reference is not symbolic + * Returns if the ref is pointed at by HEAD * @return {Boolean} */ -Reference.prototype.isConcrete = function() { - return this.type() == Reference.TYPE.OID; +Reference.prototype.isHead = function() { + return Branch.isHead(this); }; /** @@ -48,6 +49,14 @@ Reference.prototype.isSymbolic = function() { return this.type() == Reference.TYPE.SYMBOLIC; }; +/** + * Returns true if this reference is valid + * @return {Boolean} + */ +Reference.prototype.isValid = function() { + return this.type() != Reference.TYPE.INVALID; +}; + /** * Returns the name of the reference. * @return {String} @@ -56,10 +65,149 @@ Reference.prototype.toString = function() { return this.name(); }; +const getTerminal = (repo, refName, depth = 10, prevRef = null) => { + if (depth <= 0) { + return Promise.resolve({ + error: NodeGit.Error.CODE.ENOTFOUND, + out: prevRef + }); + } + + return NodeGit.Reference.lookup(repo, refName) + .then((ref) => { + if (ref.type() === NodeGit.Reference.TYPE.DIRECT) { + return { + error: NodeGit.Error.CODE.OK, + out: ref + }; + } else { + return getTerminal(repo, ref.symbolicTarget(), depth - 1, ref) + .then(({ error, out }) => { + if (error === NodeGit.Error.CODE.ENOTFOUND && !out) { + return { error, out: ref }; + } else { + return { error, out }; + } + }); + } + }) + .catch((error) => { + return { + error: error.errno, + out: null + }; + }); +}; + +const getSignatureForReflog = (repo) => { + const { email, name } = repo.ident(); + if (email && name) { + return Promise.resolve(NodeGit.Signature.now(name, email)); + } + + return NodeGit.Signature.default(repo) + .catch(() => NodeGit.Signature.now("unknown", "unknown")); +}; + /** - * Returns if the ref is pointed at by HEAD - * @return {bool} + * Given a reference name, follows symbolic links and updates the direct + * reference to point to a given OID. Updates the reflog with a given message. + * + * @async + * @param {Repository} repo The repo where the reference and objects live + * @param {String} refName The reference name to update + * @param {Oid} oid The target OID that the reference will point to + * @param {String} logMessage The reflog message to be writted + * @param {Signature} signature Optional signature to use for the reflog entry */ -Reference.prototype.isHead = function() { - return Branch.isHead(this); +Reference.updateTerminal = function ( + repo, + refName, + oid, + logMessage, + signature +) { + let signatureToUse; + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => getSignatureForReflog(repo)) + .then((sig) => { + signatureToUse = sig; + return Promise.resolve(); + }); + } else { + signatureToUse = signature; + } + + return promiseChain + .then(() => getTerminal(repo, refName)) + .then(({ error, out }) => { + if (error === NodeGit.Error.CODE.ENOTFOUND && out) { + return NodeGit.Reference.create( + repo, + out.symbolicTarget(), + oid, + 0, + logMessage + ); + } else if (error === NodeGit.Error.CODE.ENOTFOUND) { + return NodeGit.Reference.create( + repo, + refName, + oid, + 0, + logMessage + ); + } else { + return NodeGit.Reference.createMatching( + repo, + out.name(), + oid, + 1, + out.target(), + logMessage + ); + } + }) + .then(() => NodeGit.Reflog.read(repo, refName)) + .then((reflog) => { + // Janky, but works. Ideally, we would want to generate the correct reflog + // entry in the first place, rather than drop the most recent entry and + // write the correct one. + // NOTE: There is a theoretical race condition that could happen here. + // We may want to consider some kind of transactional logic to make sure + // that the reflog on disk isn't modified before we can write back. + reflog.drop(0, 1); + reflog.append(oid, signatureToUse, logMessage); + return reflog.write(); + }); }; + +// Deprecated ----------------------------------------------------------------- + +Object.defineProperty(NodeGit.Reference.TYPE, "OID", { + get: util.deprecate( + () => NodeGit.Reference.TYPE.DIRECT, + "Use NodeGit.Reference.TYPE.DIRECT instead of NodeGit.Reference.TYPE.OID." + ) +}); + +Object.defineProperty(NodeGit.Reference.TYPE, "LISTALL", { + get: util.deprecate( + () => NodeGit.Reference.TYPE.ALL, + "Use NodeGit.Reference.TYPE.ALL instead of NodeGit.Reference.TYPE.LISTALL." + ) +}); + +NodeGit.Reference.NORMALIZE = {}; +Object.keys(NodeGit.Reference.FORMAT).forEach((key) => { + Object.defineProperty(NodeGit.Reference.NORMALIZE, `REF_FORMAT_${key}`, { + get: util.deprecate( + () => NodeGit.Reference.FORMAT[key], + `Use NodeGit.Reference.FORMAT.${key} instead of ` + + `NodeGit.Reference.NORMALIZE.REF_FORMAT_${key}.` + ) + }); +}); diff --git a/lib/remote.js b/lib/remote.js index e6e242ccf6..c0483ca87a 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -1,10 +1,8 @@ +var util = require("util"); var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; var lookupWrapper = NodeGit.Utils.lookupWrapper; var Remote = NodeGit.Remote; -var setCallbacks = Remote.prototype.setCallbacks; -var push = Remote.prototype.push; /** * Retrieves the remote by name @@ -16,29 +14,32 @@ var push = Remote.prototype.push; */ Remote.lookup = lookupWrapper(Remote); -Remote.prototype.setCallbacks = function(callbacks) { - callbacks = normalizeOptions(callbacks, NodeGit.RemoteCallbacks); - - return setCallbacks.call(this, callbacks); -}; - /** - * Pushes to a remote + * Lists advertised references from a remote. You must connect to the remote + * before using referenceList. * * @async - * @param {Array} refSpecs The ref specs that should be pushed - * @param {PushOptions} options Options for the checkout - * @param {Signature} signature The identity to use for the reflog of the - * updated references - * @param {String} message The message to use for the update reflog messages - * @return {Number} error code + * @return {Promise>} a list of the remote heads the remote + * had available at the last established + * connection. + * */ -Remote.prototype.push = function(refSpecs, options, signature, message) { - options = normalizeOptions(options, NodeGit.PushOptions); - signature = signature || this.owner().defaultSignature(); - message = message || "Push to " + this.name(); +Remote.prototype.referenceList = Remote.prototype.referenceList; - return push.call(this, refSpecs, options, signature, message); +NodeGit.Remote.COMPLETION_TYPE = {}; +var DEPRECATED_STATES = { + COMPLETION_DOWNLOAD: "DOWNLOAD", + COMPLETION_INDEXING: "INDEXING", + COMPLETION_ERROR: "ERROR" }; -module.exports = Remote; +Object.keys(DEPRECATED_STATES).forEach((key) => { + const newKey = DEPRECATED_STATES[key]; + Object.defineProperty(NodeGit.Remote.COMPLETION_TYPE, key, { + get: util.deprecate( + () => NodeGit.Remote.COMPLETION[newKey], + `Use NodeGit.Remote.COMPLETION.${newKey} instead of ` + + `NodeGit.Remote.COMPLETION_TYPE.${key}.` + ) + }); +}); diff --git a/lib/repository.js b/lib/repository.js index 2c90582699..64d566dcdc 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -1,9 +1,13 @@ -var Promise = require("nodegit-promise"); +var fse = require("fs-extra"); +var fp = require("lodash/fp"); var NodeGit = require("../"); var Blob = NodeGit.Blob; var Checkout = NodeGit.Checkout; var Commit = NodeGit.Commit; -var normalizeOptions = NodeGit.Utils.normalizeOptions; +var shallowClone = NodeGit.Utils.shallowClone; +var path = require("path"); +var Filter = NodeGit.Filter; +var FilterList = NodeGit.FilterList; var Reference = NodeGit.Reference; var Remote = NodeGit.Remote; var Repository = NodeGit.Repository; @@ -11,14 +15,475 @@ var Revwalk = NodeGit.Revwalk; var Status = NodeGit.Status; var StatusFile = NodeGit.StatusFile; var StatusList = NodeGit.StatusList; +var Submodule = NodeGit.Submodule; var Tag = NodeGit.Tag; var Tree = NodeGit.Tree; var TreeBuilder = NodeGit.Treebuilder; -Object.defineProperty(Repository.prototype, "openIndex", { - enumerable: false, - value: Repository.prototype.index -}); +var _discover = Repository.discover; +var _fetchheadForeach = Repository.prototype.fetchheadForeach; +var _mergeheadForeach = Repository.prototype.mergeheadForeach; + +function applySelectedLinesToTarget + (originalContent, newLines, pathHunks, isStaged, reverse) { + // 43: ascii code for '+' + // 45: ascii code for '-' + var lineTypes = { + ADDED: !reverse ? 43 : 45, + DELETED: !reverse ? 45 : 43 + }; + var newContent = ""; + var oldIndex = 0; + var linesPromises = []; + + var oldLines = originalContent.toString().split("\n"); + + // if no selected lines were sent, return the original content + if (!newLines || newLines.length === 0) { + return originalContent; + } + + function lineEqualsFirstNewLine(hunkLine) { + return ((hunkLine.oldLineno() === newLines[0].oldLineno()) && + (hunkLine.newLineno() === newLines[0].newLineno())); + } + + function processSelectedLine(hunkLine) { + // if this hunk line is a selected line find the selected line + var newLine = newLines.filter(function(nLine) { + return ((hunkLine.oldLineno() === nLine.oldLineno()) && + (hunkLine.newLineno() === nLine.newLineno())); + }); + + if (hunkLine.content().indexOf("\\ No newline at end of file") !== -1) { + return false; + } + + // determine what to add to the new content + if ((isStaged && newLine && newLine.length > 0) || + (!isStaged && (!newLine || newLine.length === 0))) { + if (hunkLine.origin() !== lineTypes.ADDED) { + newContent += hunkLine.content(); + } + if ((isStaged && hunkLine.origin() !== lineTypes.DELETED) || + (!isStaged && hunkLine.origin() !== lineTypes.ADDED)) { + oldIndex++; + } + } + else { + switch (hunkLine.origin()) { + case lineTypes.ADDED: + newContent += hunkLine.content(); + if (isStaged) { + oldIndex++; + } + break; + case lineTypes.DELETED: + if (!isStaged) { + oldIndex++; + } + break; + default: + newContent += oldLines[oldIndex++]; + if (oldIndex < oldLines.length) { + newContent += "\n"; + } + break; + } + } + } + + // find the affected hunk + pathHunks.forEach(function(pathHunk) { + linesPromises.push(pathHunk.lines()); + }); + + return Promise.all(linesPromises).then(function(results) { + for (var i = 0; i < results.length && newContent.length < 1; i++) { + var hunkStart = isStaged || reverse ? pathHunks[i].newStart() + : pathHunks[i].oldStart(); + var lines = results[i]; + if (lines.filter(lineEqualsFirstNewLine).length > 0) { + // add content that is before the hunk + while (hunkStart > (oldIndex + 1)) { + newContent += oldLines[oldIndex++] + "\n"; + } + + // modify the lines of the hunk according to the selection + lines.forEach(processSelectedLine); + + // add the rest of the file + while (oldLines.length > oldIndex) { + newContent += oldLines[oldIndex++] + + (oldLines.length > oldIndex ? "\n" : ""); + } + } + } + + return newContent; + }); +} + +function getPathHunks(repo, index, filePath, isStaged, additionalDiffOptions) { + var diffOptions = additionalDiffOptions ? { + flags: additionalDiffOptions + } : undefined; + + return Promise.resolve() + .then(function() { + if (isStaged) { + return repo.getHeadCommit() + .then(function getTreeFromCommit(commit) { + return commit.getTree(); + }) + .then(function getDiffFromTree(tree) { + return NodeGit.Diff.treeToIndex(repo, tree, index, diffOptions); + }); + } + + return NodeGit.Diff.indexToWorkdir(repo, index, { + flags: + NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | + NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS | + (additionalDiffOptions || 0) + }); + }) + .then(function(diff) { + return NodeGit.Status.file(repo, filePath) + .then(function(status) { + if (!(status & NodeGit.Status.STATUS.WT_MODIFIED) && + !(status & NodeGit.Status.STATUS.INDEX_MODIFIED)) { + return Promise.reject + ("Selected staging is only available on modified files."); + } + return diff.patches(); + }); + }) + .then(function(patches) { + var pathPatch = patches.filter(function(patch) { + return patch.newFile().path() === filePath; + }); + + if (pathPatch.length !== 1) { + return Promise.reject("No differences found for this file."); + } + + return pathPatch[0].hunks(); + }); +} + +function getReflogMessageForCommit(commit) { + var parentCount = commit.parentcount(); + var summary = commit.summary(); + var commitType; + + if (parentCount >= 2) { + commitType = " (merge)"; + } else if (parentCount == 0) { + commitType = " (initial)"; + } else { + commitType = ""; + } + + return `commit${commitType}: ${summary}`; +} + +/** + * Goes through a rebase's rebase operations and commits them if there are + * no merge conflicts + * + * @param {Repository} repository The repository that the rebase is being + * performed in + * @param {Rebase} rebase The current rebase being performed + * @param {Signature} signature Identity of the one performing the rebase + * @param {Function} beforeNextFn Callback to be called before each + * invocation of next(). If the callback + * returns a promise, the next() will be + * called when the promise resolves. + * @param {Function} beforeFinishFn Callback called before the invocation + * of finish(). If the callback returns a + * promise, finish() will be called when the + * promise resolves. This callback will be + * provided a detailed overview of the rebase + * @return {Int|Index} An error code for an unsuccesful rebase or an index for + * a rebase with conflicts + */ +function performRebase( + repository, + rebase, + signature, + beforeNextFn, + beforeFinishFn +) { + var beforeNextFnResult; + + /* In the case of FF merges and a beforeFinishFn, this will fail + * when looking for 'rewritten' so we need to handle that case. + */ + function readRebaseMetadataFile(fileName, continueOnError) { + return fse.readFile( + path.join(repository.path(), "rebase-merge", fileName), + { encoding: "utf8" } + ) + .then(fp.trim) + .catch(function(err) { + if (continueOnError) { + return null; + } + throw err; + }); + } + + function calcHeadName(input) { + return input.replace(/refs\/heads\/(.*)/, "$1"); + } + + function getPromise() { + return rebase.next() + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + if (index.hasConflicts()) { + throw index; + } + + return rebase.commit(null, signature); + }) + .then(function() { + + return performRebase( + repository, + rebase, + signature, + beforeNextFn, + beforeFinishFn + ); + }) + .catch(function(error) { + if (error && error.errno === NodeGit.Error.CODE.ITEROVER) { + const calcRewritten = fp.cond([ + [fp.isEmpty, fp.constant(null)], + [fp.stubTrue, fp.flow([ + fp.split("\n"), + fp.map(fp.split(" ")) + ])] + ]); + + const beforeFinishFnPromise = !beforeFinishFn ? + Promise.resolve() : + Promise.all([ + readRebaseMetadataFile("onto_name"), + readRebaseMetadataFile("onto"), + readRebaseMetadataFile("head-name").then(calcHeadName), + readRebaseMetadataFile("orig-head"), + readRebaseMetadataFile("rewritten", true).then(calcRewritten) + ]) + .then(function([ + ontoName, + ontoSha, + originalHeadName, + originalHeadSha, + rewritten + ]) { + return beforeFinishFn({ + ontoName, + ontoSha, + originalHeadName, + originalHeadSha, + rebase, + rewritten + }); + }); + + return beforeFinishFnPromise + .then(function() { + return rebase.finish(signature); + }); + } else { + throw error; + } + }); + } + + if(beforeNextFn) { + beforeNextFnResult = beforeNextFn(rebase); + // if beforeNextFn returns a promise, chain the promise + return Promise.resolve(beforeNextFnResult) + .then(getPromise); + } + + return getPromise(); +} + +/** + * Look for a git repository, returning its path. + * + * @async + * @param {String} startPath The base path where the lookup starts. + * @param {Number} acrossFs If non-zero, then the lookup will not stop when a + filesystem device change is detected while exploring + parent directories. + * @param {String} ceilingDirs A list of absolute symbolic link free paths. + the search will stop if any of these paths + are hit. This may be set to null + * @return {String} Path of the git repository + */ +Repository.discover = function(startPath, acrossFs, ceilingDirs) { + return _discover(startPath, acrossFs, ceilingDirs) + .then(function(foundPath) { + return path.resolve(foundPath); + }); +}; + + +Repository.getReferences = function(repo, type, refNamesOnly) { + return repo.getReferences().then(function(refList) { + var filteredRefList = refList.filter(function(reference) { + return type === Reference.TYPE.ALL || reference.type( ) === type; + }); + + if (refNamesOnly) { + return filteredRefList.map(function(reference) { + return reference.name(); + }); + } + + return filteredRefList; + }); +}; + +/** + * This will set the HEAD to point to the local branch and then attempt + * to update the index and working tree to match the content of the + * latest commit on that branch + * + * @async + * @param {String|Reference} branch the branch to checkout + * @param {Object|CheckoutOptions} opts the options to use for the checkout + */ +Repository.prototype.checkoutBranch = function(branch, opts) { + var repo = this; + + return repo.getReference(branch) + .then(function(ref) { + if (!ref.isBranch()) { + return false; + } + return repo.checkoutRef(ref, opts); + }); +}; + +/** + * This will set the HEAD to point to the reference and then attempt + * to update the index and working tree to match the content of the + * latest commit on that reference + * + * @async + * @param {Reference} reference the reference to checkout + * @param {Object|CheckoutOptions} opts the options to use for the checkout + */ +Repository.prototype.checkoutRef = function(reference, opts) { + var repo = this; + opts = opts || {}; + + opts.checkoutStrategy = opts.checkoutStrategy || + (NodeGit.Checkout.STRATEGY.SAFE | + NodeGit.Checkout.STRATEGY.RECREATE_MISSING); + return repo.getReferenceCommit(reference.name()) + .then(function(commit) { + return commit.getTree(); + }) + .then(function(tree) { + return Checkout.tree(repo, tree, opts); + }) + .then(function() { + var name = reference.name(); + return repo.setHead(name); + }); +}; + +/** + * Continues an existing rebase + * + * @async + * @param {Signature} signature Identity of the one performing the rebase + * @param {Function} beforeNextFn Callback to be called before each step + * of the rebase. If the callback returns a + * promise, the rebase will resume when the + * promise resolves. The rebase object is + * is passed to the callback. + * @param {Function} beforeFinishFn Callback called before the invocation + * of finish(). If the callback returns a + * promise, finish() will be called when the + * promise resolves. This callback will be + * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with + * @return {Oid|Index} A commit id for a succesful merge or an index for a + * rebase with conflicts + */ +Repository.prototype.continueRebase = function( + signature, + beforeNextFn, + beforeFinishFn, + rebaseOptions +) { + const repo = this; + + let rebase; + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } + + return promiseChain + .then(() => repo.refreshIndex()) + .then((index) => { + if (index.hasConflicts()) { + throw index; + } + + return NodeGit.Rebase.open(repo, rebaseOptions); + }) + .then((_rebase) => { + rebase = _rebase; + return rebase.commit(null, signature) + .catch((e) => { + // If the first commit on continueRebase is a + // "patch already applied" error, + // interpret that as an explicit "skip commit" + // and ignore the error. + const errno = fp.get(["errno"], e); + if (errno === NodeGit.Error.CODE.EAPPLIED) { + return; + } + + throw e; + }); + }) + .then(() => { + return performRebase( + repo, + rebase, + signature, + beforeNextFn, + beforeFinishFn + ); + }) + .then((error) => { + if (error) { + throw error; + } + + return repo.getBranchCommit("HEAD"); + }); +}; /** * Creates a branch with the passed in name pointing to the commit @@ -26,13 +491,10 @@ Object.defineProperty(Repository.prototype, "openIndex", { * @async * @param {String} name Branch name, e.g. "master" * @param {Commit|String|Oid} commit The commit the branch will point to - * @param {bool} force Overwrite branch if it exists - * @param {Signature} signature Identity to use to populate reflog - * @param {String} logMessage One line message to be appended to the reflog - * @return {Ref} + * @param {Boolean} force Overwrite branch if it exists + * @return {Reference} */ -Repository.prototype.createBranch = -function(name, commit, force, signature, logMessage) { +Repository.prototype.createBranch = function(name, commit, force) { var repo = this; if (commit instanceof Commit) { @@ -40,9 +502,7 @@ function(name, commit, force, signature, logMessage) { repo, name, commit, - force ? 1 : 0, - signature, - logMessage); + force ? 1 : 0); } else { return repo.getCommit(commit).then(function(commit) { @@ -50,181 +510,541 @@ function(name, commit, force, signature, logMessage) { repo, name, commit, - force ? 1 : 0, - signature, - logMessage); + force ? 1 : 0); }); } }; /** - * Look up a refs's commit. + * Create a blob from a buffer * * @async - * @param {String|Ref} name Ref name, e.g. "master", "refs/heads/master" - * or Branch Ref - * @return {Commit} + * @param {Buffer} buffer + * @return {Oid} */ -Repository.prototype.getReferenceCommit = function(name, callback) { - var repository = this; +Repository.prototype.createBlobFromBuffer = function(buffer) { + return Blob.createFromBuffer(this, buffer, buffer.length); +}; - return this.getReference(name).then(function(reference) { - return repository.getCommit(reference.target()).then(function(commit) { - if (typeof callback === "function") { - callback(null, commit); - } +/** + * Create a commit + * + * @async + * @param {String} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {String} message + * @param {Oid|String} Tree + * @param {Array} parents + * @return {Oid} The oid of the commit + */ +Repository.prototype.createCommit = function( + updateRef, author, committer, message, tree, parents) { - return commit; - }); - }, callback); + var repo = this; + var promises = []; + + parents = parents || []; + + promises.push(repo.getTree(tree)); + + parents.forEach(function(parent) { + promises.push(repo.getCommit(parent)); + }); + + return Promise.all(promises).then(function(results) { + tree = results[0]; + + // Get the normalized values for our input into the function + var parentsLength = parents.length; + parents = []; + + for (var i = 0; i < parentsLength; i++) { + parents.push(results[i + 1]); + } + + return Commit.create( + repo, + updateRef, + author, + committer, + null /* use default message encoding */, + message, + tree, + parents.length, + parents + ); + }); }; /** -* Look up a branch. Alias for `getReference` -* -* @async -* @param {String|Ref} name Ref name, e.g. "master", "refs/heads/master" -* or Branch Ref -* @return {Ref} -*/ -Repository.prototype.getBranch = function(name, callback) { - return this.getReference(name, callback); + * Create a commit + * + * @async + * @param {Signature} author + * @param {Signature} committer + * @param {String} message + * @param {Oid|String} treeOid + * @param {Array} parents + * @return {String} The content of the commit object + * as a string + */ +Repository.prototype.createCommitBuffer = function( + author, committer, message, treeOid, parents) { + + const repo = this; + const promises = (parents || []) + .reduce(function(acc, parent) { + acc.push(repo.getCommit(parent)); + return acc; + }, [repo.getTree(treeOid)]); + + return Promise.all(promises) + .then(function([tree, ...parentCommits]) { + return Commit.createBuffer( + repo, + author, + committer, + null /* use default message encoding */, + message, + tree, + parentCommits.length, + parentCommits + ); + }); }; /** -* Look up a branch's most recent commit. Alias to `getReferenceCommit` -* -* @async -* @param {String|Ref} name Ref name, e.g. "master", "refs/heads/master" -* or Branch Ref -* @return {Commit} -*/ -Repository.prototype.getBranchCommit = function(name, callback) { - return this.getReferenceCommit(name, callback); + * Create a commit that is digitally signed + * + * @async + * @param {String} updateRef + * @param {Signature} author + * @param {Signature} committer + * @param {String} message + * @param {Tree|Oid|String} Tree + * @param {Array} parents + * @param {Function} onSignature Callback to be called with string to be signed + * @return {Oid} The oid of the commit + */ +Repository.prototype.createCommitWithSignature = function( + updateRef, + author, + committer, + message, + tree, + parents, + onSignature +) { + + var repo = this; + var promises = []; + var commitContent; + var skippedSigning; + + parents = parents || []; + + promises.push(repo.getTree(tree)); + + parents.forEach(function(parent) { + promises.push(repo.getCommit(parent)); + }); + + const createCommitPromise = Promise.all(promises).then(function(results) { + tree = results[0]; + + // Get the normalized values for our input into the function + var parentsLength = parents.length; + parents = []; + + for (var i = 0; i < parentsLength; i++) { + parents.push(results[i + 1]); + } + + return Commit.createBuffer( + repo, + author, + committer, + null /* use default message encoding */, + message, + tree, + parents.length, + parents + ); + }).then(function(commitContentResult) { + commitContent = commitContentResult; + if (!commitContent.endsWith("\n")) { + commitContent += "\n"; + } + return onSignature(commitContent); + }).then(function({ code, field, signedData }) { + switch (code) { + case NodeGit.Error.CODE.OK: + return Commit.createWithSignature( + repo, + commitContent, + signedData, + field + ); + case NodeGit.Error.CODE.PASSTHROUGH: + skippedSigning = true; + return Commit.create( + repo, + updateRef, + author, + committer, + null /* use default message encoding */, + message, + tree, + parents.length, + parents + ); + default: { + const error = new Error( + "Repository.prototype.createCommitWithSignature " + + `threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } + }); + + if (!updateRef) { + return createCommitPromise; + } + + return createCommitPromise + .then(function(commitOid) { + if (skippedSigning) { + return commitOid; + } + + return repo.getCommit(commitOid) + .then(function(commitResult) { + return Reference.updateTerminal( + repo, + updateRef, + commitOid, + getReflogMessageForCommit(commitResult), + committer + ); + }) + .then(function() { + return commitOid; + }); + }); }; /** - * Gets the branch that HEAD currently points to - * Is an alias to head() + * Creates a new commit on HEAD from the list of passed in files + * * @async - * @return {Reference} + * @param {Array} filesToAdd + * @param {Signature} author + * @param {Signature} committer + * @param {String} message + * @return {Oid} The oid of the new commit */ -Repository.prototype.getCurrentBranch = function() { - return this.head(); +Repository.prototype.createCommitOnHead = function( + filesToAdd, + author, + committer, + message) { + + var repo = this; + + return repo.refreshIndex() + .then(function(index) { + if (!filesToAdd) { + filesToAdd = []; + } + + return filesToAdd + .reduce(function(lastFilePromise, filePath) { + return lastFilePromise + .then(function() { + return index.addByPath(filePath); + }); + }, Promise.resolve()) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(treeOid) { + return repo.getHeadCommit() + .then(function(parent) { + if (parent !== null) { // To handle a fresh repo with no commits + parent = [parent]; + } + return repo.createCommit( + "HEAD", + author, + committer, + message, + treeOid, + parent + ); + }); + }); }; /** - * Lookup the reference with the given name. + * Creates a new lightweight tag * * @async - * @param {String|Ref} name Ref name, e.g. "master", "refs/heads/master" - * or Branch Ref + * @param {String|Oid} String sha or Oid + * @param {String} name the name of the tag * @return {Reference} */ -Repository.prototype.getReference = function(name, callback) { +Repository.prototype.createLightweightTag = function(oid, name) { var repository = this; - return Reference.dwim(this, name).then(function(reference) { - if (reference.isSymbolic()) { - return reference.resolve().then(function(reference) { - reference.repo = repository; + return Commit.lookup(repository, oid) + .then(function(commit) { + // Final argument is `force` which overwrites any previous tag + return Tag.createLightweight(repository, name, commit, 0); + }) + .then(function() { + return Reference.lookup(repository, "refs/tags/" + name); + }); +}; - if (typeof callback === "function") { - callback(null, reference); - } +/** + * Instantiate a new revision walker for browsing the Repository"s history. + * See also `Commit.prototype.history()` + * + * @return {Revwalk} + */ +Repository.prototype.createRevWalk = function() { + return Revwalk.create(this); +}; - return reference; - }, callback); - } else { - reference.repo = repository; - if (typeof callback === "function") { - callback(null, reference); +/** + * Creates a new annotated tag + * + * @async + * @param {String|Oid} String sha or Oid + * @param {String} name the name of the tag + * @param {String} message the description that will be attached to the + * annotated tag + * @return {Tag} + */ +Repository.prototype.createTag = function(oid, name, message) { + const repository = this; + let signature = null; + + return repository.defaultSignature() + .then((signatureResult) => { + signature = signatureResult; + return Commit.lookup(repository, oid); + }) + .then((commit) => { + // Final argument is `force` which overwrites any previous tag + return Tag.create(repository, name, commit, signature, message, 0); + }) + .then((tagOid) => { + return repository.getTag(tagOid); + }); +}; + +/** + * Gets the default signature for the default user and now timestamp + * + * @async + * @return {Signature} + */ +Repository.prototype.defaultSignature = function() { + return NodeGit.Signature.default(this) + .then((result) => { + if (!result || !result.name()) { + result = NodeGit.Signature.now("unknown", "unknown@example.com"); } - return reference; - } - }, callback); + return result; + }) + .catch(() => { + return NodeGit.Signature.now("unknown", "unknown@example.com"); + }); }; -Repository.getReferences = function(repo, type, refNamesOnly, callback) { - return Reference.list(repo).then(function(refList) { - var refFilterPromises = []; - var filteredRefs = []; +/** + * Deletes a tag from a repository by the tag name. + * + * @async + * @param {String} Short or full tag name + */ +Repository.prototype.deleteTagByName = function(name) { + var repository = this; - refList.forEach(function(refName) { - refFilterPromises.push(Reference.lookup(repo, refName) - .then(function(ref) { - if (type == Reference.TYPE.ALL || ref.type() == type) { - if (refNamesOnly) { - filteredRefs.push(refName); - return; - } + name = ~name.indexOf("refs/tags/") ? name.substr(10) : name; - if (ref.isSymbolic()) { - return ref.resolve().then(function(resolvedRef) { - resolvedRef.repo = repo; + return Tag.delete(repository, name); +}; - filteredRefs.push(resolvedRef); - }); - } - else { - filteredRefs.push(ref); - } - } - }) +/** + * Discard line selection of a specified file. + * Assumes selected lines are unstaged. + * + * @async + * @param {String} filePath The relative path of this file in the repo + * @param {Array} selectedLines The array of DiffLine objects + * selected for discarding + * @return {Number} 0 or an error code + */ +Repository.prototype.discardLines = + function(filePath, selectedLines, additionalDiffOptions) { + var repo = this; + var fullFilePath = path.join(repo.workdir(), filePath); + var index; + var originalContent; + var filterList; + + return repo.refreshIndex() + .then(function(indexResult) { + index = indexResult; + return FilterList.load( + repo, + null, + filePath, + Filter.MODE.CLEAN, + Filter.FLAG.DEFAULT ); - }); + }) + .then(function(_filterList) { + filterList = _filterList; - return Promise.all(refFilterPromises).then(function() { - if (typeof callback === "function") { - callback(null, filteredRefs); + if (filterList) { + return filterList.applyToFile(repo, filePath); } - return filteredRefs; - }, callback); - }); -}; + return fse.readFile(fullFilePath, "utf8"); + }) + .then(function(content) { + originalContent = content; + return getPathHunks(repo, index, filePath, false, additionalDiffOptions); + }) + .then(function(hunks) { + return applySelectedLinesToTarget( + originalContent, selectedLines, hunks, false, true + ); + }) + .then(function(newContent) { + return FilterList.load( + repo, + null, + filePath, + Filter.MODE.SMUDGE, + Filter.FLAG.DEFAULT + ) + .then(function(_filterList) { + filterList = _filterList; + if (filterList) { + /* jshint ignore:start */ + // We need the constructor for the check in NodeGit's C++ layer + // to accept an object, and this seems to be a nice way to do it + return filterList.applyToData(new String(newContent)); + /* jshint ignore:end */ + } + + return newContent; + }); + }) + .then(function(filteredContent) { + return fse.writeFile(fullFilePath, filteredContent); + }); +}; /** - * Lookup references for a repository. + * Fetches from a remote * * @async - * @param {Reference.TYPE} type Type of reference to look up - * @return {Array} + * @param {String|Remote} remote + * @param {Object|FetchOptions} fetchOptions Options for the fetch, includes + * callbacks for fetching */ -Repository.prototype.getReferences = function(type, callback) { - return Repository.getReferences(this, type, false, callback); +Repository.prototype.fetch = function( + remote, + fetchOptions) +{ + var repo = this; + + return repo.getRemote(remote) + .then(function(remote) { + return remote.fetch(null, fetchOptions, "Fetch from " + remote) + .then(function() { + return remote.disconnect(); + }); + }); }; /** - * Lookup reference names for a repository. + * Fetches from all remotes. This is done in series due to deadlocking issues + * with fetching from many remotes that can happen. * * @async - * @param {Reference.TYPE} type Type of reference to look up - * @return {Array} + * @param {Object|FetchOptions} fetchOptions Options for the fetch, includes + * callbacks for fetching */ -Repository.prototype.getReferenceNames = function(type, callback) { - return Repository.getReferences(this, type, true, callback); +Repository.prototype.fetchAll = function(fetchOptions) { + var repo = this; + + function createCallbackWrapper(fn, remote) { + return function() { + var args = Array.prototype.slice.call(arguments); + args.push(remote); + + return fn.apply(this, args); + }.bind(this); + } + + fetchOptions = fetchOptions || {}; + + var remoteCallbacks = fetchOptions.callbacks || {}; + + var credentials = remoteCallbacks.credentials; + var certificateCheck = remoteCallbacks.certificateCheck; + var transferProgress = remoteCallbacks.transferProgress; + + return repo.getRemoteNames() + .then(function(remotes) { + return remotes.reduce(function(fetchPromise, remote) { + var wrappedFetchOptions = shallowClone(fetchOptions); + var wrappedRemoteCallbacks = shallowClone(remoteCallbacks); + + if (credentials) { + wrappedRemoteCallbacks.credentials = + createCallbackWrapper(credentials, remote); + } + + if (certificateCheck) { + wrappedRemoteCallbacks.certificateCheck = + createCallbackWrapper(certificateCheck, remote); + } + + if (transferProgress) { + wrappedRemoteCallbacks.transferProgress = + createCallbackWrapper(transferProgress, remote); + } + + wrappedFetchOptions.callbacks = wrappedRemoteCallbacks; + + return fetchPromise.then(function() { + return repo.fetch(remote, wrappedFetchOptions); + }); + }, Promise.resolve()); + }); }; /** - * Retrieve the commit identified by oid. - * * @async - * @param {String|Oid} String sha or Oid - * @return {Commit} + * @param {FetchheadForeachCb} callback The callback function to be called on + * each entry */ -Repository.prototype.getCommit = function(oid, callback) { - var repository = this; - - return Commit.lookup(repository, oid).then(function(commit) { - commit.repo = repository; - - if (typeof callback === "function") { - callback(null, commit); - } - - return commit; - }, callback); +Repository.prototype.fetchheadForeach = function(callback) { + return _fetchheadForeach.call(this, callback, null); }; /** @@ -234,440 +1054,543 @@ Repository.prototype.getCommit = function(oid, callback) { * @param {String|Oid} String sha or Oid * @return {Blob} */ -Repository.prototype.getBlob = function(oid, callback) { +Repository.prototype.getBlob = function(oid) { var repository = this; return Blob.lookup(repository, oid).then(function(blob) { blob.repo = repository; + return blob; + }); +}; - if (typeof callback === "function") { - callback(null, blob); - } +/** +* Look up a branch. Alias for `getReference` +* +* @async +* @param {String|Reference} name Ref name, e.g. "master", "refs/heads/master" +* or Branch Ref +* @return {Reference} +*/ +Repository.prototype.getBranch = function(name) { + return this.getReference(name); +}; - return blob; - }, callback); +/** +* Look up a branch's most recent commit. Alias to `getReferenceCommit` +* +* @async +* @param {String|Reference} name Ref name, e.g. "master", "refs/heads/master" +* or Branch Ref +* @return {Commit} +*/ +Repository.prototype.getBranchCommit = function(name) { + return this.getReferenceCommit(name); }; /** - * Retrieve the tree represented by the oid. + * Retrieve the commit identified by oid. * * @async * @param {String|Oid} String sha or Oid - * @return {Tree} + * @return {Commit} */ -Repository.prototype.getTree = function(oid, callback) { +Repository.prototype.getCommit = function(oid) { var repository = this; - return Tree.lookup(repository, oid).then(function(tree) { - tree.repo = repository; - - if (typeof callback === "function") { - callback(null, tree); - } - - return tree; - }, callback); + return Commit.lookup(repository, oid); }; /** - * Creates a new annotated tag + * Gets the branch that HEAD currently points to + * Is an alias to head() * * @async - * @param {String|Oid} String sha or Oid - * @param {String} name the name of the tag - * @param {String} message the description that will be attached to the - * annotated tag - * @return {Tag} + * @return {Reference} */ -Repository.prototype.createTag = function(oid, name, message, callback) { - var repository = this; - var signature = repository.defaultSignature(); - - return Commit.lookup(repository, oid) - .then(function(commit) { - // Final argument is `force` which overwrites any previous tag - return Tag.create(repository, name, commit, signature, message, 0); - }) - .then(function(tagOid) { - return repository.getTag(tagOid, callback); - }); +Repository.prototype.getCurrentBranch = function() { + return this.head(); }; /** - * Creates a new lightweight tag + * Retrieve the commit that HEAD is currently pointing to * * @async - * @param {String|Oid} String sha or Oid - * @param {String} name the name of the tag - * @return {Reference} + * @return {Commit} */ -Repository.prototype.createLightweightTag = function(oid, name, callback) { - var repository = this; +Repository.prototype.getHeadCommit = function() { + var repo = this; - return Commit.lookup(repository, oid) - .then(function(commit) { - // Final argument is `force` which overwrites any previous tag - return Tag.createLightweight(repository, name, commit, 0); + return Reference.nameToId(repo, "HEAD") + .then(function(head) { + return repo.getCommit(head); }) - .then(function() { - return Reference.lookup(repository, "refs/tags/" + name); + .catch(function() { + return null; }); }; /** - * Retrieve the tag represented by the oid. + * Retrieve the master branch commit. * * @async - * @param {String|Oid} String sha or Oid - * @return {Tag} + * @return {Commit} */ -Repository.prototype.getTag = function(oid, callback) { - var repository = this; - - return Tag.lookup(repository, oid).then(function(reference) { - reference.repo = repository; - - if (typeof callback === "function") { - callback(null, reference); - } - - return reference; - }, callback); +Repository.prototype.getMasterCommit = function() { + return this.getBranchCommit("master"); }; /** - * Retrieve the tag represented by the tag name. + * Lookup the reference with the given name. * * @async - * @param {String} Short or full tag name - * @return {Tag} + * @param {String|Reference} name Ref name, e.g. "master", "refs/heads/master" + * or Branch Ref + * @return {Reference} */ -Repository.prototype.getTagByName = function(name, callback) { - var repo = this; - - name = ~name.indexOf("refs/tags/") ? name : "refs/tags/" + name; - - return Reference.nameToId(repo, name).then(function(oid) { - return Tag.lookup(repo, oid).then(function(reference) { - reference.repo = repo; +Repository.prototype.getReference = function(name) { + var repository = this; - if (typeof callback === "function") { - callback(null, reference); - } + return Reference.dwim(this, name).then(function(reference) { + if (reference.isSymbolic()) { + return reference.resolve().then(function(reference) { + reference.repo = repository; + return reference; + }); + } - return reference; - }); - }, callback); + reference.repo = repository; + return reference; + }); }; /** - * Deletes a tag from a repository by the tag name. + * Look up a refs's commit. * * @async - * @param {String} Short or full tag name + * @param {String|Reference} name Ref name, e.g. "master", "refs/heads/master" + * or Branch Ref + * @return {Commit} */ -Repository.prototype.deleteTagByName = function(name) { +Repository.prototype.getReferenceCommit = function(name) { var repository = this; - name = ~name.indexOf("refs/tags/") ? name.substr(10) : name; - - return Tag.delete(repository, name); + return this.getReference(name).then(function(reference) { + return repository.getCommit(reference.target()); + }); }; /** - * Instantiate a new revision walker for browsing the Repository"s history. - * See also `Commit.prototype.history()` + * Lookup reference names for a repository. * - * @param {String|Oid} String sha or Oid - * @return {RevWalk} + * @async + * @param {Reference.TYPE} type Type of reference to look up + * @return {Array} */ -Repository.prototype.createRevWalk = function() { - var revWalk = Revwalk.create(this); - revWalk.repo = this; - return revWalk; +Repository.prototype.getReferenceNames = function(type) { + return Repository.getReferences(this, type, true); }; /** - * Retrieve the master branch commit. + * Lookup references for a repository. * * @async - * @return {Commit} + * @param {Reference.TYPE} type Type of reference to look up + * @return {Array} */ -Repository.prototype.getMasterCommit = function(callback) { - return this.getBranchCommit("master", callback); -}; /** - * Retrieve the commit that HEAD is currently pointing to + * Gets a remote from the repo * * @async - * @return {Commit} + * @param {String|Remote} remote + * @return {Remote} The remote object */ -Repository.prototype.getHeadCommit = function(callback) { - var repo = this; +Repository.prototype.getRemote = function(remote) { + if (remote instanceof NodeGit.Remote) { + return Promise.resolve(remote); + } - return Reference.nameToId(repo, "HEAD").then(function(head) { - return repo.getCommit(head, callback); - }); + return NodeGit.Remote.lookup(this, remote); }; /** - * Create a commit +* Lists out the remotes in the given repository. +* +* @async +* @return {Object} Promise object. +*/ +Repository.prototype.getRemoteNames = function() { + return Remote.list(this); +}; + +/** + * Get the status of a repo to it's working directory * * @async - * @param {String} updateRef - * @param {Signature} author - * @param {Signature} committer - * @param {String} message - * @param {Tree|Oid|String} Tree - * @param {Array} parents - * @return {Oid} The oid of the commit + * @param {obj} opts + * @return {Array} */ -Repository.prototype.createCommit = function( - updateRef, author, committer, message, tree, parents, callback) { - - var repo = this; - var promises = []; - - parents = parents || []; +Repository.prototype.getStatus = function(opts) { + var statuses = []; + var statusCallback = function(path, status) { + statuses.push(new StatusFile({path: path, status: status})); + }; - promises.push(repo.getTree(tree)); + if (!opts) { + opts = { + flags: Status.OPT.INCLUDE_UNTRACKED | + Status.OPT.RECURSE_UNTRACKED_DIRS + }; + } - parents.forEach(function(parent) { - promises.push(repo.getCommit(parent)); + return Status.foreachExt(this, opts, statusCallback).then(function() { + return statuses; }); - - return Promise.all(promises).then(function(results) { - tree = results[0]; - - // Get the normalized values for our input into the function - var parentsLength = parents.length; - parents = []; - - for (var i = 0; i < parentsLength; i++) { - parents.push(results[i + 1]); - } - - return Commit.create( - repo, - updateRef, - author, - committer, - null /* use default message encoding */, - message, - tree, - parents.length, - parents - ); - }).then(function(commit) { - if (typeof callback === "function") { - callback(null, commit); - } - - return commit; - }, callback); }; /** - * Creates a new commit on HEAD from the list of passed in files + * Get extended statuses of a repo to it's working directory. Status entries + * have `status`, `headToIndex` delta, and `indexToWorkdir` deltas + * * @async - * @param {Array} filesToAdd - * @param {Signature} author - * @param {Signature} committer - * @param {String} message - * @return {Oid} The oid of the new commit + * @param {obj} opts + * @return {Array} */ -Repository.prototype.createCommitOnHead = function( - filesToAdd, - author, - committer, - message, - callback){ - var repo = this; - var index; +Repository.prototype.getStatusExt = function(opts) { + var statuses = []; - return repo.openIndex().then(function(index_) { - index = index_; - index.read(1); - return index.addAll(); - }) - .then(function() { - index.write(); + if (!opts) { + opts = { + flags: Status.OPT.INCLUDE_UNTRACKED | + Status.OPT.RECURSE_UNTRACKED_DIRS | + Status.OPT.RENAMES_INDEX_TO_WORKDIR | + Status.OPT.RENAMES_HEAD_TO_INDEX | + Status.OPT.RENAMES_FROM_REWRITES + }; + } - return index.writeTree(); - }).then(function(treeOid) { + return StatusList.create(this, opts) + .then(function(list) { + for (var i = 0; i < list.entrycount(); i++) { + var entry = Status.byIndex(list, i); + statuses.push(new StatusFile({entry: entry})); + } - return repo.getHeadCommit().then(function(parent) { - return repo.createCommit( - "HEAD", - author, - committer, - message, - treeOid, - [parent], - callback); + return statuses; }); - }, callback); }; /** - * Create a blob from a buffer + * Get the names of the submodules in the repository. + * + * @async + * @return {Array} + */ +Repository.prototype.getSubmoduleNames = function() { + var names = []; + var submoduleCallback = function(submodule, name, payload) { + names.push(name); + }; + + return Submodule.foreach(this, submoduleCallback).then(function() { + return names; + }); +}; + +/** + * Retrieve the tag represented by the oid. * - * @param {Buffer} buffer - * @return {Blob} + * @async + * @param {String|Oid} String sha or Oid + * @return {Tag} */ -Repository.prototype.createBlobFromBuffer = function(buffer, callback) { - return Blob.createFromBuffer(this, buffer, buffer.length, callback); +Repository.prototype.getTag = function(oid) { + var repository = this; + + return Tag.lookup(repository, oid).then(function(reference) { + reference.repo = repository; + return reference; + }); }; /** - * Create a new tree builder. + * Retrieve the tag represented by the tag name. * - * @param {Tree} tree + * @async + * @param {String} Short or full tag name + * @return {Tag} */ -Repository.prototype.treeBuilder = function() { - var builder = TreeBuilder.create(null); +Repository.prototype.getTagByName = function(name) { + var repo = this; - builder.root = builder; - builder.repo = this; + name = ~name.indexOf("refs/tags/") ? name : "refs/tags/" + name; - return builder; + return Reference.nameToId(repo, name) + .then(function(oid) { + return Tag.lookup(repo, oid); + }).then(function(reference) { + reference.repo = repo; + return reference; + }); }; /** - * Gets the default signature for the default user and now timestamp - * @return {Signature} + * Retrieve the tree represented by the oid. + * + * @async + * @param {String|Oid} String sha or Oid + * @return {Tree} */ -Repository.prototype.defaultSignature = function() { - var result = NodeGit.Signature.default(this); +Repository.prototype.getTree = function(oid) { + var repository = this; - if (!result.name()) { - result = NodeGit.Signature.now("unknown", "unknown@unknown.com"); - } + return Tree.lookup(repository, oid).then(function(tree) { + tree.repo = repository; + return tree; + }); +}; - return result; +/** + * Returns true if the repository is in the APPLY_MAILBOX or + * APPLY_MAILBOX_OR_REBASE state. + * @return {Boolean} + */ +Repository.prototype.isApplyingMailbox = function() { + var state = this.state(); + return state === NodeGit.Repository.STATE.APPLY_MAILBOX || + state === NodeGit.Repository.STATE.APPLY_MAILBOX_OR_REBASE; }; /** -* Lists out the remotes in the given repository. -* -* @param {Function} Optional callback -* @return {Object} Promise object. -*/ -Repository.prototype.getRemotes = function(callback) { - return Remote.list(this).then(function(remotes) { - if (typeof callback === "function") { - callback(null, remotes); - } + * Returns true if the repository is in the BISECT state. + * @return {Boolean} + */ +Repository.prototype.isBisecting = function() { + return this.state() === NodeGit.Repository.STATE.BISECT; +}; - return remotes; - }, callback); +/** + * Returns true if the repository is in the CHERRYPICK state. + * @return {Boolean} + */ +Repository.prototype.isCherrypicking = function() { + return this.state() === NodeGit.Repository.STATE.CHERRYPICK; }; /** - * Gets a remote from the repo - * - * @param {String|Remote} remote - * @param {Function} callback - * @return {Remote} The remote object + * Returns true if the repository is in the default NONE state. + * @return {Boolean} */ -Repository.prototype.getRemote = function(remote, callback) { - if (remote instanceof NodeGit.Remote) { - return Promise.resolve(remote).then(function(remoteObj) { - if (typeof callback === "function") { - callback(null, remoteObj); - } +Repository.prototype.isDefaultState = function() { + return this.state() === NodeGit.Repository.STATE.NONE; +}; - return remoteObj; - }, callback); - } +/** + * Returns true if the repository is in the MERGE state. + * @return {Boolean} + */ +Repository.prototype.isMerging = function() { + return this.state() === NodeGit.Repository.STATE.MERGE; +}; - return NodeGit.Remote.lookup(this, remote).then(function(remoteObj) { - if (typeof callback === "function") { - callback(null, remoteObj); - } +/** + * Returns true if the repository is in the REBASE, REBASE_INTERACTIVE, or + * REBASE_MERGE state. + * @return {Boolean} + */ +Repository.prototype.isRebasing = function() { + var state = this.state(); + return state === NodeGit.Repository.STATE.REBASE || + state === NodeGit.Repository.STATE.REBASE_INTERACTIVE || + state === NodeGit.Repository.STATE.REBASE_MERGE; +}; - return remoteObj; - }, callback); +/** + * Returns true if the repository is in the REVERT state. + * @return {Boolean} + */ +Repository.prototype.isReverting = function() { + return this.state() === NodeGit.Repository.STATE.REVERT; }; /** - * Fetches from a remote + * Rebases a branch onto another branch * - * @param {String|Remote} remote - * @param {Object|RemoteCallback} remoteCallbacks Any custom callbacks needed - * @param {Bool} pruneAfter will perform a prune after the fetch if true + * @async + * @param {String} branch + * @param {String} upstream + * @param {String} onto + * @param {Signature} signature Identity of the one performing the rebase + * @param {Function} beforeNextFn Callback to be called before each step + * of the rebase. If the callback returns a + * promise, the rebase will resume when the + * promise resolves. The rebase object is + * is passed to the callback. + * @param {Function} beforeFinishFn Callback called before the invocation + * of finish(). If the callback returns a + * promise, finish() will be called when the + * promise resolves. This callback will be + * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with + * @return {Oid|Index} A commit id for a succesful merge or an index for a + * rebase with conflicts */ -Repository.prototype.fetch = function( - remote, - remoteCallbacks, - pruneAfter, - callback) +Repository.prototype.rebaseBranches = function( + branch, + upstream, + onto, + signature, + beforeNextFn, + beforeFinishFn, + rebaseOptions +) { - var repo = this; + const repo = this; + let branchCommit; + let upstreamCommit; + let ontoCommit; + let mergeOptions = (rebaseOptions || {}).mergeOptions; + + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } - return repo.getRemote(remote).then(function(remote) { - remote.setCallbacks(remoteCallbacks); + return Promise.all([ + repo.getReference(branch), + upstream ? repo.getReference(upstream) : null, + onto ? repo.getReference(onto) : null + ]) + .then(function(refs) { + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repo, refs[0]), + upstream ? NodeGit.AnnotatedCommit.fromRef(repo, refs[1]) : null, + onto ? NodeGit.AnnotatedCommit.fromRef(repo, refs[2]) : null + ]); + }) + .then(function(annotatedCommits) { + branchCommit = annotatedCommits[0]; + upstreamCommit = annotatedCommits[1]; + ontoCommit = annotatedCommits[2]; - return remote.fetch(null, repo.defaultSignature(), "Fetch from " + remote) - .then(function() { - if (pruneAfter) { - remote.prune(); - } - }) - .then(function() { - return remote.disconnect(); - }).then(function() { - if (typeof callback === "function") { - callback(); - } - }); - }, callback); + return NodeGit.Merge.base(repo, branchCommit.id(), upstreamCommit.id()); + }) + .then(function(oid) { + if (oid.toString() === branchCommit.id().toString()) { + // we just need to fast-forward + return repo.mergeBranches(branch, upstream, null, null, mergeOptions) + .then(function() { + // checkout 'branch' to match the behavior of rebase + return repo.checkoutBranch(branch); + }); + } else if (oid.toString() === upstreamCommit.id().toString()) { + // 'branch' is already on top of 'upstream' + // checkout 'branch' to match the behavior of rebase + return repo.checkoutBranch(branch); + } + + return NodeGit.Rebase.init( + repo, + branchCommit, + upstreamCommit, + ontoCommit, + rebaseOptions + ) + .then(function(rebase) { + return performRebase( + repo, + rebase, + signature, + beforeNextFn, + beforeFinishFn + ); + }) + .then(function(error) { + if (error) { + throw error; + } + }); + }) + .then(function() { + return repo.getBranchCommit("HEAD"); + }); }; /** - * Fetches from all remotes - * @param {Object|RemoteCallback} remoteCallbacks Any custom callbacks needed - * @param {Bool} pruneAfter will perform a prune after the fetch if true + * Grabs a fresh copy of the index from the repository. Invalidates + * all previously grabbed indexes + * + * @async + * @return {Index} */ -Repository.prototype.fetchAll = function( - remoteCallbacks, - pruneAfter, - callback) -{ +Repository.prototype.refreshIndex = function() { var repo = this; - return repo.getRemotes().then(function(remotes) { - var fetchPromises = []; - - remotes.forEach(function(remote) { - fetchPromises.push( - repo.fetch(remote, remoteCallbacks, pruneAfter, callback)); - }); + repo.setIndex(); // clear the index - return Promise.all(fetchPromises); - }, callback); + return repo.index(); }; /** * Merge a branch onto another branch * - * @param {String|Ref} to - * @param {String|Ref} from + * @async + * @param {String|Reference} to + * @param {String|Reference} from + * @param {Signature} signature + * @param {Merge.PREFERENCE} mergePreference + * @param {MergeOptions} mergeOptions + * @param {MergeBranchOptions} mergeBranchOptions * @return {Oid|Index} A commit id for a succesful merge or an index for a * merge with conflicts */ -Repository.prototype.mergeBranches = function(to, from, signature) { - var repo = this; - var fromBranch; - var toBranch; - - signature = signature || repo.defaultSignature(); +Repository.prototype.mergeBranches = function( + to, + from, + signature, + mergePreference, + mergeOptions, + mergeBranchOptions +) { + const repo = this; + let fromBranch; + let toBranch; + // Support old parameter `processMergeMessageCallback` + const isOldOptionParameter = typeof mergeBranchOptions === "function"; + if (isOldOptionParameter) { + console.error("DeprecationWarning: Repository#mergeBranches parameter " + + "processMergeMessageCallback, use MergeBranchOptions"); + } + const processMergeMessageCallback = mergeBranchOptions && + (isOldOptionParameter ? + mergeBranchOptions : + mergeBranchOptions.processMergeMessageCallback) || + function (message) { return message; }; + const signingCallback = mergeBranchOptions && mergeBranchOptions.signingCb; + + mergePreference = mergePreference || NodeGit.Merge.PREFERENCE.NONE; + + let promiseChain = Promise.resolve(); + + if (!signature) { + promiseChain = promiseChain + .then(() => repo.defaultSignature()) + .then((signatureResult) => { + signature = signatureResult; + }); + } - return Promise.all([ - repo.getBranch(to), - repo.getBranch(from) - ]).then(function(objects) { + return promiseChain.then(() => Promise.all([ + repo.getBranch(to), + repo.getBranch(from) + ])) + .then((objects) => { toBranch = objects[0]; fromBranch = objects[1]; @@ -676,18 +1599,19 @@ Repository.prototype.mergeBranches = function(to, from, signature) { repo.getBranchCommit(fromBranch) ]); }) - .then(function(branchCommits) { + .then((branchCommits) => { var toCommitOid = branchCommits[0].toString(); var fromCommitOid = branchCommits[1].toString(); return NodeGit.Merge.base(repo, toCommitOid, fromCommitOid) - .then(function(baseCommit) { + .then((baseCommit) => { if (baseCommit.toString() == fromCommitOid) { // The commit we're merging to is already in our history. // nothing to do so just return the commit the branch is on return toCommitOid; } - else if (baseCommit.toString() == toCommitOid) { + else if (baseCommit.toString() == toCommitOid && + mergePreference !== NodeGit.Merge.PREFERENCE.NO_FASTFORWARD) { // fast forward var message = "Fast forward branch " + @@ -696,161 +1620,354 @@ Repository.prototype.mergeBranches = function(to, from, signature) { fromBranch.shorthand(); return branchCommits[1].getTree() - .then(function(tree) { + .then((tree) => { if (toBranch.isHead()) { // Checkout the tree if we're on the branch var opts = { - checkoutStrategy: NodeGit.Checkout.STRATEGY.SAFE_CREATE + checkoutStrategy: NodeGit.Checkout.STRATEGY.SAFE | + NodeGit.Checkout.STRATEGY.RECREATE_MISSING }; return NodeGit.Checkout.tree(repo, tree, opts); } }) - .then(function() { + .then(() => { return toBranch.setTarget( fromCommitOid, - signature, message) - .then(function() { + .then(() => { return fromCommitOid; }); }); } - else { + else if (mergePreference !== NodeGit.Merge.PREFERENCE.FASTFORWARD_ONLY) { + var updateHead; // We have to merge. Lets do it! - return NodeGit.Merge.commits(repo, toCommitOid, fromCommitOid) - .then(function(index) { + return NodeGit.Reference.lookup(repo, "HEAD") + .then((headRef) => { + return headRef.resolve(); + }) + .then((headRef) => { + updateHead = !!headRef && (headRef.name() === toBranch.name()); + return NodeGit.Merge.commits( + repo, + toCommitOid, + fromCommitOid, + mergeOptions + ); + }) + .then((index) => { // if we have conflicts then throw the index if (index.hasConflicts()) { throw index; } // No conflicts so just go ahead with the merge - index.write(); return index.writeTreeTo(repo); - }).then(function(oid) { + }) + .then((oid) => { + var mergeDecorator; + if (fromBranch.isTag()) { + mergeDecorator = "tag"; + } else if (fromBranch.isRemote()) { + mergeDecorator = "remote-tracking branch"; + } else { + mergeDecorator = "branch"; + } + var message = - "Merged " + + "Merge " + + mergeDecorator + + " '" + fromBranch.shorthand() + - " into " + - toBranch.shorthand(); + "'"; + + // https://github.com/git/git/blob/master/builtin/fmt-merge-msg.c#L456-L459 + if (toBranch.shorthand() !== "master") { + message += " into " + toBranch.shorthand(); + } + return Promise.all([oid, processMergeMessageCallback(message)]); + }) + .then(([oid, message]) => { + if (signingCallback) { + return repo.createCommitWithSignature( + toBranch.name(), + signature, + signature, + message, + oid, + [toCommitOid, fromCommitOid], + signingCallback + ); + } return repo.createCommit( toBranch.name(), signature, signature, message, oid, - [toCommitOid, fromCommitOid]); + [toCommitOid, fromCommitOid] + ); + }) + .then((commit) => { + // we've updated the checked out branch, so make sure we update + // head so that our index isn't messed up + if (updateHead) { + return repo.getBranch(to) + .then((branch) => { + return repo.getBranchCommit(branch); + }) + .then((branchCommit) => { + return branchCommit.getTree(); + }) + .then((tree) => { + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.SAFE | + NodeGit.Checkout.STRATEGY.RECREATE_MISSING + }; + return NodeGit.Checkout.tree(repo, tree, opts); + }) + .then(() => { + return commit; + }); + } + else { + return commit; + } }); } + else { + // A non fast-forwardable merge with ff-only + return toCommitOid; + } }); }); }; -// Override Repository.initExt to normalize initoptions -var initExt = Repository.initExt; -Repository.initExt = function(repo_path, opts) { - opts = normalizeOptions(opts, NodeGit.RepositoryInitOptions); - return initExt(repo_path, opts); +/** + * @async + * @param {MergeheadForeachCb} callback The callback function to be called on + * each entry + */ +Repository.prototype.mergeheadForeach = function(callback) { + return _mergeheadForeach.call(this, callback, null); }; /** - * Get the status of a repo to it's working directory + * Stages or unstages line selection of a specified file * - * @param {obj} opts - * @return {Array} + * @async + * @param {String|Array} filePath The relative path of this file in the repo + * @param {Boolean} stageNew Set to stage new filemode. Unset to unstage. + * @return {Number} 0 or an error code */ -Repository.prototype.getStatus = function(opts) { - var statuses = []; - var statusCallback = function(path, status) { - statuses.push(new StatusFile({path: path, status: status})); - }; +Repository.prototype.stageFilemode = + function(filePath, stageNew, additionalDiffOptions) { + var repo = this; + var index; + var diffOptions = additionalDiffOptions ? { + flags: additionalDiffOptions + } : undefined; + var diffPromise = stageNew ? + NodeGit.Diff.indexToWorkdir(repo, index, { + flags: + NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | + NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS | + (additionalDiffOptions || 0) + }) + : + repo.getHeadCommit() + .then(function getTreeFromCommit(commit) { + return commit.getTree(); + }) + .then(function getDiffFromTree(tree) { + return NodeGit.Diff.treeToIndex(repo, tree, index, diffOptions); + }); + var filePaths = (filePath instanceof Array) ? filePath : [filePath]; + + var indexLock = repo.path().replace(".git/", "") + ".git/index.lock"; + + return fse.remove(indexLock) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return diffPromise; + }) + .then(function(diff) { + var origLength = filePaths.length; + var fileFilterPromises = fp.map(function(p) { + return NodeGit.Status.file(repo, p) + .then(function(status) { + return { + path: p, + filter: ( + (status & NodeGit.Status.STATUS.WT_MODIFIED) || + (status & NodeGit.Status.STATUS.INDEX_MODIFIED) + ) + }; + }); + }, filePaths); + + return Promise.all(fileFilterPromises) + .then(function(results) { + filePaths = fp.flow([ + fp.filter(function(filterResult) { + return filterResult.filter; + }), + fp.map(function(filterResult) { + return filterResult.path; + }) + ])(results); + + if (filePaths.length === 0 && origLength > 0) { + return Promise.reject + ("Selected staging is only available on modified files."); + } + return diff.patches(); + }); + }) + .then(function(patches) { + var pathPatches = patches.filter(function(patch) { + return ~filePaths.indexOf(patch.newFile().path()); + }); + if (pathPatches.length === 0) { + return Promise.reject("No differences found for this file."); + } - if (!opts) { - opts = { - flags: Status.OPT.INCLUDE_UNTRACKED | - Status.OPT.RECURSE_UNTRACKED_DIRS - }; - } + return pathPatches + .reduce(function(lastIndexAddPromise, pathPatch) { + var entry = index.getByPath(pathPatch.newFile().path(), 0); - return Status.foreachExt(this, opts, statusCallback).then(function() { - return statuses; - }); + entry.mode = stageNew ? + pathPatch.newFile().mode() : pathPatch.oldFile().mode(); + + return lastIndexAddPromise + .then(function() { + return index.add(entry); + }); + }, Promise.resolve()); + }) + .then(function() { + return index.write(); + }); }; /** - * Get extended statuses of a repo to it's working directory. Status entries - * have `status`, `headToIndex` delta, and `indexToWorkdir` deltas + * Stages or unstages line selection of a specified file * - * @param {obj} opts - * @return {Array} + * @async + * @param {String} filePath The relative path of this file in the repo + * @param {Array} selectedLines The array of DiffLine objects + * selected for staging or unstaging + * @param {Boolean} isStaged Are the selected lines currently staged + * @return {Number} 0 or an error code */ -Repository.prototype.getStatusExt = function(opts) { - var statuses = []; +Repository.prototype.stageLines = + function(filePath, selectedLines, isSelectionStaged, additionalDiffOptions) { - if (!opts) { - opts = { - flags: Status.OPT.INCLUDE_UNTRACKED | - Status.OPT.RECURSE_UNTRACKED_DIRS | - Status.OPT.RENAMES_INDEX_TO_WORKDIR | - Status.OPT.RENAMES_HEAD_TO_INDEX | - Status.OPT.RENAMES_FROM_REWRITES - }; - } + var repo = this; + var index; + var originalBlob; + + // The following chain checks if there is a patch with no hunks left for the + // file, and no filemode changes were done on the file. It is then safe to + // stage the entire file so the file doesn't show as having unstaged changes + // in `git status`. Also, check if there are no type changes. + var lastHunkStagedPromise = function lastHunkStagedPromise(result) { + return NodeGit.Diff.indexToWorkdir(repo, index, { + flags: + NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | + NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS | + (additionalDiffOptions || 0) + }) + .then(function(diff) { + return diff.patches(); + }) + .then(function(patches) { + var pathPatch = patches.filter(function(patch) { + return patch.newFile().path() === filePath; + }); + var emptyPatch = false; + if (pathPatch.length > 0) { + // No hunks, unchanged file mode, and no type changes. + emptyPatch = pathPatch[0].size() === 0 && + pathPatch[0].oldFile().mode() === pathPatch[0].newFile().mode() && + !pathPatch[0].isTypeChange(); + } + if (emptyPatch) { + return index.addByPath(filePath) + .then(function() { + return index.write(); + }); + } - var list = StatusList.create(this, opts); + return result; + }); + }; - for (var i = 0; i < list.entrycount(); i++) { - var entry = Status.byIndex(list, i); - statuses.push(new StatusFile({entry: entry})); - } + return repo.refreshIndex() + .then(function(indexResult) { + index = indexResult; + var pathOid = index.getByPath(filePath).id; - return statuses; -}; + return repo.getBlob(pathOid); + }) + .then(function(blob) { + originalBlob = blob; -/** - * This will set the HEAD to point to the local branch and then attempt - * to update the index and working tree to match the content of the - * latest commit on that branch - * @param {String|Reference} branch the branch to checkout - * @param {Object|CheckoutOptions} opts the options to use for the checkout - */ -Repository.prototype.checkoutBranch = function(branch, opts) { - var repo = this; - var reference; - opts = opts || {}; - opts.checkoutStrategy = opts.checkoutStrategy || - Checkout.STRATEGY.SAFE_CREATE; - return repo.getReference(branch) - .then(function(ref) { - if (!ref.isBranch()) { - return false; - } - reference = ref; - return repo.getBranchCommit(ref.name()); - }) - .then(function(commit) { - return commit.getTree(); - }) - .then(function(tree) { - return Checkout.tree(repo, tree, opts); - }) - .then(function() { - var name = reference.name(); - return repo.setHead(name, - repo.defaultSignature(), - "Switch HEAD to " + name); - }); + return getPathHunks( + repo, + index, + filePath, + isSelectionStaged, + additionalDiffOptions + ); + }) + .then(function(hunks) { + return applySelectedLinesToTarget( + originalBlob, selectedLines, hunks, isSelectionStaged + ); + }) + .then(function(newContent) { + var newContentBuffer = Buffer.from(newContent); + + return repo.createBlobFromBuffer(newContentBuffer); + }) + .then(newOid => repo.getBlob(newOid)) + .then(function(newBlob) { + var entry = index.getByPath(filePath, 0); + entry.id = newBlob.id(); + entry.path = filePath; + entry.fileSize = newBlob.content().length; + + return index.add(entry); + }) + .then(function() { + return index.write(); + }) + .then(function(result) { + if (isSelectionStaged) { + return result; + } + + return lastHunkStagedPromise(result); + }); }; -var fetchheadForeach = Repository.prototype.fetchheadForeach; /** - * @async - * @param {FetchheadForeachCb} callback The callback function to be called on - * each entry + * Create a new tree builder. + * + * @param {Tree} tree */ -Repository.prototype.fetchheadForeach = function(callback) { - return fetchheadForeach.call(this, callback, null); -}; +Repository.prototype.treeBuilder = function() { + var builder = TreeBuilder.create(null); + + builder.root = builder; + builder.repo = this; -module.exports = Repository; + return builder; +}; diff --git a/lib/reset.js b/lib/reset.js index 8250ddeff9..38b6b1bffc 100644 --- a/lib/reset.js +++ b/lib/reset.js @@ -1,18 +1,51 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; var Reset = NodeGit.Reset; -var defaultFn = Reset.default; +var _default = Reset.default; +var _reset = Reset.reset; +/** + * Look up a refs's commit. + * + * @async + * @param {Repository} repo Repository where to perform the reset operation. + * @param {Commit|Tag} target The committish which content will be used to reset + * the content of the index. + * @param {Strarray} pathspecs List of pathspecs to operate on. + * + * @return {Number} 0 on success or an error code + */ Reset.default = function(repo, target, pathspecs) { - return defaultFn.call(this, repo, target, pathspecs); + return _default.call(this, repo, target, pathspecs); }; -var reset = Reset.reset; -Reset.reset = function(repo, target, resetType, opts, signature, logMessage) { - opts = normalizeOptions(opts, NodeGit.CheckoutOptions); - - return reset.call(this, repo, target, resetType, opts, signature, logMessage); +/** + * Reset a repository's current HEAD to the specified target. + * + * @async + * @param {Repository} repo Repository where to perform the reset operation. + * + * @param {Commit|Tag} target Committish to which the Head should be moved to. + * This object must belong to the given `repo` and can + * either be a git_commit or a git_tag. When a git_tag is + * being passed, it should be dereferencable to a + * git_commit which oid will be used as the target of the + * branch. + * @param {Number} resetType Kind of reset operation to perform. + * + * @param {CheckoutOptions} opts Checkout options to be used for a HARD reset. + * The checkout_strategy field will be overridden + * (based on reset_type). This parameter can be + * used to propagate notify and progress + * callbacks. + * + * @return {Number} 0 on success or an error code + */ +Reset.reset = function(repo, target, resetType, opts) { + if (repo !== target.repo) { + // this is the same that is performed on libgit2's side + // https://github.com/nodegit/libgit2/blob/8d89e409616831b7b30a5ca7b89354957137b65e/src/reset.c#L120-L124 + throw new Error("Repository and target commit's repository does not match"); + } + return _reset.call(this, repo, target, resetType, opts); }; - -module.exports = Reset; diff --git a/lib/revparse.js b/lib/revparse.js new file mode 100644 index 0000000000..74c1fa4c24 --- /dev/null +++ b/lib/revparse.js @@ -0,0 +1,18 @@ +var util = require("util"); +var NodeGit = require("../"); + +const MODE = { + SINGLE: 1, + RANGE: 2, + MERGE_BASE: 4, +}; + +NodeGit.Revparse.MODE = {}; +Object.keys(MODE).forEach((key) => { + Object.defineProperty(NodeGit.Revparse.MODE, key, { + get: util.deprecate( + () => MODE[key], + `Use NodeGit.Revspec.TYPE.${key} instead of NodeGit.Revparse.MODE.${key}.` + ) + }); +}); diff --git a/lib/revwalk.js b/lib/revwalk.js index f33991509c..7787fc89b1 100644 --- a/lib/revwalk.js +++ b/lib/revwalk.js @@ -1,66 +1,67 @@ var NodeGit = require("../"); var Revwalk = NodeGit.Revwalk; -var Promise = require("nodegit-promise"); -var oldSorting = Revwalk.prototype.sorting; +Object.defineProperty(Revwalk.prototype, "repo", { + get: function () { return this.repository(); }, + configurable: true +}); +var _sorting = Revwalk.prototype.sorting; /** - * Set the sort order for the revwalk. This function takes variable arguments - * like `revwalk.sorting(NodeGit.RevWalk.Topological, NodeGit.RevWalk.Reverse).` - * - * @param {Number} sort + * @typedef historyEntry + * @type {Object} + * @property {Commit} commit the commit for this entry + * @property {Number} status the status of the file in the commit + * @property {String} newName the new name that is provided when status is + * renamed + * @property {String} oldName the old name that is provided when status is + * renamed */ -Revwalk.prototype.sorting = function() { - var sort = 0; - - for (var i = 0; i < arguments.length; i++) { - sort |= arguments[i]; - } - - oldSorting.call(this, sort); -}; +var fileHistoryWalk = Revwalk.prototype.fileHistoryWalk; +/** + * @param {String} filePath + * @param {Number} max_count + * @async + * @return {Array} + */ +Revwalk.prototype.fileHistoryWalk = fileHistoryWalk; /** - * Walk the history from the given oid. The callback is invoked for each commit; - * When the walk is over, the callback is invoked with `(null, null)`. + * Get a number of commits. * - * @param {Oid} oid - * @param {Function} callback - * @return {Commit} + * @async + * @param {Number} count (default: 10) + * @return {Array} */ -Revwalk.prototype.walk = function(oid, callback) { - var revwalk = this; - - this.push(oid); +Revwalk.prototype.getCommits = function(count) { + count = count || 10; + var promises = []; + var walker = this; - function walk() { - revwalk.next().then(function(oid) { - if (!oid) { - if (typeof callback === "function") { - return callback(); - } + function walkCommitsCount(count) { + if (count === 0) { return; } - return; + return walker.next().then(function(oid) { + promises.push(walker.repo.getCommit(oid)); + return walkCommitsCount(count - 1); + }) + .catch(function(error) { + if (error.errno !== NodeGit.Error.CODE.ITEROVER) { + throw error; } - - revwalk.repo.getCommit(oid).then(function(commit) { - if (typeof callback === "function") { - callback(null, commit); - } - - walk(); - }); - }, callback); + }); } - walk(); + return walkCommitsCount(count).then(function() { + return Promise.all(promises); + }); }; - /** * Walk the history grabbing commits until the checkFn called with the * current commit returns false. * + * @async * @param {Function} checkFn function returns false to stop walking * @return {Array} */ @@ -70,14 +71,17 @@ Revwalk.prototype.getCommitsUntil = function(checkFn) { function walkCommitsCb() { return walker.next().then(function(oid) { - if (!oid) { return; } - return walker.repo.getCommit(oid).then(function(commit) { commits.push(commit); if (checkFn(commit)) { return walkCommitsCb(); } }); + }) + .catch(function(error) { + if (error.errno !== NodeGit.Error.CODE.ITEROVER) { + throw error; + } }); } @@ -87,28 +91,52 @@ Revwalk.prototype.getCommitsUntil = function(checkFn) { }; /** - * Get a number of commits. + * Set the sort order for the revwalk. This function takes variable arguments + * like `revwalk.sorting(NodeGit.RevWalk.Topological, NodeGit.RevWalk.Reverse).` * - * @param {Number} count (default: 10) - * @return {Array} + * @param {Number} sort */ -Revwalk.prototype.getCommits = function(count) { - count = count || 10; - var promises = []; - var walker = this; +Revwalk.prototype.sorting = function() { + var sort = 0; - function walkCommitsCount(count) { - if (count === 0) { return; } + for (var i = 0; i < arguments.length; i++) { + sort |= arguments[i]; + } - return walker.next().then(function(oid) { - if (!oid) { return; } + _sorting.call(this, sort); +}; - promises.push(walker.repo.getCommit(oid)); - return walkCommitsCount(count - 1); - }); +/** + * Walk the history from the given oid. The callback is invoked for each commit; + * When the walk is over, the callback is invoked with `(null, null)`. + * + * @param {Oid} oid + * @param {Function} callback + */ +Revwalk.prototype.walk = function(oid, callback) { + var revwalk = this; + + this.push(oid); + + function walk() { + revwalk.next().then(function(oid) { + if (!oid) { + if (typeof callback === "function") { + return callback(); + } + + return; + } + + revwalk.repo.getCommit(oid).then(function(commit) { + if (typeof callback === "function") { + callback(null, commit); + } + + walk(); + }); + }, callback); } - return walkCommitsCount(count).then(function() { - return Promise.all(promises); - }); + walk(); }; diff --git a/lib/signature.js b/lib/signature.js index 7fc8e274d3..4dfe84a363 100644 --- a/lib/signature.js +++ b/lib/signature.js @@ -1,11 +1,38 @@ var NodeGit = require("../"); var Signature = NodeGit.Signature; +const toPaddedDoubleDigitString = (number) => { + if (number < 10) { + return `0${number}`; + } + + return `${number}`; +}; + /** * Standard string representation of an author. - * - * @return {string} Representation of the author. + * @param {Boolean} withTime Whether or not to include timestamp + * @return {String} Representation of the author. */ -Signature.prototype.toString = function() { - return this.name().toString() + " <" + this.email().toString() + ">"; +Signature.prototype.toString = function(withTime) { + const name = this.name().toString(); + const email = this.email().toString(); + + let stringifiedSignature = `${name} <${email}>`; + + if (!withTime) { + return stringifiedSignature; + } + + const when = this.when(); + const offset = when.offset(); + const offsetMagnitude = Math.abs(offset); + const time = when.time(); + + const sign = (offset < 0 || when.sign() === "-") ? "-" : "+"; + const hours = toPaddedDoubleDigitString(Math.floor(offsetMagnitude / 60)); + const minutes = toPaddedDoubleDigitString(offsetMagnitude % 60); + + stringifiedSignature += ` ${time} ${sign}${hours}${minutes}`; + return stringifiedSignature; }; diff --git a/lib/stash.js b/lib/stash.js index 960d7b648b..88e9f3510d 100644 --- a/lib/stash.js +++ b/lib/stash.js @@ -1,9 +1,9 @@ var NodeGit = require("../"); - var Stash = NodeGit.Stash; +var _foreach = Stash.foreach; + // Override Stash.foreach to eliminate the need to pass null payload -var foreach = Stash.foreach; Stash.foreach = function(repo, callback) { function wrappedCallback(index, message, oid) { // We need to copy the OID since libgit2 types are getting cleaned up @@ -12,5 +12,5 @@ Stash.foreach = function(repo, callback) { return callback(index, message, oid.copy()); } - return foreach(repo, wrappedCallback, null); + return _foreach(repo, wrappedCallback, null); }; diff --git a/lib/status.js b/lib/status.js index 964569df08..93aca08e09 100644 --- a/lib/status.js +++ b/lib/status.js @@ -1,17 +1,16 @@ var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; var Status = NodeGit.Status; +var _foreach = Status.foreach; +var _foreachExt = Status.foreachExt; + // Override Status.foreach to eliminate the need to pass null payload -var foreach = Status.foreach; Status.foreach = function(repo, callback) { - return foreach(repo, callback, null); + return _foreach(repo, callback, null); }; -// Override Status.foreachExt to normalize opts -var foreachExt = Status.foreachExt; +// Override Status.foreachExt to eliminate the need to pass null payload Status.foreachExt = function(repo, opts, callback) { - opts = normalizeOptions(opts, NodeGit.StatusOptions); - return foreachExt(repo, opts, callback, null); + return _foreachExt(repo, opts, callback, null); }; diff --git a/lib/status_file.js b/lib/status_file.js index ddce025b2b..ac6b124e37 100644 --- a/lib/status_file.js +++ b/lib/status_file.js @@ -37,12 +37,6 @@ var StatusFile = function(args) { }; return { - status: function() { - return data.statuses; - }, - statusBit: function() { - return data.statusBit; - }, headToIndex: function() { if (data.entry) { return entry.headToIndex(); @@ -57,45 +51,54 @@ var StatusFile = function(args) { return undefined; } }, - path: function() { - return data.path; + inIndex: function() { + return status & codes.INDEX_NEW || + status & codes.INDEX_MODIFIED || + status & codes.INDEX_DELETED || + status & codes.INDEX_TYPECHANGE || + status & codes.INDEX_RENAMED; }, - isNew: function() { + inWorkingTree: function() { return status & codes.WT_NEW || - status & codes.INDEX_NEW; + status & codes.WT_MODIFIED || + status & codes.WT_DELETED || + status & codes.WT_TYPECHANGE || + status & codes.WT_RENAMED; }, - isModified: function() { - return status & codes.WT_MODIFIED || - status & codes.INDEX_MODIFIED; + isConflicted: function() { + return status & codes.CONFLICTED; }, isDeleted: function() { return status & codes.WT_DELETED || status & codes.INDEX_DELETED; }, - isTypechange: function() { - return status & codes.WT_TYPECHANGE || - status & codes.INDEX_TYPECHANGE; + isIgnored: function() { + return status & codes.IGNORED; + }, + isModified: function() { + return status & codes.WT_MODIFIED || + status & codes.INDEX_MODIFIED; + }, + isNew: function() { + return status & codes.WT_NEW || + status & codes.INDEX_NEW; }, isRenamed: function() { return status & codes.WT_RENAMED || status & codes.INDEX_RENAMED; }, - isIgnored: function() { - return data.statusBit & codes.IGNORED; + isTypechange: function() { + return status & codes.WT_TYPECHANGE || + status & codes.INDEX_TYPECHANGE; }, - inWorkingTree: function() { - return status & codes.WT_NEW || - status & codes.WT_MODIFIED || - status & codes.WT_DELETED || - status & codes.WT_TYPECHANGE || - status & codes.WT_RENAMED; + path: function() { + return data.path; }, - inIndex: function() { - return status & codes.INDEX_NEW || - status & codes.INDEX_MODIFIED || - status & codes.INDEX_DELETED || - status & codes.INDEX_TYPECHANGE || - status & codes.INDEX_RENAMED; + status: function() { + return data.statuses; + }, + statusBit: function() { + return data.statusBit; } }; }; diff --git a/lib/status_list.js b/lib/status_list.js deleted file mode 100644 index e05eede09d..0000000000 --- a/lib/status_list.js +++ /dev/null @@ -1,11 +0,0 @@ -var NodeGit = require("../"); -var normalizeOptions = NodeGit.Utils.normalizeOptions; - -var StatusList = NodeGit.StatusList; - -// Override StatusList.create to normalize opts -var create = StatusList.create; -StatusList.create = function(repo, opts) { - opts = normalizeOptions(opts, NodeGit.StatusOptions); - return create(repo, opts); -}; diff --git a/lib/submodule.js b/lib/submodule.js new file mode 100644 index 0000000000..2b0cb530db --- /dev/null +++ b/lib/submodule.js @@ -0,0 +1,10 @@ +var NodeGit = require("../"); + +var Submodule = NodeGit.Submodule; + +var _foreach = Submodule.foreach; + +// Override Submodule.foreach to eliminate the need to pass null payload +Submodule.foreach = function(repo, callback) { + return _foreach(repo, callback, null); +}; diff --git a/lib/tag.js b/lib/tag.js index bf8ddff49f..aae20c9302 100644 --- a/lib/tag.js +++ b/lib/tag.js @@ -1,12 +1,141 @@ +var util = require("util"); var NodeGit = require("../"); var LookupWrapper = NodeGit.Utils.lookupWrapper; var Tag = NodeGit.Tag; +const signatureRegexesBySignatureType = { + gpgsig: [ + /-----BEGIN PGP SIGNATURE-----[\s\S]+?-----END PGP SIGNATURE-----/gm, + /-----BEGIN PGP MESSAGE-----[\s\S]+?-----END PGP MESSAGE-----/gm, + ], + x509: [ + /-----BEGIN SIGNED MESSAGE-----[\s\S]+?-----END SIGNED MESSAGE-----/gm, + ] +}; + /** -* Retrieves the tag pointed to by the oid -* @async -* @param {Repository} repo The repo that the tag lives in -* @param {String|Oid|Tag} id The tag to lookup -* @return {Tag} -*/ + * Retrieves the tag pointed to by the oid + * @async + * @param {Repository} repo The repo that the tag lives in + * @param {String|Oid|Tag} id The tag to lookup + * @return {Tag} + */ Tag.lookup = LookupWrapper(Tag); + +/** + * @async + * @param {Repository} repo + * @param {String} tagName + * @param {Oid} target + * @param {Signature} tagger + * @return {String} + */ +Tag.createBuffer = function(repo, tagName, target, tagger, message) { + return NodeGit.Object.lookup(repo, target, NodeGit.Object.TYPE.ANY) + .then((object) => { + if (!NodeGit.Object.typeisloose(object.type())) { + throw new Error("Object must be a loose type"); + } + + const id = object.id().toString(); + const objectType = NodeGit.Object.type2String(object.type()); + const lines = [ + `object ${id}`, + `type ${objectType}`, + `tag ${tagName}`, + `tagger ${tagger.toString(true)}\n`, + `${message}${message.endsWith("\n") ? "" : "\n"}` + ]; + return lines.join("\n"); + }); +}; + +const deprecatedCreateWithSignatureHelper = util.deprecate(function(repo, oidTarget) { + return repo.getCommit(oidTarget); +}, "Tag.createWithSignature target should be a Git Object, not Oid"); + +/** + * @async + * @param {Repository} repo + * @param {String} tagName + * @param {Object} target + * @param {Signature} tagger + * @param {String} message + * @param {Number} force + * @param {Function} signingCallback Takes a string and returns a string + * representing the signed message + * @return {Oid} + */ +Tag.createWithSignature = async ( + repo, + tagName, + target, + tagger, + message, + force, + signingCallback +) => { + let targetOid; + if (!target.id) { + targetOid = await deprecatedCreateWithSignatureHelper(repo, target); + } else { + targetOid = target; + } + + const tagBuffer = await Tag.createBuffer(repo, tagName, targetOid.id(), tagger, message); + const { code, signedData } = await signingCallback(tagBuffer); + switch (code) { + case NodeGit.Error.CODE.OK: { + const normalizedEnding = signedData.endsWith("\n") ? "" : "\n"; + const signedTagString = tagBuffer + signedData + normalizedEnding; + return Tag.createFromBuffer(repo, signedTagString, force); + } + case NodeGit.Error.CODE.PASSTHROUGH: + return Tag.create( + repo, + tagName, + targetOid, + tagger, + message, + force + ); + default: { + const error = new Error( + `Tag.createWithSignature threw with error code ${code}` + ); + error.errno = code; + throw error; + } + } +}; + +/** + * Retrieves the signature of an annotated tag + * @async + * @param {String} signatureType + * @return {String|null} + */ +Tag.prototype.extractSignature = function(signatureType = "gpgsig") { + const id = this.id(); + const repo = this.repo; + const signatureRegexes = signatureRegexesBySignatureType[signatureType]; + if (!signatureRegexes) { + throw new Error("Unsupported signature type"); + } + + return repo.odb().then((odb) => { + return odb.read(id); + }).then((odbObject) => { + const odbData = odbObject.toString(); + + for (const regex of signatureRegexes) { + const matchResult = odbData.match(regex); + + if (matchResult !== null) { + return matchResult[0]; + } + } + + throw new Error("this tag is not signed"); + }); +}; diff --git a/lib/tree.js b/lib/tree.js index e632d1337f..1067fa3f2d 100644 --- a/lib/tree.js +++ b/lib/tree.js @@ -1,3 +1,4 @@ +var path = require("path"); var events = require("events"); var NodeGit = require("../"); var Diff = NodeGit.Diff; @@ -5,32 +6,62 @@ var LookupWrapper = NodeGit.Utils.lookupWrapper; var Tree = NodeGit.Tree; var Treebuilder = NodeGit.Treebuilder; - /** * Retrieves the tree pointed to by the oid * @async * @param {Repository} repo The repo that the tree lives in * @param {String|Oid|Tree} id The tree to lookup -* @param {Function} callback * @return {Tree} */ Tree.lookup = LookupWrapper(Tree); +/** + * Make builder. This is helpful for modifying trees. + * @return {Treebuilder} + */ +Tree.prototype.builder = function() { + var builder = Treebuilder.create(this); + + builder.root = builder; + builder.repo = this.repo; + + return builder; +}; + /** * Diff two trees * @async * @param {Tree} tree to diff against - * @param {Function} callback - * @return {DiffList} + * @return {Diff} */ -Tree.prototype.diff = function(tree, callback) { - return Diff.treeToTree(this.repo, tree, this, null).then(function(diff) { - if (typeof callback === "function") { - callback(null, diff); - } +Tree.prototype.diff = function(tree) { + return this.diffWithOptions(tree, null); +}; + +/** + * Diff two trees with options + * @async + * @param {Tree} tree to diff against + * @param {Object} options + * @return {Diff} + */ +Tree.prototype.diffWithOptions = function(tree, options) { + return Diff.treeToTree(this.repo, tree, this, options); +}; + +/** + * Return an array of the entries in this tree (excluding its children). + * @return {Array} an array of TreeEntrys + */ +Tree.prototype.entries = function() { + var size = this.entryCount(); + var result = []; - return diff; - }, callback); + for (var i = 0; i < size; i++) { + result.push(this.entryByIndex(i)); + } + + return result; }; /** @@ -52,7 +83,7 @@ Tree.prototype.entryByIndex = function(i) { * @return {TreeEntry} */ Tree.prototype.entryByName = function(name) { - var entry = this.entryByname(name); + var entry = this._entryByName(name); entry.parent = this; return entry; }; @@ -60,37 +91,26 @@ Tree.prototype.entryByName = function(name) { /** * Get an entry at a path. Unlike by name, this takes a fully * qualified path, like `/foo/bar/baz.javascript` - * - * @param {String} path + * @async + * @param {String} filePath * @return {TreeEntry} */ -Tree.prototype.getEntry = function(path, callback) { +Tree.prototype.getEntry = function(filePath) { var tree = this; - return this.entryByPath(path).then(function(entry) { + return this.entryByPath(filePath).then(function(entry) { entry.parent = tree; - - if (typeof callback === "function") { - callback(null, entry); - } - + entry.dirtoparent = path.dirname(filePath); return entry; }); }; /** - * Return an array of the entries in this tree (excluding its children). - * @return {[TreeEntry]} an array of TreeEntrys + * Return the path of this tree, like `/lib/foo/bar` + * @return {String} */ -Tree.prototype.entries = function() { - var size = this.entryCount(); - var result = []; - - for (var i = 0; i < size; i++) { - result.push(this.entryByIndex(i)); - } - - return result; +Tree.prototype.path = function(blobsOnly) { + return this.entry ? this.entry.path() : ""; }; /** @@ -113,6 +133,8 @@ Tree.prototype.walk = function(blobsOnly) { var event = new events.EventEmitter(); var total = 1; + var entries = new Set(); + var finalEntires = []; // This looks like a DFS, but it is a BFS because of implicit queueing in // the recursive call to `entry.getTree(bfs)` @@ -122,21 +144,26 @@ Tree.prototype.walk = function(blobsOnly) { if (error) { return event.emit("error", error); } - var entries = tree.entries(); - entries.forEach(function (entry, entryIndex) { - if (!blobsOnly || entry.isFile()) { + + tree.entries().forEach(function (entry, entryIndex) { + if (!blobsOnly || entry.isFile() && !entries.has(entry)) { event.emit("entry", entry); - entries.push(entry); + entries.add(entry); + + // Node 0.12 doesn't support either [v for (v of entries)] nor + // Array.from so we'll just maintain our own list. + finalEntires.push(entry); } if (entry.isTree()) { total++; - entry.getTree(bfs); + entry.getTree() + .then(result => bfs(null, result), bfs); } }); if (total === 0) { - event.emit("end", entries); + event.emit("end", finalEntires); } } @@ -146,24 +173,3 @@ Tree.prototype.walk = function(blobsOnly) { return event; }; - -/** - * Return the path of this tree, like `/lib/foo/bar` - * @return {String} - */ -Tree.prototype.path = function(blobsOnly) { - return this.entry ? this.entry.path() : ""; -}; - -/** - * Make builder. This is helpful for modifying trees. - * @return {Treebuilder} - */ -Tree.prototype.builder = function() { - var builder = Treebuilder.create(this); - - builder.root = builder; - builder.repo = this.repo; - - return builder; -}; diff --git a/lib/tree_entry.js b/lib/tree_entry.js index a2d19def20..a978de9a3c 100644 --- a/lib/tree_entry.js +++ b/lib/tree_entry.js @@ -1,85 +1,94 @@ -var path = require("path"); +var path = require("path").posix; var NodeGit = require("../"); -var Tree = NodeGit.Tree; var TreeEntry = NodeGit.TreeEntry; /** - * Is this TreeEntry a blob? (i.e., a file) - * @return {Boolean} + * Retrieve the blob for this entry. Make sure to call `isBlob` first! + * @async + * @return {Blob} */ -TreeEntry.prototype.isFile = function() { - return this.attr() === TreeEntry.FILEMODE.BLOB || - this.attr() === TreeEntry.FILEMODE.EXECUTABLE; +TreeEntry.prototype.getBlob = function() { + return this.parent.repo.getBlob(this.id()); }; /** - * Is this TreeEntry a tree? (i.e., a directory) + * Retrieve the tree for this entry. Make sure to call `isTree` first! + * @async + * @return {Tree} + */ +TreeEntry.prototype.getTree = function() { + var entry = this; + + return this.parent.repo.getTree(this.id()).then(function(tree) { + tree.entry = entry; + return tree; + }); +}; + +/** + * Is this TreeEntry a blob? Alias for `isFile` * @return {Boolean} */ -TreeEntry.prototype.isTree = function() { - return this.attr() === TreeEntry.FILEMODE.TREE; +TreeEntry.prototype.isBlob = function() { + return this.isFile(); }; /** * Is this TreeEntry a directory? Alias for `isTree` * @return {Boolean} */ -TreeEntry.prototype.isDirectory = TreeEntry.prototype.isTree; +TreeEntry.prototype.isDirectory = function() { + return this.isTree(); +}; /** - * Is this TreeEntry a blob? Alias for `isFile` + * Is this TreeEntry a blob? (i.e., a file) * @return {Boolean} */ -TreeEntry.prototype.isBlob = TreeEntry.prototype.isFile; +TreeEntry.prototype.isFile = function() { + return this.filemode() === TreeEntry.FILEMODE.BLOB || + this.filemode() === TreeEntry.FILEMODE.EXECUTABLE; +}; /** - * Retrieve the SHA for this TreeEntry. - * @return {String} + * Is this TreeEntry a submodule? + * @return {Boolean} */ -TreeEntry.prototype.sha = function() { - return this.oid().toString(); +TreeEntry.prototype.isSubmodule = function() { + return this.filemode() === TreeEntry.FILEMODE.COMMIT; }; /** - * Retrieve the tree for this entry. Make sure to call `isTree` first! - * @async - * @return {Tree} + * Is this TreeEntry a tree? (i.e., a directory) + * @return {Boolean} */ -TreeEntry.prototype.getTree = function(callback) { - var entry = this; - - return this.parent.repo.getTree(this.oid()).then(function(tree) { - tree.entry = entry; - - if (typeof callback === "function") { - callback(null, tree); - } - - return tree; - }, callback); +TreeEntry.prototype.isTree = function() { + return this.filemode() === TreeEntry.FILEMODE.TREE; }; /** - * Retrieve the tree for this entry. Make sure to call `isTree` first! - * @async - * @return {Blob} + * Retrieve the SHA for this TreeEntry. Alias for `sha` + * @return {String} */ -TreeEntry.prototype.getBlob = function(callback) { - return this.parent.repo.getBlob(this.oid()).then(function(blob) { - if (typeof callback === "function") { - callback(null, blob); - } - - return blob; - }, callback); +TreeEntry.prototype.oid = function() { + return this.sha(); }; /** * Returns the path for this entry. * @return {String} */ -TreeEntry.prototype.path = function(callback) { - return path.join(this.parent.path(), this.filename()); +TreeEntry.prototype.path = function() { + var dirtoparent = this.dirtoparent || ""; + return path.join(this.parent.path(), dirtoparent, this.name()); +}; + +/** + * Retrieve the SHA for this TreeEntry. + * @return {String} + */ +TreeEntry.prototype.sha = function() { + return this.id().toString(); }; /** @@ -88,7 +97,3 @@ TreeEntry.prototype.path = function(callback) { TreeEntry.prototype.toString = function() { return this.path(); }; - -TreeEntry.prototype.oid = function() { - return Tree.entryId(this).toString(); -}; diff --git a/lib/utils/lookup_wrapper.js b/lib/utils/lookup_wrapper.js index 309c675a27..eee4dd7682 100644 --- a/lib/utils/lookup_wrapper.js +++ b/lib/utils/lookup_wrapper.js @@ -1,4 +1,3 @@ -var Promise = require("nodegit-promise"); var NodeGit = require("../../"); /** diff --git a/lib/utils/normalize_options.js b/lib/utils/normalize_options.js deleted file mode 100644 index a7b73cb5e1..0000000000 --- a/lib/utils/normalize_options.js +++ /dev/null @@ -1,23 +0,0 @@ -var NodeGit = require("../../"); - -/** - * Normalize an object to match a struct. - * - * @param {String, Object} oid - The oid string or instance. - * @return {Object} An Oid instance. - */ -function normalizeOptions(options, Ctor) { - var instance = options instanceof Ctor ? options : new Ctor(); - - if (!options) { - return null; - } - - Object.keys(options).forEach(function(key) { - instance[key] = options[key]; - }); - - return instance; -} - -NodeGit.Utils.normalizeOptions = normalizeOptions; diff --git a/lib/utils/shallow_clone.js b/lib/utils/shallow_clone.js index f93e675235..0dbe4113e9 100644 --- a/lib/utils/shallow_clone.js +++ b/lib/utils/shallow_clone.js @@ -1,10 +1,14 @@ -module.exports = function(obj) { - var merges = Array.prototype.slice.call(arguments, 1); +var NodeGit = require("../../"); + +function shallowClone() { + var merges = Array.prototype.slice.call(arguments); return merges.reduce(function(obj, merge) { return Object.keys(merge).reduce(function(obj, key) { obj[key] = merge[key]; return obj; }, obj); - }, obj || {}); -}; + }, {}); +} + +NodeGit.Utils.shallowClone = shallowClone; diff --git a/lifecycleScripts/README.md b/lifecycleScripts/README.md new file mode 100644 index 0000000000..cc1feeb148 --- /dev/null +++ b/lifecycleScripts/README.md @@ -0,0 +1,5 @@ +## /lifecycleScripts + + These scripts are responsible for downloading the right dependencies, configuring vendors, and all other dependencies that are required to build, generate, and clean the module. + + \ No newline at end of file diff --git a/lifecycleScripts/checkPrepared.js b/lifecycleScripts/checkPrepared.js deleted file mode 100644 index ffb1a5c283..0000000000 --- a/lifecycleScripts/checkPrepared.js +++ /dev/null @@ -1,67 +0,0 @@ -var Promise = require("nodegit-promise"); -var path = require("path"); -var fs = require("fs"); -var rooted = path.join.bind(path, __dirname, ".."); -var pkg = require(rooted("package")); - -var NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]); - -module.exports.checkAll = function checkAll() { - return Promise.all([ - checkVendor("libgit2"), - checkVendor("libssh2"), - checkVendor("http_parser"), - - checkExists("lib/nodegit.js"), - checkExists("lib/enums.js"), - checkExists("src"), - checkExists("include") - ]).then(function(checks) { - return checks.reduce(function(soFar, currentCheck) { - return soFar && currentCheck; - }, true); - }); -}; - -function checkExists(name) { - return new Promise(function(resolve, reject) { - fs.exists(rooted(name), function(exists) { - resolve(exists); - }); - }); -} -module.exports.checkExists = checkExists; - -function checkVendor(name, skipVersion) { - var version = ""; - if (!skipVersion) { - var vendorPackage = pkg[name]; - if (NODE_VERSION === 0.1 && vendorPackage["0.10"]) { - vendorPackage = vendorPackage["0.10"]; - } - version = vendorPackage.sha || vendorPackage.version; - } - - var vendorPath = "vendor/" + name + "/" + version; - return checkExists(vendorPath); -} -module.exports.checkVendor = checkVendor; - -function checkGenerated() { - return Promise.all([ - checkExists("lib/nodegit.js"), - checkExists("lib/enums.js"), - checkExists("src"), - checkExists("include") - ]).then(function(checks) { - return checks.reduce(function(soFar, currentCheck) { - return soFar && currentCheck; - }, true); - }); -} -module.exports.checkGenerated = checkGenerated; - -// Called on the command line -if (require.main === module) { - module.exports.checkAll(); -} diff --git a/lifecycleScripts/clean.js b/lifecycleScripts/clean.js index 43f54e1b47..a0f7076b3f 100644 --- a/lifecycleScripts/clean.js +++ b/lifecycleScripts/clean.js @@ -1,142 +1,5 @@ -var fse = require("fs-extra"); +var cleanForPublish = require("clean-for-publish"); var path = require("path"); -var npm = require("npm"); -var Promise = require("nodegit-promise"); -var rooted = path.join.bind(path, __dirname, ".."); -if (fse.existsSync(rooted(".didntcomefromthenpmregistry"))) { - console.error("[nodegit] We only clean when downloaded from the npm " + - "registry. Skipping clean."); - return; -} - -npm.load({ - "production": true -}, function() { - - var filesToDelete = [ - "build/Makefile", - "build/binding.Makefile", - "build/config.gypi", - "build/gyp-mac-tool", - "build/nodegit.target.mk", - "build/vendor", - - "build/Release/.deps", - "build/Release/git2.a", - "build/Release/http_parser.a", - "build/Release/linker.lock", - "build/Release/obj.target", - "build/Release/openssl.a", - "build/Release/ssh2.a", - "build/Release/zlib.a", - - "build/Debug/.deps", - "build/Debug/git2.a", - "build/Debug/http_parser.a", - "build/Debug/linker.lock", - "build/Debug/obj.target", - "build/Debug/openssl.a", - "build/Debug/ssh2.a", - "build/Debug/zlib.a", - - "example", - "generate", - "include", - "lifecycleScripts", - "src", - "test", - "vendor", - - ".astylerc", - ".editorconfig", - ".gitingore", - ".gitmodules", - ".jshintrc", - ".npmignore", - ".travis.yml", - "appveyor.yml", - "binding.gyp", - "TESTING.md" - ]; - - var modulesToPrune = [ - "for-node-webkit", - "which-native-nodish", - "fs-extra", - "node-pre-gyp", - "npm" - ]; - - console.info("[nodegit] Cleaning up after ourselves."); - - Promise.all([ - cleanFiles(), - pruneDevDependencies(), - pruneOtherDependencies() - ]).then( - function success() { - console.info("[nodegit] Done cleaning, enjoy!"); - }, - function failure() { - console.error("[nodegit] Couldn't finish cleaning."); - } - ); - - function cleanFiles() { - console.info("[nodegit] Deleting unneeded files."); - return new Promise(function(resolve, reject) { - var failures = filesToDelete.some(function(deletable) { - try { - fse.removeSync(rooted(deletable)); - return false; - } - catch (e) { - console.info("[nodegit] Error deleting files. Errored on " + - rooted(deletable) + "."); - console.error(e); - - reject(e); - return true; - } - }); - - if (!failures) { - console.info("[nodegit] Finished deleting files."); - resolve(); - } - }); - } - - function pruneDevDependencies() { - console.info("[nodegit] Pruning devdependencies."); - return new Promise(function (resolve, reject) { - npm.commands.prune(function(err) { - if (err) { - console.error("[nodegit] Failed pruning devdependencies."); - reject(err); - } - else { - console.info("[nodegit] Successfully pruned devdependencies."); - resolve(); - } - }); - }); - } - - function pruneOtherDependencies() { - console.info("[nodegit] Cleaning unneeded dependencies."); - return new Promise(function (resolve, reject) { - npm.commands.uninstall(modulesToPrune, function(err) { - if (err) { - console.error("[nodegit] Failed cleaning unneeded dependencies."); - reject(err); - } - else { - console.info("[nodegit] Successfully cleaned unneeded dependencies."); - resolve(); - } - }); - }); - } -}); +var location = path.join(__dirname, ".."); +cleanForPublish(location); diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js old mode 100644 new mode 100755 index 65b80319b7..96e47afbe5 --- a/lifecycleScripts/install.js +++ b/lifecycleScripts/install.js @@ -1,131 +1,75 @@ -var Promise = require("nodegit-promise"); -var promisify = require("promisify-node"); +var buildFlags = require("../utils/buildFlags"); +var spawn = require("child_process").spawn; var path = require("path"); -var fs = require("fs"); -var checkPrepared = require("./checkPrepared"); -var whichNativeNodish = require("which-native-nodish"); -var prepareForBuild = require("./prepareForBuild"); +const nodePreGypModulePath = require.resolve("@mapbox/node-pre-gyp"); -var exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); -var nwVersion = null; -var asVersion = null; +module.exports = function install() { + console.log("[nodegit] Running install script"); -var local = path.join.bind(path, __dirname); - -return whichNativeNodish("..") - .then(function(results) { - nwVersion = results.nwVersion; - asVersion = results.asVersion; - }) - .then(function() { - if (nwVersion) { - console.info("[nodegit] Must build for node-webkit/nw.js"); - return checkAndBuild(); - } - else if (asVersion) { - console.info("[nodegit] Must build for atom-shell"); - return checkAndBuild(); - } - if (fs.existsSync(local("../.didntcomefromthenpmregistry"))) { - return checkAndBuild(); - } - if (process.env.BUILD_DEBUG) { - console.info("[nodegit] Doing a debug build, no fetching allowed."); - return checkAndBuild(); - } - if (process.env.BUILD_ONLY) { - console.info("[nodegit] BUILD_ONLY is set to true, no fetching allowed."); - return checkAndBuild(); - } - console.info("[nodegit] Fetching binary from S3."); - return exec("node-pre-gyp install") - .then( - function() { - console.info("[nodegit] Completed installation successfully."); - }, - function() { - console.info("[nodegit] Failed to install prebuilt binary, " + - "building manually."); - return checkAndBuild(); - } - ); - }); + var nodePreGyp = "node-pre-gyp"; + if (process.platform === "win32") { + nodePreGyp += ".cmd"; + } -function checkAndBuild() { - console.info("[nodegit] Making sure dependencies are available and native " + - "code is generated"); + var args = ["install"]; - return checkPrepared.checkAll() - .then(function(allGood) { - if (allGood) { - return Promise.resolve(); - } - else { - console.info("[nodegit] Something is missing, retrieving " + - "dependencies and regenerating code"); - return prepareForBuild(); - } - }) - .then(function() { - return build(); - }); -} + if (buildFlags.mustBuild) { + console.info( + "[nodegit] Pre-built download disabled, building from source." + ); + args.push("--build-from-source"); -function build() { - console.info("[nodegit] Everything is ready to go, attempting compilation"); - if (nwVersion) { - console.info("[nodegit] Building native node-webkit module."); + if (buildFlags.debugBuild) { + console.info("[nodegit] Building debug version."); + args.push("--debug"); + } } else { - console.info("[nodegit] Building native node module."); + args.push("--fallback-to-build"); } - var opts = { - cwd: ".", - maxBuffer: Number.MAX_VALUE, - env: process.env - }; + return new Promise(function(resolve, reject) { + const gypPath = path.join(__dirname, "..", "node_modules", "node-gyp", "bin", "node-gyp.js"); - var prefix = ""; - var target = ""; - var debug = (process.env.BUILD_DEBUG ? " --debug" : ""); - var builder = "pangyp"; - var distUrl = ""; - - if (asVersion) { - prefix = (process.platform == "win32" ? - "SET HOME=%HOME%\\.atom-shell-gyp&& " : - "HOME=~/.atom-shell-gyp"); - - target = "--target=" + asVersion; + const nodePreGypPath = path.resolve(path.dirname(nodePreGypModulePath), path.join("..", "bin", nodePreGyp)); + console.log("node-pre-gyp path", nodePreGypPath); + var spawnedNodePreGyp = spawn(nodePreGypPath, args, { + env: { + ...process.env, + npm_config_node_gyp: gypPath + }, + shell: process.platform === "win32" + }); - distUrl = "--dist-url=https://gh-contractor-zcbenz.s3." + - "amazonaws.com/atom-shell/dist"; - } - else if (nwVersion) { - builder = "nw-gyp"; - target = "--target=" + nwVersion; - } + spawnedNodePreGyp.stdout.on("data", function(data) { + console.info(data.toString().trim()); + }); - return exec("npm install --ignore-scripts") - .then(function() { - builder = path.resolve(".", "node_modules", ".bin", builder); - builder = builder.replace(/\s/g, "\\$&"); - var cmd = [prefix, builder, "rebuild", target, debug, distUrl] - .join(" ").trim(); + spawnedNodePreGyp.stderr.on("data", function(data) { + console.error(data.toString().trim()); + }); - return exec(cmd, opts); - }) + spawnedNodePreGyp.on("close", function(code) { + if (!code) { + resolve(); + } else { + reject(code); + } + }); + }) .then(function() { - console.info("[nodegit] Compilation complete."); console.info("[nodegit] Completed installation successfully."); - }, - function(err, stderr) { - console.error(err); - console.error(stderr); + }); +}; + +// Called on the command line +if (require.main === module) { + module.exports() + .catch(function(e) { + console.error("[nodegit] ERROR - Could not finish install"); + console.error("[nodegit] ERROR - finished with error code: " + e); + process.exit(e); }); } diff --git a/lifecycleScripts/postinstall.js b/lifecycleScripts/postinstall.js new file mode 100755 index 0000000000..f8260e3b73 --- /dev/null +++ b/lifecycleScripts/postinstall.js @@ -0,0 +1,83 @@ +var fse = require("fs-extra"); +var path = require("path"); + +var exec = require("../utils/execPromise"); +var buildFlags = require("../utils/buildFlags"); + +var rootPath = path.join(__dirname, ".."); + +function printStandardLibError() { + console.log( + "[nodegit] ERROR - the latest libstdc++ is missing on your system!" + ); + console.log(""); + console.log("On Ubuntu you can install it using:"); + console.log(""); + console.log("$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test"); + console.log("$ sudo apt-get update"); + console.log("$ sudo apt-get install libstdc++-4.9-dev"); +} + +module.exports = function install() { + if (buildFlags.isGitRepo) { + // If we're building NodeGit from a git repo we aren't going to do any + // cleaning up + return Promise.resolve(); + } + if (buildFlags.isElectron || buildFlags.isNWjs) { + // If we're building for electron or NWjs, we're unable to require the + // built library so we have to just assume success, unfortunately. + return Promise.resolve(); + } + + return exec("node \"" + path.join(rootPath, "lib/nodegit.js\"")) + .catch(function(e) { + if (~e.toString().indexOf("Module version mismatch")) { + console.warn( + "[nodegit] WARN - NodeGit was built for a different version of node." + ); + console.warn( + "If you are building NodeGit for electron/nwjs you can " + + "ignore this warning." + ); + } + else { + throw e; + } + }) + .then(function() { + // If we're using NodeGit from a package manager then let's clean up after + // ourselves when we install successfully. + if (!buildFlags.mustBuild) { + // We can't remove the source files yet because apparently the + // "standard workflow" for native node moduels in Electron/nwjs is to + // build them for node and then nah eff that noise let's rebuild them + // again for the actual platform! Hurray!!! When that madness is dead + // we can clean up the source which is a serious amount of data. + // fse.removeSync(path.join(rootPath, "vendor")); + // fse.removeSync(path.join(rootPath, "src")); + // fse.removeSync(path.join(rootPath, "include")); + + fse.removeSync(path.join(rootPath, "build/Release/*.a")); + fse.removeSync(path.join(rootPath, "build/Release/obj.target")); + } + }); +}; + +// Called on the command line +if (require.main === module) { + module.exports() + .catch(function(e) { + console.warn("[nodegit] WARN - Could not finish postinstall"); + + if ( + process.platform === "linux" && + ~e.toString().indexOf("libstdc++") + ) { + printStandardLibError(); + } + else { + console.log(e); + } + }); +} diff --git a/lifecycleScripts/preinstall.js b/lifecycleScripts/preinstall.js new file mode 100755 index 0000000000..870cf15580 --- /dev/null +++ b/lifecycleScripts/preinstall.js @@ -0,0 +1,47 @@ +var path = require("path"); +var local = path.join.bind(path, __dirname); + +var exec = require(local("../utils/execPromise")); +var buildFlags = require(local("../utils/buildFlags")); + +module.exports = function prepareForBuild() { + console.log("[nodegit] Running pre-install script"); + + return exec("npm -v") + .then( + function(npmVersion) { + if (npmVersion.split(".")[0] < 3) { + console.log( + "[nodegit] npm@2 installed, pre-loading required packages" + ); + return exec("npm install --ignore-scripts"); + } + + return Promise.resolve(); + }, + function() { + // We're installing via yarn, so don't + // care about compability with npm@2 + } + ) + .then(function() { + if (buildFlags.isGitRepo) { + var submodules = require(local("submodules")); + var generate = require(local("../generate")); + return submodules() + .then(function() { + return generate(); + }); + } + }); +}; + +// Called on the command line +if (require.main === module) { + module.exports() + .catch(function(e) { + console.error("[nodegit] ERROR - Could not finish preinstall"); + console.error(e); + process.exit(1); + }); +} diff --git a/lifecycleScripts/prepareForBuild.js b/lifecycleScripts/prepareForBuild.js deleted file mode 100644 index e326531579..0000000000 --- a/lifecycleScripts/prepareForBuild.js +++ /dev/null @@ -1,62 +0,0 @@ -var Promise = require("nodegit-promise"); -var cp = require("child_process"); -var path = require("path"); - -var local = path.join.bind(path, __dirname); - -var check = require(local("checkPrepared")).checkGenerated; -var retrieve = require(local("retrieveExternalDependencies")); -var generate = require(local("../generate")); - -module.exports = function prepareForBuild() { - - return new Promise(function(resolve, reject) { - cp.exec("npm install --ignore-scripts", function(err, stdout, stderr) { - if (err) { - console.error(stderr); - reject(err, stderr); - } - else { - resolve(); - console.info(stdout); - } - }); - }).then(function() { - return Promise.all([ - retrieve(), - doGenerate() - ]); - }); -}; - -function doGenerate() { - console.info("[nodegit] Detecting generated code."); - return check().then(function(allThere) { - if (allThere) { - console.info("[nodegit] Generated code is intact."); - return Promise.resolve(); - } - else { - console.info("[nodegit] Generated code is missing or incomplete, " + - "regenerating now."); - - return new Promise(function(resolve, reject) { - try { - generate(); - console.info("[nodegit] Code regenerated."); - resolve(); - } - catch (e) { - console.info("[nodegit] Error generating code."); - console.info(e); - //console.info(stderr); - reject(e); - } - }); - } - }); -} -// Called on the command line -if (require.main === module) { - module.exports(); -} diff --git a/lifecycleScripts/retrieveExternalDependencies.js b/lifecycleScripts/retrieveExternalDependencies.js deleted file mode 100644 index 8e0d7edce5..0000000000 --- a/lifecycleScripts/retrieveExternalDependencies.js +++ /dev/null @@ -1,113 +0,0 @@ -var Promise = require("nodegit-promise"); -var promisify = require("promisify-node"); -var fse = promisify("fs-extra"); -var zlib = require("zlib"); -var cp = require("child_process"); -var path = require("path"); - -var local = path.join.bind(path, __dirname); -var rooted = path.join.bind(path, __dirname, ".."); - -var check = require(local("checkPrepared")).checkVendor; -var pkg = require(rooted("package")); -var tar; -var request; - -var NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]); - -module.exports = function retrieveExternalDependencies() { - tar = require("tar"); - request = require("request"); - return Promise.all([ - getVendorLib("libgit2"), - getVendorLib("libssh2"), - getVendorLib("http_parser") - ]); -}; - - -function getVendorLib(name) { - var vendorPath = "vendor/" + name + "/"; - var vendorPackage = pkg[name]; - if (NODE_VERSION === 0.1 && vendorPackage["0.10"]) { - vendorPackage = vendorPackage["0.10"]; - } - - var version = vendorPackage.sha || vendorPackage.version; - - console.info("[nodegit] Detecting " + vendorPath + version + "."); - return check(name) - .then(function(exists) { - if (exists) { - console.info("[nodegit] " + vendorPath + version + " already exists."); - return Promise.resolve(); - } - else { - return check(name, true) - .then(function(exists) { - if (exists) { - console.info("[nodegit] Removing outdated " + vendorPath + "."); - return fse.remove(rooted(vendorPath)); - } - else { - console.info("[nodegit] " + vendorPath + " not found."); - return Promise.resolve(); - } - }) - .then(function() { - return new Promise(function (resolve, reject) { - console.info("[nodegit] Retrieving " + vendorPath + "."); - - var extract = tar.Extract({ - path: rooted("vendor/" + name + "/"), - strip: true - }); - - request.get(vendorPackage.url) - .pipe(zlib.createUnzip()) - .pipe(extract) - .on("error", reject) - .on("end", resolve); - }); - - }) - .then(function() { - return fse.writeFile(rooted(vendorPath + version), ""); - }) - .then(function() { - if ((name == "libssh2") && (process.platform !== "win32")) { - return new Promise(function(resolve, reject) { - console.info("[nodegit] Configuring libssh2."); - cp.execFile( - rooted(vendorPath) + "configure", - {cwd: rooted(vendorPath)}, - function(err, stdout, stderr) { - if (err) { - console.error(err); - console.error(stderr); - reject(err, stderr); - } - else { - resolve(stdout); - } - } - ); - }); - } - else { - return Promise.resolve(); - } - }) - .then(function() { - console.info("[nodegit] Successfully updated " + vendorPath + - version + "."); - }); - } - }); - -} - -// Called on the command line -if (require.main === module) { - module.exports(); -} diff --git a/lifecycleScripts/submodules/getStatus.js b/lifecycleScripts/submodules/getStatus.js new file mode 100644 index 0000000000..2fcc42d37c --- /dev/null +++ b/lifecycleScripts/submodules/getStatus.js @@ -0,0 +1,50 @@ +var path = require("path"); +var rootDir = path.join(__dirname, "../.."); +var exec = require(path.join(rootDir, "./utils/execPromise")); + +module.exports = function getStatus() { + return exec("git submodule status", { cwd: rootDir}) + .then(function(stdout) { + if (!stdout) { + // In the case where we pull from npm they pre-init the submodules for + // us and `git submodule status` returns empty-string. In that case + // we'll just assume that we're good. + return Promise.resolve([]); + } + + function getStatusPromiseFromLine(line) { + var lineSections = line.trim().split(" "); + var onNewCommit = !!~lineSections[0].indexOf("+"); + var needsInitialization = !!~lineSections[0].indexOf("-"); + var commitOid = lineSections[0].replace("+", "").replace("-", ""); + var name = lineSections[1]; + + return exec("git status", { cwd: path.join(rootDir, name)}) + .then(function(workDirStatus) { + return { + commitOid: commitOid, + onNewCommit: onNewCommit, + name: name, + needsInitialization: needsInitialization, + workDirDirty: !~workDirStatus + .trim() + .split("\n") + .pop() + .indexOf("nothing to commit") + }; + }); + } + + return Promise.all(stdout + .trim() + .split("\n") + .map(getStatusPromiseFromLine) + ); + }) + .catch(function() { + // In the case that NodeGit is required from another project via npm we + // won't be able to run submodule commands but that's ok since the + // correct version of libgit2 is published with nodegit. + return Promise.resolve([]); + }); +}; diff --git a/lifecycleScripts/submodules/index.js b/lifecycleScripts/submodules/index.js new file mode 100644 index 0000000000..2d13d3c891 --- /dev/null +++ b/lifecycleScripts/submodules/index.js @@ -0,0 +1,82 @@ +var path = require("path"); +var rootDir = path.join(__dirname, "../.."); + +var gitExecutableLocation = require( + path.join(rootDir, "./utils/gitExecutableLocation") +); +var submoduleStatus = require("./getStatus"); + +var exec = require(path.join(rootDir, "./utils/execPromise")); + +module.exports = function submodules() { + return gitExecutableLocation() + .catch(function() { + console.error("[nodegit] ERROR - Compilation of NodeGit requires git " + + "CLI to be installed and on the path"); + + throw new Error("git CLI is not installed or not on the path"); + }) + .then(function() { + console.log("[nodegit] Checking submodule status"); + return submoduleStatus(); + }) + .then(function(statuses) { + function printSubmodule(submoduleName) { + console.log("\t" + submoduleName); + } + + var dirtySubmodules = statuses + .filter(function(status) { + return status.workDirDirty && !status.needsInitialization; + }) + .map(function(dirtySubmodule) { + return dirtySubmodule.name; + }); + + if (dirtySubmodules.length) { + console.error( + "[nodegit] ERROR - Some submodules have uncommited changes:" + ); + dirtySubmodules.forEach(printSubmodule); + console.error( + "\nThey must either be committed or discarded before we build" + ); + + throw new Error("Dirty Submodules: " + dirtySubmodules.join(" ")); + } + + var outOfSyncSubmodules = statuses + .filter(function(status) { + return status.onNewCommit && !status.needsInitialization; + }) + .map(function(outOfSyncSubmodule) { + return outOfSyncSubmodule.name; + }); + + if (outOfSyncSubmodules.length) { + console.warn( + "[nodegit] WARNING - Some submodules are pointing to an new commit:" + ); + outOfSyncSubmodules.forEach(printSubmodule); + console.warn("\nThey will not be updated."); + } + + return statuses + .filter(function(status) { + return !status.onNewCommit; + }) + .reduce(function(chainPromise, submoduleToUpdate) { + return chainPromise + .then(function() { + console.log( + "[nodegit] Initializing submodule", + submoduleToUpdate.name + ); + return exec( + "git submodule update --init --recursive " + + submoduleToUpdate.name + ); + }); + }, Promise.resolve()); + }); +}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..93f2f440d8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,10243 @@ +{ + "name": "nodegit", + "version": "0.28.0-alpha.36", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "nodegit", + "version": "0.28.0-alpha.36", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@mapbox/node-pre-gyp": "^2.0.0", + "fs-extra": "^7.0.0", + "got": "^14.4.7", + "json5": "^2.1.0", + "lodash": "^4.17.14", + "nan": "^2.23.1", + "node-gyp": "^11.2.0", + "tar-fs": "^3.0.9" + }, + "devDependencies": { + "aws-sdk": "^2.1095.0", + "clean-for-publish": "~1.0.2", + "combyne": "~0.8.1", + "js-beautify": "~1.5.10", + "jshint": "^2.10.0", + "lcov-result-merger": "^3.1.0", + "mocha": "^11.4.0", + "nyc": "^17.1.0", + "walk": "^2.3.9" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz", + "integrity": "sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz", + "integrity": "sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.26.7", + "@babel/types": "^7.26.7", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz", + "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.5", + "@babel/types": "^7.26.5", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz", + "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", + "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.1" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz", + "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", + "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@isaacs/fs-minipass/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.0.tgz", + "integrity": "sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==", + "license": "BSD-3-Clause", + "dependencies": { + "consola": "^3.2.3", + "detect-libc": "^2.0.0", + "https-proxy-agent": "^7.0.5", + "node-fetch": "^2.6.7", + "nopt": "^8.0.0", + "semver": "^7.5.3", + "tar": "^7.4.0" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", + "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", + "license": "MIT" + }, + "node_modules/@sindresorhus/is": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.0.1.tgz", + "integrity": "sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "license": "MIT", + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "license": "MIT" + }, + "node_modules/abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "dependencies": { + "buffer-equal": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-require-extensions": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/aws-sdk": { + "version": "2.1692.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1692.0.tgz", + "integrity": "sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.16.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "util": "^0.12.4", + "uuid": "8.0.0", + "xml2js": "0.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "license": "Apache-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/bare-events": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz", + "integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.5.tgz", + "integrity": "sha512-1zccWBMypln0jEE05LzZt+V/8y8AQsQQqxtklqaIyg5nu6OAYFhZxPXinJTSG+kU5qyNmeLgcn9AW7eHiCHVLA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4" + }, + "engines": { + "bare": ">=1.16.0" + }, + "peerDependencies": { + "bare-buffer": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + } + } + }, + "node_modules/bare-os": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.1.tgz", + "integrity": "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "bare": ">=1.14.0" + } + }, + "node_modules/bare-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", + "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-os": "^3.0.1" + } + }, + "node_modules/bare-stream": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz", + "integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "streamx": "^2.21.0" + }, + "peerDependencies": { + "bare-buffer": "*", + "bare-events": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + }, + "bare-events": { + "optional": true + } + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/cacache": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", + "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^4.0.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cacache/node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/cacache/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/cacheable-request": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-12.0.1.tgz", + "integrity": "sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==", + "license": "MIT", + "dependencies": { + "@types/http-cache-semantics": "^4.0.4", + "get-stream": "^9.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.4", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.1", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cacheable-request/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001696", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz", + "integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/clean-for-publish": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clean-for-publish/-/clean-for-publish-1.0.4.tgz", + "integrity": "sha1-KZMj50qzSwXSIHBsWd+B3QTKAYo=", + "dev": true, + "dependencies": { + "fs-extra": "^0.26.2", + "glob": "~5.0.15", + "yargs": "~3.29.0" + }, + "bin": { + "clean-for-publish": "lib/cli.js" + } + }, + "node_modules/clean-for-publish/node_modules/fs-extra": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", + "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "node_modules/clean-for-publish/node_modules/jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/clean-for-publish/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/clean-for-publish/node_modules/rimraf/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "dependencies": { + "exit": "0.1.2", + "glob": "^7.1.1" + }, + "engines": { + "node": ">=0.2.5" + } + }, + "node_modules/cli/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "node_modules/cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "node_modules/cloneable-readable/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/cloneable-readable/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/cloneable-readable/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/combyne": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/combyne/-/combyne-0.8.1.tgz", + "integrity": "sha1-WJ3kcEXVcVbcHs4YXWTDidzLR9g=", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "dependencies": { + "date-now": "^0.1.4" + } + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/convert-source-map/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-require-extensions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", + "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "strip-bom": "^4.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexify/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/duplexify/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.90", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.90.tgz", + "integrity": "sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT" + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", + "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==" + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "node_modules/flush-write-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/flush-write-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/flush-write-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreachasync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", + "integrity": "sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=", + "dev": true + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data-encoder": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", + "integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "license": "MIT", + "dependencies": { + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream/node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", + "dev": true, + "dependencies": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/glob-stream/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/glob-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/glob-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/got": { + "version": "14.4.7", + "resolved": "https://registry.npmjs.org/got/-/got-14.4.7.tgz", + "integrity": "sha512-DI8zV1231tqiGzOiOzQWDhsBmncFW7oQDH6Zgy6pDPrqJuVZMtoSgPLLsBZQj8Jg4JFfwoOsDA8NGtLQLnIx2g==", + "license": "MIT", + "dependencies": { + "@sindresorhus/is": "^7.0.1", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^12.0.1", + "decompress-response": "^6.0.0", + "form-data-encoder": "^4.0.2", + "http2-wrapper": "^2.2.1", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^4.0.1", + "responselike": "^3.0.0", + "type-fest": "^4.26.1" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/got/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "license": "MIT", + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" + }, + "node_modules/is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "node_modules/is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "append-transform": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "license": "ISC", + "dependencies": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jmespath": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/js-beautify": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.5.10.tgz", + "integrity": "sha1-TZU3FwJpk0SlFsomv1nwonu3Vxk=", + "dev": true, + "dependencies": { + "config-chain": "~1.1.5", + "mkdirp": "~0.5.0", + "nopt": "~3.0.1" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + } + }, + "node_modules/js-beautify/node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/js-yaml/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jshint": { + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.4.tgz", + "integrity": "sha512-HO3bosL84b2qWqI0q+kpT/OpRJwo0R4ivgmxaO848+bo10rc50SkPnrtwSFXttW0ym4np8jbJvLwk5NziB7jIw==", + "dev": true, + "dependencies": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.21", + "minimatch": "~3.0.2", + "strip-json-comments": "1.0.x" + }, + "bin": { + "jshint": "bin/jshint" + } + }, + "node_modules/jshint/node_modules/dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "dependencies": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, + "node_modules/jshint/node_modules/dom-serializer/node_modules/domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/jshint/node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/jshint/node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "node_modules/jshint/node_modules/domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/jshint/node_modules/domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "dependencies": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "node_modules/jshint/node_modules/entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "node_modules/jshint/node_modules/htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "dependencies": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "node_modules/jshint/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "node_modules/jshint/node_modules/minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jshint/node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/jshint/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.9" + } + }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "dependencies": { + "invert-kv": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lcov-result-merger": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lcov-result-merger/-/lcov-result-merger-3.3.0.tgz", + "integrity": "sha512-Krg9p24jGaIT93RBMA8b5qLHDEiAXTavaTiEdMAZaJS93PsBKIcg/89cw/8rgeSfRuQX+I9x7h73SHFjCZ6cHg==", + "dev": true, + "dependencies": { + "through2": "^2.0.3", + "vinyl": "^2.1.0", + "vinyl-fs": "^3.0.2", + "yargs": "^16.2.0" + }, + "bin": { + "lcov-result-merger": "bin/lcov-result-merger.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lcov-result-merger/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/lcov-result-merger/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lcov-result-merger/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/lcov-result-merger/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "dependencies": { + "flush-write-stream": "^1.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/make-fetch-happen/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.1.tgz", + "integrity": "sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==", + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-fetch/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "license": "MIT", + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mocha": { + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.4.0.tgz", + "integrity": "sha512-O6oi5Y9G6uu8f9iqXR6iKNLWHLRex3PKbmHynfpmUnMJJGrdgXh8ZmS85Ei5KR2Gnl+/gQ9s+Ktv5CqKybNw4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/mocha/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mocha/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/mocha/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nan": { + "version": "2.23.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.1.tgz", + "integrity": "sha512-r7bBUGKzlqk8oPBDYxt6Z0aEdF1G1rwlMcLk8LCOMbOzf0mG+JUfUzG4fIMWwHWP0iyaLWEQZJmtB7nOHEm/qw==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.2.0.tgz", + "integrity": "sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==", + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^14.0.3", + "nopt": "^8.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5", + "tar": "^7.4.3", + "tinyglobby": "^0.2.12", + "which": "^5.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "process-on-spawn": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nopt": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", + "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", + "license": "ISC", + "dependencies": { + "abbrev": "^3.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/nopt/node_modules/abbrev": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", + "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==", + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "dependencies": { + "once": "^1.3.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nyc": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "bin": { + "nyc": "bin/nyc.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/nyc/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/nyc/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/nyc/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/nyc/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/nyc/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.1" + } + }, + "node_modules/ordered-read-streams/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/ordered-read-streams/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/ordered-read-streams/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "dependencies": { + "lcid": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-cancelable": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", + "integrity": "sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", + "integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/proc-log": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", + "integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==", + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/process-on-spawn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "fromentries": "^1.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/pumpify/node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", + "dev": true, + "license": "ISC", + "dependencies": { + "es6-error": "^4.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "dependencies": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true, + "license": "ISC" + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "license": "MIT" + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "dependencies": { + "value-or-function": "^3.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "license": "MIT", + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "node_modules/sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "dev": true, + "license": "ISC" + }, + "node_modules/semver": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/spawn-wrap/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/spawn-wrap/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/ssri": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", + "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/ssri/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "node_modules/streamx": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz", + "integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==", + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true, + "bin": { + "strip-json-comments": "cli.js" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tar-fs": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", + "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "dependencies": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "dependencies": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "dependencies": { + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unique-filename": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", + "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", + "license": "ISC", + "dependencies": { + "unique-slug": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/unique-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", + "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "dependencies": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "dev": true, + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/uuid": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "dependencies": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-fs/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/vinyl-fs/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/vinyl-fs/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "dependencies": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/walk": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.15.tgz", + "integrity": "sha512-4eRTBZljBfIISK1Vnt69Gvr2w/wc3U6Vtrw7qiN5iqYJPH7LElcYh/iU4XWhdCy2dZqv1ToMyYlybDylfG/5Vg==", + "dev": true, + "dependencies": { + "foreachasync": "^3.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", + "dev": true, + "bin": { + "window-size": "cli.js" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dev": true, + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", + "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", + "dev": true, + "dependencies": { + "camelcase": "^1.2.1", + "cliui": "^3.0.3", + "decamelize": "^1.0.0", + "os-locale": "^1.4.0", + "window-size": "^0.1.2", + "y18n": "^3.2.0" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + } + }, + "@babel/compat-data": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz", + "integrity": "sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==", + "dev": true + }, + "@babel/core": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz", + "integrity": "sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA==", + "dev": true, + "peer": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.26.7", + "@babel/types": "^7.26.7", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz", + "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==", + "dev": true, + "requires": { + "@babel/parser": "^7.26.5", + "@babel/types": "^7.26.5", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "requires": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + } + }, + "@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + } + }, + "@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz", + "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==", + "dev": true, + "requires": { + "@babel/template": "^7.27.1", + "@babel/types": "^7.27.1" + } + }, + "@babel/parser": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", + "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "dev": true, + "requires": { + "@babel/types": "^7.27.1" + } + }, + "@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + } + }, + "@babel/traverse": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz", + "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", + "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" + } + }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==" + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + } + } + } + }, + "@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "requires": { + "minipass": "^7.0.4" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "@mapbox/node-pre-gyp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.0.tgz", + "integrity": "sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==", + "requires": { + "consola": "^3.2.3", + "detect-libc": "^2.0.0", + "https-proxy-agent": "^7.0.5", + "node-fetch": "^2.6.7", + "nopt": "^8.0.0", + "semver": "^7.5.3", + "tar": "^7.4.0" + } + }, + "@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "requires": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + } + }, + "@npmcli/fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", + "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "requires": { + "semver": "^7.3.5" + } + }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true + }, + "@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==" + }, + "@sindresorhus/is": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.0.1.tgz", + "integrity": "sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==" + }, + "@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "requires": { + "defer-to-connect": "^2.0.1" + } + }, + "@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" + }, + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==" + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "requires": { + "buffer-equal": "^1.0.0" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "aws-sdk": { + "version": "2.1692.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1692.0.tgz", + "integrity": "sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw==", + "dev": true, + "requires": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.16.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "util": "^0.12.4", + "uuid": "8.0.0", + "xml2js": "0.6.2" + } + }, + "b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "bare-events": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz", + "integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==", + "optional": true + }, + "bare-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.5.tgz", + "integrity": "sha512-1zccWBMypln0jEE05LzZt+V/8y8AQsQQqxtklqaIyg5nu6OAYFhZxPXinJTSG+kU5qyNmeLgcn9AW7eHiCHVLA==", + "optional": true, + "requires": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4" + } + }, + "bare-os": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.1.tgz", + "integrity": "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g==", + "optional": true + }, + "bare-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz", + "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", + "optional": true, + "requires": { + "bare-os": "^3.0.1" + } + }, + "bare-stream": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz", + "integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==", + "optional": true, + "requires": { + "streamx": "^2.21.0" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "peer": true, + "requires": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true + }, + "cacache": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", + "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", + "requires": { + "@npmcli/fs": "^4.0.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "requires": { + "minipass": "^7.0.3" + } + }, + "glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==" + }, + "cacheable-request": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-12.0.1.tgz", + "integrity": "sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==", + "requires": { + "@types/http-cache-semantics": "^4.0.4", + "get-stream": "^9.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.4", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.1", + "responselike": "^3.0.0" + }, + "dependencies": { + "mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==" + } + } + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, + "call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + } + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001696", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz", + "integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "requires": { + "readdirp": "^4.0.1" + } + }, + "chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==" + }, + "clean-for-publish": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clean-for-publish/-/clean-for-publish-1.0.4.tgz", + "integrity": "sha1-KZMj50qzSwXSIHBsWd+B3QTKAYo=", + "dev": true, + "requires": { + "fs-extra": "^0.26.2", + "glob": "~5.0.15", + "yargs": "~3.29.0" + }, + "dependencies": { + "fs-extra": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", + "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "^7.1.1" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "combyne": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/combyne/-/combyne-0.8.1.tgz", + "integrity": "sha1-WJ3kcEXVcVbcHs4YXWTDidzLR9g=", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==" + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "requires": { + "ms": "^2.1.3" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "requires": { + "mimic-response": "^3.1.0" + } + }, + "default-require-extensions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", + "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, + "defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==" + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==" + }, + "diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "electron-to-chromium": { + "version": "1.5.90", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.90.tgz", + "integrity": "sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "exponential-backoff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", + "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==" + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" + }, + "fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "requires": {} + }, + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "requires": { + "is-callable": "^1.2.7" + } + }, + "foreachasync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", + "integrity": "sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=", + "dev": true + }, + "foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "dependencies": { + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + } + } + }, + "form-data-encoder": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", + "integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==" + }, + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, + "get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "requires": { + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + }, + "dependencies": { + "is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==" + } + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", + "dev": true, + "requires": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true + }, + "got": { + "version": "14.4.7", + "resolved": "https://registry.npmjs.org/got/-/got-14.4.7.tgz", + "integrity": "sha512-DI8zV1231tqiGzOiOzQWDhsBmncFW7oQDH6Zgy6pDPrqJuVZMtoSgPLLsBZQj8Jg4JFfwoOsDA8NGtLQLnIx2g==", + "requires": { + "@sindresorhus/is": "^7.0.1", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^12.0.1", + "decompress-response": "^6.0.0", + "form-data-encoder": "^4.0.2", + "http2-wrapper": "^2.2.1", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^4.0.1", + "responselike": "^3.0.0", + "type-fest": "^4.26.1" + }, + "dependencies": { + "type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==" + } + } + }, + "graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "requires": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + } + }, + "http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "requires": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + } + }, + "https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "requires": { + "agent-base": "^7.1.2", + "debug": "4" + } + }, + "iconv-lite": { + "version": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "requires": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "dependencies": { + "sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + } + } + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.16" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "requires": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "dependencies": { + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "requires": { + "semver": "^7.5.3" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, + "jmespath": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", + "dev": true + }, + "js-beautify": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.5.10.tgz", + "integrity": "sha1-TZU3FwJpk0SlFsomv1nwonu3Vxk=", + "dev": true, + "requires": { + "config-chain": "~1.1.5", + "mkdirp": "~0.5.0", + "nopt": "~3.0.1" + }, + "dependencies": { + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true + }, + "jshint": { + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.4.tgz", + "integrity": "sha512-HO3bosL84b2qWqI0q+kpT/OpRJwo0R4ivgmxaO848+bo10rc50SkPnrtwSFXttW0ym4np8jbJvLwk5NziB7jIw==", + "dev": true, + "requires": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.21", + "minimatch": "~3.0.2", + "strip-json-comments": "1.0.x" + }, + "dependencies": { + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "dev": true + }, + "entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "requires": { + "json-buffer": "3.0.1" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lcov-result-merger": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lcov-result-merger/-/lcov-result-merger-3.3.0.tgz", + "integrity": "sha512-Krg9p24jGaIT93RBMA8b5qLHDEiAXTavaTiEdMAZaJS93PsBKIcg/89cw/8rgeSfRuQX+I9x7h73SHFjCZ6cHg==", + "dev": true, + "requires": { + "through2": "^2.0.3", + "vinyl": "^2.1.0", + "vinyl-fs": "^3.0.2", + "yargs": "^16.2.0" + }, + "dependencies": { + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + } + } + }, + "lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "requires": { + "flush-write-stream": "^1.0.2" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==" + }, + "lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "requires": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true + }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true + }, + "minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "requires": { + "minipass": "^7.0.3" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "minipass-fetch": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.1.tgz", + "integrity": "sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==", + "requires": { + "encoding": "^0.1.13", + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "requires": { + "minipass": "^7.1.2" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mocha": { + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.4.0.tgz", + "integrity": "sha512-O6oi5Y9G6uu8f9iqXR6iKNLWHLRex3PKbmHynfpmUnMJJGrdgXh8ZmS85Ei5KR2Gnl+/gQ9s+Ktv5CqKybNw4A==", + "dev": true, + "requires": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "dependencies": { + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + } + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "nan": { + "version": "2.23.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.1.tgz", + "integrity": "sha512-r7bBUGKzlqk8oPBDYxt6Z0aEdF1G1rwlMcLk8LCOMbOzf0mG+JUfUzG4fIMWwHWP0iyaLWEQZJmtB7nOHEm/qw==" + }, + "negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-gyp": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.2.0.tgz", + "integrity": "sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==", + "requires": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^14.0.3", + "nopt": "^8.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5", + "tar": "^7.4.3", + "tinyglobby": "^0.2.12", + "which": "^5.0.0" + } + }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true + }, + "nopt": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", + "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", + "requires": { + "abbrev": "^3.0.0" + }, + "dependencies": { + "abbrev": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", + "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==" + } + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "normalize-url": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==" + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "requires": { + "once": "^1.3.2" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "p-cancelable": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", + "integrity": "sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==" + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", + "integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==" + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "requires": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "peer": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true + }, + "proc-log": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", + "integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "process-on-spawn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, + "promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + } + }, + "remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "requires": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "requires": { + "value-or-function": "^3.0.0" + } + }, + "responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "requires": { + "lowercase-keys": "^3.0.0" + } + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "dev": true + }, + "semver": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==" + }, + "serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + }, + "socks": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "requires": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + } + }, + "socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "requires": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + } + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "ssri": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", + "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", + "requires": { + "minipass": "^7.0.3" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + } + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "streamx": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz", + "integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==", + "requires": { + "bare-events": "^2.2.0", + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "requires": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "dependencies": { + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + }, + "mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==" + }, + "yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==" + } + } + }, + "tar-fs": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", + "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", + "requires": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0", + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + } + }, + "tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "requires": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "requires": { + "b4a": "^1.6.4" + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "tinyglobby": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "requires": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + } + }, + "to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + }, + "to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "requires": { + "through2": "^2.0.3" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "unique-filename": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", + "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", + "requires": { + "unique-slug": "^5.0.0" + } + }, + "unique-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", + "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "requires": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "requires": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + } + }, + "url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", + "dev": true + }, + "value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "requires": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "requires": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + } + }, + "walk": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.15.tgz", + "integrity": "sha512-4eRTBZljBfIISK1Vnt69Gvr2w/wc3U6Vtrw7qiN5iqYJPH7LElcYh/iU4XWhdCy2dZqv1ToMyYlybDylfG/5Vg==", + "dev": true, + "requires": { + "foreachasync": "^3.0.0" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "requires": { + "isexe": "^3.1.1" + }, + "dependencies": { + "isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==" + } + } + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + } + }, + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", + "dev": true + }, + "workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yargs": { + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", + "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", + "dev": true, + "requires": { + "camelcase": "^1.2.1", + "cliui": "^3.0.3", + "decamelize": "^1.0.0", + "os-locale": "^1.4.0", + "window-size": "^0.1.2", + "y18n": "^3.2.0" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + } + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json index 7bb1197868..41ccc32dc4 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,7 @@ { "name": "nodegit", "description": "Node.js libgit2 asynchronous native bindings", - "version": "0.3.3", - "libgit2": { - "url": "https://github.com/libgit2/libgit2/tarball/fb6df50b7f250a4fd8b2fab257f119a5185e9bf5", - "sha": "fb6df50b7f250a4fd8b2fab257f119a5185e9bf5", - "version": "0.22.2" - }, - "libssh2": { - "url": "http://www.libssh2.org/download/libssh2-1.4.3.tar.gz", - "version": "1.4.3" - }, - "http_parser": { - "url": "https://github.com/joyent/http-parser/archive/v2.3.tar.gz", - "version": "2.3.0", - "0.10": { - "url": "https://github.com/joyent/http-parser/archive/v2.0.tar.gz", - "version": "2.0.0" - } - }, + "version": "0.28.0-alpha.36", "homepage": "http://nodegit.org", "keywords": [ "libgit2", @@ -36,6 +19,10 @@ { "name": "Max Korp", "email": "maxkorp@8bytealchemy.com" + }, + { + "name": "Tyler Ang-Wanek", + "email": "tylerw@axosoft.com" } ], "main": "lib/nodegit.js", @@ -48,60 +35,54 @@ "lib": "./lib" }, "engines": { - "node": ">= 0.8" + "node": ">= 20" }, - "bundledDependencies": [ - "node-pre-gyp" - ], "dependencies": { - "fs-extra": "^0.16.3", - "node-pre-gyp": "^0.6.2", - "nodegit-promise": "^2.0.0", - "npm": "^2.5.0", - "promisify-node": "^0.1.5", - "which-native-nodish": "^1.0.3" + "@mapbox/node-pre-gyp": "^2.0.0", + "fs-extra": "^7.0.0", + "got": "^14.4.7", + "json5": "^2.1.0", + "lodash": "^4.17.14", + "nan": "^2.23.1", + "node-gyp": "^11.2.0", + "tar-fs": "^3.0.9" }, "devDependencies": { - "combyne": "^0.6.5", - "coveralls": "^2.11.2", - "istanbul": "^0.3.5", - "js-beautify": "^1.5.4", - "jshint": "^2.6.0", - "lcov-result-merger": "^1.0.2", - "lodash": "^3.1.0", - "mocha": "~2.1.0", - "nan": "^1.7.0", - "nw-gyp": "^0.12.4", - "pangyp": "^2.1.0", - "request": "^2.53.0", - "tar": "^1.0.3" + "aws-sdk": "^2.1095.0", + "clean-for-publish": "~1.0.2", + "combyne": "~0.8.1", + "js-beautify": "~1.5.10", + "jshint": "^2.10.0", + "lcov-result-merger": "^3.1.0", + "mocha": "^11.4.0", + "nyc": "^17.1.0", + "walk": "^2.3.9" }, "binary": { + "bucket_name": "axonodegit", "module_name": "nodegit", "module_path": "./build/Release/", - "host": "https://nodegit.s3.amazonaws.com/nodegit/nodegit/" + "host": "https://axonodegit.s3.amazonaws.com/nodegit/nodegit/" }, "scripts": { - "lint": "jshint lib test/tests examples lifecycleScripts", - "coveralls": "cat ./test/coverage/merged.lcov | coveralls", - "filtercov": "lcov --extract test/coverage/cpp/lcov_full.info $(pwd)/src/* $(pwd)/src/**/* $(pwd)/include/* $(pwd)/include/**/* --output-file test/coverage/cpp/lcov.info && rm test/coverage/cpp/lcov_full.info", - "cppcov": "mkdir -p test/coverage/cpp && lcov --gcov-tool $(which gcov) --capture --directory build/Release/obj.target/nodegit/src --output-file test/coverage/cpp/lcov_full.info", - "mergecov": "lcov-result-merger 'test/**/*.info' 'test/coverage/merged.lcov' && genhtml test/coverage/merged.lcov --output-directory test/coverage/report", "cov": "npm run cppcov && npm run filtercov && npm run mergecov", - "mocha": "mocha test/runner test/tests", - "mochaDebug": "mocha --debug-brk test/runner test/tests", - "test": "npm run lint && (iojs --expose-gc test || node --expose-gc test)", + "cppcov": "mkdir -p test/coverage/cpp && ./lcov-1.10/bin/lcov --gcov-tool /usr/bin/gcov-4.9 --capture --directory build/Release/obj.target/nodegit/src --output-file test/coverage/cpp/lcov_full.info", + "filtercov": "./lcov-1.10/bin/lcov --extract test/coverage/cpp/lcov_full.info $(pwd)/src/* $(pwd)/src/**/* $(pwd)/include/* $(pwd)/include/**/* --output-file test/coverage/cpp/lcov.info && rm test/coverage/cpp/lcov_full.info", "generateJson": "node generate/scripts/generateJson", - "generateNativeCode": "node generate/scripts/generateNativeCode", "generateMissingTests": "node generate/scripts/generateMissingTests", - "prepublish": "node lifecycleScripts/prepareForBuild.js", - "publish": "node-pre-gyp package && node-pre-gyp publish", - "install": "node lifecycleScripts/install", + "generateNativeCode": "node generate/scripts/generateNativeCode", + "install": "node lifecycleScripts/preinstall && node lifecycleScripts/install", "installDebug": "BUILD_DEBUG=true npm install", - "postinstall": "node lifecycleScripts/clean", - "recompile": "pangyp configure build", - "rebuild": "node generate && pangyp configure build", - "recompileDebug": "pangyp configure --debug build", - "rebuildDebug": "node generate && pangyp configure --debug build" + "lint": "jshint lib test/tests test/utils lifecycleScripts", + "mergecov": "lcov-result-merger 'test/**/*.info' 'test/coverage/merged.lcov' && ./lcov-1.10/bin/genhtml test/coverage/merged.lcov --output-directory test/coverage/report", + "mocha": "mocha --expose-gc test/runner test/tests --timeout 15000", + "mochaDebug": "mocha --expose-gc --inspect-brk test/runner test/tests --timeout 15000", + "postinstall": "node lifecycleScripts/postinstall", + "rebuild": "node generate && node-gyp configure build", + "rebuildDebug": "node generate && node-gyp configure --debug build", + "recompile": "node-gyp configure build", + "recompileDebug": "node-gyp configure --debug build", + "test": "npm run lint && node --expose-gc test", + "xcodeDebug": "node-gyp configure -- -f xcode" } } diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000000..e6bdccbc4d --- /dev/null +++ b/test/README.md @@ -0,0 +1,36 @@ +## /test + +Contains all the test scripts, runner, and keys for running the tests. + +----------- + +#### /home +Contains gitconfig for the test repositories. + +#### /repos +Contains blame, empty, nonrepo, and workdir test repositories. + +#### /tests +Unit tests for NodeGit. + +#### /utils +Test utilities with garbage collector, index, and repository setup, that can be used in tests. + + +## Keys + +Note: all files are encoded in base64 in `\*.enc` and decoded before the test suite runs. + +### encrypted_rsa + - passphrase "test-password" + - registered as deploy key on [nodegit/test](https://github.com/nodegit/test) repo named "Encrypted test key" + +### id_rsa + - registered as deploy key on [nodegit/test](https://github.com/nodegit/test) repo named "Unencrypted Test Key" + +### private.ppk + - same key as id_rsa + - ppk format is used by putty/pageant and converted/generated by puttygen + +### nodegit-test-rsa + - registered as deploy key on [nodegit/private](https://github.com/nodegit/private) repo named "Tests" diff --git a/test/encrypted_rsa b/test/encrypted_rsa new file mode 100644 index 0000000000..2ecf534faf --- /dev/null +++ b/test/encrypted_rsa @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,76C5AF2E37D863AA3712FFD502FE63FF + +dp3B4Mz7//+AxUpMEBiJUmOGherBSM5LGov4Je7Od+LoORPCGu17+l44VovPnwgg +JrK5IcV/MiDOJ/iYXtyeMWtUWU8v66M3bmQn83VzcUv0SnuXi673tNtZe14u2UhM +adW78AqC15lM2za1iMLM7Y5MTcg8rAtXZIuOllxIRCt+sbsLWObMo9YHPjiRPPa/ +cDfIW+PXTTiIE0qw+7cACVRXXZsH04HqvrK8qH34MZcGqLjA3sj1fZt0wd2IgwGa +CK0lm8edMcLlZeM9vippKUEgNvjgN+8xCcPf9AoCEQepd4JVAIJYeeV+qxkUsp4s +SV2dUF8RWXdTG9QT7PCZq0o0KMcD0u7yhAquI21+ggti3lx1Ix9I5wMNCBqNEYVE +Q/hNt8PJwjaiD3x+rFHjjiVmA0onAIgdMXPLLkg43H3kBYanFc8mP+hLtegNlY5V +zfb3RilnMua0DHf0sqybvPNrvrUNchQPL0Py00PP4yf3nuKcIYgqgj+1wMVK1prS +4nMCyFNAlSt7KxSJOGU050BeBYcYlQRPXicoesNqfFmJ2hNv4jc1EM9khxSlcsU6 +zS3ZFv4kPJoKnn6CBOjsFwZ8EY7wwJvZHwDFZnrBXU8LcLG8+KCjvjHb0qXGFfG7 +g3VElz5IFhN6MrpGGrn/81LFGepg4FCa+55xCje1ykJrPdMwTnA4ezOfvcVXIuFm +iVk/2GiUUDOmn2FeSyNYSgQ/UFgxc5jUXMRcSDRKOM3y/Upl8+hzne91IHVVH1el +ChMR5HowQaRKmTgml6nG43D4jTcwcJdhcuDbXlbvBgVg0rTs4ZDVjP6RtCTmZete +nlHIYeRxutvGBYD4xjuSEldsSoQvVaDkLoKNZCHLzNFEutG4P4Ee8frGFD11j3gu +R+p7KlLLa+MyfW3Z3yxMc84iTw8ULzIQFRQX3Wk1NBW9giRpxEDZpXK3KYZErFZ6 +dK2zFAYpryYQxFx5+Qnl9okTAxi7NHhAVksKAQQBEgikbS8vJSJvDBhidpOJ1Kr0 +L896bjOFdzl8Xz0VturUmduSghiCrMPzCC5iVonJfqNLaXExYDWlcr+GpZzbuxbw +tP0KjvL4lM9MwgxCAXLh6SAwn79I3VWFTDMsFBLoCVpReyu7RU546DhuspZmY7+l +kuWhjE4P+zYGy9Rd8xnXREsDD43m2laX1JDjRHDAw5maUBWJXCXUDmSSL1Tyha9y +r6H99HjfMYc2RgPr+4yjYeVU1d1PgS94q9u8XiFDsDC3+WrxpQQdpraN6gRhdb2j +aoZ7BpqMxccaMwskRayoTCXOzd0p2Xf848soQtnRTE7/TowUHE0QGFn5v+zgUeFI +aGj61MB9q+M297/XTeqDowr4QDYGWA8HWGGkaAUhmntyoQRjIdN50dztDy0IeQrY +rL7scCBGeyxlFJiazhs5h9ppCchhhuxR2hViRGzXIdaII2MwKHh1UDw7+Jm14K46 +fSrFmhZJn2cGFL+fRQEwV1tBUG083DJJFtfP0XxDtcEkSZxMfE7GFDTL7izRGdCg +Mj3zOsUbhZxc8YSAqPIT/tYNuaESk/m+s14EF4ni8WU19T4tKNy0LFh5eFHfk9OO +Sz1CIaOWVRSnDcYiOGacpBV8LLrjaqq+awi9EATj9t/47OzOKbO3IVzVgjZKQBsl +mgo+vjZ3W0LH59XNVgE15x6NqG+gdlPRbX+1iJF44c8RWIm5RLtZ8RfQw63P1PgI +R9VRlfqhtna17nOYP/w03WfGDRUGR6MgSdwyy6pKo93hsvJRCpBzmAiXtcVxiVZ7 +ggGk6khhtWrEKZe8DYT1lWamJyng+dUhHGPxYPdoeBy9fZ2fQzoT+OVPCFCuUy2h +wBwRJjOCr7e7fwuyS+cAM/1uRfLDMq7xs7N1JGSVePAvGvICrEDHoMMe5oSMKpoi +EEjPxS+glKdLflbXatJ4V5+Zm/dVvSkb9b+k5RNV4rFZst1Yahl/7expic0rVF6h +nOieyRPzFeE9cGDtDkoFOicixJfLOI6Ex/6nfGsIJa2hcXFm+ibO54vWCgtgMaXm +AANrwxvvEWROvmkL8l/tbmWgj8Nd/Vt8L+2r/7tcZ6vWWqseTUNOYL9o2gV6lHEn +OkGY/WrPUfAIXml5dWTDWGGi8YuE2KhYXBn6msN8lcO7hGOIWetfnCGB7xsafjBl +4xaT18L4b+mNSX3lmCqfcXMY0tJZUZBgFw9gAdIl3xcKqyUSMHJHyMpm7dj0cP0P +Egs4Y4qDN5uvVI2zHobYfhez2uk+T43yXu/tYFVFL9I37/fshzPJoVb7oevNDNKH +siPljm/dhGB8jxbXoARJFoHgUeA+CLj9bD9JSh5Siu93KTjYTJZLK/XC0nVe/R4q +Sd7EaM2B92IU5LPGnO7BvcXHygjhwCqVyyGFiS5m6VirG6TsZEawPTVtWFme+T71 +FQevwtgNkmblN7ETvqrsXkaU992zGa7dPs8Dsvpmm9TS7wHNObFRPQshJ7i7lKG4 +vypXduG0vPjGwFqoz4UxGYFYpytfXT83+Iww4VGfKA0NbIkG3huh/Tl5mya39FUi +b2tMk2pE9Zjj0uLTlTR7YSPKDD/C67kPww9ppCW3CTJPn7Fp5cIMjGp6KtCEnfz4 +dMRMPOH7VIi57XsSWm2frcxmMkNIE+80JD9hW7zjANkrsHZ/l9QwTOCzlMNWKu82 +RrXIj4peZocXBYxlqNyX7LaaK1lVgbjwX51eyaNKMiOcV483XEWAj6omkJi2jRte +eOMLQ0ZmIMklIG8dA4YTilmvFczN5TUEfGmKknQ3tVkjGyYVThjbKoEeSJODKDIN +md46fUM1sIYR/CtDQl3KK0KSUdYGvsSNOF4g/6D96d6GQk85nQvlUkxCjjUxNaur +TgF0+DM3O+UjSs2RGldrqtb4DP2AtqH1WulKdX94Y/LUb6icGI6jC6QwgdAjZpAC +s+os4irP6fLOho4IpNtqFqWzairzFhnyDWussh9A50mxPt1EFl1ygbjgD6KKdtx3 +ZaI+ZjKtqY/2d4qmhnKT68is5cv/vXy+Eow3uT5SvXeCOtS8ceWBpYKfO/pc3Bh2 +wNf1gVqdttD3npCqaXCKo9QdXYqt+hqeLK55p7D7CMG5c05tOCr06l3VUG7Wq5RK +-----END RSA PRIVATE KEY----- diff --git a/test/encrypted_rsa.pub b/test/encrypted_rsa.pub new file mode 100644 index 0000000000..3ab84a7d05 --- /dev/null +++ b/test/encrypted_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6x3pGhFSz+CT5bjeIWNvYNh4BBNFiGn+YzT09we58vwnyHWb940e6SJalrTqLH+6QWAXMcZpSZFBwnYia9Ja/XE2UWwxQU5rryGdc5Tju/u1kB0HuMjGpQDmFSpVrJcfRS5wXJCtoka5O0qvPUUNVAK9k/6HVX+2CGbafNjOMXnNtWgKKWlDd5eQAk3Ok3LvSrTv0kp9S3C4KdO8cz9NvtlWXHTFit94kOIzaL/v10f2u6V93VvV5jckJwZhjfyH1Q2WS/+j0ck7WqyGEBltPz6dubJipqrlAHRUacmWtI0ODdsoNwUrKCidiEkwheWA2SmbIdkTInt5vrcYvbOdNrn9aJ1aII15PSLE7eCqNdasEkp2G75hQ5DWYnprxVGY2FzqCCg2DwYev1qe4MzJ+m9PrUL+FKCrkhiCgpaOT+Noz5gX1gRvYtvg+BeRA2uoIi7rK1A3CapKRJmVM7kukgCZ5ZSMgXgXPtX4ttUgu43jVjEdcjrkoZqBSH8l72cmEcIyjahuJZqg859CyQbX5qAGDwxdz7Qjj0gwGU//bNd3/vZMzWEfkN49iDpYjipLZzg4MR946kFTT90X9S5ryjSXkyFZJWSyks8K8BOztL/o8avAu4RUn/4+ipISSz+5FoOi/pkH+KkvIoSzlcuGxAigDyUlev8wxn/FQj2tmGQ== your_email@example.com diff --git a/test/id_rsa b/test/id_rsa deleted file mode 100644 index 91ae66320a..0000000000 --- a/test/id_rsa +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEA5E3IF5x7qkdIG8HoJ6/Wcc+IU5I41f0qYCTTyc+5qPxyjW8d -K6o49T9MhkdOd0fRkhRYptrreDSvQzz1JEHcrnMPg6C5GERyZpSeATWvTUwg9LJf -nklztvevZGaIwmEjoG5pAicfJnYE8Ic3YBP44Qa7GNITxOqUU5VPh+vP83jXSVAC -CX9Cy1zpt4aUyiwNfVSApbZf4/VbwSaYER3QcpVxMi/B6JGKY5EEJNWV495uzZaP -Mg3YOFXJYziVgvl4fJMUTHyucf1UVbGCgkFzeUJcynqn+1EkQ1Ev+5haD1AVvneJ -MCrRsUbFriC9snqs4n2VEzoLIffmVgFsVn30GQIDAQABAoIBAQDPQm2sQbti0mN8 -D4Uawl8D40v30n8WhUa7EbPTOmlqKAQ2sfDhex9KRbTLEmEBmImA/Eee8o9iCTIy -8Fv8Fm6pUHt9G6Pti/XvemwW3Q3QNpSUkHqN0FDkgecQVqVBEb6uHo3mDm4RFINX -eOmkp30BjIK9/blEw1D0sFALLOEUPaDdPMwiXtFgqfrFSgpDET3TvQIwZ2LxxTm0 -cNmP3sCSlZHJNkZI4hBEWaaXR+V5/+C1qblDCo5blAWTcX3UzqrwUUJgFi6VnBuh -7S9Q6+CEIU+4JRyWQNmY8YgZFaAp6IOr/kyfPxTP1+UEVVgcLn3WDYwfG9og0tmz -fzlruAgBAoGBAPfz73Pey86tNZEanhJhbX8gVjzy2hvyhT0paHg0q/H6c1VWOtUH -OwZ3Ns2xAZqJhlDqCHnQYSCZDly042U/theP4N8zo1APb4Yg4qdmXF9QE1+2M03r -kS6138gU/CSCLf8pCYa6pA/GmsaXxloeJGLvT4fzOZRsVav80/92XHRhAoGBAOu2 -mKh4Gr1EjgN9QNbk9cQTSFDtlBEqO/0pTepvL73UvNp/BAn4iYZFU4WnklFVBSWc -L84Sc732xU12TAbTTUsa6E7W29pS8u7zVTxlIdQIIU5pzDyU1pNNk2kpxzte5p3Y -PDtniPFsoYLWoH0LpsKL93t2pLAj+IOkE6f3XBq5AoGAIKaYo5N1FxQr952frx/x -QUpK0N/R5Ng8v18SiLG26rhmM5iVSrQXC7TrHI7wfR8a9tC6qP/NqnM9NuwC/bQ0 -EEo7/GhaWxKNRwZRkmWiSFLNGk9t1hbtGU+N1lUdFtmloPIQdRNiw0kN3JTj474Q -YI7O1EItFORnK6yxZfR6HEECgYEA1CT7MGUoa8APsMRCXyaiq15Pb8bjxK8mXquW -HLEFXuzhLCW1FORDoj0y9s/iuKC0iS0ROX8R/J7k5NrbgikbH8WP36UxKkYNr1IC -HOFImPTYRSKjVsL+fIUNb1DSp3S6SsYbL7v3XJJQqtlQiDq8U8x1aQFXJ9C4EoLR -zhKrKsECgYBtU/TSF/TATZY5XtrN9O+HX1Fbz70Ci8XgvioheVI2fezOcXPRzDcC -OYPaCMNKA5E8gHdg4s0TN7uDvKTJ+KhSg2V7gZ39A28dHrJaRX7Nz4k6t2uEBjX9 -a1JidpAIbJ+3w7+hj6L299tVZvS+Y/6Dz/uuEQGXfJg/l/5CCvQPsA== ------END RSA PRIVATE KEY----- diff --git a/test/id_rsa.enc b/test/id_rsa.enc new file mode 100644 index 0000000000..8c992bebde --- /dev/null +++ b/test/id_rsa.enc @@ -0,0 +1 @@ +LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0KYjNCbGJuTnphQzFyWlhrdGRqRUFBQUFBQkc1dmJtVUFBQUFFYm05dVpRQUFBQUFBQUFBQkFBQUNGd0FBQUFkemMyZ3RjbgpOaEFBQUFBd0VBQVFBQUFnRUFzRG5CRGV2dVZTNzFLVHg0OEdiRzlMeHp3UUJ1OVVYc25Qd3ROdGh3bHdpRmpYL1M5U0lKCnhwNENIdVBjS3JYdjJLcTI1NnRMby9jcENkZk9waFhjSWNpZ09RNzc1MGQwSDAvZkpyMHpzWjh3akFiZ1ZPOXpPanlRbXUKbE15WWNzWmpkMURESjQ2djBwNGU4YTZsbldwbHduVFNzVVB3OVVXRkt0MDRDcDZSNVpXaHdlTDg5cmI2Qk13SEJySURNWQpWY2VZSVlGZFRsZWU5MStGQWhLZVVFVE9LNzF6aWRPQXY0Ti9jdnRUQWNtYmlhTTgvUEtXVDEvRDFCeDJ6YzJsY0d3Y2RWCkJiaUxWQmNZKzJReGZzWjVlMGk5SGhKdjdCcWw4SXgxTTYzaVlkQU0yQUFseEZkTU1ONEMwUW1YeDlkSkxTdFdFcXRXZ2gKSHNGY05MSnpDTUs5MGRnSEh3OHZnOTFtdGNMVjVUS01nb3RXaEI2YjRMdkZEUUlac2V5RnY0cVJnM2NOb1hlUFY3bmg3OQp1YVlhL0NremJrNEdZQytsbXhENndFZDhHOGM4d0s4cjJ3NW04ZTAwWmdrQUVhbnovZGZRZ1dzdHBkajRmK05RdUVXRnN6CnNpeGlrTUtOVnJhWnpoRmFUaE9DbTNUUHNmY05LZ2NBN3VXVGJZNllNMlQ1SmowU3ZHRW5Ka1EzUitIK1RIamxqc0wrMnUKWVRCM2NlZ2dXc1dzSmlyazFTdjNlMURxUlhUeGNTcDlyRWlMaHVxV0NLL0t4QzZyWGpBMGJWSkgxMENnRjJNZWtVRTJtNApmeVZjUE5ML0VYWVN1V2t6elZzTDFjdzJSc3psS3RIQVJMNzRISlp6Z3RZMjZ2SlFLOTlub09QMk10aEc0dWI5aWRyajN1CmtBQUFkQVVoVnBRRklWYVVBQUFBQUhjM05vTFhKellRQUFBZ0VBc0RuQkRldnVWUzcxS1R4NDhHYkc5THh6d1FCdTlVWHMKblB3dE50aHdsd2lGalgvUzlTSUp4cDRDSHVQY0tyWHYyS3EyNTZ0TG8vY3BDZGZPcGhYY0ljaWdPUTc3NTBkMEgwL2ZKcgowenNaOHdqQWJnVk85ek9qeVFtdWxNeVljc1pqZDFEREo0NnYwcDRlOGE2bG5XcGx3blRTc1VQdzlVV0ZLdDA0Q3A2UjVaCldod2VMODlyYjZCTXdIQnJJRE1ZVmNlWUlZRmRUbGVlOTErRkFoS2VVRVRPSzcxemlkT0F2NE4vY3Z0VEFjbWJpYU04L1AKS1dUMS9EMUJ4MnpjMmxjR3djZFZCYmlMVkJjWSsyUXhmc1o1ZTBpOUhoSnY3QnFsOEl4MU02M2lZZEFNMkFBbHhGZE1NTgo0QzBRbVh4OWRKTFN0V0VxdFdnaEhzRmNOTEp6Q01LOTBkZ0hIdzh2ZzkxbXRjTFY1VEtNZ290V2hCNmI0THZGRFFJWnNlCnlGdjRxUmczY05vWGVQVjduaDc5dWFZYS9Da3piazRHWUMrbG14RDZ3RWQ4RzhjOHdLOHIydzVtOGUwMFpna0FFYW56L2QKZlFnV3N0cGRqNGYrTlF1RVdGc3pzaXhpa01LTlZyYVp6aEZhVGhPQ20zVFBzZmNOS2djQTd1V1RiWTZZTTJUNUpqMFN2RwpFbkprUTNSK0grVEhqbGpzTCsydVlUQjNjZWdnV3NXc0ppcmsxU3YzZTFEcVJYVHhjU3A5ckVpTGh1cVdDSy9LeEM2clhqCkEwYlZKSDEwQ2dGMk1la1VFMm00ZnlWY1BOTC9FWFlTdVdrenpWc0wxY3cyUnN6bEt0SEFSTDc0SEpaemd0WTI2dkpRSzkKOW5vT1AyTXRoRzR1YjlpZHJqM3VrQUFBQURBUUFCQUFBQ0FGL2pUUlNTSitEWjZEUkQzMXFQMGZvaEFLc24zVGhBai9ycgpqSDZuVHJ3ZnV1dS9mYjQ4Z3kwN2xOUFNFRjU5R01EQVF6M1RpeGp3eDdlL1lZWWxwdDRMR0lOemo4WE1yM2JLTXhZVkpTCmVsQXZsdVZHcGkwRVFENkhzaUx0SUpaek5IUWIwZFNZWXpzckpwTkRBSUtpL2pQTTlVZlhQQ2w1Wm5ob1hySUlqa0pxSk4KWW0rSllXQWZ6U041Q0JGQlBDQ1F0a3FrNVd4WGFQd1pVWHBMUHpGVi93ajEwUVJSdldCMzRNVmowMHJKdElReitsOTRjQwpsSVpubm44dzBRdE5CelF4amlYS3dLVkUzQ2NONFpDbDFqd3EzQnljMDZHWTdtbnhRMlNYWFBMMERja0thNEptTGVMNUtuCmNyelJiRUllRWVEM3VoRnpVM0kwckVOUVJoNjY5SXByYWpmUnpMY0Z4bkM3M0JTMVJUeWNmcGRTR0ZPUFhULzJOZDM2MlgKU2VwNlZOeFN0NWE2d2tXZ0hKaDJIOGRQY25pREgxRG1yQWRQOTdBa2VpMWxtWHFiekNJVjlwaWQzbWZNQUpiSm00UmhRcApURHZldUU4TmlCZ0k2MlRrd3Vjb1cyeTNMZFN2MTM3aUpCbkpTYzExRzlBNWJHMnlRWEUyYWlYUXhIeW9UMlF0VmY1WklYClJhVkx1YlFuY1NnTEJqZ0NkMUNsakI1amxSWU10U2M4YkZhL1RKNW9YT1ZNdENYNHhhcVo3Z3JHS05CcUJsRFRXblRnWk0KbXZ3UFZ1Y2xlNzI4MzZPSlBYbzFMajNLM2ttcnhDMXVORzA3NjMvemJLOWl2QWF1SFRMMnQ0cHkra0k0NC9ZcERvR2sybgp4bFdNZEQzTDNKVXgzUXo5THhBQUFCQVFDVzh6YVI5T2VPMXAzWGkxNFg5MDNuOWNjY1JVcGRMOEZSUDZ5MWkrVFpmN2RSClpla3ltWDZGbU9qbTAvbm9XM0hwZVoyYmJEaUFQRFp1VzRmUW1nWjBnemxvZERDZUp2UHF2U1FzUWVISjRjMkdzVG4xVHMKMzNYU1RWeFVLd3dqbEZ2TGpvMkJBdmlBaGZ3YUN3UmxUaGlrRy9CdC8wbVhObTF6cHFZbnFBc1pXb3JqOVVWQTYyT1c4MQpDVVgxL2RVMWtjUkFpY2NsUWxqTlNEWGJ6aWJVN2pvdXpzQzNFVUVEcG1HZG1UUVh4WHNCNTFVTmh5eVZoMmdBVnFDMDAyCm1Kd2dFVXNqcHFzYUw2TTczYXo4Mzg4b0RwWGJwMUNLTER5aDh2SnBJTkgwak5OZEQxd1dvQVJRZUhzL05iUUZLUThJTkkKdlBzWnowWkdmRzcvdVMrSkFBQUJBUURiVG94anFOUHJGT1piWDkzeDZONTVJV05DVUt1cUwxVks2MURIYUtYZmlpd0hEeQpRYjEzUnhPREk2RlNXMElIeVpqMDh5ZjBTVElGOXNZTUFwNy9GS1FORElqVVZyMVI2Z0RFZ0F3K2N5L2dpeWowVWxxSE1zCmdUUnNnSmEvSjJQYnViRDRWMzdZUkQ4enB2a0tmOFNKMGJRalEwaUx0YUNVYm9BUDVmYWFYbElLdmUyeHpLdVgzT0l2TTMKTyt1UTBJMDZqZGtMc2JBRzEvZ0E5emJmaW1wTHdJQkJkVUl6djdoRTJqOGJoak9HbTVTSU5rczRZZVROVFZXZHhmcjdiLwowVlFPSXJDd0RQKytCaGM5N2QrWDdZVVVkUUgzUHBTV3JWb0pOc0hNcHVUWmhpd0NnRk1NT1RYSEdWbGpFOHJnZGVTbFBzCmdCMXNRaHhyUlNNQitmQUFBQkFRRE50ZTQrMW5sWUtWNkVRWXhyeUpVQUtPdE1LSmZBNVhSVHNzWGhzRXlSMDBxL1djd3QKcmZmMzV3N2ZBWEJWd2VOemVlaXlwZXZKc1lnUnBBdTlPTVl0d1hFQlY1Rit5SUJRa2lHMTdiU2V6L3NibnlvaVdVNkJBWApHYmRDamZhNGVVRVRGemJjbGp0S2xnQUJSR2pXRDdQRk82V2ZwQWpRcGNqYVFwSVQ2WHpYZnVmV2d0bG5Ga1d5UGRXekpMCjQyV1lDemNhU3JKU0ZLZnpORHZtUjNzbllOZHB1bE1aUEtlRnZtZTJUWmp1VFJSRTd1OEtaRnhQalBkK0E4R2FuQnJOUGkKalBjSXE1SmFDWnpMMzVkaGlYcGJCQzJTMlh5cktwbWMrWEpRODJxZU93ZDZlOW9KVjEzUDdKU3NZYUVqdlFUeU5yNkE2bgo0ODIvcW1SZHUxUjNBQUFBQm01dmJtRnRaUUVDQXdRPQotLS0tLUVORCBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0K \ No newline at end of file diff --git a/test/id_rsa.pub b/test/id_rsa.pub index bd84623f11..77f36c6534 100644 --- a/test/id_rsa.pub +++ b/test/id_rsa.pub @@ -1 +1 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkTcgXnHuqR0gbwegnr9Zxz4hTkjjV/SpgJNPJz7mo/HKNbx0rqjj1P0yGR053R9GSFFim2ut4NK9DPPUkQdyucw+DoLkYRHJmlJ4BNa9NTCD0sl+eSXO2969kZojCYSOgbmkCJx8mdgTwhzdgE/jhBrsY0hPE6pRTlU+H68/zeNdJUAIJf0LLXOm3hpTKLA19VICltl/j9VvBJpgRHdBylXEyL8HokYpjkQQk1ZXj3m7Nlo8yDdg4VcljOJWC+Xh8kxRMfK5x/VRVsYKCQXN5QlzKeqf7USRDUS/7mFoPUBW+d4kwKtGxRsWuIL2yeqzifZUTOgsh9+ZWAWxWffQZ your_email@example.com +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwOcEN6+5VLvUpPHjwZsb0vHPBAG71Reyc/C022HCXCIWNf9L1IgnGngIe49wqte/Yqrbnq0uj9ykJ186mFdwhyKA5DvvnR3QfT98mvTOxnzCMBuBU73M6PJCa6UzJhyxmN3UMMnjq/Snh7xrqWdamXCdNKxQ/D1RYUq3TgKnpHllaHB4vz2tvoEzAcGsgMxhVx5ghgV1OV573X4UCEp5QRM4rvXOJ04C/g39y+1MByZuJozz88pZPX8PUHHbNzaVwbBx1UFuItUFxj7ZDF+xnl7SL0eEm/sGqXwjHUzreJh0AzYACXEV0ww3gLRCZfH10ktK1YSq1aCEewVw0snMIwr3R2AcfDy+D3Wa1wtXlMoyCi1aEHpvgu8UNAhmx7IW/ipGDdw2hd49XueHv25phr8KTNuTgZgL6WbEPrAR3wbxzzAryvbDmbx7TRmCQARqfP919CBay2l2Ph/41C4RYWzOyLGKQwo1WtpnOEVpOE4KbdM+x9w0qBwDu5ZNtjpgzZPkmPRK8YScmRDdH4f5MeOWOwv7a5hMHdx6CBaxawmKuTVK/d7UOpFdPFxKn2sSIuG6pYIr8rELqteMDRtUkfXQKAXYx6RQTabh/JVw80v8RdhK5aTPNWwvVzDZGzOUq0cBEvvgclnOC1jbq8lAr32eg4/Yy2Ebi5v2J2uPe6Q== noname diff --git a/test/index.js b/test/index.js index c78082e31a..abd2fc2174 100644 --- a/test/index.js +++ b/test/index.js @@ -1,8 +1,14 @@ var fork = require("child_process").fork; var path = require("path"); +var fs = require('fs'); -var bin = "./node_modules/.bin/istanbul"; -var cov = "cover --report=lcov --dir=test/coverage/js _mocha --".split(" "); +var bin = "./node_modules/.bin/nyc"; +var cov = [ + "--reporter=lcov", + "--reporter=text-summary", + "--report-dir=test/coverage/js", + "mocha" +] if (process.platform === 'win32') { bin = "./node_modules/mocha/bin/mocha"; @@ -12,7 +18,31 @@ if (process.platform === 'win32') { var args = cov.concat([ "test/runner", "test/tests", - "--expose-gc" + "--expose-gc", + "--timeout", + "15000" ]); -fork(bin, args, { cwd: path.join(__dirname, "../") }); +if (!process.env.APPVEYOR && !process.env.TRAVIS && !process.env.GITHUB_ACTION) { + var local = path.join.bind(path, __dirname); + var dummyPath = local("home"); + process.env.HOME = dummyPath; + process.env.USERPROFILE = dummyPath; +} + +// unencrypt test keys +function unencryptKey(fileName) { + var base64Contents = fs.readFileSync( + path.join(__dirname, fileName + '.enc'), + 'utf8' + ); + var asciiContents = Buffer.from(base64Contents, 'base64') + .toString('ascii'); + fs.writeFileSync(path.join(__dirname, fileName), asciiContents, 'utf8'); +} + +unencryptKey('private.ppk'); +unencryptKey('id_rsa'); +unencryptKey('nodegit-test-rsa'); + +fork(bin, args, { cwd: path.join(__dirname, "../") }).on("close", process.exit); diff --git a/test/nodegit-test-rsa.enc b/test/nodegit-test-rsa.enc new file mode 100644 index 0000000000..c90ea0781b --- /dev/null +++ b/test/nodegit-test-rsa.enc @@ -0,0 +1 @@ +LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBekNxSzI3cEV1cU1GQm45b3FIU2pzbkkrOFdxNW9IQUNHRU1tSmMyRHd6VDNNbXZ2ClR1ejZBUTU3L3lLK3lEZnY0VFlseWlVdHZBeUFxSy83TklNRmRTWldVOGIvNkNZQUhMcDZPM0p4WUZLUEQxa2MKdDBwNlVpNHdsY0lNRFZ5a252L3hlY0lYeXNqRVZaUEpUbGdoNDRqWXltOEFXdzg0YzQzQzNqelNJYkhHWlBDcgpxdi91ekgveVdZcFlrb3hBMXcyKy9LTDRBdlBpOUtRdkl6L2FpeUhqdzdEM1k2ZnRadW5GaGNyZ0hHZUhyUjBSCnJXT2ZybXZHYSthZStMRHI4Rk9TSno5U1RmY2dwZXNrYzFjNGorWkFFOHdxdzhhYmd6SVhXckducS9UUE5ScHcKU0hoMHg2T3g2aDJ3VStGTjdkTWZwOGNxekw2dXpiZUY5SXkrVlFJREFRQUJBb0lCQUhmME10dUFhQ3NqNXFyMwpwcHo2MHNiZ1d0enFzSjl6ejdkRGxLRTNTMGdnMFhBZGZGL3AyY1ZQSmtrenQ5WFpENlpKY3hCK29ZMVA1ek8xCkdhbXpwVHc4UnhJMzVGa1lJbzYrZlZ4NkUrVGMvTkt1cjdGOUg3c3pDamFpNlFQY3Y1ZnZsb2ZNSXNCeER2R2MKdi9TNDBVaG5PY0JPVVc0dTFpTUdVa3pTZlQ5dnJtbEFPNnVtaHExSVdFUTZnOUVCUXovNm9RUFNWUCszVGIwbgppemZWK1pIQkpQMS9jVEdsdmFzb2tFOTgvS3VpQmoyeHB3bVJHcy95YndyMVZMbTRWVkVKQTlLREI5aldueXgvCkpVMnpLQ3UreVMxSHBLcXVWdEh5NUw4ditDRzJQUkNtUnpGcEVQbVRpaGpaKy9HbG1xM3Bjc1FhK2FVZFduUW8KcTkyVXFtRUNnWUVBLzVGTEdORGd2blRyZ2dvMnltcXNSbGtaNTV0NjJIVXl2K3NPaUJ5eDc4VXFNSitjZENoRApJUTcvQmE4NE9QU2Jyb0E3WDJ2ZldEK01OcXRUdWFsUUl1eFJ0Ukh6c2hYNFZZODNWdzJRRmJ6RFp2dk5RV25UCjVybWlIK1FXS0N3THFEY3NQTm81eHdxemlXZ3JWdk1ZRFloaTR6enNlQW9yNFB6dTZRREVkUWtDZ1lFQXpJTDcKcUtXRWg1Q2NSRmlrY25mUEpJL2dySHkwckdpRHBneXE1N25sWWNOWm1BTEdaUnRyN2hDeVpNZTMyYVdISVdMcgoxa2hadE16bEFiZlBBYjdNdDIyT2RCWTJ3UDF3WG8wa25YMVdTUlN2RUt5MTFwN1RqRTJFVFBMekJmUkJ2ckR5CkF2T3l2UjVOUWxrQk4yMDhNRHlyUnRhcStpTTZxdmVweFVZUGZlMENnWUVBcUFHUTE3aUE5bE9RZXNWU0xaRWcKdllKWG1EMUs3YjlsNUdxVysvMjVMOEZ5c2RKTG5NVFhGSVZ5T3Y5c08yejZaeVhmWWlSZEIvdUdwbTNNdFpITApuNW14UVJLVEhMQjZ0MnhWMmdHTmhleTRuQnZPWEVGQXp6MmJpZEY4aTE0aEw2MU5oSmVGUWdjVDdiR3dSQkc4Cjd6Q0lxWS9rZUNsZm5TRkp3WjBDaVZrQ2dZQnJOMGdrRkJJMDJCVjBwMXdmUHJ4MEdKSGJHODNFalU1bllVREEKRjI4d0g2LzZ4NG1uUEFjTFdlbU1lRC9rZEtreFVhRCtTQlB2ZTNPYndQZGZuTjNLVkQ5WWtNVEh6Slo2bTFoVQowSDdKOVhRS00rRm8wUDlyRU1DSmJ0MEZoQlpybUd4b0s4Yks2dlhxRUt0WW1ZWHlhL3dIT1VlTnQ2WnNOMGJqCnkyVVh5UUtCZ1FEQTBjTm5aT0FuUllTaE93bjlsR3YxcFJ6SGRZdTduMlVteXpaM2RuRUhsTXRSRlFaQjIvdmYKVFpwWGVNSTJyWGRGUVphb1pydWxmZE1Fa3BDVmlTSGlRWnFKNlkrYXZ3NjQ1dzV3a09RU1F3ZjNzOEYrL0t5agoyNDMyY25pN3grUGVlOXp6R3VmQ3RJNkZSK2hTdDZSdnNsRzdRWFgreHM3dGxCNmU0SEhmUUE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= \ No newline at end of file diff --git a/test/nodegit-test-rsa.pub b/test/nodegit-test-rsa.pub new file mode 100644 index 0000000000..7321a79e5c --- /dev/null +++ b/test/nodegit-test-rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMKorbukS6owUGf2iodKOycj7xarmgcAIYQyYlzYPDNPcya+9O7PoBDnv/Ir7IN+/hNiXKJS28DICor/s0gwV1JlZTxv/oJgAcuno7cnFgUo8PWRy3SnpSLjCVwgwNXKSe//F5whfKyMRVk8lOWCHjiNjKbwBbDzhzjcLePNIhscZk8Kuq/+7Mf/JZiliSjEDXDb78ovgC8+L0pC8jP9qLIePDsPdjp+1m6cWFyuAcZ4etHRGtY5+ua8Zr5p74sOvwU5InP1JN9yCl6yRzVziP5kATzCrDxpuDMhdasaer9M81GnBIeHTHo7HqHbBT4U3t0x+nxyrMvq7Nt4X0jL5V diff --git a/test/private.ppk.enc b/test/private.ppk.enc new file mode 100644 index 0000000000..c388d98d86 --- /dev/null +++ b/test/private.ppk.enc @@ -0,0 +1,47 @@ +UHVUVFktVXNlci1LZXktRmlsZS0zOiBzc2gtcnNhCkVuY3J5cHRpb246IG5vbmUKQ29tbWVudDog +bm9uYW1lClB1YmxpYy1MaW5lczogMTIKQUFBQUIzTnphQzF5YzJFQUFBQURBUUFCQUFBQ0FRQ3dP +Y0VONis1Vkx2VXBQSGp3WnNiMHZIUEJBRzcxUmV5YwovQzAyMkhDWENJV05mOUwxSWduR25nSWU0 +OXdxdGUvWXFyYm5xMHVqOXlrSjE4Nm1GZHdoeUtBNUR2dm5SM1FmClQ5OG12VE94bnpDTUJ1QlU3 +M002UEpDYTZVekpoeXhtTjNVTU1uanEvU25oN3hycVdkYW1YQ2ROS3hRL0QxUlkKVXEzVGdLbnBI +bGxhSEI0dnoydHZvRXpBY0dzZ014aFZ4NWdoZ1YxT1Y1NzNYNFVDRXA1UVJNNHJ2WE9KMDRDLwpn +Mzl5KzFNQnladUpveno4OHBaUFg4UFVISGJOemFWd2JCeDFVRnVJdFVGeGo3WkRGK3hubDdTTDBl +RW0vc0dxClh3akhVenJlSmgwQXpZQUNYRVYwd3czZ0xSQ1pmSDEwa3RLMVlTcTFhQ0Vld1Z3MHNu +TUl3cjNSMkFjZkR5K0QKM1dhMXd0WGxNb3lDaTFhRUhwdmd1OFVOQWhteDdJVy9pcEdEZHcyaGQ0 +OVh1ZUh2MjVwaHI4S1ROdVRnWmdMNgpXYkVQckFSM3dieHp6QXJ5dmJEbWJ4N1RSbUNRQVJxZlA5 +MTlDQmF5MmwyUGgvNDFDNFJZV3pPeUxHS1F3bzFXCnRwbk9FVnBPRTRLYmRNK3g5dzBxQndEdTVa +TnRqcGd6WlBrbVBSSzhZU2NtUkRkSDRmNU1lT1dPd3Y3YTVoTUgKZHg2Q0JheGF3bUt1VFZLL2Q3 +VU9wRmRQRnhLbjJzU0l1RzZwWUlyOHJFTHF0ZU1EUnRVa2ZYUUtBWFl4NlJRVAphYmgvSlZ3ODB2 +OFJkaEs1YVRQTld3dlZ6RFpHek9VcTBjQkV2dmdjbG5PQzFqYnE4bEFyMzJlZzQvWXkyRWJpCjV2 +MkoydVBlNlE9PQpQcml2YXRlLUxpbmVzOiAyOApBQUFDQUYvalRSU1NKK0RaNkRSRDMxcVAwZm9o +QUtzbjNUaEFqL3Jyakg2blRyd2Z1dXUvZmI0OGd5MDdsTlBTCkVGNTlHTURBUXozVGl4and4N2Uv +WVlZbHB0NExHSU56ajhYTXIzYktNeFlWSlNlbEF2bHVWR3BpMEVRRDZIc2kKTHRJSlp6TkhRYjBk +U1lZenNySnBOREFJS2kvalBNOVVmWFBDbDVabmhvWHJJSWprSnFKTlltK0pZV0FmelNONQpDQkZC +UENDUXRrcWs1V3hYYVB3WlVYcExQekZWL3dqMTBRUlJ2V0IzNE1WajAwckp0SVF6K2w5NGNDbEla +bm5uCjh3MFF0TkJ6UXhqaVhLd0tWRTNDY040WkNsMWp3cTNCeWMwNkdZN21ueFEyU1hYUEwwRGNr +S2E0Sm1MZUw1S24KY3J6UmJFSWVFZUQzdWhGelUzSTByRU5RUmg2NjlJcHJhamZSekxjRnhuQzcz +QlMxUlR5Y2ZwZFNHRk9QWFQvMgpOZDM2MlhTZXA2Vk54U3Q1YTZ3a1dnSEpoMkg4ZFBjbmlESDFE +bXJBZFA5N0FrZWkxbG1YcWJ6Q0lWOXBpZDNtCmZNQUpiSm00UmhRcFREdmV1RThOaUJnSTYyVGt3 +dWNvVzJ5M0xkU3YxMzdpSkJuSlNjMTFHOUE1YkcyeVFYRTIKYWlYUXhIeW9UMlF0VmY1WklYUmFW +THViUW5jU2dMQmpnQ2QxQ2xqQjVqbFJZTXRTYzhiRmEvVEo1b1hPVk10QwpYNHhhcVo3Z3JHS05C +cUJsRFRXblRnWk1tdndQVnVjbGU3MjgzNk9KUFhvMUxqM0sza21yeEMxdU5HMDc2My96CmJLOWl2 +QWF1SFRMMnQ0cHkra0k0NC9ZcERvR2sybnhsV01kRDNMM0pVeDNRejlMeEFBQUJBUURiVG94anFO +UHIKRk9aYlg5M3g2TjU1SVdOQ1VLdXFMMVZLNjFESGFLWGZpaXdIRHlRYjEzUnhPREk2RlNXMElI +eVpqMDh5ZjBTVApJRjlzWU1BcDcvRktRTkRJalVWcjFSNmdERWdBdytjeS9naXlqMFVscUhNc2dU +UnNnSmEvSjJQYnViRDRWMzdZClJEOHpwdmtLZjhTSjBiUWpRMGlMdGFDVWJvQVA1ZmFhWGxJS3Zl +Mnh6S3VYM09Jdk0zTyt1UTBJMDZqZGtMc2IKQUcxL2dBOXpiZmltcEx3SUJCZFVJenY3aEUyajhi +aGpPR201U0lOa3M0WWVUTlRWV2R4ZnI3Yi8wVlFPSXJDdwpEUCsrQmhjOTdkK1g3WVVVZFFIM1Bw +U1dyVm9KTnNITXB1VFpoaXdDZ0ZNTU9UWEhHVmxqRThyZ2RlU2xQc2dCCjFzUWh4clJTTUIrZkFB +QUJBUUROdGU0KzFubFlLVjZFUVl4cnlKVUFLT3RNS0pmQTVYUlRzc1hoc0V5UjAwcS8KV2N3dHJm +ZjM1dzdmQVhCVndlTnplZWl5cGV2SnNZZ1JwQXU5T01ZdHdYRUJWNUYreUlCUWtpRzE3YlNlei9z +YgpueW9pV1U2QkFYR2JkQ2pmYTRlVUVURnpiY2xqdEtsZ0FCUkdqV0Q3UEZPNldmcEFqUXBjamFR +cElUNlh6WGZ1CmZXZ3RsbkZrV3lQZFd6Skw0MldZQ3pjYVNySlNGS2Z6TkR2bVIzc25ZTmRwdWxN +WlBLZUZ2bWUyVFpqdVRSUkUKN3U4S1pGeFBqUGQrQThHYW5Cck5QaWpQY0lxNUphQ1p6TDM1ZGhp +WHBiQkMyUzJYeXJLcG1jK1hKUTgycWVPdwpkNmU5b0pWMTNQN0pTc1lhRWp2UVR5TnI2QTZuNDgy +L3FtUmR1MVIzQUFBQkFRQ1c4emFSOU9lTzFwM1hpMTRYCjkwM245Y2NjUlVwZEw4RlJQNnkxaStU +WmY3ZFJaZWt5bVg2Rm1Pam0wL25vVzNIcGVaMmJiRGlBUERadVc0ZlEKbWdaMGd6bG9kRENlSnZQ +cXZTUXNRZUhKNGMyR3NUbjFUczMzWFNUVnhVS3d3amxGdkxqbzJCQXZpQWhmd2FDdwpSbFRoaWtH +L0J0LzBtWE5tMXpwcVlucUFzWldvcmo5VVZBNjJPVzgxQ1VYMS9kVTFrY1JBaWNjbFFsak5TRFhi +CnppYlU3am91enNDM0VVRURwbUdkbVRRWHhYc0I1MVVOaHl5VmgyZ0FWcUMwMDJtSndnRVVzanBx +c2FMNk03M2EKejgzODhvRHBYYnAxQ0tMRHloOHZKcElOSDBqTk5kRDF3V29BUlFlSHMvTmJRRktR +OElOSXZQc1p6MFpHZkc3Lwp1UytKClByaXZhdGUtTUFDOiBmMjY3ZTM0MzYwOTViZDc5OWYwNzQw +NDExZmJhMDM0YzZjOWNiN2VhYzk1ZDg4NDk3ZGVlYmMxNGZjZWQ0ZDU2Cg== diff --git a/test/runner.js b/test/runner.js index 8a4ff378f2..3ca48486bd 100644 --- a/test/runner.js +++ b/test/runner.js @@ -1,20 +1,47 @@ -var promisify = require("promisify-node"); -var fse = promisify("fs-extra"); +var fse = require("fs-extra"); var path = require("path"); var local = path.join.bind(path, __dirname); +var exec = require('../utils/execPromise'); -// Have to wrap exec, since it has a weird callback signature. -var exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); +var NodeGit = require('..'); var workdirPath = local("repos/workdir"); +var constWorkdirPath = local("repos/constworkdir"); + +const testRepos = [ + "repos/bare", + "repos/blameRepo", + "repos/cherrypick", + "repos/clone", + "repos/constworkdir", + "repos/convenientLineTest", + "repos/empty", + "repos/index", + "repos/index", + "repos/merge", + "repos/merge-head", + "repos/new", + "repos/newrepo", + "repos/nonrepo", + "repos/rebase", + "repos/renamedFileRepo", + "repos/revertRepo", + "repos/stagingRepo", + "repos/submodule", + "repos/submodule/nodegittest/", + "repos/tree/", + "repos/workdir", +]; before(function() { this.timeout(350000); - var url = "https://github.com/nodegit/test"; + var testUrl = "https://github.com/nodegit/test"; + var constTestUrl = "https://github.com/nodegit/test-frozen"; return fse.remove(local("repos")) + .then(function() { + fse.remove(local("home")) + }) .then(function() { fse.mkdir(local("repos")); }) @@ -22,7 +49,17 @@ before(function() { return exec("git init " + local("repos", "empty")); }) .then(function() { - return exec("git clone " + url + " " + workdirPath); + return exec("git clone " + constTestUrl + " " + constWorkdirPath); + }) + .then(function() { + return exec("git clone " + testUrl + " " + workdirPath); + }) + .then(function() { + //to checkout the longpaths-checkout branch + if(process.platform === "win32") { + return exec("git config core.longpaths true", {cwd: workdirPath}); + } + return Promise.resolve(); }) .then(function() { return exec("git checkout rev-walk", {cwd: workdirPath}); @@ -30,6 +67,9 @@ before(function() { .then(function() { return exec("git checkout checkout-test", {cwd: workdirPath}); }) + .then(function() { + return exec("git checkout longpaths-checkout", {cwd: workdirPath}); + }) .then(function() { return exec("git checkout master", {cwd: workdirPath}); }) @@ -39,7 +79,20 @@ before(function() { .then(function() { return fse.writeFile(local("repos", "nonrepo", "file.txt"), "This is a bogus file"); - }); + }) + .then(function() { + return fse.mkdir(local("home")); + }) + .then(function() { + return fse.writeFile(local("home", ".gitconfig"), + "[user]\n name = John Doe\n email = johndoe@example.com"); + }) + .then( async function() { + //mark all test repos as safe + for(let repo of testRepos) { + await exec(`git config --global --add safe.directory ${local(repo)}`); + } + }) }); beforeEach(function() { diff --git a/test/tests/annotated_commit.js b/test/tests/annotated_commit.js new file mode 100644 index 0000000000..c87ba859bf --- /dev/null +++ b/test/tests/annotated_commit.js @@ -0,0 +1,74 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); + +describe("AnnotatedCommit", function() { + var NodeGit = require("../../"); + var Repository = NodeGit.Repository; + var AnnotatedCommit = NodeGit.AnnotatedCommit; + var Branch = NodeGit.Branch; + + var reposPath = local("../repos/workdir"); + var branchName = "master"; + + beforeEach(function() { + var test = this; + + return Repository.open(reposPath) + .then(function(repository) { + test.repository = repository; + }); + }); + + it("can create an AnnotatedCommit from a ref", function() { + var test = this; + + return Branch.lookup(test.repository, branchName, Branch.BRANCH.LOCAL) + .then(function(ref) { + return AnnotatedCommit.fromRef(test.repository, ref); + }) + .then(function(annotatedCommit) { + assert(annotatedCommit.id()); + }); + }); + + it("can lookup an AnnotatedCommit after creating it", function() { + var test = this; + var id; + + return Branch.lookup(test.repository, branchName, Branch.BRANCH.LOCAL) + .then(function(ref) { + return AnnotatedCommit.fromRef(test.repository, ref); + }) + .then(function(annotatedCommit) { + id = annotatedCommit.id(); + return AnnotatedCommit.lookup(test.repository, id); + }) + .then(function(annotatedCommit) { + assert(id, annotatedCommit.id()); + }); + }); + + it("can lookup an AnnotatedCommit from a revspec", function() { + var test = this; + + return AnnotatedCommit.fromRevspec(test.repository, "checkout-test") + .then(function(annotatedCommit) { + assert.equal(annotatedCommit.id().toString(), + "1729c73906bb8467f4095c2f4044083016b4dfde"); + }); + }); + + it("can lookup an AnnotatedCommit from a fetchhead", function() { + var test = this; + + return AnnotatedCommit.fromFetchhead(test.repository, + "rev-walk", + "https://github.com/nodegit/test", + "32789a79e71fbc9e04d3eff7425e1771eb595150") + .then(function(annotatedCommit) { + assert.equal(annotatedCommit.id().toString(), + "32789a79e71fbc9e04d3eff7425e1771eb595150"); + }); + }); +}); diff --git a/test/tests/blame.js b/test/tests/blame.js new file mode 100644 index 0000000000..c16efdd034 --- /dev/null +++ b/test/tests/blame.js @@ -0,0 +1,36 @@ +var assert = require("assert"); +var RepoUtils = require("../utils/repository_setup"); +var path = require("path"); +var local = path.join.bind(path, __dirname); + +describe("Blame", function() { + var NodeGit = require("../../"); + + var Blame = NodeGit.Blame; + + var test; + var fileName = "foobar.js"; + var repoPath = local("../repos/blameRepo"); + + beforeEach(function() { + test = this; + + return RepoUtils.createRepository(repoPath) + .then(function(repository) { + test.repository = repository; + + return RepoUtils.commitFileToRepo( + repository, + fileName, + "line1\nline2\nline3" + ); + }); + }); + + it("can initialize blame without options", function() { + return Blame.file(test.repository, fileName) + .then(function(blame) { + assert(blame); + }); + }); +}); diff --git a/test/tests/blob.js b/test/tests/blob.js index 342cb25781..2d6512c86c 100644 --- a/test/tests/blob.js +++ b/test/tests/blob.js @@ -1,16 +1,80 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); +var fse = require("fs-extra"); +var exec = require("../../utils/execPromise"); describe("Blob", function() { var NodeGit = require("../../"); var Oid = NodeGit.Oid; var Repository = NodeGit.Repository; + var Blob = NodeGit.Blob; var FileMode = NodeGit.TreeEntry.FILEMODE; var reposPath = local("../repos/workdir"); var oid = "111dd657329797f6165f52f5085f61ac976dcf04"; + var previousCommitOid = ""; + + function commitFile(repo, fileName, fileContent, commitMessage) { + var index; + var treeOid; + var parent; + + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommit( + "HEAD", + author, + committer, + commitMessage, + treeOid, + [parent] + ); + }); + } + + before(function() { + return Repository.open(reposPath) + .then(function(repository) { + return repository.getHeadCommit(); + }) + .then(function(commit) { + previousCommitOid = commit.id(); + }); + }); beforeEach(function() { var test = this; @@ -26,6 +90,16 @@ describe("Blob", function() { }); }); + after(function() { + return exec("git clean -xdf", {cwd: reposPath}) + .then(function() { + return exec("git checkout master", {cwd: reposPath}); + }) + .then(function() { + return exec("git reset --hard " + previousCommitOid, {cwd: reposPath}); + }); + }); + it("can provide content as a buffer", function() { var contents = this.blob.content(); @@ -50,4 +124,539 @@ describe("Blob", function() { assert.equal(blob.id().toString(), oid); }); }); + + describe("createFromBuffer", function() { + it("creates a new blob from the buffer", function() { + var content = "This is a new buffer"; + var buf = Buffer.from(content, content.length); + var test = this; + + return Blob.createFromBuffer(test.repository, buf, content.length) + .then(function(oid) { + return test.repository.getBlob(oid); + }) + .then(function(newBlob) { + assert.equal(newBlob.toString(), content); + }); + }); + + it("creates blob with content equal to length", function() { + var content = "This is a new buffer"; + var buf = Buffer.from(content, content.length); + var test = this; + + return Blob.createFromBuffer(test.repository, buf, 2) + .then(function(oid) { + return test.repository.getBlob(oid); + }) + .then(function(newBlob) { + assert.equal(newBlob.toString(), "Th"); + }); + }); + + it("throws an error when repository is null", function() { + return Blob.createFromBuffer(null, null, 0) + .catch(function(error) { + assert.strictEqual(error.message, "Repository repo is required."); + }); + }); + + it("throws an error when buffer is null", function() { + var test = this; + return Blob.createFromBuffer(test.repository, null) + .catch(function(error) { + assert.strictEqual(error.message, "Buffer buffer is required."); + }); + }); + + it("throws an error when no length is provided", function() { + var test = this; + return Blob.createFromBuffer(test.repository, Buffer.from("testing")) + .catch(function(error) { + assert.strictEqual(error.message, "Number len is required."); + }); + }); + }); + + describe("createFromDisk", function() { + var fileName = path.join(reposPath, "testFile.zzz"); + var fileContent = "this is my file content"; + + beforeEach(function() { + return fse.writeFile(fileName, fileContent); + }); + + afterEach(function() { + return fse.unlink(fileName); + }); + + it("creates a new blob from the file", function() { + var test = this; + + return Blob.createFromDisk(test.repository, fileName) + .then(function(oid) { + return test.repository.getBlob(oid); + }) + .then(function(newBlob) { + assert.equal(newBlob.toString(), fileContent); + }); + }); + + it("throws an error when the file cannot be found", function() { + var test = this; + + return Blob.createFromDisk(test.repository, "aaaaaaaaaa") + .catch(function(error) { + assert.equal(error.errno, -3); + }); + }); + + it("throws an error when repository is null", function() { + return Blob.createFromDisk(null, null, 0) + .catch(function(error) { + assert.strictEqual(error.message, "Repository repo is required."); + }); + }); + + it("throws an error when path is null", function() { + var test = this; + return Blob.createFromDisk(test.repository, null) + .catch(function(error) { + assert.strictEqual(error.message, "String path is required."); + }); + }); + }); + + describe("createFromWorkdir", function() { + it("creates a blob from the file", function() { + var fileName = "package.json"; + var filePath = path.join(reposPath, "package.json"); + var test = this; + + return fse.readFile(filePath) + .then(function(content) { + test.content = content.toString(); + return Blob.createFromWorkdir(test.repository, fileName); + }) + .then(function(oid) { + return test.repository.getBlob(oid); + }) + .then(function(newBlob) { + assert.equal(newBlob.toString(), test.content); + }); + }); + + it("throws an error when the file cannot be found", function() { + var test = this; + + return Blob.createFromWorkdir(test.repository, "thisisabadfile.jpg") + .catch(function(error) { + assert.equal(error.errno, -3); + }); + }); + + it("throws an error when repository is null", function() { + return Blob.createFromWorkdir(null, null, 0) + .catch(function(error) { + assert.strictEqual(error.message, "Repository repo is required."); + }); + }); + + it("throws an error when path is null", function() { + var test = this; + return Blob.createFromWorkdir(test.repository, null) + .catch(function(error) { + assert + .strictEqual(error.message, "String relative_path is required."); + }); + }); + }); + + describe("filteredContent (DEPRECATED)", function() { + var attrFileName = ".gitattributes"; + var filter = "* text eol=crlf"; + var lineEndingRegex = /\r\n|\r|\n/; + var newFileName = "testfile.test"; + + it("retrieves the filtered content", function() { + var test = this; + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + "this\nis\nfun\guys", + "added LF ending file" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(lfBlob) { + test.lfBlob = lfBlob; + var ending = test.lfBlob.toString().match(lineEndingRegex); + assert.strictEqual(ending[0], "\n"); + + return Blob.filteredContent( + test.lfBlob, + newFileName, + 0 + ); + }) + .then(function(content) { + var ending = content.match(lineEndingRegex); + assert.strictEqual(ending[0], "\r\n"); + assert.notStrictEqual(content, test.blob.toString()); + }); + }); + + it("returns non-binary filtered content when checking binary", function() { + var test = this; + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + "this\nis\nfun\guys", + "added LF ending file" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(lfBlob) { + test.lfBlob = lfBlob; + var ending = test.lfBlob.toString().match(lineEndingRegex); + assert.strictEqual(ending[0], "\n"); + + return Blob.filteredContent( + test.lfBlob, + newFileName, + 1 + ); + }) + .then(function(content) { + var ending = content.match(lineEndingRegex); + assert.strictEqual(ending[0], "\r\n"); + assert.notStrictEqual(content, test.blob.toString()); + }); + }); + + it("returns nothing when checking binary blob", function() { + var test = this; + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + binary, + "binary content" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(binaryBlob) { + test.binaryBlob = binaryBlob; + assert.equal(true, binaryBlob.isBinary()); + + return Blob.filteredContent( + test.binaryBlob, + newFileName, + 1 + ); + }) + .then(function(content) { + assert.strictEqual(content, ""); + }); + }); + + it("returns blob when not checking binary on binary blob", function() { + var test = this; + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + binary, + "binary content" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(binaryBlob) { + test.binaryBlob = binaryBlob; + assert.equal(true, binaryBlob.isBinary()); + + return Blob.filteredContent( + test.binaryBlob, + newFileName, + 0 + ); + }) + .then(function(content) { + assert.strictEqual(content, binary.toString()); + }); + }); + + it("throws an error when the blob is null", function() { + return Blob.filteredContent(null, "", 0) + .catch(function(err) { + assert.strictEqual( + err.message, + "Blob blob is required." + ); + }); + }); + + it("throws an error when the path is null", function() { + var test = this; + return Blob.filteredContent(test.blob, null, 0) + .catch(function(err) { + assert.strictEqual(err.message, "String as_path is required."); + }); + }); + + it("throws an error when the flag is undefined", function() { + var test = this; + return Blob.filteredContent(test.blob, "") + .catch(function(err) { + assert.strictEqual( + err.message, + "Number check_for_binary_data is required." + ); + }); + }); + }); + + describe("filter", function() { + var attrFileName = ".gitattributes"; + var filter = "* text eol=crlf"; + var lineEndingRegex = /\r\n|\r|\n/; + var newFileName = "testfile.test"; + + it("retrieves the filtered content", function() { + var test = this; + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + "this\nis\nfun\guys", + "added LF ending file" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(lfBlob) { + test.lfBlob = lfBlob; + var ending = test.lfBlob.toString().match(lineEndingRegex); + assert.strictEqual(ending[0], "\n"); + + return test.lfBlob.filter(newFileName, { flags: 0 }); + }) + .then(function(content) { + var ending = content.match(lineEndingRegex); + assert.strictEqual(ending[0], "\r\n"); + assert.notStrictEqual(content, test.blob.toString()); + }); + }); + + it("returns non-binary filtered content when checking binary", function() { + var test = this; + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + "this\nis\nfun\guys", + "added LF ending file" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(lfBlob) { + test.lfBlob = lfBlob; + var ending = test.lfBlob.toString().match(lineEndingRegex); + assert.strictEqual(ending[0], "\n"); + + return test.lfBlob.filter( + newFileName, + { flags: NodeGit.Blob.FILTER_FLAG.CHECK_FOR_BINARY } + ); + }) + .then(function(content) { + var ending = content.match(lineEndingRegex); + assert.strictEqual(ending[0], "\r\n"); + assert.notStrictEqual(content, test.blob.toString()); + }); + }); + + it("returns nothing when checking binary blob", function() { + var test = this; + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + binary, + "binary content" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(binaryBlob) { + test.binaryBlob = binaryBlob; + assert.equal(true, binaryBlob.isBinary()); + + return test.binaryBlob.filter( + newFileName, + { flags: NodeGit.Blob.FILTER_FLAG.CHECK_FOR_BINARY } + ); + }) + .then(function(content) { + assert.strictEqual(content, ""); + }); + }); + + it("returns blob when not checking binary on binary blob", function() { + var test = this; + var binary = Buffer.from(new Uint8Array([1,2,3,4,5,6])); + + return commitFile( + test.repository, + attrFileName, + filter, + "added gitattributes") + .then(function() { + return commitFile( + test.repository, + newFileName, + binary, + "binary content" + ); + }) + .then(function(oid) { + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.filteredCommit = commit; + return commit.getEntry(newFileName); + }) + .then(function(entry) { + return entry.getBlob(); + }) + .then(function(binaryBlob) { + test.binaryBlob = binaryBlob; + assert.equal(true, binaryBlob.isBinary()); + + return test.binaryBlob.filter( + newFileName, + { flags: 0 } + ); + }) + .then(function(content) { + assert.strictEqual(content, binary.toString()); + }); + }); + + it("throws an error when the path is null", function() { + var test = this; + return test.blob.filter(test.blob, null, { flags: 0 }) + .catch(function(err) { + assert.strictEqual(err.message, "String as_path is required."); + }); + }); + }); }); diff --git a/test/tests/branch.js b/test/tests/branch.js index 922b481520..3900e4242b 100644 --- a/test/tests/branch.js +++ b/test/tests/branch.js @@ -1,14 +1,20 @@ var assert = require("assert"); var path = require("path"); -var Promise = require("nodegit-promise"); var local = path.join.bind(path, __dirname); describe("Branch", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; var Branch = NodeGit.Branch; + var AnnotatedCommit = NodeGit.AnnotatedCommit; var branchName = "test-branch"; + var branchName2 = "test-branch2"; var fullBranchName = "refs/heads/" + branchName; + var fullBranchName2 = "refs/heads/" + branchName2; + var remoteName = "origin"; + var upstreamName = "origin/master"; + var fullUpstreamName = "refs/remotes/origin/master"; + var nonHeadCommit = "c82fb078a192ea221c9f1093c64321c60d64aa0d"; var reposPath = local("../repos/workdir"); @@ -27,6 +33,8 @@ describe("Branch", function() { }) .then(function(branch) { test.branch = branch; + return test.repository.createBranch( + branchName2, test.masterCommit, true); }); }); @@ -45,7 +53,7 @@ describe("Branch", function() { return repo.getBranch(branchName) // Reverse the results, since if we found it it wasn't deleted - .then(Promise.reject, Promise.resolve); + .then(Promise.reject.bind(Promise), Promise.resolve.bind(Promise)); }); it("can see if the branch is pointed to by head", function() { @@ -56,4 +64,105 @@ describe("Branch", function() { assert.ok(branch.isHead()); }); }); + + it("can set an upstream for a branch", function() { + var branch = this.branch; + + return NodeGit.Branch.setUpstream(branch, upstreamName) + .then(function() { + return NodeGit.Branch.upstream(branch); + }) + .then(function(upstream) { + assert.equal(upstream.shorthand(), upstreamName); + }); + }); + + it("can get the name of a branch", function() { + var branch = this.branch; + + return NodeGit.Branch.name(branch) + .then(function(branchNameToTest) { + assert.equal(branchNameToTest, branchName); + }); + }); + + it("can get the remote name of a branch", function() { + var repo = this.repository; + + return NodeGit.Branch.remoteName(repo, fullUpstreamName) + .then(function(remoteNameToTest) { + assert.equal(remoteNameToTest, remoteName); + }); + }); + + it("cannot get remote name from a non-remote branch", function() { + var repo = this.repository; + + return NodeGit.Branch.remoteName(repo, fullBranchName) + .then(function() { + assert.fail("The ref should not have been a remote"); + }) + .catch(function(err) { + assert.strictEqual(err.errno, -1); + }); + }); + + it("can rename a branch", function() { + var branch = this.branch; + + // don't force the move + return Branch.move(branch, branchName2, 0) + .then(function(branch) { + return Promise.reject(new Error( + "should not be able to rename the branch")); + }, function(error) { + return Promise.resolve() + .then(function() { + // force the move + return Branch.move(branch, branchName2, 1); + }) + .then(function(branch) { + assert.equal(branch.name(), fullBranchName2); + }); + }); + }); + + it("can lookup a branch", function() { + var repo = this.repository; + + return Branch.lookup(repo, branchName, Branch.BRANCH.LOCAL) + .then(function(branch) { + assert.equal(branch.name(), fullBranchName); + return Branch.lookup(repo, upstreamName, Branch.BRANCH.REMOTE); + }) + .then(function(branch) { + assert.equal(branch.name(), fullUpstreamName); + }); + }); + + it("can create branch from annotated commit", function() { + var repo = this.repository; + var annotatedCommit = null; + + return AnnotatedCommit.fromRevspec(repo, nonHeadCommit) + .then(function(theAnnotatedCommit) { + annotatedCommit = theAnnotatedCommit; + return Branch.createFromAnnotated( + repo, branchName, annotatedCommit, 0); + }) + .then(function(branch) { + return Promise.reject(new Error( + "should not be able to create the branch")); + }, function(error) { + return Promise.resolve() + .then(function() { + // force the branch creation + return Branch.createFromAnnotated( + repo, branchName, annotatedCommit, 1); + }) + .then(function(branch) { + assert.equal(branch.name(), fullBranchName); + }); + }); + }); }); diff --git a/test/tests/checkout.js b/test/tests/checkout.js index 05c3105a93..c10d50d3a7 100644 --- a/test/tests/checkout.js +++ b/test/tests/checkout.js @@ -14,6 +14,7 @@ describe("Checkout", function() { var readMePath = local("../repos/workdir/" + readMeName); var packageJsonPath = local("../repos/workdir/" + packageJsonName); var checkoutBranchName = "checkout-test"; + var longpathBranchName = "longpaths-checkout"; beforeEach(function() { var test = this; @@ -35,6 +36,52 @@ describe("Checkout", function() { }); }); + it("can checkout a branch with a long file path", function() { + var test = this; + + return (function () { + if(process.platform === "win32") { + return test.repository.config() + .then(function(config) { + return config.setBool("core.longpaths", true); + }); + } + + return Promise.resolve(); + })() + .then(function() { + return test.repository.checkoutBranch(longpathBranchName); + }) + .then(function() { + return test.repository.getStatus(); + }) + .then(function(statuses) { + assert.equal(statuses.length, 0); + }); + }); + + it("cannot checkout long path file if core.longpaths is not set on win32", function() { + var test = this; + + if (process.platform !== "win32") { + this.skip(); + } + + return test.repository.config() + .then(function(config) { + config.setBool("core.longpaths", false); + }) + .then(function () { + return test.repository.checkoutBranch(longpathBranchName); + }) + .then(function() { + assert.fail(); + }) + .catch(function(err) { + assert(~err.message.indexOf("path too long")); + }); + }); + it("can force checkout a single file", function() { var test = this; @@ -75,7 +122,7 @@ describe("Checkout", function() { var test = this; return test.repository.getTagByName("annotated-tag").then(function(tag) { - return Checkout.tree(test.repository, test.tag); + return Checkout.tree(test.repository, tag); }).then(function() { return test.repository.getHeadCommit(); }).then(function(commit) { @@ -107,4 +154,83 @@ describe("Checkout", function() { assert.ok(~packageContent.indexOf("\"ejs\": \"~1.0.0\",")); }); }); + + it("can checkout an index with conflicts", function() { + const test = this; + + const testBranchName = "test"; + let ourCommit; + let signature; + + return test.repository.defaultSignature() + .then((signatureResult) => { + signature = signatureResult; + return test.repository.getBranchCommit(checkoutBranchName); + }) + .then((commit) => { + ourCommit = commit; + + return test.repository.createBranch(testBranchName, commit.id()); + }) + .then(() => { + return test.repository.checkoutBranch(testBranchName); + }) + .then((branch) => { + fse.writeFileSync(packageJsonPath, "\n"); + + return test.repository.refreshIndex() + .then((index) => { + return index.addByPath(packageJsonName) + .then(() => { + return index.write(); + }) + .then(() => { + return index.writeTree(); + }); + }); + }) + .then((oid) => { + assert.equal(oid.toString(), + "85135ab398976a4d5be6a8704297a45f2b1e7ab2"); + + return test.repository.createCommit("refs/heads/" + testBranchName, + signature, signature, "we made breaking changes", oid, [ourCommit]); + }) + .then((commit) => { + return Promise.all([ + test.repository.getBranchCommit(testBranchName), + test.repository.getBranchCommit("master") + ]); + }) + .then((commits) => { + return NodeGit.Merge.commits(test.repository, commits[0], commits[1], + null); + }) + .then((index) => { + assert.ok(index); + assert.ok(index.hasConflicts && index.hasConflicts()); + + return NodeGit.Checkout.index(test.repository, index); + }) + .then(() => { + // Verify that the conflict has been written to disk + var conflictedContent = fse.readFileSync(packageJsonPath, "utf-8"); + + assert.ok(~conflictedContent.indexOf("<<<<<<< ours")); + assert.ok(~conflictedContent.indexOf("=======")); + assert.ok(~conflictedContent.indexOf(">>>>>>> theirs")); + + // Cleanup + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: packageJsonName + }; + + return Checkout.head(test.repository, opts); + }) + .then(() => { + var finalContent = fse.readFileSync(packageJsonPath, "utf-8"); + assert.equal(finalContent, "\n"); + }); + }); }); diff --git a/test/tests/cherrypick.js b/test/tests/cherrypick.js new file mode 100644 index 0000000000..1a1dc92235 --- /dev/null +++ b/test/tests/cherrypick.js @@ -0,0 +1,159 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); +var fse = require("fs-extra"); + +describe("Cherrypick", function() { + var RepoUtils = require("../utils/repository_setup"); + var NodeGit = require("../../"); + var Cherrypick = NodeGit.Cherrypick; + + var repoPath = local("../repos/cherrypick"); + + beforeEach(function() { + var test = this; + return RepoUtils.createRepository(repoPath) + .then(function(repo) { + test.repository = repo; + }); + }); + + after(function() { + return fse.remove(repoPath); + }); + + it("can cherrypick a commit onto the index", function() { + var repo = this.repository; + var workDirPath = repo.workdir(); + var repoInfo; + + return RepoUtils.setupBranches(repo, true) + .then(function(info) { + repoInfo = info; + + assert(!fse.existsSync(path.join(workDirPath, repoInfo.theirFileName)), + repoInfo.theirFileName + " shouldn't exist"); + + var promise = Cherrypick.cherrypick(repo, repoInfo.theirCommit, {}); + assert(promise.then); + return promise; + }) + .then(function() { + assert(fse.existsSync(path.join(workDirPath, repoInfo.theirFileName)), + repoInfo.theirFileName + " should exist"); + + // Cherrypick.cherrypick leaves the repo in a cherrypick state + assert.equal(repo.state(), NodeGit.Repository.STATE.CHERRYPICK); + assert.ok(repo.isCherrypicking()); + + // cleanup + assert.equal(repo.stateCleanup(), 0); + assert.equal(repo.state(), NodeGit.Repository.STATE.NONE); + assert.ok(repo.isDefaultState()); + }); + }); + + it("can cherrypick a commit onto another specified commit", function() { + var repo = this.repository; + var workDirPath = repo.workdir(); + var repoInfo; + + return RepoUtils.setupBranches(repo) + .then(function(info) { + repoInfo = info; + + assert(!fse.existsSync(path.join(workDirPath, repoInfo.ourFileName)), + repoInfo.ourFileName + " shouldn't exist"); + assert(!fse.existsSync(path.join(workDirPath, repoInfo.theirFileName)), + repoInfo.theirFileName + " shouldn't exist"); + + var promise = Cherrypick.commit(repo, repoInfo.theirCommit, + repoInfo.ourCommit, 0, {}); + assert(promise.then); + return promise; + }) + .then(function(index) { + assert(index); + return index.writeTreeTo(repo); + }) + .then(function(oid) { + return repo.getTree(oid); + }) + .then(function(tree) { + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE + }; + + return NodeGit.Checkout.tree(repo, tree, opts); + }) + .then(function() { + assert(fse.existsSync(path.join(workDirPath, repoInfo.ourFileName)), + repoInfo.ourFileName + " should exist"); + assert(fse.existsSync(path.join(workDirPath, repoInfo.theirFileName)), + repoInfo.theirFileName + " should exist"); + }); + }); + + it("can cherrypick a stash to apply it", function() { + var repo = this.repository; + var workDirPath = repo.workdir(); + var repoInfo; + var cherrypickOid; + + var addedContent = "\nIt makes things E-Z!"; + + return RepoUtils.setupBranches(repo, true) + .then(function(info) { + repoInfo = info; + + return repo.getStatus(); + }) + .then(function(statuses) { + assert.equal(statuses.length, 0); + + return fse.writeFile(path.join(workDirPath, repoInfo.ourFileName), + repoInfo.ourFileContent + addedContent); + }) + .then(function() { + return repo.getStatus(); + }) + .then(function(statuses) { + assert.equal(statuses.length, 1); + + return NodeGit.Stash.save(repo, repoInfo.ourSignature, "our stash", 0); + }) + .then(function(oid) { + cherrypickOid = oid; + + return fse.readFile(path.join(workDirPath, repoInfo.ourFileName)); + }) + .then(function(fileContent) { + assert.equal(fileContent, repoInfo.ourFileContent); + + return repo.getStatus(); + }) + .then(function(statuses) { + assert.equal(statuses.length, 0); + + return repo.getCommit(cherrypickOid); + }) + .then(function(commit) { + var opts = { + mainline: 1 + }; + + return Cherrypick.cherrypick(repo, commit, opts); + }) + .then(function() { + return repo.getStatus(); + }) + .then(function(statuses) { + assert.equal(statuses.length, 1); + + return fse.readFile(path.join(workDirPath, repoInfo.ourFileName)); + }) + .then(function(fileContent) { + assert.equal(fileContent, repoInfo.ourFileContent + addedContent); + }); + }); +}); diff --git a/test/tests/clone.js b/test/tests/clone.js index b519f3bb53..f256e85f51 100644 --- a/test/tests/clone.js +++ b/test/tests/clone.js @@ -1,8 +1,28 @@ var path = require("path"); var assert = require("assert"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); +var _ = require("lodash"); + + +const generatePathWithLength = (base, length) => { + let path = `${base}/`; + const baseLength = path.length; + const remaining = length - baseLength; + + for (let i = 0; i < remaining; ++i) { + // add a slash every 240 characters, but not as first or last character + if (i % 239 == 0 && i != remaining - 1 && i != 0) { + path += "/"; + } else { + path += "a"; + } + } + + assert.ok(path.length === length); + + return path; +}; describe("Clone", function() { var NodeGit = require("../../"); @@ -10,22 +30,28 @@ describe("Clone", function() { var Clone = NodeGit.Clone; var clonePath = local("../repos/clone"); + var longClonePath = generatePathWithLength(clonePath, 600); - var sshPublicKey = local("../id_rsa.pub"); - var sshPrivateKey = local("../id_rsa"); + var sshPublicKeyPath = local("../id_rsa.pub"); + var sshPrivateKeyPath = local("../id_rsa"); + var sshEncryptedPublicKeyPath = local("../encrypted_rsa.pub"); + var sshEncryptedPrivateKeyPath = local("../encrypted_rsa"); // Set a reasonable timeout here now that our repository has grown. this.timeout(30000); beforeEach(function() { - return fse.remove(clonePath).catch(function(err) { - console.log(err); - - throw err; - }); + return fse.remove(clonePath) + .then(function() { + return fse.remove(longClonePath); + }) + .catch(function(err) { + console.log(err); + throw err; + }); }); - it("can clone with http", function() { + it.skip("can clone with http", function() { var test = this; var url = "http://git.tbranyen.com/smart/site-content"; @@ -39,9 +65,9 @@ describe("Clone", function() { var test = this; var url = "https://github.com/nodegit/test.git"; var opts = { - remoteCallbacks: { - certificateCheck: function() { - return 1; + fetchOpts: { + callbacks: { + certificateCheck: () => 0 } } }; @@ -52,13 +78,153 @@ describe("Clone", function() { }); }); + it("can clone twice with https using same config object", function() { + var test = this; + var url = "https://github.com/nodegit/test.git"; + var progressCount = 0; + var opts = { + fetchOpts: { + callbacks: { + transferProgress: function(progress) { + progressCount++; + } + } + } + }; + + return Clone(url, clonePath, opts) + .then(function(repo) { + assert.ok(repo instanceof Repository); + assert.notEqual(progressCount, 0); + return fse.remove(clonePath); + }) + .then(function() { + progressCount = 0; + return Clone(url, clonePath, opts); + }) + .then(function(repo) { + assert.ok(repo instanceof Repository); + assert.notEqual(progressCount, 0); + test.repository = repo; + }); + }); + + function updateProgressIntervals(progressIntervals, lastInvocation) { + var now = new Date(); + if (lastInvocation) { + progressIntervals.push(now - lastInvocation); + } + return now; + } + + it("can clone with https and default throttled progress", function() { + var test = this; + var url = "https://github.com/nodegit/test.git"; + var progressCount = 0; + var lastInvocation; + var progressIntervals = []; + var opts = { + fetchOpts: { + callbacks: { + transferProgress: function(progress) { + lastInvocation = updateProgressIntervals(progressIntervals, + lastInvocation); + progressCount++; + } + } + } + }; + + return Clone(url, clonePath, opts).then(function(repo) { + assert.ok(repo instanceof Repository); + assert.notEqual(progressCount, 0); + var averageProgressInterval = _.sum(progressIntervals) / + progressIntervals.length; + // even though we are specifying a throttle period of 100, + // the throttle is applied on the scheduling side, + // and actual execution is at the mercy of the main js thread + // so the actual throttle intervals could be less than the specified + // throttle period + if (!averageProgressInterval || averageProgressInterval < 75) { + assert.fail(averageProgressInterval, 75, + "unexpected average time between callbacks", "<"); + } + test.repository = repo; + }); + }); + + it("can clone with https and explicitly throttled progress", function() { + var test = this; + var url = "https://github.com/nodegit/test.git"; + var progressCount = 0; + var lastInvocation; + var progressIntervals = []; + var opts = { + fetchOpts: { + callbacks: { + transferProgress: { + throttle: 50, + callback: function(progress) { + lastInvocation = updateProgressIntervals(progressIntervals, + lastInvocation); + progressCount++; + } + } + } + } + }; + + return Clone(url, clonePath, opts).then(function(repo) { + assert.ok(repo instanceof Repository); + assert.notEqual(progressCount, 0); + var averageProgressInterval = _.sum(progressIntervals) / + progressIntervals.length; + if (!averageProgressInterval || averageProgressInterval < 35) { + assert.fail(averageProgressInterval, 35, + "unexpected average time between callbacks", "<"); + } + test.repository = repo; + }); + }); + + it("can clone without waiting for callback results", function() { + var test = this; + var url = "https://github.com/nodegit/test.git"; + var lastReceivedObjects = 0; + var cloneFinished = false; + var opts = { + fetchOpts: { + callbacks: { + transferProgress: { + waitForResult: false, + callback: function(progress) { + var receivedObjects = progress.receivedObjects(); + assert.false( + cloneFinished, + "callback running after clone completion" + ); + assert.gt(receivedObjects, lastReceivedObjects); + lastReceivedObjects = receivedObjects; + } + } + } + } + }; + + return Clone(url, clonePath, opts).then(function(repo) { + assert.ok(repo instanceof Repository); + cloneFinished = true; + test.repository = repo; + }); + }); + it("can clone using nested function", function() { var test = this; var url = "https://github.com/nodegit/test.git"; var opts = { - remoteCallbacks: { - certificateCheck: function() { - return 1; + fetchOpts: { + callbacks: { + certificateCheck: () => 0 } } }; @@ -73,12 +239,12 @@ describe("Clone", function() { var test = this; var url = "git@github.com:nodegit/test.git"; var opts = { - remoteCallbacks: { - certificateCheck: function() { - return 1; - }, - credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); + fetchOpts: { + callbacks: { + certificateCheck: () => 0, + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyFromAgent(userName); + } } } }; @@ -93,16 +259,16 @@ describe("Clone", function() { var test = this; var url = "git@github.com:nodegit/test.git"; var opts = { - remoteCallbacks: { - certificateCheck: function() { - return 1; - }, - credentials: function(url, userName) { - return NodeGit.Cred.sshKeyNew( - userName, - sshPublicKey, - sshPrivateKey, - ""); + fetchOpts: { + callbacks: { + certificateCheck: () => 0, + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyNew( + userName, + sshPublicKeyPath, + sshPrivateKeyPath, + ""); + } } } }; @@ -113,13 +279,40 @@ describe("Clone", function() { }); }); - it("can clone with git", function() { + it("can clone with ssh while manually loading an encrypted key", function() { + var test = this; + var url = "git@github.com:nodegit/test.git"; + var opts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0, + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyNew( + userName, + sshEncryptedPublicKeyPath, + sshEncryptedPrivateKeyPath, + "test-password" + ); + } + } + } + }; + + return Clone(url, clonePath, opts).then(function(repo) { + assert.ok(repo instanceof Repository); + test.repository = repo; + }); + }); + + // Since 15 March the unauthenticated git protocol on port 9418 is no longer supported in Github. + // https://github.blog/2021-09-01-improving-git-protocol-security-github/ + it.skip("can clone with git", function() { var test = this; var url = "git://github.com/nodegit/test.git"; var opts = { - remoteCallbacks: { - certificateCheck: function() { - return 1; + fetchOpts: { + callbacks: { + certificateCheck: () => 0 } } }; @@ -144,16 +337,23 @@ describe("Clone", function() { it("will not segfault when accessing a url without username", function() { var url = "https://github.com/nodegit/private"; + var firstPass = true; + return Clone(url, clonePath, { - remoteCallbacks: { - certificateCheck: function() { - return 1; - }, - credentials: function() { - return NodeGit.Cred.userpassPlaintextNew("fake-token", - "x-oauth-basic"); + fetchOpts: { + callbacks: { + certificateCheck: () => 0, + credentials: function() { + if (firstPass) { + firstPass = false; + return NodeGit.Credential.userpassPlaintextNew("fake-token", + "x-oauth-basic"); + } else { + return NodeGit.Credential.defaultNew(); + } + } } } - }).catch(function unhandledError() { }); + }).catch(function(reason) { }); }); }); diff --git a/test/tests/commit.js b/test/tests/commit.js index 79758a683c..8ff9b8ea78 100644 --- a/test/tests/commit.js +++ b/test/tests/commit.js @@ -1,15 +1,23 @@ var assert = require("assert"); var path = require("path"); -var Promise = require("nodegit-promise"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); + +var garbageCollect = require("../utils/garbage_collect.js"); +var leakTest = require("../utils/leak_test"); + var local = path.join.bind(path, __dirname); +var exec = require("../../utils/execPromise"); + describe("Commit", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; + var Commit = NodeGit.Commit; + var Diff = NodeGit.Diff; + var Oid = NodeGit.Oid; var reposPath = local("../repos/workdir"); + var newRepoPath = local("../repos/new"); var oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; function reinitialize(test) { @@ -24,6 +32,59 @@ describe("Commit", function() { }); } + function commitFile(repo, fileName, fileContent, commitMessage) { + var index; + var treeOid; + var parent; + + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommit( + "HEAD", + author, + committer, + "message", + treeOid, + [parent]); + }); + } + + function undoCommit() { + return exec("git reset --hard HEAD~1", {cwd: reposPath}); + } + beforeEach(function() { return reinitialize(this); }); @@ -67,6 +128,18 @@ describe("Commit", function() { assert.equal(this.commit.timeOffset(), 780); }); + it("can call getTree on a parent commit", function() { + return this.commit.parent(0) + .then(function(parent) { + return parent.getTree(); + }) + .then(function(tree) { + assert.equal( + tree.id().toString(), "327ff68e59f94f0c25d2c62fb0938efa01e8a107" + ); + }); + }); + it("can create a commit", function() { var test = this; var expectedCommitId = "315e77328ef596f3bc065d8ac6dd2c72c09de8a5"; @@ -84,11 +157,10 @@ describe("Commit", function() { return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); }) .then(function() { - return repo.openIndex(); + return repo.refreshIndex(); }) .then(function(indexResult) { index = indexResult; - return index.read(1); }) .then(function() { return index.addByPath(fileName); @@ -127,6 +199,82 @@ describe("Commit", function() { }) .then(function(commitId) { assert.equal(expectedCommitId, commitId); + return undoCommit() + .then(function(){ + return reinitialize(test); + }); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("can create a commit as a buffer", function() { + var test = this; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + const expectedCommitContent = + "tree 11c8685af551550e73e5ab89fa554576bd92ef3f\n" + + "parent 32789a79e71fbc9e04d3eff7425e1771eb595150\n" + + "author Foo Bar 123456789 +0100\n" + + "committer Foo A Bar 987654321 +0130\n\n" + + "message"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitBuffer( + author, + committer, + "message", + treeOid, + [parent]); + }) + .then(function(commitContent) { + assert.equal(expectedCommitContent, commitContent); return reinitialize(test); }, function(reason) { return reinitialize(test) @@ -136,7 +284,420 @@ describe("Commit", function() { }); }); + it("can amend commit", function(){ + var commitToAmendId = "315e77328ef596f3bc065d8ac6dd2c72c09de8a5"; + var expectedAmendedCommitId = "a41de0d1c3dc169c873dd03bd9240d9f88e60ffc"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + var newFileName = "newerfile.txt"; + var newFileContent = "goodbye world"; + var messageEncoding = "US-ASCII"; + var message = "First commit"; + + var repo; + var index; + var treeOid; + var parent; + var author; + var committer; + var amendedCommitId; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommit( + "HEAD", + author, + committer, + "message", + treeOid, + [parent]); + }) + .then(function() { + return fse.writeFile( + path.join(repo.workdir(), newFileName), + newFileContent + ); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(newFileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(resultOid){ + treeOid = resultOid; + return Promise.all([ + repo.getCommit(commitToAmendId), + NodeGit.Signature.create( + "New Foo Bar", + "newfoo@bar.com", + 246802468, + 12 + ), + NodeGit.Signature.create( + "New Foo A Bar", + "newfoo@bar.com", + 4807891730, + 32 + ) + ]); + + }) + .then(function(amendInfo){ + var commit = amendInfo[0]; + author = amendInfo[1]; + committer = amendInfo[2]; + return commit.amend( + "HEAD", + author, + committer, + messageEncoding, + message, + treeOid + ); + }) + .then(function(commitId){ + amendedCommitId = commitId; + return undoCommit(); + }) + .then(function(){ + assert.equal(amendedCommitId, expectedAmendedCommitId); + }); + }); + + it("can amend commit and update reference separately", function() { + var customReflogMessage = "updating reference manually"; + + var head, repo, oid, originalReflogCount; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + // grab the original reflog entry count (to make sure .amend + // doesn't add a reflog entry when not given a reference) + return NodeGit.Reflog.read(repo, "HEAD"); + }) + .then(function(reflog) { + originalReflogCount = reflog.entrycount(); + // get the head reference and commit + return repo.head(); + }) + .then(function(headResult) { + head = headResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + // amend the commit but don't update any reference + // (passing null as update_ref) + return headCommit.amend( + null, + null, + null, + "message", + null, + null); + }).then(function(oidResult) { + oid = oidResult; + // update the reference manually + return head.setTarget(oid, customReflogMessage); + }).then(function() { + // load reflog and make sure the last message is what we expected + return NodeGit.Reflog.read(repo, "HEAD"); + }).then(function(reflog) { + var reflogEntry = reflog.entryByIndex(0); + assert.equal( + reflogEntry.message(), + customReflogMessage + ); + assert.equal( + reflogEntry.idNew().toString(), + oid + ); + // only setTarget should have added to the entrycount + assert.equal(reflog.entrycount(), originalReflogCount + 1); + }); + }); + + describe("amendWithSignature", function() { + it("can amend with signature", function() { + const signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQJHBAEBCAAxFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxPKUYTHHN0ZXZla0Bh\n" + + "eG9zb2Z0LmNvbQAKCRBRGMkp5058Q3vcD/0Uf6P68g98Kbvsgjg/aidM1ujruXaw\n" + + "X5WSsCAw+wWGICOj0n+KBnmQruI4HSFz3zykEshuOpcBv1X/+huwDeB/hBqonCU8\n" + + "QdexCdWR70YbT1bufesUwV9v1qwE4WOmFxWXgwh55K0wDRkc0u2aLcwrJkIEEVfs\n" + + "HqZyFzU4kwbGekY/m7d1DsBhWyKEGW9/25WMYmjWOWOiaFjeBaHLlxiEM8KGnMLH\n" + + "wx37NuFuaABgi23AAcBGdeWy04TEuU4S51+bHM3RotrZ2cryW2lEbkkXodhIJcq0\n" + + "RgrStCbvR0ehnOPdYSiRbxK8JNLZuNjHlK2g7wVi+C83vwMQuhU4H6OlYHGVr664\n" + + "4YzL83FdIo7wiMOFd2OOMLlCfHgTun60FvjCs4WHjrwH1fQl287FRPLa/4olBSQP\n" + + "yUXJaZdxm4cB4L/1pmbb/J/XUiOio3MpaN3GFm2hZloUlag1uPDBtCxTl5odvj4a\n" + + "GOmTBWznXxF/zrKnQVSvv+EccNxYFc0VVjAxGgNqPzIxDAKtw1lE5pbBkFpFpNHz\n" + + "StmwZkP9QIJY4hJYQfM+pzHLe8xjexL+Kh/TrYXgY1m/4vJe0HJSsnRnaR8Yfqhh\n" + + "LReqo94VHRYXR0rZQv4py0D9TrWaI8xHLve6ewhLPNRzyaI9fNrinbcPYZZOWnRi\n" + + "ekgUBx+BX6nJOw==\n" + + "=4Hy5\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var repo; + var oid; + var commit; + var message; + var parents; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message() + "\n"; + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signatureInfo.signature, signedData); + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + }); + }); + + it("will respects overridden arguments", function() { + const signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQJHBAEBCAAxFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxPKUYTHHN0ZXZla0Bh\n" + + "eG9zb2Z0LmNvbQAKCRBRGMkp5058Q3vcD/0Uf6P68g98Kbvsgjg/aidM1ujruXaw\n" + + "X5WSsCAw+wWGICOj0n+KBnmQruI4HSFz3zykEshuOpcBv1X/+huwDeB/hBqonCU8\n" + + "QdexCdWR70YbT1bufesUwV9v1qwE4WOmFxWXgwh55K0wDRkc0u2aLcwrJkIEEVfs\n" + + "HqZyFzU4kwbGekY/m7d1DsBhWyKEGW9/25WMYmjWOWOiaFjeBaHLlxiEM8KGnMLH\n" + + "wx37NuFuaABgi23AAcBGdeWy04TEuU4S51+bHM3RotrZ2cryW2lEbkkXodhIJcq0\n" + + "RgrStCbvR0ehnOPdYSiRbxK8JNLZuNjHlK2g7wVi+C83vwMQuhU4H6OlYHGVr664\n" + + "4YzL83FdIo7wiMOFd2OOMLlCfHgTun60FvjCs4WHjrwH1fQl287FRPLa/4olBSQP\n" + + "yUXJaZdxm4cB4L/1pmbb/J/XUiOio3MpaN3GFm2hZloUlag1uPDBtCxTl5odvj4a\n" + + "GOmTBWznXxF/zrKnQVSvv+EccNxYFc0VVjAxGgNqPzIxDAKtw1lE5pbBkFpFpNHz\n" + + "StmwZkP9QIJY4hJYQfM+pzHLe8xjexL+Kh/TrYXgY1m/4vJe0HJSsnRnaR8Yfqhh\n" + + "LReqo94VHRYXR0rZQv4py0D9TrWaI8xHLve6ewhLPNRzyaI9fNrinbcPYZZOWnRi\n" + + "ekgUBx+BX6nJOw==\n" + + "=4Hy5\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var repo; + var oid; + var commit; + var message; + var parents; + var commitTree; + + var author = NodeGit.Signature.create( + "Scooby Doo", + "scoob@mystery.com", + 123456789, + 60 + ); + var committer = NodeGit.Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + var tree = Oid.fromString("f4661419a6fbbe865f78644fec722c023ce4b65f"); + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message() + "\n"; + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + author, + committer, + null, + null, + tree, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getTree(); + }) + .then(function(commitTreeResult) { + commitTree = commitTreeResult; + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signatureInfo.signature, signedData); + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + assert.deepEqual(commitTree.id(), tree); + assert.deepEqual(commit.author(), author); + assert.deepEqual(commit.committer(), committer); + }); + }); + + it("can optionally skip signing process", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + var repo; + var oid; + var commit; + var message; + var parents; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + message = headCommit.message(); + parents = headCommit.parents(); + + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function(oidResult) { + oid = oidResult; + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature("gpgsig") + .then(function() { + assert.fail("Should not have a signature"); + }, function(error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }) + .then(function(signatureInfo) { + assert.equal(commit.message(), message); + assert.deepEqual(commit.parents(), parents); + }); + }); + + it("will throw if signing callback returns an error code", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + return NodeGit.Repository.open(reposPath) + .then(function(repo) { + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + return headCommit.amendWithSignature( + null, + null, + null, + null, + null, + null, + onSignature + ); + }) + .then(function() { + assert.fail("amendWithSignature should have failed."); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + }); it("has an owner", function() { var owner = this.commit.owner(); @@ -213,6 +774,16 @@ describe("Commit", function() { assert.equal(1, this.commit.parentcount()); }); + it("can fetch a single parent", function() { + return this.commit.parent(0).then(function(parent) { + assert.strictEqual(parent.sha(), + "ecfd36c80a3e9081f200dfda2391acadb56dac27"); + // This used to crash due to a missing .repo property on the retrieved + // parent. + return parent.getTree().then(tree => assert(tree)); + }); + }); + it("can retrieve and walk a commit tree", function() { var commitTreeEntryCount = 0; var expectedCommitTreeEntryCount = 198; @@ -251,6 +822,145 @@ describe("Commit", function() { }); }); + // it("can get the commit diff in large context", function() { + // For displaying the full file we can set context_lines of options. + // Eventually this should work, but right now there is a + // comment in diff.c in libgit2 of "/* TODO: parse thresholds */" + // It will add the "--unified" but not with the "=x" part. + // options.context_lines = 20000; + // }); + + it("can get the commit diff without whitespace", function() { + var repo; + var options = {}; + var GIT_DIFF_IGNORE_WHITESPACE = (1 << 22); + options.flags = GIT_DIFF_IGNORE_WHITESPACE; + + var fileName = "whitespacetest.txt"; + var fileContent = "line a\nline b\nline c\nline d\n line e\nline f\n" + + "line g\nline h\nline i\n line j\nline k\nline l\n" + + "line m\nline n\n line o\nline p\nline q\n" + + "line r\nline s\nline t\nline u\nline v\nline w\n" + + "line x\nline y\nline z\n"; + var changedFileContent = "line a\nline b\n line c\nline d\n" + + "line e\nline f\nline g\n line h\nline i\nline j\n" + + "line k\nline l\nline m\nline n\nline o\nlinep\n" + + " line q\nline r\nline s\nline t\n\nline u\n" + + "line v1\nline w\nline x\n \nline y\nline z\n"; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return commitFile(repo, fileName, fileContent, "commit this"); + }) + .then(function(){ + return commitFile(repo, fileName, changedFileContent, "commit that"); + }) + .then (function() { + return repo.getHeadCommit(); + }) + .then (function(wsCommit) { + return wsCommit.getDiffWithOptions(options); + }) + .then(function(diff) { + assert.equal(diff.length, 1); + return diff[0].patches(); + }) + .then(function(patches) { + assert.equal(patches.length, 1); + var patch = patches[0]; + + assert.equal(patch.oldFile().path(), fileName); + assert.equal(patch.newFile().path(), fileName); + assert.ok(patch.isModified()); + + return patch.hunks(); + }) + .then(function(hunks) { + return hunks[0].lines(); + }) + .then(function(lines) { + //check all hunk lines + assert.equal(lines.length, 12); + assert.equal(lines[0].origin(), Diff.LINE.CONTEXT); + + assert.equal(lines[1].content().length, 9); + assert.equal(lines[1].content(), "line s\n"); + assert.equal(lines[1].origin(), Diff.LINE.CONTEXT); + + assert.equal(lines[2].origin(), Diff.LINE.CONTEXT); + + assert.equal(lines[3].content().length, 1); + assert.equal(lines[3].content(), "\n"); + assert.equal(lines[3].origin(), Diff.LINE.ADDITION); + + assert.equal(lines[4].origin(), Diff.LINE.CONTEXT); + + assert.equal(lines[5].content().length, 7); + assert.equal(lines[5].content(), "line v\n"); + assert.equal(lines[5].origin(), Diff.LINE.DELETION); + + assert.equal(lines[6].content().length, 8); + assert.equal(lines[6].content(), "line v1\n"); + assert.equal(lines[6].origin(), Diff.LINE.ADDITION); + + assert.equal(lines[7].origin(), Diff.LINE.CONTEXT); + + assert.equal(lines[8].origin(), Diff.LINE.CONTEXT); + + assert.equal(lines[9].content().length, 4); + assert.equal(lines[9].content(), "\t\t\t\n"); + assert.equal(lines[9].origin(), Diff.LINE.ADDITION); + + assert.equal(lines[10].origin(), Diff.LINE.CONTEXT); + + assert.equal(lines[11].origin(), Diff.LINE.CONTEXT); + }); + }); + + it("can get header fields", function() { + var commit = this.commit; + return commit.headerField("parent").then(function(field) { + assert.equal(field, + "ecfd36c80a3e9081f200dfda2391acadb56dac27"); + return commit.headerField("author"); + }) + .then(function(field) { + assert.equal(field, + "Michael Robinson 1362012884 +1300"); + return commit.headerField("committer"); + }) + .then(function(field) { + assert.equal(field, + "Michael Robinson 1362012884 +1300"); + }); + }); + + it("can lookup using a short id", function () { + return NodeGit.Repository.open(reposPath) + .then(function (repo) { + return Commit.lookupPrefix(repo, Oid.fromString("bf1da765"), 8); + }) + .then(function (commit) { + assert.equal(commit.id().toString(), + "bf1da765e357a9b936d6d511f2c7b78e0de53632"); + }); + }); + + it("can find nth gen ancestor", function () { + return NodeGit.Repository.open(reposPath) + .then(function (repo) { + return repo.getCommit("b52067acaa755c3b3fc21b484ffed2bce4150f62"); + }) + .then(function (commit) { + return commit.nthGenAncestor(3); + }) + .then(function (commit) { + assert.equal(commit.id().toString(), + "9b2f3a37d46d47248d2704b6a46ec7e197bcd48c"); + }); + }); + describe("Commit's Author", function() { before(function() { this.author = this.commit.author(); @@ -286,4 +996,611 @@ describe("Commit", function() { assert.equal(this.committer.email(), "mike@panmedia.co.nz"); }); }); + + describe("Commit's Body", function() { + + it("null if only summary", function() { + var test = this; + return NodeGit.Commit.lookup(test.repository, + "15315cf41ad76400d9189c85a5827b77b8c392f1") + .then(function(commit) { + assert.equal(commit.body(), null); + }); + }); + + it("non-null when body exists", function() { + var test = this; + return NodeGit.Commit.lookup(test.repository, + "c82fb078a192ea221c9f1093c64321c60d64aa0d") + .then(function(commit) { + assert.equal(commit.body(), + "Added new methods in checkout and repository"); + }); + }); + }); + + it("does not leak", function() { + var test = this; + + return leakTest(NodeGit.Commit, function() { + return NodeGit.Commit.lookup(test.repository, oid); + }); + }); + + it("duplicates signature", function() { + garbageCollect(); + var Signature = NodeGit.Signature; + var startSelfFreeingCount = Signature.getSelfFreeingInstanceCount(); + var startNonSelfFreeingCount = + Signature.getNonSelfFreeingConstructedCount(); + var signature = this.commit.author(); + + garbageCollect(); + var endSelfFreeingCount = Signature.getSelfFreeingInstanceCount(); + var endNonSelfFreeingCount = Signature.getNonSelfFreeingConstructedCount(); + // we should get one duplicated, self-freeing signature + assert.equal(startSelfFreeingCount + 1, endSelfFreeingCount); + assert.equal(startNonSelfFreeingCount, endNonSelfFreeingCount); + + signature = null; + garbageCollect(); + endSelfFreeingCount = Signature.getSelfFreeingInstanceCount(); + // the self-freeing signature should get freed + assert.equal(startSelfFreeingCount, endSelfFreeingCount); + }); + + describe("Commit's Signature", function() { + it("Can create a signed commit in a repo", function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "Version: GnuPG v1.4.12 (Darwin)\n" + + "\n" + + "iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n" + + "o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n" + + "JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n" + + "AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n" + + "SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n" + + "who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n" + + "6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n" + + "cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n" + + "c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n" + + "ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n" + + "7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n" + + "cpxtDQQMGYFpXK/71stq\n" + + "=ozeK\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var test = this; + var expectedCommitId = "ccb99bb20716ef7c37e92c7b8db029a7af7f747b"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Can create a signed commit in a repo and update existing ref", + function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "Version: GnuPG v1.4.12 (Darwin)\n" + + "\n" + + "iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n" + + "o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n" + + "JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n" + + "AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n" + + "SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n" + + "who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n" + + "6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n" + + "cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n" + + "c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n" + + "ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n" + + "7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n" + + "cpxtDQQMGYFpXK/71stq\n" + + "=ozeK\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var test = this; + var expectedCommitId = "ccb99bb20716ef7c37e92c7b8db029a7af7f747b"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + "HEAD", + author, + committer, + "message", + treeOid, + [parent], + onSignature); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + assert.equal(expectedCommitId, headCommit.id()); + return undoCommit() + .then(function(){ + return reinitialize(test); + }); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Can create a signed commit in bare a repo and update non-existent ref", + function() { + var signedData = "-----BEGIN PGP SIGNATURE-----\n" + + "\n" + + "iQIzBAABCAAdFiEEHYpzGBSIRCy6QrNr0R10kNTwiG8FAlxcuSoACgkQ0R10kNTw\n" + + "iG9sZA//Z6mrX5l//gjtn7Fy3Cg5khasNMZA15JUPzfoSyVkaYM7g/iZrJr4uZmm\n" + + "lrhqxTDP4SUEL6dMOT0fjAudulP19Stv0mUMOoQ9cfvU0DAuFlI1z2Ny9IR+3hJK\n" + + "XpIQCHZAAY9KrGajJvDO+WqukrMwKh2dwaQLgB2+cS7ehBpbW45+l+Bq4hTlULiJ\n" + + "ohZ2SQhqj65knErdbfJ2B7yVlQbfG2vbD6qN4qJOkJpkFRdDhLmGnNjUj+vcmYO2\n" + + "Be5CLyjuhYszzUqys6ix4UHr10KihFk31N17CgA2ZsDSzE3VsMCPlVPV9jWuMceJ\n" + + "0IFsJEXFR4SOlRAq23BxD7aaYao6AF/YBhCQnDiuiQLCJ7WdUAmja6VPyEajAjoX\n" + + "CkdDs1P4N9IeIPvJECn8Df4NEEkzW8sV3i96ryk066m1ZmZWemJ2zdGVbfR+AuFZ\n" + + "7QwgBRidj3thIk0geh9g10+pbRuTzxNXklqxq4DQb3VEXIIJMUcqtN1bUPEPiLyA\n" + + "SU3uJ1THyYznAVZy6aqw+mNq7Lg9gV65LRd0WtNqgneknDZoH3zXyzlcJexjHkRF\n" + + "qt4K6w9TDA2Erda3wE4BM4MCgl1Hc629kH3ROCyWTFuJAEZtNDJPgIc2LTRDhHNd\n" + + "+K937RhWU8lUnI2jJLmKdQDk2dnS1ZepFqA5Ynwza1qDSOgUqVw=\n" + + "=M81P\n" + + "-----END PGP SIGNATURE-----"; + + const onSignature = () => ({ + code: NodeGit.Error.CODE.OK, + field: "gpgsig", + signedData + }); + + var expectedCommitId = "ef11571eb3590007712c7ee3b4a11cd9c6094e30"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + + return NodeGit.Repository.init(newRepoPath, 0) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + "HEAD", + author, + committer, + "message", + treeOid, + [], + onSignature); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signedData, signatureInfo.signature); + return repo.getHeadCommit(); + }) + .then(function(headCommit) { + assert.equal(expectedCommitId, headCommit.id()); + }); + }); + + it("Can create a signed commit raw", function() { + var expectedCommitId = "cc1401eaac4e9e77190e98a9353b305f0c6313d8"; + + var signature = "-----BEGIN PGP SIGNATURE-----\n\n" + + "iQEcBAABCAAGBQJarBhIAAoJEE8pfTd/81lKQA4IAL8Mu5kc4B/MX9s4XB26Ahap\n" + + "n06kCx3RQ1KHMZIRomAjCnb48WieNVuy1y+Ut0RgfCxxrJ1ZnzFG3kF2bIKwIxNI\n" + + "tYIC76iWny+mrVnb2mjKYjn/3F4c4VJGENq9ITiV1WeE4yJ8dHw2ox2D+hACzTvQ\n" + + "KVroedk8BDFJxS6DFb20To35xbAVhwBnAGRcII4Wi5PPMFpqAhGLfq3Czv95ddSz\n" + + "BHlyp27+YWSpV0Og0dqOEhsdDYaPrOBGRcoRiqjue+l5tgK/QerLFZ4aovZzpuEP\n" + + "Xx1yZfqXIiy4Bo40qScSrdnmnp/kMq/NQGR3jYU+SleFHVKNFsya9UwurMaezY0=\n" + + "=eZzi\n-----END PGP SIGNATURE-----"; + + var commit_content = "tree f4661419a6fbbe865f78644fec722c023ce4b65f\n" + + "parent 32789a79e71fbc9e04d3eff7425e1771eb595150\n" + + "author Tyler Ang-Wanek 1521227848 -0700\n" + + "committer Tyler Ang-Wanek 1521227848 -0700\n\n" + + "GPG Signed commit\n"; + + var repo; + var commit; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return Commit.createWithSignature( + repo, + commit_content, + signature, + "gpgsig"); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commitResult) { + commit = commitResult; + return commit.getSignature(); + }) + .then(function(signatureInfoDefault) { + assert.equal(signature, signatureInfoDefault.signature); + assert.equal(commit_content, signatureInfoDefault.signedData); + + return commit.getSignature("gpgsig"); + }) + .then(function(signatureInfo) { + assert.equal(signature, signatureInfo.signature); + assert.equal(commit_content, signatureInfo.signedData); + }); + }); + + it("Can retrieve the gpg signature from a commit", function() { + var expectedSignedData = + "tree f4661419a6fbbe865f78644fec722c023ce4b65f\n" + + "parent 32789a79e71fbc9e04d3eff7425e1771eb595150\n" + + "author Tyler Ang-Wanek 1521227848 -0700\n" + + "committer Tyler Ang-Wanek 1521227848 -0700\n\n" + + "GPG Signed commit\n"; + + var expectedSignature = + "-----BEGIN PGP SIGNATURE-----\n\n" + + "iQEcBAABCAAGBQJarBhIAAoJEE8pfTd/81lKQA4IAL8Mu5kc4B/MX9s4XB26Ahap\n" + + "n06kCx3RQ1KHMZIRomAjCnb48WieNVuy1y+Ut0RgfCxxrJ1ZnzFG3kF2bIKwIxNI\n" + + "tYIC76iWny+mrVnb2mjKYjn/3F4c4VJGENq9ITiV1WeE4yJ8dHw2ox2D+hACzTvQ\n" + + "KVroedk8BDFJxS6DFb20To35xbAVhwBnAGRcII4Wi5PPMFpqAhGLfq3Czv95ddSz\n" + + "BHlyp27+YWSpV0Og0dqOEhsdDYaPrOBGRcoRiqjue+l5tgK/QerLFZ4aovZzpuEP\n" + + "Xx1yZfqXIiy4Bo40qScSrdnmnp/kMq/NQGR3jYU+SleFHVKNFsya9UwurMaezY0=\n" + + "=eZzi\n-----END PGP SIGNATURE-----"; + + return NodeGit.Commit.lookup( + this.repository, + "cc1401eaac4e9e77190e98a9353b305f0c6313d8" + ) + .then(function(commit) { + return commit.getSignature(); + }) + .then(function(extractSignature) { + assert.equal( + extractSignature.signature, + expectedSignature + ); + assert.equal( + extractSignature.signedData, + expectedSignedData + ); + }); + }); + + it("Can be optionally skipped to create without signature", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + var test = this; + var expectedCommitId = "c9bffe040519231d32431c101bca4efc0917f64c"; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function(commitId) { + assert.equal(expectedCommitId, commitId); + return NodeGit.Commit.lookup(repo, commitId); + }) + .then(function(commit) { + return commit.getSignature("gpgsig") + .then(function() { + assert.fail("Should not have been able to retrieve gpgsig"); + }, function(error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }) + .then(function() { + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + + it("Will throw if the signing cb returns an error code", function() { + const onSignature = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + var test = this; + var fileName = "newfile.txt"; + var fileContent = "hello world"; + + var repo; + var index; + var treeOid; + var parent; + + return NodeGit.Repository.open(reposPath) + .then(function(repoResult) { + repo = repoResult; + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + var author = signatures[0]; + var committer = signatures[1]; + + return repo.createCommitWithSignature( + null, + author, + committer, + "message", + treeOid, + [parent], + onSignature + ); + }) + .then(function() { + assert.fail("createCommitWithSignature should have failed."); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }) + .then(function() { + return reinitialize(test); + }, function(reason) { + return reinitialize(test) + .then(function() { + return Promise.reject(reason); + }); + }); + }); + }); }); diff --git a/test/tests/config.js b/test/tests/config.js index 3afeb6d8ee..bc4b802f37 100644 --- a/test/tests/config.js +++ b/test/tests/config.js @@ -1,18 +1,109 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -// Have to wrap exec, since it has a weird callback signature. -var exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); +var exec = require("../../utils/execPromise"); describe("Config", function() { var NodeGit = require("../../"); + var Repository = NodeGit.Repository; + var Config = NodeGit.Config; var reposPath = local("../repos/workdir"); + describe("openOnDisk", function() { + var configPath = path.join(reposPath, ".git/config"); + + it("opens the same config as the repo", function() { + var repo; + var onDiskConfig; + return Repository.open(reposPath) + .then(function(_repo) { + repo = _repo; + return Config.openOndisk(configPath); + }) + .then(function(config) { + onDiskConfig = config; + return repo.config(); + }) + .then(function(repoConfig) { + return Promise.all([ + onDiskConfig.getString("core.filemode"), + onDiskConfig.getString("core.bare"), + repoConfig.getString("core.filemode"), + repoConfig.getString("core.bare") + ]); + }) + .then(function(results) { + var onDiskFileMode = results[0]; + var onDiskBare = results[1]; + var repoFileMode = results[2]; + var repoBare = results[3]; + + assert.equal(onDiskFileMode, repoFileMode); + assert.equal(onDiskBare, repoBare); + }); + }); + + it("opens the config and can change a value", function() { + var repo; + var onDiskConfig; + var repoConfig; + var originalFileMode; + return Repository.open(reposPath) + .then(function(_repo) { + repo = _repo; + return Config.openOndisk(configPath); + }) + .then(function(config) { + onDiskConfig = config; + return repo.config(); + }) + .then(function(_repoConfig) { + repoConfig = _repoConfig; + return Promise.all([ + onDiskConfig.getString("core.filemode"), + repoConfig.getString("core.filemode") + ]); + }) + .then(function(results) { + var onDiskFileMode = results[0]; + var repoFileMode = results[1]; + + assert.equal(onDiskFileMode, repoFileMode); + originalFileMode = onDiskFileMode; + var oppositeFileMode = onDiskFileMode === "true" ? "false" : "true"; + + return onDiskConfig.setString( + "core.filemode", + oppositeFileMode + ); + }) + .then(function() { + return Config.openOndisk(configPath); + }) + .then(function(config) { + return Promise.all([ + config.getString("core.filemode"), + repoConfig.getString("core.filemode") + ]); + }) + .then(function(results) { + var onDiskFileMode = results[0]; + var repoFileMode = results[1]; + assert.notEqual(onDiskFileMode, originalFileMode); + assert.equal(onDiskFileMode, repoFileMode); + }) + .then(function() { + // cleanup + return onDiskConfig.setString( + "core.filemode", + originalFileMode + ); + }); + }); + }); + it("can get and set a global value", function() { var savedUserName; @@ -36,7 +127,25 @@ describe("Config", function() { .then(function(userNameFromNodeGit) { assert.equal(savedUserName + "-test", userNameFromNodeGit); }) - .then(finallyFn, finallyFn); + .then(finallyFn) + .catch(function(e) { + return finallyFn() + .then(function() { + throw e; + }); + }); + }); + + it("will reject when getting value of non-existent config key", function() { + // Test initially for finding source of a segfault. There was a problem + // where getting an empty config value crashes nodegit. + return NodeGit.Config.openDefault() + .then(function(config) { + return config.getString("user.fakevalue"); + }) + .catch(function (e) { + return true; + }); }); it("can get and set a repo config value", function() { @@ -70,6 +179,32 @@ describe("Config", function() { .then(function(userNameFromNodeGit) { assert.equal(savedUserName + "-test", userNameFromNodeGit); }) - .then(finallyFn, finallyFn); + .then(finallyFn) + .catch(function(e) { + return finallyFn() + .then(function() { + throw e; + }); + }); + }); + + describe("getPath", function() { + it("can get path for a given config", function() { + return NodeGit.Repository.open(reposPath) + .then(function(repo) { + return repo.config(); + }) + .then(function(config) { + return Promise.all([ + config.getPath("core.filemode"), + config.getString("core.filemode") + ]); + }) + .then(function(results) { + var localFilemode = results[0]; + var repoFilemode = results[1]; + assert.equal(localFilemode, repoFilemode); + }); + }); }); }); diff --git a/test/tests/convenient_line.js b/test/tests/convenient_line.js new file mode 100644 index 0000000000..994041cb45 --- /dev/null +++ b/test/tests/convenient_line.js @@ -0,0 +1,68 @@ +var assert = require("assert"); +var repoSetup = require("../utils/repository_setup"); +var fse = require("fs-extra"); +var path = require("path"); +var local = path.join.bind(path, __dirname); + +describe("ConvenientLine", function() { + var repoPath = local("../repos/convenientLineTest"); + var unicodeLine = "Ťḥ𝖎ṧ â„“á»đť“ệ çǒ𝚗ẗảḭṋṦ Ă›đť§Ç𝗰ṓḍ𝔢\n"; + var asciiLine = "but this line doesn't\n"; + + beforeEach(function() { + var test = this; + + return repoSetup.createRepository(repoPath) + .then(function(repo) { + return repoSetup.commitFileToRepo( + repo, + "fileWithUnicodeChars", + unicodeLine + asciiLine + ); + }) + .then(function(commit) { + return commit.getDiff(); + }) + .then(function(diff) { + return diff[0].patches(); + }) + .then(function(patches) { + return patches[0].hunks(); + }) + .then(function(hunks) { + return hunks[0].lines(); + }) + .then(function(lines) { + test.unicodeLine = lines[0]; + test.asciiLine = lines[1]; + }); + }); + + after(function() { + return fse.remove(repoPath); + }); + + it("can parse the byte length of a unicode string", function() { + var line = this.unicodeLine; + + assert.equal(line.contentLen(), Buffer.byteLength(unicodeLine, "utf8")); + }); + + it("can get a line that contains unicode", function() { + var line = this.unicodeLine; + + assert.equal(line.content(), unicodeLine); + }); + + it("can parse the byte length of a ascii string", function() { + var line = this.asciiLine; + + assert.equal(line.contentLen(), Buffer.byteLength(asciiLine, "utf8")); + }); + + it("can get a line that contains ascii", function() { + var line = this.asciiLine; + + assert.equal(line.content(), asciiLine); + }); +}); diff --git a/test/tests/cred.js b/test/tests/cred.js index 28e48ef482..eee98d69bd 100644 --- a/test/tests/cred.js +++ b/test/tests/cred.js @@ -1,31 +1,73 @@ var assert = require("assert"); var path = require("path"); +var fs = require("fs"); var local = path.join.bind(path, __dirname); describe("Cred", function() { var NodeGit = require("../../"); - + var sshPublicKey = local("../id_rsa.pub"); var sshPrivateKey = local("../id_rsa"); it("can create default credentials", function() { - var defaultCreds = NodeGit.Cred.defaultNew(); - assert.ok(defaultCreds instanceof NodeGit.Cred); + var defaultCreds = NodeGit.Credential.defaultNew(); + assert.ok(defaultCreds instanceof NodeGit.Credential); }); it("can create ssh credentials using passed keys", function() { - var cred = NodeGit.Cred.sshKeyNew( + var cred = NodeGit.Credential.sshKeyNew( "username", sshPublicKey, sshPrivateKey, ""); - assert.ok(cred instanceof NodeGit.Cred); + assert.ok(cred instanceof NodeGit.Credential); + }); + + it("can create ssh credentials using passed keys in memory", function() { + var publicKeyContents = fs.readFileSync(sshPublicKey, { + encoding: "ascii" + }); + var privateKeyContents = fs.readFileSync(sshPrivateKey, { + encoding: "ascii" + }); + + return NodeGit.Credential.sshKeyMemoryNew( + "username", + publicKeyContents, + privateKeyContents, + "").then(function(cred) { + assert.ok(cred instanceof NodeGit.Credential); + }); }); it("can create credentials using plaintext", function() { - var plaintextCreds = NodeGit.Cred.userpassPlaintextNew + var plaintextCreds = NodeGit.Credential.userpassPlaintextNew + ("username", "password"); + assert.ok(plaintextCreds instanceof NodeGit.Credential); + }); + + it("can create credentials using agent", function() { + var fromAgentCreds = NodeGit.Credential.sshKeyFromAgent + ("username"); + assert.ok(fromAgentCreds instanceof NodeGit.Credential); + }); + + it("can create credentials using username", function() { + return NodeGit.Credential.usernameNew + ("username").then(function(cred) { + assert.ok(cred instanceof NodeGit.Credential); + }); + }); + + it("can return 1 if a username exists", function() { + var plaintextCreds = NodeGit.Credential.userpassPlaintextNew ("username", "password"); - assert.ok(plaintextCreds instanceof NodeGit.Cred); + assert.ok(plaintextCreds.hasUsername() === 1); + }); + + it("can return 0 if a username does not exist", function() { + var defaultCreds = NodeGit.Credential.defaultNew(); + assert.ok(defaultCreds.hasUsername() === 0); }); }); diff --git a/test/tests/diff.js b/test/tests/diff.js index c00d898803..9fd483c388 100644 --- a/test/tests/diff.js +++ b/test/tests/diff.js @@ -1,14 +1,36 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var Promise = require("nodegit-promise"); -var fse = promisify(require("fs-extra")); +var _ = require("lodash"); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); +function getLinesFromDiff(diff) { + return diff.patches() + .then(function(patches) { + return Promise.all(_.map(patches, function(patch) { + return patch.hunks(); + })); + }) + .then(function(listsOfHunks) { + var hunks = _.flatten(listsOfHunks); + return Promise.all(_.map(hunks, function(hunk) { + return hunk.lines(); + })); + }) + .then(function(listsOfLines) { + var lines = _.flatten(listsOfLines); + return _.map(lines, function(line) { + return line.content(); + }); + }); +} + describe("Diff", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; var Diff = NodeGit.Diff; + var Blob = NodeGit.Blob; + var Index = NodeGit.Index; var reposPath = local("../repos/workdir"); var oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; @@ -27,7 +49,7 @@ describe("Diff", function() { return Repository.open(reposPath).then(function(repository) { test.repository = repository; - return repository.openIndex(); + return repository.refreshIndex(); }) .then(function(index) { test.index = index; @@ -90,59 +112,102 @@ describe("Diff", function() { }); }); - it("can walk a DiffList", function() { - var patch = this.diff[0].patches()[0]; - - assert.equal(patch.oldFile().path(), "README.md"); - assert.equal(patch.newFile().path(), "README.md"); - assert.equal(patch.size(), 1); - assert.ok(patch.isModified()); - - var hunk = patch.hunks()[0]; - assert.equal(hunk.size(), 5); - - var lines = hunk.lines(); - assert.equal(lines[0].origin(), Diff.LINE.CONTEXT); - assert.equal(lines[1].origin(), Diff.LINE.CONTEXT); - assert.equal(lines[2].origin(), Diff.LINE.CONTEXT); - - var oldContent = "__Before submitting a pull request, please ensure " + - "both unit tests and lint checks pass.__\n"; - assert.equal(lines[3].rawContent(), oldContent); - assert.equal(lines[3].origin(), Diff.LINE.DELETION); - assert.equal(lines[3].contentLen(), 90); - - var newContent = "__Before submitting a pull request, please ensure " + - "both that you've added unit tests to cover your shiny new code, " + - "and that all unit tests and lint checks pass.__\n"; - assert.equal(lines[4].rawContent(), newContent); - assert.equal(lines[4].origin(), Diff.LINE.ADDITION); - assert.equal(lines[4].contentLen(), 162); + it("can walk an Array", function() { + return this.diff[0].patches() + .then(function(patches) { + var patch = patches[0]; + + assert.equal(patch.oldFile().path(), "README.md"); + assert.equal(patch.newFile().path(), "README.md"); + assert.equal(patch.size(), 1); + assert.ok(patch.isModified()); + + return patch.hunks(); + }) + .then(function(hunks) { + var hunk = hunks[0]; + assert.equal(hunk.size(), 5); + + return hunk.lines(); + }) + .then(function(lines) { + assert.equal(lines[0].origin(), Diff.LINE.CONTEXT); + assert.equal(lines[1].origin(), Diff.LINE.CONTEXT); + assert.equal(lines[2].origin(), Diff.LINE.CONTEXT); + + var oldContent = "__Before submitting a pull request, please ensure " + + "both unit tests and lint checks pass.__\n"; + assert.equal(lines[3].content(), oldContent); + assert.equal(lines[3].origin(), Diff.LINE.DELETION); + assert.equal(lines[3].content().length, oldContent.length); + + var newContent = "__Before submitting a pull request, please ensure " + + "both that you've added unit tests to cover your shiny new code, " + + "and that all unit tests and lint checks pass.__\n"; + assert.equal(lines[4].content(), newContent); + assert.equal(lines[4].origin(), Diff.LINE.ADDITION); + assert.equal(lines[4].content().length, newContent.length); + }); }); it("can diff the workdir with index", function() { - var patches = this.workdirDiff.patches(); - assert.equal(patches.length, 3); - assert(patches[2].isUntracked()); + return this.workdirDiff.patches() + .then(function(patches) { + assert.equal(patches.length, 3); + assert(patches[2].isUntracked()); - var oldFile = patches[2].delta.oldFile(); - assert.equal(oldFile.path(), "wddiff.txt"); - assert.equal(oldFile.size(), 0); + var oldFile = patches[2].oldFile(); + assert.equal(oldFile.path(), "wddiff.txt"); + assert.equal(oldFile.size(), 0); - var newFile = patches[2].delta.newFile(); - assert.equal(newFile.path(), "wddiff.txt"); - assert.equal(newFile.size(), 23); + var newFile = patches[2].newFile(); + assert.equal(newFile.path(), "wddiff.txt"); + assert.equal(newFile.size(), 23); + }); }); - it("can resolve individual line chages from the patch hunks", function() { - this.workdirDiff.patches().forEach(function(convenientPatch) { - convenientPatch.hunks().forEach(function(convenientHunk) { - convenientHunk.lines().forEach(function(line) { - assert(!/\n/.exec(line.content())); + it("can resolve individual line changes from the patch hunks", function() { + return this.workdirDiff.patches() + .then(function(patches) { + var result = []; + var hunkPromises = []; + + patches.forEach(function(patch) { + hunkPromises.push(patch.hunks() + .then(function(hunks) { + result = result.concat(hunks); + }) + ); + }); + + return Promise.all(hunkPromises) + .then(function() { + return result; + }); + }) + .then(function(hunks) { + var result = []; + var linePromises = []; + + hunks.forEach(function(hunk) { + linePromises.push(hunk.lines() + .then(function(lines) { + result = result.concat(lines); + }) + ); + }); + + return Promise.all(linePromises) + .then(function() { + return result; + }); + }) + .then(function(lines) { + lines.forEach(function(line) { + assert(/\n/.exec(line.content())); assert(/\n/.exec(line.rawContent())); }); }); - }); }); it("can diff the contents of a file to a string", function(done) { @@ -163,9 +228,48 @@ describe("Diff", function() { null, null, null, - function() { - console.log("delta"); + null, + function(delta, hunk, payload) { + assert.equal(hunk.oldStart(), 1); + assert.equal(hunk.oldLines(), 19); + assert.equal(hunk.newStart(), 1); + assert.equal(hunk.newLines(), 1); + assert.equal( + hunk.header().substring(0, hunk.headerLen() - 1), + "@@ -1,19 +1 @@" + ); + done(); + }); + }); + }); + + it("can diff the contents of a file to a string with unicode characters", + function(done) { + var evilString = "Unicode’s fun!\nAnd it’s good for you!\n"; + var buffer = Buffer.from(evilString); + var test = this; + Blob.createFromBuffer(test.repository, buffer, buffer.length) + .then(function(oid) { + return Blob.lookup(test.repository, oid); + }) + .then(function(blob) { + blob.repo = test.repository; + return Diff.blobToBuffer( + blob, + null, + evilString, + null, + null, + null, + null, + function(delta, hunk, payload) { + assert.fail( + "There aren't any changes so this shouldn't be called."); + done(); }); + }) + .then(function() { + done(); }); }); @@ -174,7 +278,14 @@ describe("Diff", function() { var tree = this.masterCommitTree; return Diff.treeToTree(repo, null, tree, null) .then(function(diff) { - assert.equal(diff.patches().length, 85); + return diff.patches(); + }) + .then(function(patches) { + // Number of patches returned is 84 or 85 depending + // on something unknown at this time. Hopefully we can + // eventually resolve the root cause of the difference. + // https://github.com/nodegit/nodegit/issues/746 + assert.ok(patches.length === 84 || patches.length === 85); }); }); @@ -186,7 +297,10 @@ describe("Diff", function() { return commit.getDiff(); }) .then(function(diffs) { - assert.equal(diffs[0].patches().length, 8); + return diffs[0].patches(); + }) + .then(function(patches) { + assert.equal(patches.length, 8); }); }); @@ -196,16 +310,187 @@ describe("Diff", function() { var index = this.index; var opts = { flags: Diff.OPTION.INCLUDE_UNTRACKED }; - return Diff.treeToIndex(repo, tree, index, opts).then(function(diff) { - assert.equal(diff.patches().length, 0); - }); + return Diff.treeToIndex(repo, tree, index, opts) + .then(function(diff) { + return diff.patches(); + }) + .then(function(patches) { + assert.equal(patches.length, 0); + }); }); it("can diff index to workdir", function() { - assert.equal(this.indexToWorkdirDiff.patches().length, 3); + return this.indexToWorkdirDiff.patches() + .then(function(patches) { + assert.equal(patches.length, 3); + }); }); - it("can find similar files in a diff", function() { + it("can pass undefined pathspec as option to indexToWorkdir", function() { + var test = this; + + return Repository.open(reposPath).then(function(repository) { + test.repository = repository; + + return repository.refreshIndex(); + }) + .then(function(index) { + test.index = index; + + return test.repository.getBranchCommit("master"); + }) + .then(function() { + var opts = { + flags: Diff.OPTION.INCLUDE_UNTRACKED | + Diff.OPTION.RECURSE_UNTRACKED_DIRS, + pathspec: undefined + }; + + // should not segfault + return Diff.indexToWorkdir(test.repository, test.index, opts); + }); + }); + + + it("can merge two commit diffs", function() { + var linesOfFirstDiff; + var linesOfSecondDiff; + var firstDiff = this.diff[0]; + var secondDiff; + var oid = "c88d39e70585199425b111c6a2c7fa7b4bc617ad"; + return this.repository.getCommit(oid) + .then(function(testCommit) { + return testCommit.getDiff(); + }) + .then(function(_secondDiff) { + secondDiff = _secondDiff[0]; + return Promise.all([ + getLinesFromDiff(firstDiff), + getLinesFromDiff(secondDiff) + ]); + }) + .then(function(listOfLines) { + linesOfFirstDiff = listOfLines[0]; + linesOfSecondDiff = listOfLines[1]; + return firstDiff.merge(secondDiff); + }) + .then(function() { + return getLinesFromDiff(firstDiff); + }) + .then(function(linesOfMergedDiff) { + var allDiffLines = _.flatten([ + linesOfFirstDiff, + linesOfSecondDiff + ]); + _.forEach(allDiffLines, function(diffLine) { + assert.ok(_.includes(linesOfMergedDiff, diffLine)); + }); + }); + }); + + describe("merge between commit diff and workdir and index diff", function() { + beforeEach(function() { + var test = this; + return fse.writeFile( + path.join(test.repository.workdir(), "newFile.txt"), "some line\n" + ) + .then(function() { + return test.index.addAll(undefined, undefined, function() { + // ensure that there is no deadlock if we call + // a sync libgit2 function from the callback + test.repository.path(); + + return 0; // confirm add + }); + }) + .then(function() { + return test.repository.getHeadCommit(); + }) + .then(function(headCommit) { + return Promise.all([ + headCommit.getTree(), + test.repository.index() + ]); + }) + .then(function([headTree, index]) { + const diffOptions = new NodeGit.DiffOptions(); + if (index.caps() & Index.CAPABILITY.IGNORE_CASE !== 0) { + diffOptions.flags |= Diff.OPTION.IGNORE_CASE; + } + + return Promise.all([ + Diff.treeToWorkdirWithIndex(test.repository, headTree, diffOptions), + test.commit.getDiffWithOptions(diffOptions) + ]); + }) + .then(function(diffs) { + test.workDirWithIndexDiff = diffs[0]; + // The second item in `diffs` is the commit diff which contains and + // array of diffs, one for each parent + test.commitDiff = diffs[1][0]; + }); + }); + + it("can merge a diff from a commit into a diff from a work dir and index", + function() { + var test = this; + var linesOfWorkDirWithIndexDiff; + var linesOfCommitDiff; + return Promise.all([ + getLinesFromDiff(test.workDirWithIndexDiff), + getLinesFromDiff(test.commitDiff) + ]) + .then(function(linesOfDiffs) { + linesOfWorkDirWithIndexDiff = linesOfDiffs[0]; + linesOfCommitDiff = linesOfDiffs[1]; + return test.workDirWithIndexDiff.merge(test.commitDiff); + }) + .then(function() { + return getLinesFromDiff(test.workDirWithIndexDiff); + }) + .then(function(linesOfMergedDiff) { + var allDiffLines = _.flatten([ + linesOfWorkDirWithIndexDiff, + linesOfCommitDiff + ]); + _.forEach(allDiffLines, function(diffLine) { + assert.ok(_.includes(linesOfMergedDiff, diffLine)); + }); + }); + }); + + it("can merge a diff from a workdir and index into a diff from a commit", + function() { + var test = this; + var linesOfWorkDirWithIndexDiff; + var linesOfCommitDiff; + return Promise.all([ + getLinesFromDiff(test.workDirWithIndexDiff), + getLinesFromDiff(test.commitDiff) + ]) + .then(function(linesOfDiffs) { + linesOfWorkDirWithIndexDiff = linesOfDiffs[0]; + linesOfCommitDiff = linesOfDiffs[1]; + return test.commitDiff.merge(test.workDirWithIndexDiff); + }) + .then(function() { + return getLinesFromDiff(test.commitDiff); + }) + .then(function(linesOfMergedDiff) { + var allDiffLines = _.flatten([ + linesOfWorkDirWithIndexDiff, + linesOfCommitDiff + ]); + _.forEach(allDiffLines, function(diffLine) { + assert.ok(_.includes(linesOfMergedDiff, diffLine)); + }); + }); + }); + }); + + // This wasn't working before. It was only passing because the promise chain + // was broken + it.skip("can find similar files in a diff", function() { var diff = this.indexToWorkdirDiff; var opts = { flags: Diff.FIND.RENAMES | @@ -213,11 +498,18 @@ describe("Diff", function() { Diff.FIND.FOR_UNTRACKED }; - assert.equal(diff.patches().length, 3); + return diff.patches() + .then(function(patches) { + assert.equal(patches.length, 3); - diff.findSimilar(opts).then(function() { - // Renamed file now treated as one diff, so 3 patches -> 2 - assert.equal(diff.patches().length, 2); - }); + return diff.findSimilar(opts); + }) + .then(function() { + return diff.patches(); + }) + .then(function(patches) { + // Renamed file now treated as one diff, so 3 patches -> 2 + assert.equal(patches.length, 2); + }); }); }); diff --git a/test/tests/filter.js b/test/tests/filter.js new file mode 100644 index 0000000000..06e138ba5d --- /dev/null +++ b/test/tests/filter.js @@ -0,0 +1,844 @@ +var assert = require("assert"); +var fse = require("fs-extra"); +var path = require("path"); +var local = path.join.bind(path, __dirname); +var garbageCollect = require("../utils/garbage_collect.js"); + +describe("Filter", function() { + var NodeGit = require("../../"); + + var emptyRepoPath = local("../repos/empty"); + var filterName = "psuedo_filter"; + var Registry = NodeGit.FilterRegistry; + var Checkout = NodeGit.Checkout; + var Repository = NodeGit.Repository; + var FilterList = NodeGit.FilterList; + var reposPath = local("../repos/workdir"); + + var packageJsonPath = path.join(reposPath, "package.json"); + var readmePath = path.join(reposPath, "README.md"); + + var mockFilter = { + apply: function() {}, + check: function() {} + }; + + function commitFile(repo, fileName, fileContent, commitMessage) { + let index; + let treeOid; + let parent; + + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(indexResult) { + index = indexResult; + }) + .then(function() { + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(parentResult) { + parent = parentResult; + return Promise.all([ + NodeGit.Signature.create("Foo Bar", "foo@bar.com", 123456789, 60), + NodeGit.Signature.create("Foo A Bar", "foo@bar.com", 987654321, 90) + ]); + }) + .then(function(signatures) { + let author = signatures[0]; + let committer = signatures[1]; + + return repo.createCommit( + "HEAD", + author, + committer, + commitMessage, + treeOid, + [parent] + ); + }); + } + + beforeEach(function() { + var test = this; + + return Repository.open(reposPath) + .then(function(repository) { + test.repository = repository; + return Repository.open(emptyRepoPath); + }) + .then(function(emptyRepo) { + test.emptyRepo = emptyRepo; + return fse.writeFile( + path.join(reposPath, ".gitattributes"), + "*.md filter=" + filterName + " -text", + { encoding: "utf-8" } + ); + }); + }); + + afterEach(function() { + return Registry.unregister(filterName) + .catch(function(error) { + if (error === NodeGit.Error.CODE.ERROR) { + throw new Error("Cannot unregister filter"); + } + }); + }); + + describe("Register", function() { + var secondFilter = "hellofilter"; + + after(function(done) { + Registry.unregister(secondFilter) + .then(function() { + done(); + }); + }); + + it("can register a filter", function() { + return Registry.register(filterName, mockFilter, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }); + }); + + it("can register multiple filters", function() { + return Registry.register(filterName, mockFilter, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return Registry.register(secondFilter, mockFilter, 1); + }) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }); + }); + + it("cannot register the same filter twice", function() { + return Registry.register(filterName, mockFilter, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return Registry.register(filterName, mockFilter, 0); + }) + .catch(function(error) { + assert.strictEqual(error.errno, NodeGit.Error.CODE.EEXISTS); + }); + }); + }); + + describe("Unregister", function() { + beforeEach(function() { + return Registry.register(filterName, mockFilter, 0); + }); + + it("can unregister the filter", function() { + return Registry.unregister(filterName) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }); + }); + + it("cannot unregister the filter twice", function() { + return Registry.unregister(filterName) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return Registry.unregister(filterName); + }) + .then(function(result) { + assert.fail("Should not have unregistered successfully"); + }) + .catch(function(error) { + assert.strictEqual(error.errno, NodeGit.Error.CODE.ENOTFOUND); + }); + }); + }); + + describe("Apply", function() { + before(function() { + var test = this; + return fse.readFile(readmePath, "utf8") + .then((function(content) { + test.originalReadmeContent = content; + })); + }); + + afterEach(function() { + this.timeout(15000); + return fse.writeFile(readmePath, this.originalReadmeContent); + }); + + var message = "some new fancy filter"; + var length = message.length; + var tempBuffer = Buffer.from(message, "utf-8"); + var largeBufferSize = 500000000; + + it("should not apply when check returns GIT_PASSTHROUGH", function(){ + var test = this; + var applied = false; + + return Registry.register(filterName, { + apply: function() { + applied = true; + }, + check: function() { + return NodeGit.Error.CODE.PASSTHROUGH; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout", + { encoding: "utf-8" } + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + assert.notStrictEqual(applied, true); + }); + }); + + it("should apply filter when check succeeds", function() { + var test = this; + var applied = false; + + return Registry.register(filterName, { + apply: function() { + applied = true; + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout", + { encoding: "utf-8" } + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + assert.strictEqual(applied, true); + }); + }); + + it("does not apply when GIT_PASSTHROUGH is returned", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.PASSTHROUGH; + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }) + .then(function() { + var readmeContent = fse.readFileSync( + packageJsonPath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout" + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + var postInitializeReadmeContents = fse.readFileSync( + readmePath, + "utf-8" + ); + + assert.notStrictEqual(postInitializeReadmeContents, message); + }); + }); + + it("applies the filter data on checkout", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); + + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: ["README.md"] + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + var postInitializeReadmeContents = fse.readFileSync( + readmePath, + "utf-8" + ); + + assert.strictEqual(postInitializeReadmeContents, message); + }); + }); + + it("can run sync callback on checkout without deadlocking", function() { // jshint ignore:line + var test = this; + var syncCallbackResult = 1; + + return Registry.register(filterName, { + apply: function() { + syncCallbackResult = test.repository.isEmpty(); + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout", + { encoding: "utf-8" } + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + assert.strictEqual(syncCallbackResult, 0); + }); + }); + + // Temporary workaround for LFS checkout. Test skipped. + // To activate when reverting workaround. + // 'Checkout.head' and 'Submodule.lookup' do work with the repo locked. + // They should work together without deadlocking. + it.skip("can run async callback on checkout without deadlocking", function() { // jshint ignore:line + var test = this; + var submoduleNameIn = "vendor/libgit2"; + var asyncCallbackResult = ""; + + return Registry.register(filterName, { + apply: function() { + return NodeGit.Submodule.lookup(test.repository, submoduleNameIn) + .then(function(submodule) { + return submodule.name(); + }) + .then(function(name) { + asyncCallbackResult = name; + return NodeGit.Error.CODE.OK; + }); + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout", + { encoding: "utf-8" } + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + assert.equal(asyncCallbackResult, submoduleNameIn); + }); + }); + + // this test is useless on 32 bit CI, because we cannot construct + // a buffer big enough to test anything of significance :)... + if (process.arch === "x64") { + it("applies the massive filter data on checkout", function() { + this.timeout(350000); + var test = this; + var largeBuffer = Buffer.alloc(largeBufferSize, "a"); + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(largeBuffer, largeBufferSize); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var fd = fse.openSync(readmePath, "r"); + var readBuf = Buffer.allocUnsafe(largeBufferSize); + var readLength = fse.readSync( + fd, + readBuf, + 0, + largeBufferSize, + 0 + ); + fse.closeSync(fd); + + assert.notStrictEqual(readLength, largeBufferSize); + fse.writeFileSync(readmePath, "whoa", "utf8"); + + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: ["README.md"] + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + var fd = fse.openSync(readmePath, "r"); + var readBuf = Buffer.allocUnsafe(largeBufferSize); + var readLength = fse.readSync( + fd, + readBuf, + 0, + largeBufferSize, + 0 + ); + fse.closeSync(fd); + + assert.strictEqual( + readLength, + largeBufferSize + ); + }); + }); + } + + it("applies the filter data on checkout with gc", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); + garbageCollect(); + + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: ["README.md"] + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + var postInitializeReadmeContents = fse.readFileSync( + readmePath, + "utf-8" + ); + + assert.strictEqual(postInitializeReadmeContents, message); + }); + }); + + it("applies the filter data on commit", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return src.path() === "README.md" ? + 0 : NodeGit.Error.CODE.PASSTHROUGH; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, "testing commit contents"); + }) + .then(function() { + return commitFile(test.repository, "README.md", + "testing commit contents", + "test commit" + ); + }) + .then(function(oid) { + return test.repository.getHeadCommit(); + }) + .then(function(commit) { + var postInitializeReadmeContents = fse.readFileSync( + readmePath, + "utf-8" + ); + + assert.strictEqual( + postInitializeReadmeContents, "testing commit contents" + ); + assert.strictEqual(commit.message(), "test commit"); + + return commit.getEntry("README.md"); + }) + .then(function(entry) { + assert.strictEqual(entry.isBlob(), true); + return entry.getBlob(); + }) + .then(function(blob) { + assert.strictEqual(blob.toString(), message); + }); + }); + + it("applies the filter data on commit with gc", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return src.path() === "README.md" ? + 0 : NodeGit.Error.CODE.PASSTHROUGH; + } + }, 0) + .then(function(result) { + garbageCollect(); + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, "testing commit contents"); + }) + .then(function() { + return commitFile(test.repository, "README.md", + "testing commit contents", + "test commit" + ); + }) + .then(function(oid) { + garbageCollect(); + return test.repository.getHeadCommit(); + }) + .then(function(commit) { + var postInitializeReadmeContents = fse.readFileSync( + readmePath, + "utf-8" + ); + + assert.strictEqual( + postInitializeReadmeContents, "testing commit contents" + ); + assert.strictEqual(commit.message(), "test commit"); + garbageCollect(); + + return commit.getEntry("README.md"); + }) + .then(function(entry) { + assert.strictEqual(entry.isBlob(), true); + return entry.getBlob(); + }) + .then(function(blob) { + assert.strictEqual(blob.toString(), message); + }); + }); + }); + + describe("Manually Apply", function() { + beforeEach(function() { + var test = this; + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "README.md" + }; + return Checkout.head(test.repository, opts) + .then(() => fse.readFile(readmePath, "utf8")) + .then((function(content) { + test.originalReadmeContent = content; + })); + }); + + afterEach(function() { + this.timeout(15000); + return fse.writeFile(readmePath, this.originalReadmeContent); + }); + + var message = "This is the filtered content, friends"; + var length = message.length; + var tempBuffer = Buffer.from(message, "utf-8"); + + it("applies the filters for a path on demand", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); + + return FilterList.load( + test.repository, + null, + "README.md", + NodeGit.Filter.MODE.CLEAN, + NodeGit.Filter.FLAG.DEFAULT + ); + }) + .then(function(list) { + return list.applyToFile(test.repository, "README.md"); + }) + .then(function(content) { + assert.equal(content, message); + }); + }); + + it("applies the filters to a buffer on demand", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); + + return FilterList.load( + test.repository, + null, + "README.md", + NodeGit.Filter.MODE.CLEAN, + NodeGit.Filter.FLAG.DEFAULT + ); + }) + .then(function(list) { + /* jshint ignore:start */ + return list.applyToData(new String("garbo garbo garbo garbo")); + /* jshint ignore:end */ + }) + .then(function(content) { + assert.equal(content, message); + }); + }); + + it("applies the filters to a blob on demand", function() { + var test = this; + var list; + + return Registry.register(filterName, { + apply: function(to, from, source) { + to.set(tempBuffer, length); + return NodeGit.Error.CODE.OK; + }, + check: function(src, attr) { + return NodeGit.Error.CODE.OK; + } + }, 0) + .then(function(result) { + assert.strictEqual(result, 0); + }) + .then(function() { + var readmeContent = fse.readFileSync( + readmePath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + fse.writeFileSync(readmePath, "whoa", "utf8"); + + return FilterList.load( + test.repository, + null, + "README.md", + NodeGit.Filter.MODE.CLEAN, + NodeGit.Filter.FLAG.DEFAULT + ); + }) + .then(function(_list) { + list = _list; + + return test.repository.getHeadCommit(); + }) + .then(function(commit) { + return commit.getTree(); + }) + .then(function(tree) { + return tree.entryByPath("README.md"); + }) + .then(function(entry) { + return test.repository.getBlob(entry.id()); + }) + .then(function(blob) { + return list.applyToBlob(blob); + }) + .then(function(content) { + assert.equal(content, message); + list = null; + }); + }); + }); + + describe("FilterSource", function() { + var message = "some new fancy filter"; + + before(function() { + var test = this; + return fse.readFile(readmePath, "utf8") + .then((function(content) { + test.originalReadmeContent = content; + })); + }); + + afterEach(function() { + this.timeout(15000); + return fse.writeFile(readmePath, this.originalReadmeContent); + }); + + it("a FilterSource has an async repo getter", function() { + var test = this; + + return Registry.register(filterName, { + apply: function(to, from, source) { + return source.repo() + .then(function() { + return NodeGit.Error.CODE.PASSTHROUGH; + }); + }, + check: function(source) { + return source.repo() + .then(function() { + return NodeGit.Error.CODE.OK; + }); + } + }, 0) + .then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + }) + .then(function() { + var readmeContent = fse.readFileSync( + packageJsonPath, + "utf-8" + ); + assert.notStrictEqual(readmeContent, message); + + return fse.writeFile( + packageJsonPath, + "Changing content to trigger checkout" + ); + }) + .then(function() { + var opts = { + checkoutStrategy: Checkout.STRATEGY.FORCE, + paths: "package.json" + }; + return Checkout.head(test.repository, opts); + }) + .then(function() { + garbageCollect(); + }); + }); + }); +}); diff --git a/test/tests/graph.js b/test/tests/graph.js index 10f4db12b9..87dcfda544 100644 --- a/test/tests/graph.js +++ b/test/tests/graph.js @@ -28,4 +28,51 @@ describe("Graph", function() { assert.equal(result.behind, 1); }); }); + + it("can tell if a commit is a descendant of another", function() { + return Graph.descendantOf( + this.repository, + "32789a79e71fbc9e04d3eff7425e1771eb595150", + "e0aeedcff0584ebe00aed2c03c8ecd10839df908" + ) + .then(function(result) { + assert.equal(result, 1); + }); + }); + + it("can tell if a commit is not a descendant of another", function() { + return Graph.descendantOf( + this.repository, + "1528a019c504c9b5a68dc7d83bb2a887eb2473af", + "32789a79e71fbc9e04d3eff7425e1771eb595150" + ) + .then(function(result) { + assert.equal(result, 0); + }); + }); + + it("descendantOf will error if provided bad commits", function() { + return Graph.descendantOf( + this.repository, + "81b06facd90fe7a6e9bbd9cee59736a79105b7be", + "26744fc697849d370246749b67ac43b792a4af0c" + ) + .catch(function(result) { + assert(~result.message.indexOf("object not found - no match for id")); + }); + }); + + it("can tell if a commit is reachable from any of a list of commits", function() { + return Graph.reachableFromAny( + this.repository, + "32789a79e71fbc9e04d3eff7425e1771eb595150", + [ + "1729c73906bb8467f4095c2f4044083016b4dfde", + "e0aeedcff0584ebe00aed2c03c8ecd10839df908" + ] + ) + .then(function(result) { + assert.equal(result, 0); + }); + }); }); diff --git a/test/tests/ignore.js b/test/tests/ignore.js new file mode 100644 index 0000000000..f834b28d0f --- /dev/null +++ b/test/tests/ignore.js @@ -0,0 +1,33 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); + +describe("Ignore", function() { + var NodeGit = require("../../"); + var Repository = NodeGit.Repository; + var Ignore = NodeGit.Ignore; + + var reposPath = local("../repos/workdir"); + + before(function() { + var test = this; + + return Repository.open(reposPath).then(function(repository) { + test.repository = repository; + }); + }); + + it("can determine if a path is ignored", function() { + function expectIgnoreState(repo, fileName, expected) { + return Ignore.pathIsIgnored(repo, fileName) + .then(function(ignored) { + assert.equal(ignored, expected); + }); + } + + return Promise.all([ + expectIgnoreState(this.repository, ".git", true), + expectIgnoreState(this.repository, "LICENSE", false) + ]); + }); +}); diff --git a/test/tests/index.js b/test/tests/index.js index f073977eb3..f3d29e7f7f 100644 --- a/test/tests/index.js +++ b/test/tests/index.js @@ -1,17 +1,14 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var Promise = require("nodegit-promise"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); - -var writeFile = promisify(function(filename, data, callback) { - return require("fs").writeFile(filename, data, {}, callback); -}); +var fse = require("fs-extra"); describe("Index", function() { + var IndexUtils = require("../utils/index_setup"); + var RepoUtils = require("../utils/repository_setup"); var NodeGit = require("../../"); var Repository = NodeGit.Repository; + var ErrorCodes = NodeGit.Error.CODE; var reposPath = local("../repos/workdir"); @@ -21,7 +18,7 @@ describe("Index", function() { return Repository.open(reposPath) .then(function(repo) { test.repository = repo; - return repo.openIndex(); + return repo.refreshIndex(); }) .then(function(index) { test.index = index; @@ -46,16 +43,27 @@ describe("Index", function() { newFile2: "and this will have more content" }; var fileNames = Object.keys(fileContent); + var test = this; + var addCallbacksCount = 0; return Promise.all(fileNames.map(function(fileName) { - return writeFile( + return fse.writeFile( path.join(repo.workdir(), fileName), - fileContent[fileName]); + fileContent[fileName], {}); })) .then(function() { - return index.addAll(); + return index.addAll(undefined, undefined, function() { + addCallbacksCount++; + // ensure that there is no deadlock if we call + // a sync libgit2 function from the callback + test.repository.path(); + + return 0; // confirm add + }); }) .then(function() { + assert.equal(addCallbacksCount, 2); + var newFiles = index.entries().filter(function(entry) { return ~fileNames.indexOf(entry.path); }); @@ -68,7 +76,7 @@ describe("Index", function() { })); }) .then(function() { - index.clear(); + return index.clear(); }); }); @@ -81,11 +89,12 @@ describe("Index", function() { differentFileName: "this has a different name and shouldn't be deleted" }; var fileNames = Object.keys(fileContent); + var removeCallbacksCount = 0; return Promise.all(fileNames.map(function(fileName) { - return writeFile( + return fse.writeFile( path.join(repo.workdir(), fileName), - fileContent[fileName]); + fileContent[fileName], {}); })) .then(function() { return index.addAll(); @@ -97,9 +106,15 @@ describe("Index", function() { assert.equal(newFiles.length, 3); - return index.removeAll("newFile*"); + return index.removeAll("newFile*", function() { + removeCallbacksCount++; + + return 0; // confirm remove + }); }) .then(function() { + assert.equal(removeCallbacksCount, 2); + var newFiles = index.entries().filter(function(entry) { return ~fileNames.indexOf(entry.path); }); @@ -112,7 +127,7 @@ describe("Index", function() { })); }) .then(function() { - index.clear(); + return index.clear(); }); }); @@ -124,11 +139,12 @@ describe("Index", function() { newFile2: "and this will have more content" }; var fileNames = Object.keys(fileContent); + var updateCallbacksCount = 0; return Promise.all(fileNames.map(function(fileName) { - return writeFile( + return fse.writeFile( path.join(repo.workdir(), fileName), - fileContent[fileName]); + fileContent[fileName], {}); })) .then(function() { return index.addAll(); @@ -143,9 +159,15 @@ describe("Index", function() { return fse.remove(path.join(repo.workdir(), fileNames[0])); }) .then(function() { - return index.updateAll("newFile*"); + return index.updateAll("newFile*", function() { + updateCallbacksCount++; + + return 0; // confirm update + }); }) .then(function() { + assert.equal(updateCallbacksCount, 1); + var newFiles = index.entries().filter(function(entry) { return ~fileNames.indexOf(entry.path); }); @@ -154,4 +176,246 @@ describe("Index", function() { return fse.remove(path.join(repo.workdir(), fileNames[1])); }); }); + + it("can get a conflict from the index", function() { + var fileName = "everyonesFile.txt"; + var rebaseReposPath = local("../repos/rebase"); + var ourBranchName = "ours"; + var theirBranchName = "theirs"; + + var baseFileContent = "How do you feel about Toll Roads?\n"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!\n"; + var theirFileContent = "I'm skeptical about Toll Roads\n"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository; + var ourCommit; + var ourBranch; + var theirBranch; + + return Repository.init(rebaseReposPath, 0) + .then(function(repo) { + repository = repo; + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "044704f62399fecbe22da6d7d47b14e52625630e"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "80111c46ac73b857a3493b24c81df08639b5de99"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b826e989aca7647bea64810f0a2a38acbbdd4c1a"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "e7fe41bf7c0c28766887a63ffe2f03f624276fbe"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "28cfeb17f66132edb3c4dacb7ff38e8dd48a1844"); + + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE + }; + + return NodeGit.Checkout.head(repository, opts); + }) + .then(function() { + return repository.mergeBranches(ourBranchName, theirBranchName); + }) + .then(function(commit) { + assert.fail(commit, undefined, + "The index should have been thrown due to merge conflicts"); + }) + .catch(function(index) { + assert.ok(index); + assert.ok(index.hasConflicts()); + + return index.conflictGet(fileName); + }) + .then(function(conflict) { + var promises = []; + + promises.push(repository.getBlob(conflict.ancestor_out.id) + .then(function(blob) { + assert.equal(blob.toString(), baseFileContent); + })); + + promises.push(repository.getBlob(conflict.our_out.id) + .then(function(blob) { + assert.equal(blob.toString(), baseFileContent + ourFileContent); + })); + + promises.push(repository.getBlob(conflict.their_out.id) + .then(function(blob) { + assert.equal(blob.toString(), baseFileContent + theirFileContent); + })); + + return Promise.all(promises); + }); + }); + + it("can add a conflict to the index", function() { + var repo; + var repoPath = local("../repos/index"); + var ourBranchName = "ours"; + var theirBranchName = "theirs"; + var fileName = "testFile.txt"; + var ancestorIndexEntry; + var ourIndexEntry; + var theirIndexEntry; + + return RepoUtils.createRepository(repoPath) + .then(function(_repo) { + repo = _repo; + return IndexUtils.createConflict( + repo, + ourBranchName, + theirBranchName, + fileName + ); + }) + .then(function(index) { + assert.ok(index.hasConflicts()); + return index.conflictGet(fileName); + }) + .then(function(indexEntries) { + // Store all indexEntries for conflict + ancestorIndexEntry = indexEntries.ancestor_out; + ourIndexEntry = indexEntries.our_out; + theirIndexEntry = indexEntries.their_out; + + // Stage conflicted file + return RepoUtils.addFileToIndex(repo, fileName); + }) + .then(function() { + return repo.index(); + }) + .then(function(index) { + assert.ok(!index.hasConflicts()); + return index.conflictAdd( + ancestorIndexEntry, + ourIndexEntry, + theirIndexEntry + ); + }) + .then(function() { + return repo.index(); + }) + .then(function(index) { + assert(index.hasConflicts()); + }); + }); + + it("can find the specified file in the index", function() { + var test = this; + + return test.index.find("src/wrapper.cc") + .then(function(position) { + assert.notEqual(position, null); + }); + }); + + it("cannot find the specified file in the index", function() { + var test = this; + + return test.index.find("src/thisisfake.cc") + .then(function(position) { + assert.fail("the item should not be found"); + }) + .catch(function(error) { + assert.strictEqual(error.errno, ErrorCodes.ENOTFOUND); + }); + }); + + it("cannot find the directory in the index", function() { + var test = this; + + return test.index.find("src") + .then(function(position) { + assert.fail("the item should not be found"); + }) + .catch(function(error) { + assert.strictEqual(error.errno, ErrorCodes.ENOTFOUND); + }); + }); + + it("can find the specified prefix in the index", function() { + var test = this; + + return test.index.findPrefix("src/") + .then(function(position) { + assert.notEqual(position, null); + }); + }); + + it("cannot find the specified prefix in the index", function() { + var test = this; + + return test.index.find("testing123/") + .then(function(position) { + assert.fail("the item should not be found"); + }) + .catch(function(error) { + assert.strictEqual(error.errno, ErrorCodes.ENOTFOUND); + }); + }); + + it("can find the prefix when a file shares the name", function() { + var test = this; + + return test.index.find("LICENSE") + .then(function(position) { + assert.notEqual(position, null); + }); + }); }); diff --git a/test/tests/merge.js b/test/tests/merge.js index b08de4bc35..a5010925b2 100644 --- a/test/tests/merge.js +++ b/test/tests/merge.js @@ -1,13 +1,11 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); -fse.ensureDir = promisify(fse.ensureDir); - describe("Merge", function() { var NodeGit = require("../../"); + var RepoUtils = require("../utils/repository_setup"); var reposPath = local("../repos/merge"); var ourBranchName = "ours"; @@ -15,13 +13,7 @@ describe("Merge", function() { beforeEach(function() { var test = this; - return fse.remove(reposPath) - .then(function() { - return fse.ensureDir(reposPath); - }) - .then(function() { - return NodeGit.Repository.init(reposPath, 0); - }) + return RepoUtils.createRepository(reposPath) .then(function(repo) { test.repository = repo; }); @@ -49,12 +41,14 @@ describe("Merge", function() { ourFileContent) // Load up the repository index and make our initial commit to HEAD .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(ourFileName); - index.write(); - + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { return index.writeTree(); }); }) @@ -85,12 +79,14 @@ describe("Merge", function() { theirFileContent); }) .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(theirFileName); - index.write(); - + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { return index.writeTree(); }); }) @@ -114,7 +110,6 @@ describe("Merge", function() { }) .then(function(index) { assert(!index.hasConflicts()); - index.write(); return index.writeTreeTo(repository); }) .then(function(oid) { @@ -154,14 +149,16 @@ describe("Merge", function() { ourFileContent) // Load up the repository index and make our initial commit to HEAD .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(ourFileName); - index.write(); - - return index.writeTree(); - }); + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), @@ -190,14 +187,16 @@ describe("Merge", function() { theirFileContent); }) .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(theirFileName); - index.write(); - - return index.writeTree(); - }); + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), @@ -242,7 +241,128 @@ describe("Merge", function() { }); }); - it("can merge cleanly using the convenience method", function() { + it("can merge --no-ff a fast-forward using the convenience method", + function() { + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var theirCommit; + var ourBranch; + var theirBranch; + + return fse.writeFile( + path.join(repository.workdir(), ourFileName), + ourFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "we made a commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + + return repository.getCommit(commitOid).then(function(commit) { + theirCommit = commit; + }); + }) + .then(function() { + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.SAFE | + NodeGit.Checkout.STRATEGY.RECREATE_MISSING + }; + return repository.checkoutBranch(ourBranchName, opts); + }) + .then(function() { + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourSignature, + NodeGit.Merge.PREFERENCE.NO_FASTFORWARD); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "65516eb7b20f51d275096cd28f132ff606a09e07"); + + return repository.getBranchCommit(ourBranchName) + .then(function(branchCommit) { + assert.equal(oid.toString(), branchCommit.toString()); + }); + }) + .then(function() { + return repository.getStatus(); + }) + .then(function(statuses) { + // make sure we didn't change the index + assert.equal(statuses.length, 0); + }); + }); + + it("can merge --no-ff a non-fast-forward using the convenience method", + function() { var initialFileName = "initialFile.txt"; var ourFileName = "ourNewFile.txt"; var theirFileName = "theirNewFile.txt"; @@ -268,14 +388,16 @@ describe("Merge", function() { initialFileContent) // Load up the repository index and make our initial commit to HEAD .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(initialFileName); - index.write(); - - return index.writeTree(); - }); + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(initialFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), @@ -306,14 +428,16 @@ describe("Merge", function() { ourFileContent); }) .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(ourFileName); - index.write(); - - return index.writeTree(); - }); + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), @@ -335,14 +459,16 @@ describe("Merge", function() { theirFileContent); }) .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(theirFileName); - index.write(); - - return index.writeTree(); - }); + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), @@ -360,168 +486,1152 @@ describe("Merge", function() { }); }) .then(function() { - return repository.mergeBranches(ourBranchName, theirBranchName, - ourSignature); + var opts = {checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE}; + return repository.checkoutBranch(ourBranchName, opts); + }) + .then(function() { + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourSignature, + NodeGit.Merge.PREFERENCE.NO_FASTFORWARD); }) .then(function(commitId) { assert.equal(commitId.toString(), - "5384feb481d9c29081b3a0c1478fcc24a3953efa"); + "96d6f1d0704eb3ef9121a13348d17c1d672c28aa"); + }) + .then(function() { + return repository.getStatus(); + }) + .then(function(statuses) { + // make sure we didn't change the index + assert.equal(statuses.length, 0); }); }); - it("can merge 2 branchs with conflicts on a single file", function () { - var baseFileContent = "All Bobs are created equal. ish.\n"; - var ourFileContent = "Big Bobs are best, IMHO.\n"; - var theirFileContent = "Nobody expects the small Bobquisition!\n"; - var finalFileContent = - "Big Bobs are beautiful, and the small are unexpected!\n"; + it( + "can merge --no-ff a non-fast-forward using the convenience method " + + "with custom merge message via sync callback", + function() { + var initialFileName = "initialFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; - var baseSignature = NodeGit.Signature.create - ("Peaceful Bob", "justchill@bob.net", 123456789, 60); - var ourSignature = NodeGit.Signature.create - ("Big Bob", "impressive@bob.net", 123456789, 60); - var theirSignature = NodeGit.Signature.create - ("Small Bob", "underestimated@bob.net", 123456789, 60); + var initialFileContent = "I'd like to drive somewhere"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; - var repository = this.repository; - var baseCommit; - var baseCommitOid; - var ourCommit; - var theirCommit; - var ourBranch; - var theirBranch; - var fileName = "newFile.txt"; + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); - return fse.writeFile(path.join(repository.workdir(), fileName), - baseFileContent) - .then(function() { - return repository.openIndex() - .then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); + var repository = this.repository; + var initialCommit; + var ourCommit; + var theirCommit; + var ourBranch; + var theirBranch; + return fse.writeFile( + path.join(repository.workdir(), initialFileName), + initialFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(initialFileName) + .then(function() { + return index.write(); + }) + .then(function() { return index.writeTree(); }); }) .then(function(oid) { assert.equal(oid.toString(), - "ea2f6521fb8097a881f43796946ac1603e1f4d75"); + "21a553813e2f670815b649eef51eeadb253a5d0c"); - return repository.createCommit("HEAD", baseSignature, - baseSignature, "bobs are all ok", oid, []); + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); }) .then(function(commitOid) { assert.equal(commitOid.toString(), - "a9b202f7612273fb3a68f718304298704eaeb735"); - baseCommitOid = commitOid; + "af66a9c799a10a23319ee4318c8bb2021521f539"); return repository.getCommit(commitOid).then(function(commit) { - baseCommit = commit; - }); - }) - .then(function() { - return repository.createBranch(ourBranchName, baseCommitOid) + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) .then(function(branch) { ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); }); + }); }) - .then(function() { - return repository.createBranch(theirBranchName, baseCommitOid) - .then(function(branch) { - theirBranch = branch; - }); + .then(function(branch) { + theirBranch = branch; }) .then(function() { - return fse.writeFile(path.join(repository.workdir(), fileName), - ourFileContent); + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); }) .then(function() { - return repository.openIndex().then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); - - return index.writeTree(); - }); + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), - "c39b1e38b09085856cec7e7ff33e90f5a537d8a5"); + "af60aa06b3537f75b427f6268a130c842c84a137"); return repository.createCommit(ourBranch.name(), ourSignature, - ourSignature, "lol big bobs :yesway:", oid, [baseCommit]); + ourSignature, "we made a commit", oid, [initialCommit]); }) .then(function(commitOid) { assert.equal(commitOid.toString(), - "935a89c09ad757a9dde2c0257f6f1e379f71816f"); + "7ce31c05427659986d50abfb90c8f7db88ef4fa1"); return repository.getCommit(commitOid).then(function(commit) { ourCommit = commit; }); }) .then(function() { - return fse.writeFile(path.join(repository.workdir(), fileName), - theirFileContent); + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); }) .then(function() { - return repository.openIndex().then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); - - return index.writeTree(); - }); + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), - "d1a894a9a4a8c820eb66c82cdd7e6b76c8f713cb"); + "f007361737a2ca00a0e80fc2daf55064463173b4"); return repository.createCommit(theirBranch.name(), theirSignature, - theirSignature, "lol big bobs :poop:", oid, [baseCommit]); + theirSignature, "they made a commit", oid, [initialCommit]); }) .then(function(commitOid) { assert.equal(commitOid.toString(), - "bebb9ec2e0684c7cb7c1e1601c7d5a8f52b8b123"); + "b588f0eef1809226f8f7db542940749da15ae1de"); return repository.getCommit(commitOid).then(function(commit) { theirCommit = commit; }); }) .then(function() { - return NodeGit.Reference.lookup(repository, "HEAD") - .then(function(head) { - return head.symbolicSetTarget(ourBranch.name(), ourSignature, ""); - }); + var opts = {checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE}; + return repository.checkoutBranch(ourBranchName, opts); }) .then(function() { - return NodeGit.Merge.commits(repository, ourCommit, theirCommit, null); + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourSignature, + NodeGit.Merge.PREFERENCE.NO_FASTFORWARD, + null, + { + processMergeMessageCallback: function(message) { + assert(message === "Merge branch 'theirs' into ours"); + return "We manipulated the message, HAH."; + } + } + ); }) - .then(function(index) { - assert(index.hasConflicts()); - fse.writeFileSync(path.join(repository.workdir(), fileName), - finalFileContent); + .then(function(commitId) { + assert.equal(commitId.toString(), + "5b49a43be0ba95e7767dd9a2880bab4795c6db70"); }) .then(function() { - return repository.openIndex().then(function(index) { - index.read(1); - index.addByPath(fileName); - index.write(); + return repository.getStatus(); + }) + .then(function(statuses) { + // make sure we didn't change the index + assert.equal(statuses.length, 0); + }); + } + ); - return index.writeTree(); - }); + it( + "can merge --no-ff a non-fast-forward using the convenience method " + + "with custom merge message via async callback", + function() { + var initialFileName = "initialFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var initialFileContent = "I'd like to drive somewhere"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var initialCommit; + var ourCommit; + var theirCommit; + var ourBranch; + var theirBranch; + + return fse.writeFile( + path.join(repository.workdir(), initialFileName), + initialFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(initialFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); }) .then(function(oid) { assert.equal(oid.toString(), - "b1cd49a27cd33b99ab6dad2fb82b3174812a8b47"); + "21a553813e2f670815b649eef51eeadb253a5d0c"); - return repository.createCommit(ourBranch.name(), baseSignature, - baseSignature, "Stop this bob sized fued", oid, - [ourCommit, theirCommit]); + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "af66a9c799a10a23319ee4318c8bb2021521f539"); + + return repository.getCommit(commitOid).then(function(commit) { + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "af60aa06b3537f75b427f6268a130c842c84a137"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "7ce31c05427659986d50abfb90c8f7db88ef4fa1"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "f007361737a2ca00a0e80fc2daf55064463173b4"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b588f0eef1809226f8f7db542940749da15ae1de"); + + return repository.getCommit(commitOid).then(function(commit) { + theirCommit = commit; + }); + }) + .then(function() { + var opts = {checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE}; + return repository.checkoutBranch(ourBranchName, opts); + }) + .then(function() { + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourSignature, + NodeGit.Merge.PREFERENCE.NO_FASTFORWARD, + null, + { + processMergeMessageCallback: function(message) { + assert(message === "Merge branch 'theirs' into ours"); + return Promise.resolve("We manipulated the message, HAH."); + } + } + ); + }) + .then(function(commitId) { + assert.equal(commitId.toString(), + "5b49a43be0ba95e7767dd9a2880bab4795c6db70"); + }) + .then(function() { + return repository.getStatus(); + }) + .then(function(statuses) { + // make sure we didn't change the index + assert.equal(statuses.length, 0); + }); + } + ); + + it("can merge --ff-only a fast-forward using the convenience method", + function() { + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var theirCommit; + var ourBranch; + var theirBranch; + + return fse.writeFile( + path.join(repository.workdir(), ourFileName), + ourFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "we made a commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + + return repository.getCommit(commitOid).then(function(commit) { + theirCommit = commit; + }); + }) + .then(function() { + var opts = {checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE}; + return repository.checkoutBranch(ourBranchName, opts); + }) + .then(function() { + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourSignature, + NodeGit.Merge.PREFERENCE.FASTFORWARD_ONLY); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + + return repository.getBranchCommit(ourBranchName) + .then(function(branchCommit) { + assert.equal(oid.toString(), branchCommit.toString()); + }); + }) + .then(function() { + return repository.getStatus(); + }) + .then(function(statuses) { + // make sure we didn't change the index + assert.equal(statuses.length, 0); + }); + }); + + it("doesn't merge --ff-only a non-fast-forward using the convenience method", + function() { + var initialFileName = "initialFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var initialFileContent = "I'd like to drive somewhere"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var initialCommit; + var ourCommit; + var theirCommit; + var ourBranch; + var theirBranch; + + return fse.writeFile( + path.join(repository.workdir(), initialFileName), + initialFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(initialFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "21a553813e2f670815b649eef51eeadb253a5d0c"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "af66a9c799a10a23319ee4318c8bb2021521f539"); + + return repository.getCommit(commitOid).then(function(commit) { + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "af60aa06b3537f75b427f6268a130c842c84a137"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "7ce31c05427659986d50abfb90c8f7db88ef4fa1"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "f007361737a2ca00a0e80fc2daf55064463173b4"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b588f0eef1809226f8f7db542940749da15ae1de"); + + return repository.getCommit(commitOid).then(function(commit) { + theirCommit = commit; + }); + }) + .then(function() { + var opts = {checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE}; + return repository.checkoutBranch(ourBranchName, opts); + }) + .then(function() { + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourSignature, + NodeGit.Merge.PREFERENCE.FASTFORWARD_ONLY); + }) + .then(function(commitId) { + assert.equal(commitId.toString(), + "7ce31c05427659986d50abfb90c8f7db88ef4fa1"); + }) + .then(function() { + return repository.getStatus(); + }) + .then(function(statuses) { + // make sure we didn't change the index + assert.equal(statuses.length, 0); + }); + }); + + it("can merge cleanly using the convenience method", function() { + var initialFileName = "initialFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var initialFileContent = "I'd like to drive somewhere"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var initialCommit; + var ourCommit; + var theirCommit; + var ourBranch; + var theirBranch; + + return fse.writeFile( + path.join(repository.workdir(), initialFileName), + initialFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(initialFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "21a553813e2f670815b649eef51eeadb253a5d0c"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "af66a9c799a10a23319ee4318c8bb2021521f539"); + + return repository.getCommit(commitOid).then(function(commit) { + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(ourFileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "af60aa06b3537f75b427f6268a130c842c84a137"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "7ce31c05427659986d50abfb90c8f7db88ef4fa1"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(theirFileName) + .then(function() { + return index.write(); + }) + .then(function(){ + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "f007361737a2ca00a0e80fc2daf55064463173b4"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b588f0eef1809226f8f7db542940749da15ae1de"); + + return repository.getCommit(commitOid).then(function(commit) { + theirCommit = commit; + }); + }) + .then(function() { + return repository.mergeBranches(ourBranchName, theirBranchName, + ourSignature); + }) + .then(function(commitId) { + assert.equal(commitId.toString(), + "96d6f1d0704eb3ef9121a13348d17c1d672c28aa"); + }); + }); + + it("can merge 2 branchs with conflicts on a single file", function () { + var baseFileContent = "All Bobs are created equal. ish.\n"; + var ourFileContent = "Big Bobs are best, IMHO.\n"; + var theirFileContent = "Nobody expects the small Bobquisition!\n"; + var finalFileContent = + "Big Bobs are beautiful, and the small are unexpected!\n"; + + var baseSignature = NodeGit.Signature.create + ("Peaceful Bob", "justchill@bob.net", 123456789, 60); + var ourSignature = NodeGit.Signature.create + ("Big Bob", "impressive@bob.net", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Small Bob", "underestimated@bob.net", 123456789, 60); + + var repository = this.repository; + var baseCommit; + var baseCommitOid; + var ourCommit; + var theirCommit; + var ourBranch; + var theirBranch; + var fileName = "newFile.txt"; + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "ea2f6521fb8097a881f43796946ac1603e1f4d75"); + + return repository.createCommit("HEAD", baseSignature, + baseSignature, "bobs are all ok", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "a9b202f7612273fb3a68f718304298704eaeb735"); + baseCommitOid = commitOid; + + return repository.getCommit(commitOid).then(function(commit) { + baseCommit = commit; + }); + }) + .then(function() { + return repository.createBranch(ourBranchName, baseCommitOid) + .then(function(branch) { + ourBranch = branch; + }); + }) + .then(function() { + return repository.createBranch(theirBranchName, baseCommitOid) + .then(function(branch) { + theirBranch = branch; + }); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), fileName), + ourFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "c39b1e38b09085856cec7e7ff33e90f5a537d8a5"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "lol big bobs :yesway:", oid, [baseCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "935a89c09ad757a9dde2c0257f6f1e379f71816f"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), fileName), + theirFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "d1a894a9a4a8c820eb66c82cdd7e6b76c8f713cb"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "lol big bobs :poop:", oid, [baseCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "bebb9ec2e0684c7cb7c1e1601c7d5a8f52b8b123"); + + return repository.getCommit(commitOid).then(function(commit) { + theirCommit = commit; + }); + }) + .then(function() { + return NodeGit.Reference.lookup(repository, "HEAD") + .then(function(head) { + return head.symbolicSetTarget(ourBranch.name(), ""); + }); + }) + .then(function() { + return NodeGit.Merge.commits(repository, ourCommit, theirCommit, null); + }) + .then(function(index) { + assert(index.hasConflicts()); + fse.writeFileSync(path.join(repository.workdir(), fileName), + finalFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b1cd49a27cd33b99ab6dad2fb82b3174812a8b47"); + + return repository.createCommit(ourBranch.name(), baseSignature, + baseSignature, "Stop this bob sized fued", oid, + [ourCommit, theirCommit]); }) .then(function(commitId) { assert.equal(commitId.toString(), "49014ccabf5125f9b69316acde36f891dfdb8b5c"); }); }); + + it("leaves repo in MERGE state after a standard merge with conflicts fails", + function() { + var fileName = "everyonesFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?\n"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!\n"; + var theirFileContent = "I'm skeptical about Toll Roads\n"; + + var expectedConflictedFileContent = + "How do you feel about Toll Roads?\n" + + "<<<<<<< HEAD\n" + + "I like Toll Roads. I have an EZ-Pass!\n" + + "=======\n" + + "I'm skeptical about Toll Roads\n" + + ">>>>>>> theirs\n"; + + var conflictSolvedFileContent = + "How do you feel about Toll Roads?\n" + + "He's skeptical about Toll Roads,\n" + + "but I like Toll Roads. I have an EZ-Pass!\n"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var initialCommit; + var ourBranch; + var theirBranch; + + var repoGitPath = repository.path(); + if (!~repoGitPath.indexOf("/.git")) { + repoGitPath = path.join(repoGitPath, ".git"); + } + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "044704f62399fecbe22da6d7d47b14e52625630e"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "80111c46ac73b857a3493b24c81df08639b5de99"); + + return repository.getCommit(commitOid).then(function(commit) { + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + theirFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b826e989aca7647bea64810f0a2a38acbbdd4c1a"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + ourFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "e7fe41bf7c0c28766887a63ffe2f03f624276fbe"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "28cfeb17f66132edb3c4dacb7ff38e8dd48a1844"); + + //return repository.getCommit(commitOid) + + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE + }; + + return repository.checkoutBranch(ourBranchName, opts); + }) + .then(function() { + return repository.getHeadCommit(); + }) + .then(function(commit) { + assert.equal(commit.id().toString(), + "28cfeb17f66132edb3c4dacb7ff38e8dd48a1844"); + + return repository.getReference(theirBranchName); + }) + .then(function(theirRef) { + return NodeGit.AnnotatedCommit.fromRef(repository, theirRef); + }) + .then(function(theirAnnotatedCommit) { + return NodeGit.Merge(repository, theirAnnotatedCommit); + }) + .then(function() { + assert.equal(repository.state(), + NodeGit.Repository.STATE.MERGE); + // verify the convenience method + assert.ok(repository.isMerging()); + + assert.ok(fse.existsSync(path.join(repoGitPath, "MERGE_HEAD"))); + assert.ok(fse.existsSync(path.join(repoGitPath, "MERGE_MSG"))); + assert.ok(fse.existsSync(path.join(repoGitPath, "MERGE_MODE"))); + + return fse.readFile(path.join(repoGitPath, "MERGE_HEAD"), "utf-8"); + }) + .then(function(mergeHeadContents) { + assert.equal(mergeHeadContents, + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0\n"); + + return fse.readFile(path.join(repository.workdir(), fileName), "utf-8"); + }) + .then(function(fileContent) { + assert.equal(fileContent, expectedConflictedFileContent); + + return fse.writeFile(path.join(repository.workdir(), fileName), + conflictSolvedFileContent); + }) + .then(function() { + return repository.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + return Promise.all([ + repository.getBranchCommit(ourBranchName), + repository.getBranchCommit("MERGE_HEAD") + ]) + .then(function(commits) { + var msg = fse.readFileSync(path.join(repoGitPath, "MERGE_MSG"), + "utf-8"); + assert.ok(msg); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, msg, oid, [commits[0], commits[1]]); + }); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "8221726e3f96e3d3e0258f655e107383dc3c7335"); + + // merge isn't cleaned up automatically + assert.ok(fse.existsSync(path.join(repoGitPath, "MERGE_HEAD"))); + assert.ok(fse.existsSync(path.join(repoGitPath, "MERGE_MSG"))); + assert.ok(fse.existsSync(path.join(repoGitPath, "MERGE_MODE"))); + + assert.equal(repository.stateCleanup(), 0); + + assert.ok(!fse.existsSync(path.join(repoGitPath, "MERGE_HEAD"))); + assert.ok(!fse.existsSync(path.join(repoGitPath, "MERGE_MSG"))); + assert.ok(!fse.existsSync(path.join(repoGitPath, "MERGE_MODE"))); + + assert.equal(repository.state(), + NodeGit.Repository.STATE.NONE); + // verify the convenience method + assert.ok(repository.isDefaultState()); + }); + }); + + it("can retrieve error code on if common merge base not found", function() { + var repo; + return NodeGit.Repository.open(local("../repos/workdir")) + .then(function(r) { + repo = r; + return repo.getCommit("4bd806114ce26503c103c85dcc985021951bbc18"); + }) + .then(function(commit) { + return commit.getParents(commit.parentcount()); + }) + .then(function(parents) { + return NodeGit.Merge.base(repo, parents[0], parents[1]) + .then(function() { + return Promise.reject(new Error( + "should not be able to retrieve common merge base")); + }, function(err) { + assert.equal("no merge base found", err.message); + assert.equal("Merge.base", err.errorFunction); + assert.equal(NodeGit.Error.CODE.ENOTFOUND, err.errno); + }); + }); + }); }); diff --git a/test/tests/note.js b/test/tests/note.js index 1624714e7c..9622c667de 100644 --- a/test/tests/note.js +++ b/test/tests/note.js @@ -6,7 +6,7 @@ describe("Note", function() { var NodeGit = require("../../"); var Note = NodeGit.Note; var Signature = NodeGit.Signature; - var reposPath = local("../../"); + var reposPath = local("../repos/workdir"); beforeEach(function() { var test = this; @@ -15,7 +15,7 @@ describe("Note", function() { test.repository = repository; return repository.getMasterCommit().then(function(commit) { - test.commit = commit; + test.commit = commit; }); }); }); @@ -58,12 +58,14 @@ describe("Note", function() { var noteRef = "refs/notes/commits"; var sig = Signature.create("John", "john@doe.com", Date.now(), 0); - return Note.remove(this.repository, noteRef, sig, sig, sha) + Note.create(this.repository, noteRef, sig, sig, sha, "Testing!", 1) + .then((noteSha) => Note.remove(this.repository, noteRef, sig, sig, sha)) .then(function() { return Note.read(test.repository, noteRef, sha).catch(function(ex) { - assert.equal(ex.message, "Note could not be found"); + assert.equal(ex.message, "note could not be found"); done(); }); - }); + }) + .catch(done); }); }); diff --git a/test/tests/oid.js b/test/tests/oid.js index 7ec57631d8..4c2fbcdad3 100644 --- a/test/tests/oid.js +++ b/test/tests/oid.js @@ -2,6 +2,8 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); +var leakTest = require("../utils/leak_test"); + describe("Oid", function() { var NodeGit = require("../../"); var Oid = NodeGit.Oid; @@ -43,4 +45,51 @@ describe("Oid", function() { assert.equal(commits[0].toString(), oid); }); }); + + it("can compare two identical oids", function() { + assert.equal(this.oid.cmp(this.oid), 0); + }); + + it("can compare two different oids", function() { + var oid2 = Oid.fromString("13c633665257696a3800b0a39ff636b4593f918f"); + assert.notEqual(this.oid.cmp(oid2), 0); + }); + + it("can compare the first chunk of two identical oids", function() { + assert.equal(this.oid.ncmp(this.oid, 5), 0); + }); + + it("can compare the first chunk of two different oids", function() { + var oid2 = Oid.fromString("13c633665257696a3800b0a39ff636b4593f918f"); + assert.notEqual(this.oid.ncmp(oid2, 5), 0); + }); + + it("can check the equality of two identical oids", function() { + assert(this.oid.equal(this.oid)); + }); + + it("can check the equality of two different oids", function() { + var oid2 = Oid.fromString("13c633665257696a3800b0a39ff636b4593f918f"); + assert(!this.oid.equal(oid2)); + }); + + it("does not leak constructed Oid", function() { + return leakTest(Oid, function() { + return Promise.resolve( + Oid.fromString("13c633665257696a3800b0a39ff636b4593f918f") + ); + }); + }); + + it("does not leak owned Oid", function() { + return leakTest(Oid, function() { + return NodeGit.Repository.open(local("../repos/workdir")) + .then(function(repo) { + return NodeGit.Commit.lookup(repo, oid); + }) + .then(function(commit) { + return commit.id(); + }); + }); + }); }); diff --git a/test/tests/patch.js b/test/tests/patch.js new file mode 100644 index 0000000000..fe7fe3734a --- /dev/null +++ b/test/tests/patch.js @@ -0,0 +1,109 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); + +describe("Patch", function() { + var NodeGit = require("../../"); + var Repository = NodeGit.Repository; + + var reposPath = local("../repos/workdir"); + var oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; + + beforeEach(function() { + var test = this; + + return Repository.open(reposPath).then(function(repository) { + test.repository = repository; + + return repository.refreshIndex(); + }) + .then(function(index) { + test.index = index; + + return test.repository.getBranchCommit("master"); + }) + .then(function(masterCommit) { + return masterCommit.getTree(); + }) + .then(function(tree) { + test.masterCommitTree = tree; + + return test.repository.getCommit(oid); + }) + .then(function(commit) { + test.commit = commit; + + return commit.getDiff(); + }) + .then(function(diff) { + test.diff = diff; + + return diff[0].patches(); + }) + .catch(function(e) { + return Promise.reject(e); + }); + }); + + it("retrieve the line stats of a patch", function() { + return this.diff[0].patches() + .then(function(patches) { + var patch = patches[0]; + var lineStats = patch.lineStats(); + + assert.equal(patch.oldFile().path(), "README.md"); + assert.equal(patch.newFile().path(), "README.md"); + assert.equal(patch.size(), 1); + assert.ok(patch.isModified()); + assert.equal(lineStats.total_context, 3); + assert.equal(lineStats.total_additions, 1); + assert.equal(lineStats.total_deletions, 1); + }); + + }); + + it("can generate patch from blobs", function() { + // Generates a patch for README.md from commit + // fce88902e66c72b5b93e75bdb5ae717038b221f6 + const file = "README.md"; + + return NodeGit.Blob.lookup( + this.repository, + "b252f396b17661462372f78b7bcfc403b8731aaa" + ).then(blob => { + return NodeGit.Blob.lookup( + this.repository, + "b8d014998072c3f9e4b7eba8486011e80d8de98a" + ).then(oldBlob => { + return NodeGit.Patch.fromBlobs(oldBlob, file, blob, file) + .then(patch => { + assert.strictEqual(patch.size(0, 0, 0), 254); + }); + }); + }); + }); + + it("can generate patch from blobs without 'old_blob'", function() { + // Generates a patch for README.md from commit + // fce88902e66c72b5b93e75bdb5ae717038b221f6 without + // old_blob. Should show all lines as additions. + const file = "README.md"; + + return NodeGit.Blob.lookup( + this.repository, + "b252f396b17661462372f78b7bcfc403b8731aaa" + ).then(blob => { + return NodeGit.Patch.fromBlobs(null, file, blob, file) + .then(patch => { + assert.strictEqual(patch.size(0, 0, 0), 8905); + }); + }); + }); + + it("can generate patch from blobs without arguments", function() { + return NodeGit.Patch.fromBlobs() + .then(patch => { + assert.strictEqual(patch.size(0, 0, 0), 0); + }); + }); +}); diff --git a/test/tests/rebase.js b/test/tests/rebase.js new file mode 100644 index 0000000000..d9aae1fbce --- /dev/null +++ b/test/tests/rebase.js @@ -0,0 +1,2543 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); +var fse = require("fs-extra"); + +var garbageCollect = require("../utils/garbage_collect.js"); + +const isNode8 = process.versions.node.split(".")[0] === "8"; + +describe("Rebase", function() { + var NodeGit = require("../../"); + var Checkout = NodeGit.Checkout; + var Merge = NodeGit.Merge; + var RepoUtils = require("../utils/repository_setup"); + + var repoPath = local("../repos/rebase"); + var ourBranchName = "ours"; + var theirBranchName = "theirs"; + + var removeFileFromIndex = function(repository, fileName) { + return repository.refreshIndex() + .then(function(index) { + return index.removeByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }); + }; + + beforeEach(function() { + var test = this; + return RepoUtils.createRepository(repoPath) + .then(function(repo) { + test.repository = repo; + }); + }); + + after(function() { + return fse.remove(repoPath); + }); + + it("can cleanly fast-forward via rebase", function() { + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var theirBranch; + + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "we made a commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + }) + .then(function() { + // unstage changes so that we can begin a rebase + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + assert.equal(theirAnnotatedCommit.id().toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, theirAnnotatedCommit); + }) + .then(function(rebase) { + assert.equal(rebase.operationEntrycount(), 0); + + return rebase.finish(ourSignature); + }) + .then(function() { + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + assert.equal(commit.id().toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + }); + }); + + it("can cleanly rebase a branch in-memory", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + var rebaseOptions = new NodeGit.RebaseOptions(); + rebaseOptions.inmemory = 1; + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, undefined, rebaseOptions); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has NOT moved. + // In-memory rebase does not touch refs. + assert.equal(commit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Lookup the new commit + return NodeGit.Commit.lookup(repository, + "b937100ee0ea17ef20525306763505a7fe2be29e"); + }) + .then(function(commit) { + // Lookup the parent of our new commit + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + }); + }); + + it("can cleanly rebase a branch onto another branch", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + }); + }); + + it("can rebase 2 branches with conflicts on a single file", function() { + var fileName = "everyonesFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?\n"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!\n"; + var theirFileContent = "I'm skeptical about Toll Roads\n"; + + var expectedConflictedFileContent = + "How do you feel about Toll Roads?\n" + + "<<<<<<< theirs\n" + + "I'm skeptical about Toll Roads\n" + + "=======\n" + + "I like Toll Roads. I have an EZ-Pass!\n" + + ">>>>>>> we made a commit\n"; + + var conflictSolvedFileContent = + "How do you feel about Toll Roads?\n" + + "He's skeptical about Toll Roads,\n" + + "but I like Toll Roads. I have an EZ-Pass!\n"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "044704f62399fecbe22da6d7d47b14e52625630e"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "80111c46ac73b857a3493b24c81df08639b5de99"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b826e989aca7647bea64810f0a2a38acbbdd4c1a"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "e7fe41bf7c0c28766887a63ffe2f03f624276fbe"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "28cfeb17f66132edb3c4dacb7ff38e8dd48a1844"); + + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE + }; + + return NodeGit.Checkout.head(repository, opts); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "28cfeb17f66132edb3c4dacb7ff38e8dd48a1844"); + assert.equal(theirAnnotatedCommit.id().toString(), + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "28cfeb17f66132edb3c4dacb7ff38e8dd48a1844"); + + return repository.refreshIndex() + .then(function(index) { + assert.ok(index.hasConflicts()); + }); + }) + .then(function() { + return fse.readFile(path.join(repository.workdir(), fileName), "utf8") + .then(function(fileContent) { + assert.equal(fileContent, expectedConflictedFileContent); + + return fse.writeFile(path.join(repository.workdir(), fileName), + conflictSolvedFileContent); + }); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + return repository.refreshIndex() + .then(function(index) { + assert.ok(!index.hasConflicts()); + + return rebase.commit(null, ourSignature); + }); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "ef6d0e95167435b3d58f51ab165948c72f6f94b6"); + + return rebase.finish(ourSignature); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "ef6d0e95167435b3d58f51ab165948c72f6f94b6"); + + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); + }); + }); + + it("can abort an in-progress rebase", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + return repository.getBranchCommit("HEAD") + .then(function(commit) { + // verify that HEAD is on the rebased commit + assert.equal(commit.id().toString(), commitOid.toString()); + }); + }) + .then(function() { + return rebase.abort(); + }) + .then(function() { + return NodeGit.Rebase.open(repository) + .then(function(existingRebase) { + assert.fail(existingRebase, undefined, + "There should not be a rebase in progress"); + }) + .catch(function(e) { + assert.equal(e.message, "there is no rebase in progress"); + }); + }) + .then(function() { + return Promise.all([ + repository.getBranchCommit("HEAD"), + repository.getBranchCommit(ourBranchName) + ]); + }) + .then(function(commits) { + assert.equal(commits.length, 2); + + // verify that 'HEAD' and 'ours' are back to their pre-rebase state + assert.equal(commits[0].id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(commits[1].id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + }); + }); + + it("can fast-forward via rebase using the convenience methods", + function() { + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var theirBranch; + + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "we made a commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + }) + .then(function() { + // unstage changes so that we can begin a rebase + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + assert.equal(theirAnnotatedCommit.id().toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return repository.rebaseBranches(ourBranchName, theirBranchName, null, + ourSignature); + }) + .then(function(commit) { + assert.equal(commit.id().toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + }); + }); + + it( + "can fast-forward a merge commit via rebase using the " + + "convenience methods that has a beforeFinishFn", + function() { + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + var theirOtherFileName = "antherNewFile.txt"; + + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + var theirOtherFileContent = "This is some more content, guys!"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + var theirOtherSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456999, 60); + var ourMergeSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456889, 60); + + var repository = this.repository; + var ourCommit; + var theirCommit; + var theirBranch; + var ourBranch; + + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "we made a commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + theirCommit = commitOid; + assert.equal(commitOid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + }) + .then(function() { + return repository.checkoutBranch( + ourBranch, + { checkoutStrategy: Checkout.STRATEGY.FORCE } + ); + }) + .then(function() { + return repository.mergeBranches( + ourBranchName, + theirBranchName, + ourMergeSignature, + Merge.PREFERENCE.NO_FASTFORWARD + ); + }) + .then(function() { + return repository.getHeadCommit(); + }) + .then(function(headCommit) { + assert.notEqual(ourCommit.id().toString(), headCommit.id().toString()); + }) + .then(function() { + return repository.checkoutBranch( + theirBranch, + { checkoutStrategy: Checkout.STRATEGY.FORCE } + ); + }) + .then(function() { + return fse.writeFile( + path.join(repository.workdir(), theirOtherFileName), + theirOtherFileContent + ); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirOtherFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "c242b53f2c9446544cf9bdac7e8ed6ce583226cb"); + + return repository.createCommit(theirBranch.name(), theirOtherSignature, + theirOtherSignature, "they made another commit", oid, [theirCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "8fa0ce25a2accf464b004ddeeb63add7b816b627"); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "0d1d322b59df68bac6eea6a2a189f974cb590368"); + assert.equal(theirAnnotatedCommit.id().toString(), + "8fa0ce25a2accf464b004ddeeb63add7b816b627"); + + return repository.rebaseBranches( + ourBranchName, + theirBranchName, + null, + ourSignature, + null, + function(rebaseData) { + assert.equal(rebaseData.rewritten, null); + } + ); + }) + .then(function(commit) { + assert.equal(commit.id().toString(), + "8fa0ce25a2accf464b004ddeeb63add7b816b627"); + }); + }); + + it("can rebase using the convenience method", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + + var nextCalls = 0; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return repository.rebaseBranches(ourBranchName, theirBranchName, + null, ourSignature, function(rebase) { + assert.ok(rebase instanceof NodeGit.Rebase); + + nextCalls++; + + return Promise.resolve(); + }); + }) + .then(function(commit) { + // verify that the beforeNextFn callback was called + assert.equal(nextCalls, 2); + + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + }); + }); + + it("beforeFinishFn sync callback receives correct rebase data", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var ourBranchShaPreRebase; + var ourBranchShaPostRebase = "b937100ee0ea17ef20525306763505a7fe2be29e"; + var theirBranchSha; + + var nextCalls = 0; + + var calledBeforeFinishFn = false; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + theirBranchSha = commitOid.toString(); + assert.equal(theirBranchSha, + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + ourBranchShaPreRebase = commitOid.toString(); + assert.equal(ourBranchShaPreRebase, + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return repository.rebaseBranches(ourBranchName, theirBranchName, + null, ourSignature, function(rebase) { + assert.ok(rebase instanceof NodeGit.Rebase); + + nextCalls++; + + return Promise.resolve(); + }, function(rebaseMetadata) { + calledBeforeFinishFn = true; + + assert.equal(rebaseMetadata.ontoName, theirBranchName); + assert.equal(rebaseMetadata.ontoSha, theirBranchSha); + assert.equal(rebaseMetadata.originalHeadName, ourBranchName); + assert.equal( + rebaseMetadata.originalHeadSha, + ourBranchShaPreRebase + ); + assert.deepEqual( + rebaseMetadata.rewritten, + [[ourBranchShaPreRebase, ourBranchShaPostRebase]] + ); + }); + }) + .then(function(commit) { + // verify that the beforeNextFn callback was called + assert.equal(nextCalls, 2); + + // verify that the beforeFinishFn callback was called + assert(calledBeforeFinishFn, "beforeFinishFn was not called"); + + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), ourBranchShaPostRebase); + + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + }); + }); + + it("beforeFinishFn async callback receives correct rebase data", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var ourBranchShaPreRebase; + var ourBranchShaPostRebase = "b937100ee0ea17ef20525306763505a7fe2be29e"; + var theirBranchSha; + + var nextCalls = 0; + + var calledBeforeFinishFn = false; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + theirBranchSha = commitOid.toString(); + assert.equal(theirBranchSha, + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + ourBranchShaPreRebase = commitOid.toString(); + assert.equal(ourBranchShaPreRebase, + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return repository.rebaseBranches(ourBranchName, theirBranchName, + null, ourSignature, function(rebase) { + assert.ok(rebase instanceof NodeGit.Rebase); + + nextCalls++; + + return Promise.resolve(); + }, function(rebaseMetadata) { + calledBeforeFinishFn = true; + + assert.equal(rebaseMetadata.ontoName, theirBranchName); + assert.equal(rebaseMetadata.ontoSha, theirBranchSha); + assert.equal(rebaseMetadata.originalHeadName, ourBranchName); + assert.equal( + rebaseMetadata.originalHeadSha, + ourBranchShaPreRebase + ); + assert.deepEqual( + rebaseMetadata.rewritten, + [[ourBranchShaPreRebase, ourBranchShaPostRebase]] + ); + + return Promise.resolve(); + }); + }) + .then(function(commit) { + // verify that the beforeNextFn callback was called + assert.equal(nextCalls, 2); + + // verify that the beforeFinishFn callback was called + assert(calledBeforeFinishFn, "beforeFinishFn was not called"); + + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), ourBranchShaPostRebase); + + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + }); + }); + + it("can rebase with conflicts using the convenience methods", function() { + var fileName = "everyonesFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?\n"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!\n"; + var theirFileContent = "I'm skeptical about Toll Roads\n"; + + var expectedConflictedFileContent = + "How do you feel about Toll Roads?\n" + + "<<<<<<< theirs\n" + + "I'm skeptical about Toll Roads\n" + + "=======\n" + + "I like Toll Roads. I have an EZ-Pass!\n" + + ">>>>>>> we made a commit\n"; + + var conflictSolvedFileContent = + "How do you feel about Toll Roads?\n" + + "He's skeptical about Toll Roads,\n" + + "but I like Toll Roads. I have an EZ-Pass!\n"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var nextCalls=0; + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "044704f62399fecbe22da6d7d47b14e52625630e"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "80111c46ac73b857a3493b24c81df08639b5de99"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b826e989aca7647bea64810f0a2a38acbbdd4c1a"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); + + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "e7fe41bf7c0c28766887a63ffe2f03f624276fbe"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "28cfeb17f66132edb3c4dacb7ff38e8dd48a1844"); + + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE + }; + + return NodeGit.Checkout.head(repository, opts); + }) + .then(function() { + return repository.rebaseBranches(ourBranchName, theirBranchName, + null, ourSignature) + .then(function(commit) { + assert.fail(commit, undefined, + "The index should have been thrown due to merge conflicts"); + }) + .catch(function(index) { + assert.ok(index); + assert.ok(index.hasConflicts()); + + assert.ok(repository.isRebasing()); + }); + }) + .then(function() { + return fse.readFile(path.join(repository.workdir(), fileName), "utf8") + .then(function(fileContent) { + assert.equal(fileContent, expectedConflictedFileContent); + + return fse.writeFile(path.join(repository.workdir(), fileName), + conflictSolvedFileContent); + }); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + return repository.refreshIndex() + .then(function(index) { + assert.ok(!index.hasConflicts()); + + return repository.continueRebase(ourSignature, function(rebase) { + assert.ok(rebase instanceof NodeGit.Rebase); + + nextCalls++; + + return Promise.resolve(); + }); + }); + }) + .then(function(commit) { + // verify that the beforeNextFn callback was called + assert.equal(nextCalls, 1); + + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "ef6d0e95167435b3d58f51ab165948c72f6f94b6"); + + assert.ok(!repository.isRebasing()); + assert.ok(repository.isDefaultState()); + + return commit.parent(0); + }) + .then(function(commit) { + // verify that we are on top of "their commit" + assert.equal(commit.id().toString(), + "b3c355bb606ec7da87174dfa1a0b0c0e3dc97bc0"); + }); + }); + + if (!isNode8) { + it("can sign commits during the rebase", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: (commitContent) => ({ + code: NodeGit.Error.CODE.OK, + field: "moose-sig", + signedData: "A moose was here." + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "617cd03370dd799f372e9dcfcd0b097aede1bd7f"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "617cd03370dd799f372e9dcfcd0b097aede1bd7f"); + + return Promise.all([ + commit.parent(0), + NodeGit.Commit.extractSignature( + repository, + "617cd03370dd799f372e9dcfcd0b097aede1bd7f", + "moose-sig" + ) + ]); + }) + .then(function([parent, { signature }]) { + // verify that we are on top of "their commit" + assert.equal(parent.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + assert.equal(signature, "A moose was here."); + }); + }); + + it("can optionally skip signing commits", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + // git_rebase_operation_current returns the index of the rebase + // operation that was last applied, so after the first operation, it + // should be 0. + assert.equal(rebase.operationCurrent(), 0); + + return rebase.finish(ourSignature, {}); + }) + .then(function(result) { + assert.equal(result, 0); + + return repository.getBranchCommit(ourBranchName); + }) + .then(function(commit) { + // verify that the "ours" branch has moved to the correct place + assert.equal(commit.id().toString(), + "b937100ee0ea17ef20525306763505a7fe2be29e"); + + return commit.parent(0); + }) + .then(function(parent) { + // verify that we are on top of "their commit" + assert.equal(parent.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + return NodeGit.Commit.extractSignature( + repository, + "b937100ee0ea17ef20525306763505a7fe2be29e", + "moose-sig" + ) + .then(function() { + assert.fail("This commit should not be signed."); + }, function (error) { + if (error && error.message === "this commit is not signed") { + return; + } + throw error; + }); + }); + }); + + it("will throw if commit signing cb returns an error code", function() { + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var ourCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + return removeFileFromIndex(repository, ourFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), ourFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + assert.equal(theirAnnotatedCommit.id().toString(), + "e9ebd92f2f4778baf6fa8e92f0c68642f931a554"); + + return NodeGit.Rebase.init(repository, ourAnnotatedCommit, + theirAnnotatedCommit, null, { + signingCb: () => ({ + code: NodeGit.Error.CODE.ERROR + }) + }); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "e7f37ee070837052937e24ad8ba66f6d83ae7941"); + + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + + return rebase.commit(null, ourSignature); + }) + .then(function() { + assert.fail("rebase.commit should have failed"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + } + + it("will not throw on patch already applied errors", function() { + var baseFileName = "baseNewFile.txt"; + var theirFileName = "myFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var theirFileContent = "Hello there"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var repository = this.repository; + var initialCommit; + var ourBranch; + var theirBranch; + var rebase; + + return fse.writeFile(path.join(repository.workdir(), baseFileName), + baseFileContent) + // Load up the repository index and make our initial commit to HEAD + .then(function() { + return RepoUtils.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid).then(function(commit) { + initialCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile( + path.join(repository.workdir(), theirFileName), + theirFileContent + ); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "6f14d06b24fa8ea26f511dd8a94a003fd37eadc5"); + + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "c4cc225184b9c9682cb48294358d9d65f8ec42c7"); + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + + return removeFileFromIndex(repository, theirFileName); + }) + .then(function() { + return fse.remove(path.join(repository.workdir(), theirFileName)); + }) + .then(function() { + return repository.checkoutBranch(ourBranchName); + }) + .then(function() { + return Promise.all([ + repository.getReference(ourBranchName), + repository.getReference(theirBranchName) + ]); + }) + .then(function(refs) { + assert.equal(refs.length, 2); + + return Promise.all([ + NodeGit.AnnotatedCommit.fromRef(repository, refs[0]), + NodeGit.AnnotatedCommit.fromRef(repository, refs[1]) + ]); + }) + .then(function(annotatedCommits) { + assert.equal(annotatedCommits.length, 2); + + var ourAnnotatedCommit = annotatedCommits[0]; + var theirAnnotatedCommit = annotatedCommits[1]; + + assert.equal(ourAnnotatedCommit.id().toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + assert.equal(theirAnnotatedCommit.id().toString(), + "c4cc225184b9c9682cb48294358d9d65f8ec42c7"); + + return NodeGit.Rebase.init( + repository, + ourAnnotatedCommit, + theirAnnotatedCommit + ); + }) + .then(function(newRebase) { + rebase = newRebase; + + // there should only be 1 rebase operation to perform + assert.equal(rebase.operationEntrycount(), 1); + + return rebase.next(); + }) + .catch(function(error) { + assert.fail(error); + + throw error; + }) + .then(function(rebaseOperation) { + assert.equal(rebaseOperation.type(), + NodeGit.RebaseOperation.REBASE_OPERATION.PICK); + assert.equal(rebaseOperation.id().toString(), + "5814ffa17b8a677191d89d5372f1e46d50d976ae"); + + return rebase.commit(null, ourSignature); + }) + .then(function() { + assert.fail("Rebase should have failed."); + }, function (error) { + if (error && error.errno === NodeGit.Error.CODE.EAPPLIED) { + return; + } + + assert.fail(error); + + throw error; + }) + .then(function() { + return repository.continueRebase(); + }) + .then(function() { + return rebase.next(); + }) + .catch(function(error) { + assert.equal(error.errno, NodeGit.Error.CODE.ITEROVER); + }); + }); + + + it("rebase signs correctly if rebaseOptions are re-used", function () { + const ourFileName = "ourNewFile.txt"; + const theirFileName = "theirNewFile.txt"; + + const ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + const theirFileContent = "I'm skeptical about Toll Roads"; + + const ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + const theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + let ourCommit; + let theirCommit; + + let rebase; + let newCommitOid; + + const rebaseOptions = { + signingCb: () => ({ + code: NodeGit.Error.CODE.OK, + field: "moose-sig", + signedData: "A moose was here." + }) + }; + + const repository = this.repository; + + // Create two commits on master + // one + return fse.writeFile(path.join(repository.workdir(), ourFileName), + ourFileContent) + .then(() => RepoUtils.addFileToIndex(repository, ourFileName)) + .then((oid) => { + assert.equal(oid.toString(), + "11ead82b1135b8e240fb5d61e703312fb9cc3d6a"); + return repository.createCommit("HEAD", ourSignature, ourSignature, + "we made a commit", oid, []); + }) + .then((commitOid) => { + assert.equal(commitOid.toString(), + "91a183f87842ebb7a9b08dad8bc2473985796844"); + return repository.getCommit(commitOid); + }) + .then((_ourCommit) => { + ourCommit = _ourCommit; + return fse.writeFile(path.join(repository.workdir(), theirFileName), + theirFileContent); + }) + .then(() => RepoUtils.addFileToIndex(repository, theirFileName)) + .then((oid) => { + assert.equal(oid.toString(), + "76631cb5a290dafe2959152626bb90f2a6d8ec94"); + return repository.createCommit("HEAD", theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then((commitOid) => { + assert.equal(commitOid.toString(), + "0e9231d489b3f4303635fc4b0397830da095e7e7"); + return repository.getCommit(commitOid); + + }) + .then((_theirCommit) => { + theirCommit = _theirCommit; + return Promise.all([ + NodeGit.AnnotatedCommit.lookup( + repository, + ourCommit.id() + ), + NodeGit.AnnotatedCommit.lookup( + repository, + theirCommit.id() + ) + ]); + }) + // rebase latest commit + .then(([ourAnnotatedCommit, theirAnnotatedCommit]) => + NodeGit.Rebase.init( + repository, + // branch, upstream, onto + theirAnnotatedCommit, ourAnnotatedCommit, null, + rebaseOptions // use once + )) + .then(() => { + return NodeGit.Rebase.open( + repository, + rebaseOptions // use twice + ); + }) + .then((_rebase) => { + rebase = _rebase; + return rebase.next(); + }) + .then(() => { + const operationCurrentIndex = rebase.operationCurrent(); + assert(operationCurrentIndex === 0); + // Make sure we don't crash calling the signature CB + // after collecting garbage. + garbageCollect(); + return rebase.commit(null, ourSignature); + }) + .then((_newCommitOid) => { + newCommitOid = _newCommitOid; + assert.strictEqual(newCommitOid.toString(), + "9909e435b52322a71dc341d747b29c392a34c745"); + return rebase.next(); + }) + .then(() => { + assert.fail("should throw"); + }) + .catch((error) => { + assert(error.errno === NodeGit.Error.CODE.ITEROVER); + assert.strictEqual(rebase.finish(ourSignature), 0); + return NodeGit.Commit.extractSignature( + repository, + newCommitOid.toString(), + "moose-sig" + ); + }) + .then((sig) => { + assert.strictEqual(sig.signature, "A moose was here."); + }); +}); +}); diff --git a/test/tests/refs.js b/test/tests/refs.js index b90b42f8c5..1cad9f4084 100644 --- a/test/tests/refs.js +++ b/test/tests/refs.js @@ -1,19 +1,17 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); var local = path.join.bind(path, __dirname); -// Have to wrap exec, since it has a weird callback signature. -var exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); +var exec = require("../../utils/execPromise"); describe("Reference", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; var Reference = NodeGit.Reference; + var Reflog = NodeGit.Reflog; var reposPath = local("../repos/workdir"); + var refName = "refs/heads/master"; before(function() { var test = this; @@ -25,7 +23,7 @@ describe("Reference", function() { .then(function(repository) { test.repository = repository; - return repository.getReference("refs/heads/master"); + return repository.getReference(refName); }) .then(function(reference) { test.reference = reference; @@ -40,6 +38,31 @@ describe("Reference", function() { assert.equal(this.reference.isSymbolic(), false); }); + it("can determine if the reference is not symbolic", function() { + assert.ok(this.reference.isConcrete()); + }); + + it("can check that reference is valid", function() { + assert.ok(this.reference.isValid()); + }); + + it("can return refName when casting toString", function() { + assert.equal(this.reference.toString(), refName); + }); + + it("can compare two identical references", function() { + assert.equal(this.reference.cmp(this.reference), 0); + }); + + it("can compare two different references", function() { + var ref = this.reference; + + return this.repository.getReference("checkout-test") + .then(function(otherRef) { + assert.notEqual(ref.cmp(otherRef), 0); + }); + }); + it("will return undefined looking up the symbolic target if not symbolic", function() { assert(this.reference.symbolicTarget() === undefined); @@ -52,4 +75,50 @@ describe("Reference", function() { assert.equal(sha, "32789a79e71fbc9e04d3eff7425e1771eb595150"); }); }); + + it("can rename a reference", function() { + var newRefName = "refs/heads/chasta-boran"; + var ref = this.reference; + var repo = this.repository; + var reflogMessage = "reflog message"; + var refExistsMessage = "Renamed ref still exists"; + + return repo.getReference(newRefName) + .then(function() { + // The new ref name should not exist yet + throw new Error(refExistsMessage); + }) + .catch(function(err) { + // Should throw an error explaining that the ref + // does not exist + assert.ok(err.message.includes(newRefName)); + return ref.rename(newRefName, 0, reflogMessage); + }) + .then(function(reference) { + // The ref should be renamed at this point + assert.equal(reference.name(), newRefName); + return repo.getReference(refName); + }) + .then(function() { + // The original ref name should not be found + throw new Error(refExistsMessage); + }) + .catch(function(err) { + assert.ok(err.message.includes(refName)); + return Reflog.read(repo, newRefName); + }) + .then(function(reflog) { + var refEntryMessage = reflog + .entryByIndex(0) + .message(); + // The reflog should have the message passed to + // the rename + assert.equal(refEntryMessage, reflogMessage); + return repo.getReference(newRefName); + }) + .then(function(newRef) { + // Set the ref name back to `master` + return newRef.rename(refName, 0, "another reflog message"); + }); + }); }); diff --git a/test/tests/remote.js b/test/tests/remote.js index d32fda7819..c9bf8192c7 100644 --- a/test/tests/remote.js +++ b/test/tests/remote.js @@ -1,7 +1,13 @@ var assert = require("assert"); var path = require("path"); -var Promise = require("nodegit-promise"); var local = path.join.bind(path, __dirname); +var _ = require("lodash"); +var fp = require("lodash/fp"); + +var garbageCollect = require("../utils/garbage_collect.js"); +var RepoUtils = require("../utils/repository_setup"); + +const isNode8 = process.versions.node.split(".")[0] === "8"; describe("Remote", function() { var NodeGit = require("../../"); @@ -9,21 +15,23 @@ describe("Remote", function() { var Remote = NodeGit.Remote; var reposPath = local("../repos/workdir"); + var bareReposPath = local("../repos/bare"); var url = "https://github.com/nodegit/test"; var url2 = "https://github.com/nodegit/test2"; + var privateUrl = "git@github.com:nodegit/private"; - function removeOrigins(repo) { - return repo.getRemotes() + function removeNonOrigins(repo) { + return repo.getRemoteNames() .then(function(remotes) { - var promises = []; - - remotes.forEach(function(remote) { + return remotes.reduce(function(promise, remote) { if (remote !== "origin") { - promises.push(Remote.delete(repo, remote)); + promise = promise.then(function() { + return Remote.delete(repo, remote); + }); } - }); - return Promise.all(promises); + return promise; + }, Promise.resolve()); }); } @@ -39,12 +47,15 @@ describe("Remote", function() { .then(function(remote) { test.remote = remote; - return removeOrigins(test.repository); + return removeNonOrigins(test.repository); + }) + .then(function() { + return RepoUtils.createRepository(bareReposPath, 1); }); }); after(function() { - return removeOrigins(this.repository); + return removeNonOrigins(this.repository); }); it("can load a remote", function() { @@ -52,7 +63,7 @@ describe("Remote", function() { }); it("can read the remote url", function() { - assert.equal( this.remote.url().replace(".git", ""), url); + assert.equal(this.remote.url().replace(".git", ""), url); }); it("has an empty pushurl by default", function() { @@ -61,10 +72,17 @@ describe("Remote", function() { it("can set a remote", function() { var repository = this.repository; - var remote = Remote.create(repository, "origin1", url); - remote.setPushurl("https://google.com/"); - assert(remote.pushurl(), "https://google.com/"); + return Remote.create(repository, "origin1", url) + .then(function() { + return Remote.setPushurl(repository, "origin1", "https://google.com/"); + }) + .then(function() { + return Remote.lookup(repository, "origin1"); + }) + .then(function(remote) { + assert.equal(remote.pushurl(), "https://google.com/"); + }); }); it("can read the remote name", function() { @@ -73,36 +91,66 @@ describe("Remote", function() { it("can create and load a new remote", function() { var repository = this.repository; - var remote = Remote.create(repository, "origin2", url); - return Remote.lookup(repository, "origin2").then(function() { - assert(remote.url(), url); - }); + return Remote.create(repository, "origin2", url) + .then(function() { + return Remote.lookup(repository, "origin2"); + }) + .then(function(remote) { + assert(remote.url(), url); + }); + }); + + it("can rename a remote", function() { + var repository = this.repository; + + return Remote.list(repository) + .then(function(remoteNames) { + assert.deepEqual(remoteNames, ["origin"]); + return Remote.rename(repository, "origin", "origin2"); + }) + .then(function(problems) { + assert.deepEqual(problems, []); + return Remote.list(repository); + }) + .then(function(remoteNames) { + assert.deepEqual(remoteNames, ["origin2"]); + return Remote.rename(repository, "origin2", "origin"); + }) + .then(function(problems) { + assert.deepEqual(problems, []); + return Remote.list(repository); + }) + .then(function(remoteNames) { + assert.deepEqual(remoteNames, ["origin"]); + }); }); it("can delete a remote", function() { var repository = this.repository; - Remote.create(repository, "origin3", url); - return Remote.delete(repository, "origin3") + return Remote.create(repository, "origin3", url) .then(function() { - return Remote.lookup(repository, "origin3"); + return Remote.delete(repository, "origin3"); }) - .then(Promise.reject, Promise.resolve); + .then(function() { + return Remote.lookup(repository, "origin3") + // We only want to catch the failed lookup + .then(Promise.reject.bind(Promise), Promise.resolve.bind(Promise)); + }); }); it("can download from a remote", function() { var repo = this.repository; + var remoteCallbacks; return repo.getRemote("origin") .then(function(remote) { - remote.setCallbacks({ - certificateCheck: function() { - return 1; - } - }); + remoteCallbacks = { + certificateCheck: () => 0 + }; - return remote.connect(NodeGit.Enums.DIRECTION.FETCH) + return remote.connect(NodeGit.Enums.DIRECTION.FETCH, remoteCallbacks) .then(function() { return remote.download(null); }).then(function() { @@ -111,6 +159,59 @@ describe("Remote", function() { }); }); + it("can monitor transfer progress while pushing", function() { + var repo = this.repository; + var wasCalled = false; + + return Remote.create(repo, "bare", bareReposPath) + .then(function(remote) { + var fetchOpts = { + callbacks: { + pushTransferProgress: function() { + wasCalled = true; + } + } + }; + + var ref = "refs/heads/master"; + var refs = [ref + ":" + ref]; + + return remote.push(refs, fetchOpts) + .then(function(res) { + assert.ok(wasCalled); + }); + }); + }); + + it("can monitor transfer progress while pushing with throttling", + function() { + var repo = this.repository; + var wasCalled = false; + + return Remote.create(repo, "bare", bareReposPath) + .then(function(remote) { + var fetchOpts = { + callbacks: { + pushTransferProgress: { + throttle: 200, + callback: function() { + wasCalled = true; + }, + } + } + }; + + var ref = "refs/heads/master"; + var refs = [ref + ":" + ref]; + + return remote.push(refs, fetchOpts) + .then(function(res) { + assert.ok(wasCalled); + }); + }); + } + ); + it("can monitor transfer progress while downloading", function() { // Set a reasonable timeout here now that our repository has grown. this.timeout(600000); @@ -118,24 +219,22 @@ describe("Remote", function() { var repo = this.repository; var wasCalled = false; - Remote.create(repo, "test2", url2); - - return repo.getRemote("test2") + return Remote.create(repo, "test2", url2) .then(function(remote) { - remote.setCallbacks({ - credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); - }, - certificateCheck: function() { - return 1; - }, - - transferProgress: function() { - wasCalled = true; + var fetchOpts = { + callbacks: { + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyFromAgent(userName); + }, + certificateCheck: () => 0, + + transferProgress: function() { + wasCalled = true; + } } - }); + }; - return remote.fetch(null, repo.defaultSignature(), null); + return remote.fetch(null, fetchOpts, null); }) .then(function() { assert.ok(wasCalled); @@ -144,67 +243,385 @@ describe("Remote", function() { }); }); + it("can get the default branch of a remote", function() { + var remoteCallbacks = { + certificateCheck: () => 0 + }; + + var remote = this.remote; + + return remote.connect(NodeGit.Enums.DIRECTION.FETCH, remoteCallbacks) + .then(function() { return remote.defaultBranch(); }) + .then(function(branchName) { + assert.equal("refs/heads/master", branchName); + }); + }); + it("can fetch from a remote", function() { return this.repository.fetch("origin", { - credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); - }, - certificateCheck: function() { - return 1; + callbacks: { + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyFromAgent(userName); + }, + certificateCheck: () => 0 } }); }); - it("can fetch from all remotes", function() { - // Set a reasonable timeout here for the fetchAll test - this.timeout(15000); - - return this.repository.fetchAll({ - credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); - }, - certificateCheck: function() { - return 1; + it("can fetch from a private repository", function() { + var repo = this.repository; + var fetchOptions = { + callbacks: { + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyNew( + userName, + path.resolve("./test/nodegit-test-rsa.pub"), + path.resolve("./test/nodegit-test-rsa"), + "" + ); + }, + certificateCheck: () => 0 } - }); - }); + }; - it("cannot push to a repository", function() { - this.timeout(5000); - var repo = this.repository; - var branch = "should-not-exist"; - return Remote.lookup(repo, "origin") + return Remote.create(repo, "private", privateUrl) .then(function(remote) { - remote.setCallbacks({ + return remote.fetch(null, fetchOptions, "Fetch from private"); + }) + .catch(function() { + assert.fail("Unable to fetch from private repository"); + }); + }); + + it("can reject fetching from private repository without valid credentials", + function() { + var repo = this.repository; + var firstPass = true; + var fetchOptions = { + callbacks: { credentials: function(url, userName) { - if (url.indexOf("https") === -1) { - return NodeGit.Cred.sshKeyFromAgent(userName); - } else { - return NodeGit.Cred.userpassPlaintextNew(userName, ""); + if (firstPass) { + firstPass = false; + return NodeGit.Credential.sshKeyFromAgent(userName); } }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 + } + }; + + return Remote.create(repo, "private", privateUrl) + .then(function(remote) { + return remote.fetch(null, fetchOptions, "Fetch from private"); + }) + .then(function () { + assert.fail("Should not be able to fetch from repository"); + }) + .catch(function(error) { + assert.equal( + error.message.trim(), + "ERROR: Repository not found.", + "Should not be able to find repository." + ); }); - return remote; + }); + + it("can fetch from all remotes", function() { + var repository = this.repository; + + return Remote.create(repository, "test1", url) + .then(function() { + return Remote.create(repository, "test2", url2); }) + .then(function() { + return repository.fetchAll({ + callbacks: { + credentials: function(url, userName) { + return NodeGit.Credential.sshKeyFromAgent(userName); + }, + certificateCheck: () => 0 + } + }); + }); + }); + + if (!isNode8) { + it("will reject if credentials promise rejects", function() { + var repo = this.repository; + var branch = "should-not-exist"; + return Remote.lookup(repo, "origin") .then(function(remote) { var ref = "refs/heads/" + branch; var refs = [ref + ":" + ref]; - var signature = repo.defaultSignature(); - return remote.push(refs, null, signature, - "Pushed '" + branch + "' for test"); + var options = { + callbacks: { + credentials: function(url, userName) { + var test = Promise.resolve("test") + .then(function() { return; }) + .then(function() { return; }) + .then(function() { return; }) + .then(function() { + return Promise.reject(new Error("failure case")); + }); + return test; + }, + certificateCheck: () => 0 + } + }; + return remote.push(refs, options); }) .then(function() { return Promise.reject( new Error("should not be able to push to the repository")); - }, function(err) { - if (err.message.indexOf(401) === -1) { - throw err; - } else { - return Promise.resolve(); - } + }, function(err) { + if (err.message === "failure case") + { + return Promise.resolve(); + } else { + throw err; + } + }) + .then(function() { + return Remote.lookup(repo, "origin"); + }) + .then(function(remote) { + var ref = "refs/heads/" + branch; + var refs = [ref + ":" + ref]; + var options = { + callbacks: { + credentials: function(url, userName) { + var test = Promise.resolve() + .then(Promise.resolve.bind(Promise)) + .then(Promise.resolve.bind(Promise)) + .then(Promise.resolve.bind(Promise)) + .then(Promise.reject.bind(Promise)); + return test; + }, + certificateCheck: () => 0 + } + }; + return remote.push(refs, options); + }) + .then(function() { + return Promise.reject( + new Error("should not be able to push to the repository")); + }, function(err) { + if (err.message === "Method push has thrown an error.") + { + return Promise.resolve(); + } else { + throw err; + } + }); + }); + + it("cannot push to a repository with invalid credentials", function() { + var repo = this.repository; + var branch = "should-not-exist"; + return Remote.lookup(repo, "origin") + .then(function(remote) { + var ref = "refs/heads/" + branch; + var refs = [ref + ":" + ref]; + var firstPass = true; + var options = { + callbacks: { + credentials: function(url, userName) { + if (firstPass) { + firstPass = false; + if (url.indexOf("https") === -1) { + return NodeGit.Credential.sshKeyFromAgent(userName); + } else { + return NodeGit.Credential + .userpassPlaintextNew(userName, ""); + } + } else { + return Promise.reject(); + } + }, + certificateCheck: () => 0 + } + }; + return remote.push(refs, options); + }) + // takes care of windows bug, see the .catch for the proper pathway + // that this flow should take (cred cb doesn't run twice -> + // throws error) + .then(function() { + return Promise.reject( + new Error("should not be able to push to the repository")); + }, function(err) { + if (err.message.indexOf(401) === -1) { + throw err; + } else { + return Promise.resolve(); + } + }) + // catches linux / osx failure to use anonymous credentials + // stops callback infinite loop + .catch(function (reason) { + const messageWithoutNewlines = reason.message.replace( + /\n|\r/g, + "" + ); + const validErrors = [ + "Method push has thrown an error.", + "failed to set credentials: The parameter is incorrect." + ]; + assert.ok( + _.includes(validErrors, messageWithoutNewlines), + "Unexpected error: " + reason.message + ); + }); + }); + } + + it("is kept alive by refspec", function() { + var repo = this.repository; + var Remote = NodeGit.Remote; + + garbageCollect(); + var startSelfFreeingCount = Remote.getSelfFreeingInstanceCount(); + var startNonSelfFreeingCount = Remote.getNonSelfFreeingConstructedCount(); + + var resolve; + var promise = new Promise(function(_resolve) { resolve = _resolve; }); + + var remote; + + repo.getRemote("origin") + .then(function(_remote) { + remote = _remote; + setTimeout(resolve, 0); + }); + + return promise + .then(function() { + // make sure we have created one self-freeing remote + assert.equal(startSelfFreeingCount + 1, + Remote.getSelfFreeingInstanceCount()); + assert.equal(startNonSelfFreeingCount, + Remote.getNonSelfFreeingConstructedCount()); + var refspec = remote.getRefspec(0); + assert.equal("refs/heads/*", refspec.src()); + remote = null; + garbageCollect(); + // the refspec should be holding on to the remote + assert.equal(startSelfFreeingCount + 1, + Remote.getSelfFreeingInstanceCount()); + + assert.equal("refs/heads/*", refspec.src()); + + refspec = null; + garbageCollect(); + // the remote should be freed now + assert.equal(startSelfFreeingCount, + Remote.getSelfFreeingInstanceCount()); + }); + }); + + it("can retrieve the list of references advertised by a remote", function() { + var expectedRemoteHeads = { + HEAD: { + local: 0, + oid: "32789a79e71fbc9e04d3eff7425e1771eb595150", + loid: "0000000000000000000000000000000000000000", + name: "HEAD", + symrefTarget: "refs/heads/master" + }, + "refs/heads/checkout-test": { + local: 0, + oid: "1729c73906bb8467f4095c2f4044083016b4dfde", + loid: "0000000000000000000000000000000000000000", + name: "refs/heads/checkout-test", + symrefTarget: null + }, + "refs/heads/master": { + local: 0, + oid: "32789a79e71fbc9e04d3eff7425e1771eb595150", + loid: "0000000000000000000000000000000000000000", + name: "refs/heads/master", + symrefTarget: null + }, + "refs/heads/rev-walk": { + local: 0, + oid: "32789a79e71fbc9e04d3eff7425e1771eb595150", + loid: "0000000000000000000000000000000000000000", + name: "refs/heads/rev-walk", + symrefTarget: null + }, + "refs/tags/annotated-tag": { + local: 0, + oid: "dc800017566123ff3c746b37284a24a66546667e", + loid: "0000000000000000000000000000000000000000", + name: "refs/tags/annotated-tag", + symrefTarget: null + }, + "refs/tags/annotated-tag^{}": { + local: 0, + oid: "32789a79e71fbc9e04d3eff7425e1771eb595150", + loid: "0000000000000000000000000000000000000000", + name: "refs/tags/annotated-tag^{}", + symrefTarget: null + }, + "refs/tags/light-weight-tag": { + local: 0, + oid: "32789a79e71fbc9e04d3eff7425e1771eb595150", + loid: "0000000000000000000000000000000000000000", + name: "refs/tags/light-weight-tag", + symrefTarget: null + } + }; + + return this.repository.getRemote("origin") + .then(function(remote) { + return Promise.all([ + remote, + remote.connect(NodeGit.Enums.DIRECTION.FETCH) + ]); + }) + .then(function(results) { + var remote = results[0]; + return Promise.all([remote, remote.referenceList()]); + }) + .then(function(results) { + var remote = results[0]; + var remoteHeads = results[1]; + var remoteHeadsBySha = fp.flow([ + fp.map(function(remoteHead) { + return { + local: remoteHead.local(), + oid: remoteHead.oid().toString(), + loid: remoteHead.loid().toString(), + name: remoteHead.name(), + symrefTarget: remoteHead.symrefTarget() + }; + }), + fp.keyBy("name") + ])(remoteHeads); + + fp.flow([ + fp.keys, + fp.forEach(function(remoteHeadName) { + assert(fp.isEqual( + expectedRemoteHeads[remoteHeadName], + remoteHeadsBySha[remoteHeadName] + ), "Expectations for head " + remoteHeadName + " were not met."); + }) + ])(expectedRemoteHeads); + + return remote.disconnect(); + }); + }); + + it("will error when retrieving reference list if not connected", function() { + return this.repository.getRemote("origin") + .then(function(remote) { + return remote.referenceList(); + }) + .then(function() { + assert.fail("Unconnected remote should have no reference list."); + }) + .catch(function(notConnectedError) { + assert(notConnectedError.message === "this remote has never connected"); }); }); }); diff --git a/test/tests/repository.js b/test/tests/repository.js index 4062e1440c..29f2075099 100644 --- a/test/tests/repository.js +++ b/test/tests/repository.js @@ -1,9 +1,9 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var Promise = require("nodegit-promise"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); +var IndexUtils = require("../utils/index_setup"); +var RepoUtils = require("../utils/repository_setup"); describe("Repository", function() { var NodeGit = require("../../"); @@ -11,18 +11,40 @@ describe("Repository", function() { var Index = NodeGit.Index; var Signature = NodeGit.Signature; + var constReposPath = local("../repos/constworkdir"); var reposPath = local("../repos/workdir"); - var newRepo = local("../repos/newrepo"); + var newRepoPath = local("../repos/newrepo"); + var emptyRepoPath = local("../repos/empty"); beforeEach(function() { var test = this; - return Repository.open(reposPath) + return Repository.open(constReposPath) + .then(function(constRepository) { + test.constRepository = constRepository; + }) + .then(function() { + return Repository.open(reposPath); + }) .then(function(repository) { test.repository = repository; + }) + .then(function() { + return Repository.open(emptyRepoPath); + }) + .then(function(emptyRepo) { + test.emptyRepo = emptyRepo; }); }); + it("cannot instantiate a repository", function() { + assert.throws( + function() { new Repository(); }, + undefined, + "hello" + ); + }); + it("can open a valid repository", function() { assert.ok(this.repository instanceof Repository); }); @@ -44,21 +66,34 @@ describe("Repository", function() { }); it("can initialize a repository into a folder", function() { - return Repository.init(newRepo, 1) + return Repository.init(newRepoPath, 1) .then(function(path, isBare) { - return Repository.open(newRepo); + return Repository.open(newRepoPath); }); }); it("can utilize repository init options", function() { - return fse.remove(newRepo) + return fse.remove(newRepoPath) .then(function() { - return Repository.initExt(newRepo, { + return Repository.initExt(newRepoPath, { flags: Repository.INIT_FLAG.MKPATH }); }); }); + it("can be cleaned", function() { + this.repository.cleanup(); + + // try getting a commit after cleanup (to test that the repo is usable) + return this.repository.getHeadCommit() + .then(function(commit) { + assert.equal( + commit.toString(), + "32789a79e71fbc9e04d3eff7425e1771eb595150" + ); + }); + }); + it("can read the index", function() { return this.repository.index() .then(function(index) { @@ -67,7 +102,7 @@ describe("Repository", function() { }); it("can list remotes", function() { - return this.repository.getRemotes() + return this.repository.getRemoteNames() .then(function(remotes) { assert.equal(remotes.length, 1); assert.equal(remotes[0], "origin"); @@ -81,10 +116,21 @@ describe("Repository", function() { }); }); - it("can get the default signature", function() { - var sig = this.repository.defaultSignature(); + it("can get a reference commit", function() { + return this.repository.getReferenceCommit("master") + .then(function(commit) { + assert.equal( + "32789a79e71fbc9e04d3eff7425e1771eb595150", + commit.toString() + ); + }); + }); - assert(sig instanceof Signature); + it("can get the default signature", function() { + this.repository.defaultSignature() + .then((sig) => { + assert(sig instanceof Signature); + }); }); it("gets statuses with StatusFile", function() { @@ -120,8 +166,9 @@ describe("Repository", function() { return fse.writeFile(filePath, fileContent) .then(function() { - var statuses = repo.getStatusExt(); - + return repo.getStatusExt(); + }) + .then(function(statuses) { assert.equal(statuses.length, 1); assert.equal(statuses[0].path(), fileName); assert.equal(statuses[0].indexToWorkdir().newFile().path(), fileName); @@ -144,11 +191,9 @@ describe("Repository", function() { return repo.fetch("origin", { credentials: function(url, userName) { - return NodeGit.Cred.sshKeyFromAgent(userName); + return NodeGit.Credential.sshKeyFromAgent(userName); }, - certificateCheck: function() { - return 1; - } + certificateCheck: () => 0 }) .then(function() { return repo.fetchheadForeach(function(refname, remoteUrl, oid, isMerge) { @@ -169,4 +214,181 @@ describe("Repository", function() { } }); }); + + function discover(ceiling) { + var testPath = path.join(reposPath, "lib", "util", "normalize_oid.js"); + var expectedPath = path.join(reposPath, ".git"); + return NodeGit.Repository.discover(testPath, 0, ceiling) + .then(function(foundPath) { + assert.equal(expectedPath, foundPath); + }); + } + + it("can discover if a path is part of a repository, null ceiling", + function() { + return discover(null); + }); + + it("can discover if a path is part of a repository, empty ceiling", + function() { + return discover(""); + }); + + it("can create a repo using initExt", function() { + var initFlags = NodeGit.Repository.INIT_FLAG.NO_REINIT | + NodeGit.Repository.INIT_FLAG.MKPATH | + NodeGit.Repository.INIT_FLAG.MKDIR; + return fse.remove(newRepoPath) + .then(function() { + return NodeGit.Repository.initExt(newRepoPath, { flags: initFlags }); + }) + .then(function() { + return NodeGit.Repository.open(newRepoPath); + }); + }); + + it("will throw when a repo cannot be initialized using initExt", function() { + var initFlags = NodeGit.Repository.INIT_FLAG.NO_REINIT | + NodeGit.Repository.INIT_FLAG.MKPATH | + NodeGit.Repository.INIT_FLAG.MKDIR; + + var nonsensePath = "gibberish"; + + return NodeGit.Repository.initExt(nonsensePath, { flags: initFlags }) + .then(function() { + assert.fail("Should have thrown an error."); + }) + .catch(function(error) { + assert(error, "Should have thrown an error."); + }); + }); + + it("can get the head commit", function() { + return this.repository.getHeadCommit() + .then(function(commit) { + assert.equal( + commit.toString(), + "32789a79e71fbc9e04d3eff7425e1771eb595150" + ); + }); + }); + + it("returns null if there is no head commit", function() { + return this.emptyRepo.getHeadCommit() + .then(function(commit) { + assert(!commit); + }); + }); + + it("can commit on head on a empty repo with createCommitOnHead", function() { + const fileName = "my-new-file-that-shouldnt-exist.file"; + const fileContent = "new file from repository test"; + const repo = this.emptyRepo; + const filePath = path.join(repo.workdir(), fileName); + const commitMsg = "Doug this has been commited"; + let authSig; + let commitSig; + + return repo.defaultSignature() + .then((sig) => { + authSig = sig; + commitSig = sig; + return fse.writeFile(filePath, fileContent); + }) + .then(() => { + return repo.createCommitOnHead( + [fileName], + authSig, + commitSig, + commitMsg + ); + }) + .then((oidResult) => { + return repo.getHeadCommit() + .then(function(commit) { + assert.equal( + commit.toString(), + oidResult.toString() + ); + }); + }); + }); + + it("can get all merge heads in a repo with mergeheadForeach", function() { + var repo; + var repoPath = local("../repos/merge-head"); + var ourBranchName = "ours"; + var theirBranchName = "theirs"; + var theirBranch; + var fileName = "testFile.txt"; + var numMergeHeads = 0; + var assertBranchTargetIs = function (theirBranch, mergeHead) { + assert.equal(theirBranch.target(), mergeHead.toString()); + numMergeHeads++; + }; + + return RepoUtils.createRepository(repoPath) + .then(function(_repo) { + repo = _repo; + return IndexUtils.createConflict( + repo, + ourBranchName, + theirBranchName, + fileName + ); + }) + .then(function() { + return repo.getBranch(theirBranchName); + }) + .then(function(_theirBranch) { + // Write the MERGE_HEAD file manually since createConflict does not + theirBranch = _theirBranch; + return fse.writeFile( + path.join(repoPath, ".git", "MERGE_HEAD"), + theirBranch.target().toString() + "\n" + ); + }) + .then(function() { + return repo.mergeheadForeach( + assertBranchTargetIs.bind(this, theirBranch) + ); + }) + .then(function() { + assert.equal(numMergeHeads, 1); + }); + }); + + it("can obtain statistics from a valid constant repository", function() { + return this.constRepository.statistics() + .then(function(analysisReport) { + + assert.equal(analysisReport.repositorySize.commits.count, 992); + assert.equal(analysisReport.repositorySize.commits.size, 265544); + assert.equal(analysisReport.repositorySize.trees.count, 2416); + assert.equal(analysisReport.repositorySize.trees.size, 1188325); + assert.equal(analysisReport.repositorySize.trees.entries, 32571); + assert.equal(analysisReport.repositorySize.blobs.count, 4149); + assert.equal(analysisReport.repositorySize.blobs.size, 48489622); + assert.equal(analysisReport.repositorySize.annotatedTags.count, 1); + assert.equal(analysisReport.repositorySize.references.count, 8); + + assert.equal(analysisReport.biggestObjects.commits.maxSize, 956); + assert.equal(analysisReport.biggestObjects.commits.maxParents, 2); + assert.equal(analysisReport.biggestObjects.trees.maxEntries, 93); + assert.equal(analysisReport.biggestObjects.blobs.maxSize, 1077756); + + assert.equal(analysisReport.historyStructure.maxDepth, 931); + assert.equal(analysisReport.historyStructure.maxTagDepth, 1); + + assert.equal(analysisReport.biggestCheckouts.numDirectories, 128); + assert.equal(analysisReport.biggestCheckouts.maxPathDepth, 10); + assert.equal(analysisReport.biggestCheckouts.maxPathLength, 107); + assert.equal(analysisReport.biggestCheckouts.numFiles, 514); + assert.equal(analysisReport.biggestCheckouts.totalFileSize, 5160886); + assert.equal(analysisReport.biggestCheckouts.numSymlinks, 2); + assert.equal(analysisReport.biggestCheckouts.numSubmodules, 4); + + // console.log(JSON.stringify(analysisReport,null,2)); + }); + }); }); diff --git a/test/tests/reset.js b/test/tests/reset.js index 3638c5761e..214bf08fd1 100644 --- a/test/tests/reset.js +++ b/test/tests/reset.js @@ -1,13 +1,13 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); describe("Reset", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; var Reset = NodeGit.Reset; + var AnnotatedCommit = NodeGit.AnnotatedCommit; var reposPath = local("../repos/workdir"); var currentCommitOid = "32789a79e71fbc9e04d3eff7425e1771eb595150"; @@ -54,7 +54,7 @@ describe("Reset", function() { return Reset.default(test.repo, test.previousCommit, filePath) .then(function() { - return test.repo.openIndex(); + return test.repo.refreshIndex(); }) .then(function(index) { return index.writeTree(); @@ -80,7 +80,7 @@ describe("Reset", function() { return Reset.default(test.repo, test.currentCommit, filePath); }) .then(function() { - return test.repo.openIndex(); + return test.repo.refreshIndex(); }) .then(function(index) { return index.writeTree(); @@ -104,25 +104,57 @@ describe("Reset", function() { }); }); - it("can perform a soft reset", function() { - var test = this; - - return Reset.reset(test.repo, test.previousCommit, Reset.TYPE.SOFT) + function resetFrom(repo, commit, resetType, annotated) { + var promise = null; + if (annotated) { + promise = AnnotatedCommit.lookup(repo, commit.id()) + .then(function(annotatedCommit) { + return Reset.fromAnnotated(repo, annotatedCommit, resetType); + }); + } else { + promise = Reset.reset(repo, commit, resetType); + } + return promise .then(function() { - return test.repo.openIndex(); + return repo.refreshIndex(); }) .then(function(index) { return index.writeTree(); }) .then(function(oid) { - return test.repo.getTree(oid); + return repo.getTree(oid); }) .then(function(tree) { return tree.getEntry(filePath); }) .then(function(entry) { return entry.getBlob(); - }) + }); + } + + it("can perform a soft reset", function() { + var test = this; + + return resetFrom(test.repo, test.previousCommit, Reset.TYPE.SOFT, false) + .then(function(blob) { + var currentCommitContents = test.currentCommitBlob.toString(); + var previousCommitContents = test.previousCommitBlob.toString(); + var resetContents = blob.toString(); + + // With a soft reset all of the changes should be in the index + // still so the index should still == what we had at the current + // commit and not the one nwe reset to + assert(resetContents == currentCommitContents); + assert(resetContents != previousCommitContents); + + return Reset(test.repo, test.currentCommit, Reset.TYPE.HARD); + }); + }); + + it("can perform an annotated soft reset", function() { + var test = this; + + return resetFrom(test.repo, test.previousCommit, Reset.TYPE.SOFT, true) .then(function(blob) { var currentCommitContents = test.currentCommitBlob.toString(); var previousCommitContents = test.previousCommitBlob.toString(); @@ -130,7 +162,7 @@ describe("Reset", function() { // With a soft reset all of the changes should be in the index // still so the index should still == what we had at the current - // commit and not the one we reset to + // commit and not the one nwe reset to assert(resetContents == currentCommitContents); assert(resetContents != previousCommitContents); @@ -141,22 +173,32 @@ describe("Reset", function() { it("can perform a mixed reset", function() { var test = this; - return Reset.reset(test.repo, test.previousCommit, Reset.TYPE.MIXED) - .then(function() { - return test.repo.openIndex(); - }) - .then(function(index) { - return index.writeTree(); - }) - .then(function(oid) { - return test.repo.getTree(oid); - }) - .then(function(tree) { - return tree.getEntry(filePath); - }) - .then(function(entry) { - return entry.getBlob(); + return resetFrom(test.repo, test.previousCommit, Reset.TYPE.MIXED, false) + .then(function(blob) { + var currentCommitContents = test.currentCommitBlob.toString(); + var previousCommitContents = test.previousCommitBlob.toString(); + var resetContents = blob.toString(); + + // With a mixed reset all of the changes should removed from the index + // but still in the working directory. (i.e. unstaged) + assert(resetContents != currentCommitContents); + assert(resetContents == previousCommitContents); + + return fse.readFile(path.join(test.repo.workdir(), filePath)); }) + .then(function(fileContents) { + var currentCommitContents = test.currentCommitBlob.toString(); + + assert(fileContents == currentCommitContents); + + return Reset.reset(test.repo, test.currentCommit, Reset.TYPE.HARD); + }); + }); + + it("can perform an annotated mixed reset", function() { + var test = this; + + return resetFrom(test.repo, test.previousCommit, Reset.TYPE.MIXED, true) .then(function(blob) { var currentCommitContents = test.currentCommitBlob.toString(); var previousCommitContents = test.previousCommitBlob.toString(); @@ -181,22 +223,32 @@ describe("Reset", function() { it("can perform a hard reset", function() { var test = this; - return Reset.reset(test.repo, test.previousCommit, Reset.TYPE.HARD) - .then(function() { - return test.repo.openIndex(); - }) - .then(function(index) { - return index.writeTree(); - }) - .then(function(oid) { - return test.repo.getTree(oid); - }) - .then(function(tree) { - return tree.getEntry(filePath); - }) - .then(function(entry) { - return entry.getBlob(); + return resetFrom(test.repo, test.previousCommit, Reset.TYPE.HARD, false) + .then(function(blob) { + var currentCommitContents = test.currentCommitBlob.toString(); + var previousCommitContents = test.previousCommitBlob.toString(); + var resetContents = blob.toString(); + + // With a hard reset all of the changes should removed from the index + // and also removed from the working directory + assert(resetContents != currentCommitContents); + assert(resetContents == previousCommitContents); + + return fse.readFile(path.join(test.repo.workdir(), filePath)); }) + .then(function(fileContents) { + var previousCommitContents = test.previousCommitBlob.toString(); + + assert(fileContents == previousCommitContents); + + return Reset.reset(test.repo, test.currentCommit, Reset.TYPE.HARD); + }); + }); + + it("can perform an annotated hard reset", function() { + var test = this; + + return resetFrom(test.repo, test.previousCommit, Reset.TYPE.HARD, true) .then(function(blob) { var currentCommitContents = test.currentCommitBlob.toString(); var previousCommitContents = test.previousCommitBlob.toString(); @@ -217,4 +269,43 @@ describe("Reset", function() { return Reset.reset(test.repo, test.currentCommit, Reset.TYPE.HARD); }); }); + + it("reset fails if parameter is not a Commit object", function() { + var test = this; + var commit = test.repo.getReferenceCommit("master"); + try { + Reset.reset(test.repo, commit, Reset.TYPE.HARD); + assert.fail( + "Should not be able to pass a Promise (Commit) into the function" + ); + } catch (err) { + // ok + assert.equal( + "Repository and target commit's repository does not match", + err.message + ); + } + }); + + it("reset fails if originating repository is not the same", function() { + var test = this; + var testCommit = null; + return test.repo.getReferenceCommit("master") + .then(function(commit) { + testCommit = commit; + return Repository.open(reposPath); + }) + .then(function(repo) { + return Reset.reset(repo, testCommit, Reset.TYPE.HARD); + }) + .then(function() { + assert.fail("Different source repository instance should fail"); + }) + .catch(function(err) { + assert.equal( + "Repository and target commit's repository does not match", + err.message + ); + }); + }); }); diff --git a/test/tests/revert.js b/test/tests/revert.js new file mode 100644 index 0000000000..accb529cae --- /dev/null +++ b/test/tests/revert.js @@ -0,0 +1,84 @@ +var _ = require("lodash"); +var assert = require("assert"); +var RepoUtils = require("../utils/repository_setup"); +var path = require("path"); +var fs = require("fs"); +var local = path.join.bind(path, __dirname); + +describe("Revert", function() { + var NodeGit = require("../../"); + + var Revert = NodeGit.Revert; + var RevertOptions = NodeGit.RevertOptions; + var Status = NodeGit.Status; + + var test; + var fileName = "foobar.js"; + var repoPath = local("../repos/revertRepo"); + + beforeEach(function() { + test = this; + + return RepoUtils.createRepository(repoPath) + .then(function(repository) { + test.repository = repository; + + return RepoUtils.commitFileToRepo( + repository, + fileName, + "line1\nline2\nline3" + ); + }) + .then(function(firstCommit) { + test.firstCommit = firstCommit; + }); + }); + + it("revert modifies the working directoy", function() { + var fileStats = fs.statSync(path.join(repoPath, fileName)); + assert.ok(fileStats.isFile()); + + return Revert.revert(test.repository, test.firstCommit, new RevertOptions()) + .then(function() { + try { + fs.statSync(path.join(repoPath, fileName)); + } catch (e) { + // we expect this not to exist + return; + } + + assert.fail("Working directory was not reverted"); + }); + }); + + it("revert modifies the index", function() { + return Revert.revert(test.repository, test.firstCommit, new RevertOptions()) + .then(() => test.repository.getStatus()) + .then((status) => { + assert.equal(1, status.length); + assert.ok(_.endsWith(fileName, status[0].path())); + assert.equal(Status.STATUS.INDEX_DELETED, status[0].statusBit()); + }); + }); + + it("RevertOptions is optional (unspecified)", function() { + return Revert.revert(test.repository, test.firstCommit) + .catch(function(error) { + throw error; + }); + }); + + it("RevertOptions is optional (null)", function() { + return Revert.revert(test.repository, test.firstCommit, null) + .catch(function(error) { + throw error; + }); + }); + + it("RevertOptions without MergeOptions should not segfault", function() { + return Revert.revert(test.repository, test.firstCommit, {}) + .catch(function(error) { + throw error; + }); + }); +}); diff --git a/test/tests/revparse.js b/test/tests/revparse.js new file mode 100644 index 0000000000..84ed44ca8c --- /dev/null +++ b/test/tests/revparse.js @@ -0,0 +1,66 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); + +describe("Revparse", function() { + var NodeGit = require("../../"); + var Repository = NodeGit.Repository; + var Revparse = NodeGit.Revparse; + + var reposPath = local("../repos/workdir"); + + beforeEach(function() { + var test = this; + return Repository.open(reposPath) + .then(function(repository) { + test.repository = repository; + return test.repository.getHeadCommit(); + }) + .then(function(commit) { + test.commit = commit; + }); + }); + + it("can revparse HEAD commit with single method", function() { + var test = this; + return Revparse.single(this.repository, "HEAD") + .then(function(headCommit) { + assert.ok(headCommit.isCommit()); + assert.equal(headCommit.id().toString(), test.commit.id().toString()); + }); + }); + + it("will fail on invalid spec", function() { + return Revparse.single(this.repository, "INVALID") + .then(function() { + + }) + .catch(function(error) { + assert.ok(error instanceof Error); + assert.equal(error.message, "revspec 'INVALID' not found"); + }); + }); + + it("will fail without repo", function() { + return Revparse.single("", "INVALID") + .then(function() { + + }) + .catch(function(error) { + assert.ok(error instanceof Error); + assert.equal(error.message, "Repository repo is required."); + }); + }); + + it("will fail without spec", function() { + return Revparse.single(this.repository) + .then(function() { + + }) + .catch(function(error) { + assert.ok(error instanceof Error); + assert.equal(error.message, "String spec is required."); + }); + }); + +}); diff --git a/test/tests/revwalk.js b/test/tests/revwalk.js index d871a2193c..bb1cd06ee5 100644 --- a/test/tests/revwalk.js +++ b/test/tests/revwalk.js @@ -1,7 +1,11 @@ var assert = require("assert"); +var RepoUtils = require("../utils/repository_setup"); +var fse = require("fs-extra"); var path = require("path"); var local = path.join.bind(path, __dirname); +var leakTest = require("../utils/leak_test"); + describe("Revwalk", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; @@ -27,6 +31,7 @@ describe("Revwalk", function() { beforeEach(function() { this.walker = this.repository.createRevWalk(); + this.walker.sorting(NodeGit.Revwalk.SORT.TIME); this.walker.push(this.commit.id()); }); @@ -82,7 +87,7 @@ describe("Revwalk", function() { it("can get a specified number of commits", function() { var test = this; var storedCommits; - return test.walker.getCommits() + return test.walker.getCommits(10) .then(function(commits) { assert.equal(commits.length, 10); storedCommits = commits; @@ -99,6 +104,33 @@ describe("Revwalk", function() { }); }); + it("can get the largest number of commits within a specified range", + function() { + var test = this; + var storedCommits; + return test.walker.getCommits(991) + .then(function(commits) { + assert.equal(commits.length, 990); + storedCommits = commits; + test.walker = test.repository.createRevWalk(); + test.walker.push(test.commit.id()); + }); + }); + + it("will return all commits from the revwalk if nothing matches", function() { + var test = this; + var magicSha = "notintherepoatallwhatsoeverisntthatcool"; + + function checkCommit(commit) { + return commit.toString() != magicSha; + } + + return test.walker.getCommitsUntil(checkCommit) + .then(function(commits) { + assert.equal(commits.length, 990); + }); + }); + it("can get commits until you tell it not to", function() { var test = this; var magicSha = "b8a94aefb22d0534cc0e5acf533989c13d8725dc"; @@ -114,6 +146,211 @@ describe("Revwalk", function() { }); }); + it("can do a fast walk", function() { + var test = this; + var magicSha = "b8a94aefb22d0534cc0e5acf533989c13d8725dc"; + + return test.walker.fastWalk(10) + .then(function(commitOids) { + assert.equal(commitOids.length, 10); + assert.equal(commitOids[3].toString(), magicSha); + }); + }); + + it("can get the history of a file", function() { + var test = this; + var magicShas = [ + "6ed3027eda383d417457b99b38c73f88f601c368", + "95cefff6aabd3c1f6138ec289f42fec0921ff610", + "7ad92a7e4d26a1af93f3450aea8b9d9b8069ea8c", + "96f077977eb1ffcb63f9ce766cdf110e9392fdf5", + "694adc5369687c47e02642941906cfc5cb21e6c2", + "eebd0ead15d62eaf0ba276da53af43bbc3ce43ab", + "1273fff13b3c28cfdb13ba7f575d696d2a8902e1" + ]; + + return test.walker.fileHistoryWalk("include/functions/copy.h", 1000) + .then(function(results) { + var shas = results.map(function(result) { + return result.commit.sha(); + }); + assert.equal(magicShas.length, shas.length); + magicShas.forEach(function(sha, i) { + assert.equal(sha, shas[i]); + }); + }); + }); + + it("can get the history of a dir", function() { + var test = this; + var magicShas = [ + "6ed3027eda383d417457b99b38c73f88f601c368", + "95cefff6aabd3c1f6138ec289f42fec0921ff610", + "7ad92a7e4d26a1af93f3450aea8b9d9b8069ea8c", + "96f077977eb1ffcb63f9ce766cdf110e9392fdf5", + "694adc5369687c47e02642941906cfc5cb21e6c2", + "eebd0ead15d62eaf0ba276da53af43bbc3ce43ab", + "1273fff13b3c28cfdb13ba7f575d696d2a8902e1", + "271c65ed16ab147cee715e1076e1d716156cc5a3", + "94d532004323641fd169f375869c36a82b32fac7", + "1c71929a905da9faab64472d53815d46ff4391dd", + "3947245612ae27077517038704b7a679e742658e", + "a44c81558d0f72ccf6c1facbe2ba0b9b711586a9", + "01d469416b26340ee4922d5171ef8dbe46c879f4" + ]; + + return test.walker.fileHistoryWalk("include/functions", 1000) + .then(function(results) { + var shas = results.map(function(result) { + return result.commit.sha(); + }); + assert.equal(magicShas.length, shas.length); + magicShas.forEach(function(sha, i) { + assert.equal(sha, shas[i]); + }); + }); + }); + + it("can get the history of a file while ignoring parallel branches", + function() { + var test = this; + var magicShas = [ + "f80e085e3118bbd6aad49dad7c53bdc37088bf9b", + "907b29d8a3b765570435c922a59cd849836a7b51" + ]; + var shas; + var walker = test.repository.createRevWalk(); + walker.sorting(NodeGit.Revwalk.SORT.TIME); + walker.push("115d114e2c4d5028c7a78428f16a4528c51be7dd"); + + return walker.fileHistoryWalk("README.md", 15) + .then(function(results) { + shas = results.map(function(result) { + return result.commit.sha(); + }); + assert.equal(magicShas.length, shas.length); + magicShas.forEach(function(sha, i) { + assert.equal(sha, shas[i]); + }); + + magicShas = [ + "be6905d459f1b236e44b2445df25aff1783993e9", + "4a34168b80fe706f52417106821c9cbfec630e47", + "f80e085e3118bbd6aad49dad7c53bdc37088bf9b", + "694b2d703a02501f288269bea7d1a5d643a83cc8", + "907b29d8a3b765570435c922a59cd849836a7b51" + ]; + + walker = test.repository.createRevWalk(); + walker.sorting(NodeGit.Revwalk.SORT.TIME); + walker.push("d46f7da82969ca6620864d79a55b951be0540bda"); + + return walker.fileHistoryWalk("README.md", 50); + }) + .then(function(results) { + shas = results.map(function(result) { + return result.commit.sha(); + }); + assert.equal(magicShas.length, shas.length); + magicShas.forEach(function(sha, i) { + assert.equal(sha, shas[i]); + }); + }); + }); + + it("can yield information about renames in a file history walk", + function() { + var treeOid; + var repo; + var fileNameA = "a.txt"; + var fileNameB = "b.txt"; + var repoPath = local("../repos/renamedFileRepo"); + var signature = NodeGit.Signature.create("Foo bar", + "foo@bar.com", 123456789, 60); + var headCommit; + + return RepoUtils.createRepository(repoPath) + .then(function(r) { + repo = r; + return RepoUtils.commitFileToRepo( + repo, + fileNameA, + "line1\nline2\nline3\n" + ); + }) + .then(function() { + return fse.move( + path.join(repoPath, fileNameA), + path.join(repoPath, fileNameB) + ); + }) + .then(function() { + return repo.refreshIndex(); + }) + .then(function(index) { + return index.addByPath(fileNameB) + .then(function() { + return index.removeByPath(fileNameA); + }) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oidResult) { + treeOid = oidResult; + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(head) { + return repo.getCommit(head); + }) + .then(function(head) { + return repo.createCommit("HEAD", signature, signature, + "renamed commit", treeOid, [head]); + }) + .then(function() { + return NodeGit.Reference.nameToId(repo, "HEAD"); + }) + .then(function(commitOid) { + headCommit = commitOid.tostrS(); + var walker = repo.createRevWalk(); + walker.sorting(NodeGit.Revwalk.SORT.TIME); + walker.push(commitOid.tostrS()); + return walker.fileHistoryWalk(fileNameB, 5); + }) + .then(function(results) { + assert.equal(results[0].status, NodeGit.Diff.DELTA.RENAMED); + assert.equal(results[0].newName, fileNameB); + assert.equal(results[0].oldName, fileNameA); + }) + .then(function() { + var walker = repo.createRevWalk(); + walker.sorting(NodeGit.Revwalk.SORT.TIME); + walker.push(headCommit); + return walker.fileHistoryWalk(fileNameA, 5); + }) + .then(function(results) { + assert.equal(results[0].status, NodeGit.Diff.DELTA.RENAMED); + assert.equal(results[0].newName, fileNameB); + assert.equal(results[0].oldName, fileNameA); + }) + .then(function() { + return fse.remove(repoPath); + }); + }); + + it("does not leak", function() { + var test = this; + + return leakTest(NodeGit.Revwalk, function() { + const walker = test.repository.createRevWalk(); + walker.push("115d114e2c4d5028c7a78428f16a4528c51be7dd"); + return walker.next(); + }); + }); + // This test requires forcing garbage collection, so mocha needs to be run // via node rather than npm, with a la `node --expose-gc [pathtohmoca] // [testglob]` @@ -124,8 +361,8 @@ describe("Revwalk", function() { var walker = repository.createRevWalk(); repository.getMasterCommit().then(function(firstCommitOnMaster) { - walker.walk(firstCommitOnMaster, function(err, commit) { - if (!err && !commit) { + walker.walk(firstCommitOnMaster.id(), function(err, commit) { + if (err && err.errno === NodeGit.Error.CODE.ITEROVER) { return done(); } @@ -152,7 +389,13 @@ describe("Revwalk", function() { promise = promise.then(getNext); } } - return promise; + return promise.catch(function(error) { + if (error && error.errno === NodeGit.Error.CODE.ITEROVER) { + return Promise.resolve(); + } else { + throw error; + } + }); function getNext() { return walker.next(); diff --git a/test/tests/signature.js b/test/tests/signature.js index 9c7613986e..e0387c3d3b 100644 --- a/test/tests/signature.js +++ b/test/tests/signature.js @@ -1,13 +1,9 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var promisify = require("promisify-node"); -var Promise = require("nodegit-promise"); -// Have to wrap exec, since it has a weird callback signature. -var exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); +var garbageCollect = require("../utils/garbage_collect.js"); +var exec = require("../../utils/execPromise"); describe("Signature", function() { var NodeGit = require("../../"); @@ -49,48 +45,90 @@ describe("Signature", function() { var savedUserName; var savedUserEmail; - var cleanUp = function() { + var cleanUp = () => { return exec("git config --global user.name \"" + savedUserName + "\"") - .then(function() { - return exec( - "git config --global user.email \"" + - savedUserEmail + - "\""); + .then(() => { + exec("git config --global user.email \"" + savedUserEmail + "\""); }); }; return exec("git config --global user.name") - .then(function(userName) { + .then((userName) => { savedUserName = userName.trim(); return exec("git config --global user.email"); }) - .then(function(userEmail) { + .then((userEmail) => { savedUserEmail = userEmail.trim(); return exec("git config --global --unset user.name"); }) - .then(function() { + .then(() => { return exec("git config --global --unset user.email"); }) - .then(function() { + .then(() => { return Repository.open(reposPath); }) - .then(function(repo) { - var sig = repo.defaultSignature(); - - assert.equal(sig.name(), "unknown"); - assert.equal(sig.email(), "unknown@unknown.com"); - + .then((repo) => { + return repo.defaultSignature(); }) - .then(function() { - cleanUp(); + .then((sig) => { + assert.equal(sig.name(), "unknown"); + assert.equal(sig.email(), "unknown@example.com"); }) - .catch(function(e) { - cleanUp() + .then(cleanUp) + .catch((e) => { + return cleanUp() .then(function() { return Promise.reject(e); }); }); }); + + it("duplicates time", function() { + garbageCollect(); + var Time = NodeGit.Time; + var startSelfFreeingCount = Time.getSelfFreeingInstanceCount(); + var startNonSelfFreeingCount = + Time.getNonSelfFreeingConstructedCount(); + var time = Signature.now(name, email).when(); + + garbageCollect(); + var endSelfFreeingCount = Time.getSelfFreeingInstanceCount(); + var endNonSelfFreeingCount = Time.getNonSelfFreeingConstructedCount(); + // we should get one duplicated, self-freeing time + assert.equal(startSelfFreeingCount + 1, endSelfFreeingCount); + assert.equal(startNonSelfFreeingCount, endNonSelfFreeingCount); + + time = null; + garbageCollect(); + endSelfFreeingCount = Time.getSelfFreeingInstanceCount(); + // the self-freeing time should get freed + assert.equal(startSelfFreeingCount, endSelfFreeingCount); + }); + + it("toString does not provide a timestamp by default", function () { + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + + assert.equal(signature.toString(), "Shaggy Rogers "); + }); + + it("toString provides the correct timestamp when requested", function() { + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + + assert.equal( + signature.toString(true), + "Shaggy Rogers 987654321 +0130" + ); + }); }); diff --git a/test/tests/stage.js b/test/tests/stage.js new file mode 100644 index 0000000000..34de76630f --- /dev/null +++ b/test/tests/stage.js @@ -0,0 +1,523 @@ +var assert = require("assert"); +var path = require("path"); +var fse = require("fs-extra"); + +var exec = require("../../utils/execPromise"); + +describe("Stage", function() { + var RepoUtils = require("../utils/repository_setup"); + var NodeGit = require("../../"); + var test; + + beforeEach(function() { + test = this; + var repoDir = "../repos/stagingRepo/"; + var repoPath = path.resolve(__dirname, repoDir); + + return RepoUtils.createRepository(repoPath) + .then(function(repo) { + test.repository = repo; + }); + }); + + after(function() { + return fse.remove(test.repository.workdir()); + }); + + function stagingTest(isUnstaged, newFileContent, discarding) { + var fileContent = newFileContent || + "One line of text\n" + + "Two lines of text\n"+ + "Three lines of text\n"+ + "Four lines of text\n"+ + "Five lines of text\n"+ + "Six lines of text\n"+ + "Seven lines of text\n"+ + "Eight lines of text\n"+ + "Nine lines of text\n"+ + "Ten lines of text\n"+ + "Eleven lines of text\n"+ + "Twelve lines of text\n"+ + "Thirteen lines of text\n"+ + "Fourteen lines of text\n"+ + "Fifteen lines of text\n"+ + "Sixteen lines of text\n"+ + "Seventeen lines of text\n"+ + "Eighteen lines of text\n"+ + "Nineteen lines of text\n"+ + "Twenty lines of text\n"; + var fileName = "stagedLinesTest.txt"; + var expectedContent; + var workingDirFile; + var getDiffFunction; + + if (!isUnstaged || discarding) { + expectedContent = fileContent.replace("Three", "Changed three") + .replace("Seventeen", "Changed seventeen"); + workingDirFile = expectedContent.replace("Fifteen", "Changed fifteen"); + } + else { + expectedContent = fileContent.replace("Fifteen", "Changed fifteen"); + workingDirFile = expectedContent.replace("Three", "Changed three") + .replace("Seventeen", "Changed seventeen"); + } + + if (isUnstaged) { + getDiffFunction = function() { + return test.repository.refreshIndex() + .then(function(index) { + return NodeGit.Diff.indexToWorkdir( + test.repository, + index, + { + flags: + NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | + NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS + } + ); + }); + }; + } + else { + getDiffFunction = function() { + return RepoUtils.addFileToIndex(test.repository, fileName) + .then(function() { + return test.repository.getBranchCommit("master"); + }) + .then(function(masterCommit) { + var treePromise = masterCommit.getTree(); + var indexPromise = test.repository.refreshIndex(); + + return Promise.all([treePromise, indexPromise]); + }) + .then(function(treeAndIndex) { + var masterTree = treeAndIndex[0]; + var index = treeAndIndex[1]; + return NodeGit.Diff.treeToIndex( + test.repository, + masterTree, + index, + { + flags: + NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | + NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS + } + ); + }); + }; + } + + return RepoUtils.commitFileToRepo(test.repository, fileName, fileContent) + .then(function() { + return fse.writeFile(path.join(test.repository.workdir(), fileName), + workingDirFile); + }) + .then(function() { + return getDiffFunction(); + }) + .then(function(fileDiff) { + return fileDiff.patches(); + }) + .then(function(patches) { + var pathPatch = patches.filter(function(patch) { + return patch.newFile().path() === fileName; + }); + return pathPatch[0].hunks(); + }) + .then(function(pathHunks) { + var linePromises = []; + + pathHunks.forEach(function(pathHunk) { + linePromises.push(pathHunk.lines()); + }); + + return Promise.all(linePromises); + }) + .then(function(lines) { + var linesToStage = []; + lines.forEach(function(hunkLines) { + hunkLines.forEach(function(line) { + if (line.content().toLowerCase().indexOf("fifteen") >= 0){ + linesToStage.push(line); + } + }); + }); + + if (discarding) { + return test.repository.discardLines(fileName, linesToStage); + } + + return test.repository.stageLines(fileName, linesToStage, !isUnstaged); + }) + .then(function() { + if (discarding) { + return fse.readFile( + path.join(test.repository.workdir(), fileName), "utf8" + ); + } + + return test.repository.refreshIndex() + .then(function(reloadedIndex) { + var pathOid = reloadedIndex.getByPath(fileName).id; + return test.repository.getBlob(pathOid); + }); + }) + .then(function(resultFileContents) { + assert.equal(resultFileContents.toString(), expectedContent); + }); + } + + it("can stage selected lines", function() { + return stagingTest(true); + }); + it("can unstage selected lines", function() { + return stagingTest(false); + }); + + //This is used to test cases where there are no newline at EOF + var newlineEofTestFileContent = + "One line of text\n" + + "Two lines of text\n"+ + "Three lines of text\n"+ + "Four lines of text\n"+ + "Five lines of text\n"+ + "Six lines of text\n"+ + "Seven lines of text\n"+ + "Eight lines of text\n"+ + "Nine lines of text\n"+ + "Ten lines of text\n"+ + "Eleven lines of text\n"+ + "Twelve lines of text\n"+ + "Thirteen lines of text\n"+ + "Fourteen lines of text\n"+ + "Fifteen lines of text"; + it("can stage last line with no newline at EOF", function() { + return stagingTest(true, newlineEofTestFileContent); + }); + it("can unstage last line with no newline at EOF", function() { + return stagingTest(false, newlineEofTestFileContent); + }); + it("can stage second to last line with no newline at EOF", function() { + var newlineEofTestFileContent2 = newlineEofTestFileContent + + "\nSixteen lines of text\nSeventeen lines of text\nEighteen lines of text"; + return stagingTest(true, newlineEofTestFileContent2); + }); + it("can unstage second to last line with no newline at EOF", function() { + var newlineEofTestFileContent2 = newlineEofTestFileContent + + "\nSixteen lines of text\nSeventeen lines of text\nEighteen lines of text"; + return stagingTest(false, newlineEofTestFileContent2); + }); + + //This is used to test case where the last hunk is staged. + var lastHunkStagedFileContent = + "Thirteen lines of text\n"+ + "Fourteen lines of text\n"+ + "Fifteen lines of text\n"+ + "Sixteen lines of text\n"+ + "Shforteenteen lines of text\n"; + + it("staging last hunk stages whole file if no filemode changes", function() { + return stagingTest(true, lastHunkStagedFileContent) + .then(function() { + return test.repository.refreshIndex(); + }) + .then(function(index) { + return NodeGit.Diff.indexToWorkdir(test.repository, index, { + flags: + NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | + NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS + }); + }) + .then(function(diff) { + assert.equal(Object.keys(diff).length, 0); //Empty diff + return diff.patches(); + }) + .then(function(patches) { + //patches will have at least one item if there is something unstaged + assert.equal(patches.length, 0); + }); + }); + + function compareFilemodes(vsWorkdir, index, fileModeDifference) { + //Takes diff of head commit vs Workdir (if vsWorkdir is set) or vs Index + //(if vsWorkdir is unset). Note: there's only one file in the filemode + //staging tests for which this helper fn was written. + //index - index to use (vsWorkdir is unset) + //fileModeDifference - expected (newfilemode) - (oldfilemode) + return test.repository.getHeadCommit() + .then(function(commit) { + return commit.getTree(); + }) + .then(function(tree) { + if (vsWorkdir) { + return NodeGit.Diff.treeToWorkdir(test.repository, tree); + } else { + return NodeGit.Diff.treeToIndex(test.repository, tree, index); + } + }) + .then(function(diff) { + return diff.getDelta(0); + }) + .then(function(delta) { + if (fileModeDifference === 0) { + if (!delta) { + return true; + } else { + throw ("File change when no file change expected."); + } + } else { + assert(delta.newFile().mode() - delta.oldFile().mode() === + fileModeDifference); + } + return true; + }); + } + + function createAndCommitFiles(repo, filePaths, fileContent, afterWriteFn) { + filePaths = filePaths instanceof Array ? filePaths : [filePaths]; + var filePromises = filePaths.map(function(fileName) { + return RepoUtils.commitFileToRepo(repo, fileName, fileContent) + .then(function() { + //First, create a file, have the same file in both the repo and workdir. + return fse.writeFile(path.join(repo.workdir(), fileName), fileContent); + }) + .then(function() { + return afterWriteFn(repo, fileName); + }); + }); + + return Promise.all(filePromises); + } + + if (process.platform == "linux" || process.platform == "darwin") { + it("can stage filemode changes for one file", function() { + var fileContent = "Blek"; + var fileName = "stageFilemodeTest.txt"; + var index; + + function afterWriteFn(repo, fileName) { + return fse.chmod(path.join(repo.workdir(), fileName), + 0755 /* new filemode */); + } + + return createAndCommitFiles( + test.repository, fileName, fileContent, afterWriteFn + ) + //Then, diff between head commit and workdir should have filemode change + .then(function() { + return compareFilemodes(true, null, 0111 /* expect +x */) + .then(function() { + return test.repository.stageFilemode(fileName, true); + }); + }) + //Now lets do a commit... + .then(function() { + return test.repository.refreshIndex(); + }) + .then(function(_index) { + index = _index; + return index.writeTree(); + }) + .then(function (oid) { + return test.repository.getHeadCommit() + .then(function(parent) { + var signature = NodeGit.Signature.create("Foo bar", + "foo@bar.com", 123456789, 60); + return test.repository.createCommit("HEAD", signature, signature, + "initial commit", oid, [parent]); + }); + //... alright, we did a commit. + }) + // Now if we compare head commit to the workdir, + // there shouldn't be a filemode change + .then(function() { + return compareFilemodes(true, null, 0); + }); + }); + + it("can unstage filemode changes", function() { + var fileContent = "Blek"; + var fileName = "stageFilemodeTest2.txt"; + var index; + + function afterWriteFn(repo, fileName) { + return fse.chmod(path.join(repo.workdir(), fileName), + 0755 /* new filemode */); + } + + return createAndCommitFiles( + test.repository, + fileName, + fileContent, + afterWriteFn + ) + //Then, diff between head commit and workdir should have filemode change + .then(function() { + return compareFilemodes(true, null, 0111 /* expect +x */); + }) + .then(function() { + return test.repository.refreshIndex(); + }) + .then(function(repoIndex) { + //Now we stage the whole file... + index = repoIndex; + return index.addByPath(fileName); + }) + .then(function() { + return index.write(); + }) + .then(function() { + //We expect the Index to have the filemode changes now. + return compareFilemodes(false, index, 0111 /* expect +x */) + .then(function() { + //...then we attempt to unstage filemode + return test.repository.stageFilemode(fileName, false /* unstage */); + }); + }) + .then(function() { + return test.repository.refreshIndex(); + }) + //We expect the Index to have no filemode changes, since we unstaged. + .then(function(freshIndex) { + return compareFilemodes(false, freshIndex, 0 /* expect +x */); + }) + //We also expect the workdir to now have the filemode change. + .then(function() { + return compareFilemodes(true, null, 0111 /* expect +x */); + }); + }); + } else if (process.platform == "win32") { + it("can stage/unstage filemode changes for one file", function() { + var fileContent = "Blek"; + var fileName = "stageFilemodeTest.txt"; + var index; + + function afterWriteFn(repo, fileName) { + //change the permission on index + return exec("git update-index --chmod=+x " + fileName, + {cwd: repo.workdir()}) + .then(function() { + //Commit the change with execute bit set + return exec("git commit -m 'test'", + {cwd: repo.workdir()}); + }) + .then(function() { + //Then, change the permission on index + return exec("git update-index --chmod=-x " + fileName, + {cwd: repo.workdir()}); + }); + } + + return createAndCommitFiles( + test.repository, fileName, fileContent, afterWriteFn + ) + .then(function() { + return test.repository.refreshIndex(); + }) + .then(function(repoIndex) { + index = repoIndex; + //Head commit vs index + //We expect the Index to have +x + return compareFilemodes(false, index, -0111 /* expect +x */); + }) + .then(function() { + //...then we attempt to unstage filemode + return test.repository.stageFilemode(fileName, false /* unstage */); + }) + .then(function() { + return test.repository.refreshIndex(); + }) + .then(function(freshIndex) { + return compareFilemodes(false, freshIndex, 0 /* expect nochange */); + }); + }); + } + + it("can stage/unstage filemode changes for multiple files", function() { + var fileContent = "Blek"; + var fileName = ["stageFilemodeTest.txt", "stageFilemodeTest2.txt"]; + var index; + + var repoWorkDir = test.repository.workdir(); + var signature = NodeGit.Signature.create("Foo bar", + "foo@bar.com", 123456789, 60); + + return Promise.all(fileName.map(function(file) { + return fse.writeFile(path.join(repoWorkDir, file), fileContent); + })) + .then(function() { + // Initial commit + return test.repository.refreshIndex(); + }) + .then(function(index) { + return fileName + .reduce(function(lastPromise, file) { + return lastPromise + .then(function() { + return index.addByPath(file); + }); + }, Promise.resolve()) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }) + .then(function(oid) { + return test.repository.createCommit("HEAD", signature, signature, + "initial commit", oid, []); + }) + .then(function(commitOid) { + return test.repository.getCommit(commitOid); + }) + .then(function() { + //change the permission on index + return exec("git update-index --chmod=+x " + fileName[0], + {cwd: test.repository.workdir()}); + }) + .then(function() { + //change the permission on index + return exec("git update-index --chmod=+x " + fileName[1], + {cwd: test.repository.workdir()}); + }) + .then(function() { + //Commit the change with execute bit set + return exec("git commit -m 'test'", + {cwd: test.repository.workdir()}); + }) + .then(function() { + //Then, change the permission on index back to -x + return exec("git update-index --chmod=-x " + fileName[0], + {cwd: test.repository.workdir()}); + }) + .then(function() { + //Then, change the permission on index back to -x + return exec("git update-index --chmod=-x " + fileName[1], + {cwd: test.repository.workdir()}); + }) + .then(function() { + return test.repository.refreshIndex(); + }) + .then(function(repoIndex) { + index = repoIndex; + //Head commit vs index + //We expect the Index to have +x + return compareFilemodes(false, index, -0111 /* expect +x */); + }) + .then(function() { + //...then we attempt to unstage filemode + return test.repository.stageFilemode(fileName, false /* unstage */); + }) + .then(function() { + return test.repository.refreshIndex(); + }) + .then(function(freshIndex) { + return compareFilemodes(false, freshIndex, 0 /* expect nochange */); + }); + }); + + it("can discard selected lines", function() { + return stagingTest(true, null, true); + }); +}); diff --git a/test/tests/stash.js b/test/tests/stash.js index 0af8e7587c..811a0c5091 100644 --- a/test/tests/stash.js +++ b/test/tests/stash.js @@ -1,8 +1,6 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var Promise = require("nodegit-promise"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); describe("Stash", function() { @@ -32,25 +30,24 @@ describe("Stash", function() { }); }); - it("can save and drop a stash", function() { - var fileName = "README.md"; - var fileContent = "Cha-cha-cha-chaaaaaangessssss"; - var repo = this.repository; - var filePath = path.join(repo.workdir(), fileName); - var oldContent; - var stashes = []; - var stashOid; - var stashMessage = "stash test"; + function saveDropStash(repo, stashMessage) { + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + let stashes = []; + let stashOid; return fse.readFile(filePath) - .then(function(content) { + .then((content) => { oldContent = content; return fse.writeFile(filePath, fileContent); }) - .then(function() { - return Stash.save(repo, repo.defaultSignature(), stashMessage, 0); + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); }) - .then(function(oid) { + .then((oid) => { stashOid = oid; var stashCb = function(index, message, oid) { stashes.push({index: index, message: message, oid: oid}); @@ -58,30 +55,276 @@ describe("Stash", function() { return Stash.foreach(repo, stashCb); }) - .then(function() { + .then(() => { assert.equal(stashes.length, 1); assert.equal(stashes[0].index, 0); - assert.equal(stashes[0].message, "On master: " + stashMessage); + const expectedMessage = !stashMessage ? + "WIP on master: 32789a7 Fixes EJS not being installed via NPM" : + "On master: " + stashMessage; + assert.equal(stashes[0].message, expectedMessage); assert.equal(stashes[0].oid.toString(), stashOid.toString()); return Stash.drop(repo, 0); }) - .then(function () { + .then(() => { stashes = []; - var stashCb = function(index, message, oid) { + var stashCb = (index, message, oid) => { stashes.push({index: index, message: message, oid: oid}); }; return Stash.foreach(repo, stashCb); }) - .then(function() { + .then(() => { assert.equal(stashes.length, 0); }) - .catch(function(e) { + .catch((e) => { return fse.writeFile(filePath, oldContent) - .then(function() { + .then(() => { return Promise.reject(e); }); }); + } + + it("can save and drop a stash", function() { + return saveDropStash(this.repository, "stash test"); + }); + + it("can save a stash with no message and drop it", function() { + return saveDropStash(this.repository, null); + }); + + it("can save and pop a stash", function() { + const fileNameA = "README.md"; + const fileNameB = "install.js"; + let oldContentA; + let oldContentB; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const repo = this.repository; + const filePathA = path.join(repo.workdir(), fileNameA); + const filePathB = path.join(repo.workdir(), fileNameB); + const stashMessage = "stash test"; + + return fse.readFile(filePathA, "utf-8") + .then((content) => { + oldContentA = content; + return fse.writeFile(filePathA, fileContent); + }) + .then(() => { + return fse.readFile(filePathB, "utf-8"); + }) + .then((content) => { + oldContentB = content; + return fse.writeFile(filePathB, fileContent); + }) + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); + }) + .then(() => { + return fse.readFile(filePathA, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentA, content); + return fse.readFile(filePathB, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentB, content); + return Stash.pop(repo, 0); + }) + .then(() => { + return fse.readFile(filePathA, "utf-8"); + }) + .then((content) => { + assert.equal(fileContent, content); + return fse.readFile(filePathB, "utf-8"); + }) + .then((content) => { + assert.equal(fileContent, content); + }); + }); + + it("can save a stash, change files, and fail to pop stash", function() { + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const fileContent2 = "Somewhere over the repo, changes were made."; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessage = "stash test"; + + return fse.readFile(filePath) + .then((content) => { + oldContent = content; + return fse.writeFile(filePath, fileContent); + }) + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); + }) + .then(() => { + return fse.writeFile(filePath, fileContent2); + }) + .then(() => { + return Stash.pop(repo, 0); + }) + .catch((reason) => { + if (reason.message !== "1 conflict prevents checkout") { + throw reason; + } else { + return Promise.resolve(); + } + }); + }); + + it("can save, apply, then drop the stash", function() { + const fileName = "README.md"; + const fileContent = "Cha-cha-cha-chaaaaaangessssss"; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessage = "stash test"; + + return fse.readFile(filePath) + .then((content) => { + oldContent = content; + return fse.writeFile(filePath, fileContent); + }) + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, stashMessage, 0); + }) + .then(() => { + return Stash.apply(repo, 0); + }) + .then(() => { + return Stash.drop(repo, 0); + }, () => { + throw new Error("Unable to drop stash after apply."); + }) + .then(() => { + return Stash.drop(repo, 0); + }) + .catch((reason) => { + if (reason.message !== "reference 'refs/stash' not found") { + throw reason; + } + }); + }); + + it("can save multiple stashes and pop an arbitrary stash", function() { + const fileName = "README.md"; + const fileContentA = "Hi. It's me. I'm the dog. My name is the dog."; + const fileContentB = "Everyone likes me. I'm cute."; + const fileContentC = + "I think I will bark at nothing now. Ba. Ba. Baba Baba."; + const repo = this.repository; + const filePath = path.join(repo.workdir(), fileName); + let oldContent; + const stashMessageA = "stash test A"; + const stashMessageB = "stash test B"; + const stashMessageC = "stash test C"; + + const writeAndStash = (path, content, message) => { + return fse.writeFile(path, content) + .then(() => repo.defaultSignature()) + .then((signature) => { + return Stash.save(repo, signature, message, 0); + }); + }; + + return fse.readFile(filePath, "utf-8") + .then((content) => { + oldContent = content; + return writeAndStash(filePath, fileContentA, stashMessageA); + }) + .then(() => { + return writeAndStash(filePath, fileContentB, stashMessageB); + }) + .then(() => { + return writeAndStash(filePath, fileContentC, stashMessageC); + }) + .then(() => { + return fse.readFile(filePath, "utf-8"); + }) + .then((content) => { + assert.equal(oldContent, content); + return Stash.pop(repo, 1); + }) + .then(() => { + return fse.readFile(filePath, "utf-8"); + }) + .then((content) => { + assert.equal(fileContentB, content); + }); + }); + + it("can partial stash the workdir and pop it", function() { + const repo = this.repository; + + const fileName1 = "README.md"; + const fileName2 = "install.js"; + const fileName3 = "LICENSE"; + + const fileContentA = "Hi. It's me. I'm the dog. My name is the dog."; + const fileContentB = "Everyone likes me. I'm cute."; + + let oldContentA; + let oldContentB; + let oldContentC; + + const filePath1 = path.join(repo.workdir(), fileName1); + const filePath2 = path.join(repo.workdir(), fileName2); + const filePath3 = path.join(repo.workdir(), fileName3); + + const options = { + flags: 0, + message: "stast test", + paths: [fileName1, fileName2] + }; + + return fse.readFile(filePath1, "utf-8") + .then((content) => { + oldContentA = content; + return fse.readFile(filePath2, "utf-8"); + }) + .then((content) => { + oldContentB = content; + return fse.readFile(filePath3, "utf-8"); + }) + .then((content) => { + oldContentC = content; + return fse.writeFile(filePath1, fileContentA); + }) + .then(() => fse.writeFile(filePath2, fileContentB)) + .then(() => repo.defaultSignature()) + .then((signature) => { + options.stasher = signature; + return Stash.saveWithOpts(repo, options); + }) + .then(() => fse.readFile(filePath1, "utf-8")) + .then((content) => { + assert.equal(oldContentA, content); + return fse.readFile(filePath2, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentB, content); + return fse.readFile(filePath3, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentC, content); + return Stash.pop(repo, 0); + }) + .then(() => fse.readFile(filePath1, "utf-8")) + .then((content) => { + assert.equal(fileContentA, content); + return fse.readFile(filePath2, "utf-8"); + }) + .then((content) => { + assert.equal(fileContentB, content); + return fse.readFile(filePath3, "utf-8"); + }) + .then((content) => { + assert.equal(oldContentC, content); + }); }); }); diff --git a/test/tests/status.js b/test/tests/status.js index 7c8a3ed89e..f3caeb7bf4 100644 --- a/test/tests/status.js +++ b/test/tests/status.js @@ -1,12 +1,8 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var Promise = require("nodegit-promise"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); -var exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); +var exec = require("../../utils/execPromise"); describe("Status", function() { var NodeGit = require("../../"); @@ -105,7 +101,27 @@ describe("Status", function() { .then(function() { return Promise.reject(e); }); + }); + }); + it("gets status on non-existent file results in error", function() { + var fileName = "non-existent-Status.file-test.txt"; + var repo = this.repository; + var filePath = path.join(repo.workdir(), fileName); + return exec("git clean -xdf", {cwd: reposPath}) + .then(function() { + assert.equal(false, fse.existsSync(filePath)); + return Status.file(repo, filePath) + .then(function() { + assert.fail("Non-existent file should throw error on Status.file"); + }, function(err) { + assert.equal(NodeGit.Error.CODE.ENOTFOUND, err.errno); + assert.equal("Status.file", err.errorFunction); + assert.equal( + "attempt to get status of nonexistent file '" + filePath + "'", + err.message + ); + }); }); }); }); diff --git a/test/tests/status_file.js b/test/tests/status_file.js index dd709eee87..039296aac0 100644 --- a/test/tests/status_file.js +++ b/test/tests/status_file.js @@ -6,23 +6,80 @@ describe("StatusFile", function() { var StatusFile = NodeGit.StatusFile; var pathName = "README.md"; - var statusCode = Status.STATUS.WT_NEW; - before(function() { - this.status = new StatusFile({path: pathName, status: statusCode}); + function testStatusFile(status) { + var statusFile = new StatusFile({ + path: pathName, + status: Status.STATUS[status] + }); + var specialFunction = status.replace(/^(WT|INDEX)_/, ""); + specialFunction = "is" + + specialFunction[0] + + specialFunction.substring(1).toLowerCase(); + if (/^WT_/.test(status)) { + assert.ok(statusFile.inWorkingTree()); + assert.ok(!statusFile.inIndex()); + } + if (/^INDEX_/.test(status)) { + assert.ok(!statusFile.inWorkingTree()); + assert.ok(statusFile.inIndex()); + } + assert.equal(statusFile.path(), pathName); + assert.equal(statusFile.statusBit(), Status.STATUS[status]); + assert.equal(statusFile.status(), status); + assert.ok(statusFile[specialFunction]()); + } + + it.skip("identifies the proper statuses for CURRENT", function() { + testStatusFile("CURRENT"); + }); + + it.skip("identifies the proper statuses for WT_UNREADABLE", function() { + testStatusFile("WT_UNREADABLE"); + }); + + it("identifies the proper statuses for WT_NEW", function() { + testStatusFile("WT_NEW"); + }); + + it("identifies the proper statuses for WT_MODIFIED", function() { + testStatusFile("WT_MODIFIED"); + }); + + it("identifies the proper statuses for WT_DELETED", function() { + testStatusFile("WT_DELETED"); + }); + + it("identifies the proper statuses for WT_TYPECHANGE", function() { + testStatusFile("WT_TYPECHANGE"); + }); + + it("identifies the proper statuses for WT_RENAMED", function() { + testStatusFile("WT_RENAMED"); + }); + + it("identifies the proper statuses for IGNORED", function() { + testStatusFile("IGNORED"); }); - it("passes the path to the working function", function() { - assert.equal(this.status.path(), pathName); + it("identifies the proper statuses for INDEX_NEW", function() { + testStatusFile("INDEX_NEW"); }); - it("identifies the proper statuses", function() { - assert.ok(this.status.isNew()); - assert.ok(!this.status.isModified()); + it("identifies the proper statuses for INDEX_MODIFIED", function() { + testStatusFile("INDEX_MODIFIED"); }); - it("detects working tree and index statuses", function() { - assert.ok(this.status.inWorkingTree()); - assert.ok(!this.status.inIndex()); + it("identifies the proper statuses for INDEX_DELETED", function() { + testStatusFile("INDEX_DELETED"); }); + + it("identifies the proper statuses for INDEX_TYPECHANGE", function() { + testStatusFile("INDEX_TYPECHANGE"); + }); + + it("identifies the proper statuses for INDEX_RENAMED", function() { + testStatusFile("INDEX_RENAMED"); + }); + }); diff --git a/test/tests/status_list.js b/test/tests/status_list.js index 95315a9a6b..68a08910ec 100644 --- a/test/tests/status_list.js +++ b/test/tests/status_list.js @@ -1,12 +1,8 @@ var assert = require("assert"); var path = require("path"); -var promisify = require("promisify-node"); -var Promise = require("nodegit-promise"); -var fse = promisify(require("fs-extra")); +var fse = require("fs-extra"); var local = path.join.bind(path, __dirname); -var exec = promisify(function(command, opts, callback) { - return require("child_process").exec(command, opts, callback); -}); +var exec = require("../../utils/execPromise"); describe("StatusList", function() { var NodeGit = require("../../"); diff --git a/test/tests/submodule.js b/test/tests/submodule.js new file mode 100644 index 0000000000..2323fa56ca --- /dev/null +++ b/test/tests/submodule.js @@ -0,0 +1,194 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); + +describe("Submodule", function() { + var NodeGit = require("../../"); + var Repository = NodeGit.Repository; + var RepoUtils = require("../utils/repository_setup"); + var Submodule = NodeGit.Submodule; + + var repoPath = local("../repos/submodule"); + + beforeEach(function() { + var test = this; + + return RepoUtils.createRepository(repoPath) + .then(function(repo) { + test.repository = repo; + return Repository.open(local("../repos/workdir")); + }) + .then(function(repo) { + test.workdirRepository = repo; + }); + }); + + it("can walk over the submodules", function() { + var repo = this.workdirRepository; + var submoduleName = "vendor/libgit2"; + + return repo.getSubmoduleNames() + .then(function(submodules) { + assert.equal(submodules.length, 1); + + var submodule = submodules[0]; + assert.equal(submodule, submoduleName); + return submodule; + }) + .then(function(submodule) { + return Submodule.lookup(repo, submodule); + }) + .then(function(submodule) { + assert.equal(submodule.name(), submoduleName); + }); + }); + + it("can get submodule status", function() { + var repo = this.workdirRepository; + var submoduleName = "vendor/libgit2"; + + return Submodule.status(repo, submoduleName, Submodule.IGNORE.NONE) + .then(function(status) { + assert.equal(Submodule.STATUS.IN_CONFIG, status); + }); + }); + + it("can get submodule location", function() { + var repo = this.workdirRepository; + var submoduleName = "vendor/libgit2"; + + return Submodule.lookup(repo, submoduleName) + .then(function(submodule) { + return submodule.location(); + }) + .then(function(status) { + assert.equal(Submodule.STATUS.IN_CONFIG, status); + }); + }); + + it("can set submodule ignore", function() { + var repo = this.workdirRepository; + var submoduleName = "vendor/libgit2"; + + return Submodule.setIgnore(repo, submoduleName, Submodule.IGNORE.ALL) + .then(function() { + return Submodule.lookup(repo, submoduleName); + }) + .then(function(submodule) { + assert.equal(Submodule.IGNORE.ALL, submodule.ignore()); + }); + }); + + it("can set submodule url", function() { + var repo = this.workdirRepository; + var submoduleName = "vendor/libgit2"; + var submoduleUrl = "https://github.com/githubtraining/hellogitworld.git"; + + return Submodule.setUrl(repo, submoduleName, submoduleUrl) + .then(function() { + return Submodule.lookup(repo, submoduleName); + }) + .then(function(submodule) { + assert.equal(submoduleUrl, submodule.url()); + }); + }); + + it("can set submodule update", function() { + var repo = this.workdirRepository; + var submoduleName = "vendor/libgit2"; + + return Submodule.setUpdate(repo, submoduleName, Submodule.UPDATE.NONE) + .then(function() { + return Submodule.lookup(repo, submoduleName); + }) + .then(function(submodule) { + assert.equal(Submodule.UPDATE.NONE, submodule.updateStrategy()); + }); + }); + + it("can setup and finalize submodule add", function() { + this.timeout(30000); + + var repo = this.repository; + var submodulePath = "nodegittest"; + var submoduleUrl = "https://github.com/nodegit/test.git"; + + var submodule; + var submoduleRepo; + + return NodeGit.Submodule.addSetup(repo, submoduleUrl, submodulePath, 0) + .then(function(_submodule) { + submodule = _submodule; + + return submodule.init(0); + }) + .then(function() { + return submodule.open(); + }) + .then(function(_submoduleRepo) { + submoduleRepo = _submoduleRepo; + return submoduleRepo.fetch("origin", null, null); + }) + .then(function() { + return submoduleRepo.getReference("origin/master"); + }) + .then(function(reference) { + return reference.peel(NodeGit.Object.TYPE.COMMIT); + }) + .then(function(commit) { + return submoduleRepo.createBranch("master", commit.id()); + }) + .then(function() { + return submodule.addFinalize(); + }) + .then(function() { + // check whether the submodule exists + return Submodule.lookup(repo, submodulePath); + }) + .then(function(submodule) { + assert.equal(submodule.name(), submodulePath); + // check whether .gitmodules and the submodule are in the index + return repo.refreshIndex(); + }) + .then(function(index) { + var entries = index.entries(); + assert.equal(entries.length, 2); + assert.equal(entries[0].path, ".gitmodules"); + assert.equal(entries[1].path, submodulePath); + }); + }); + + it("can run sync callback without deadlocking", function() { + var repo = this.workdirRepository; + var submodules = []; + var submoduleCallback = function(submodule, name, payload) { + var submoduleName = submodule.name(); + assert.equal(submoduleName, name); + submodules.push(name); + }; + + return Submodule.foreach(repo, submoduleCallback).then(function() { + assert.equal(submodules.length, 1); + }); + }); + + // 'Submodule.foreach' and 'Submodule.lookup' do work with the repo locked. + // They should work together without deadlocking. + it("can run async callback without deadlocking", function() { + var repo = this.workdirRepository; + var submodules = []; + var submoduleCallback = function(submodule, name, payload) { + var owner = submodule.owner(); + + return Submodule.lookup(owner, name) + .then(function(submodule) { + assert.equal(submodule.name(), name); + submodules.push(name); + }); + }; + + return Submodule.foreach(repo, submoduleCallback).then(function() { + assert.equal(submodules.length, 1); + }); + }); +}); diff --git a/test/tests/tag.js b/test/tests/tag.js index 663c1dd84e..21acdcc1bc 100644 --- a/test/tests/tag.js +++ b/test/tests/tag.js @@ -1,7 +1,6 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); -var Promise = require("nodegit-promise"); describe("Tag", function() { var NodeGit = require("../../"); @@ -10,12 +9,15 @@ describe("Tag", function() { var Obj = NodeGit.Object; var Oid = NodeGit.Oid; var Reference = NodeGit.Reference; + var Signature = NodeGit.Signature; var reposPath = local("../repos/workdir"); var tagName = "annotated-tag"; + var tagPattern = "annotated*"; var tagFullName = "refs/tags/" + tagName; var tagOid = "dc800017566123ff3c746b37284a24a66546667e"; var commitPointedTo = "32789a79e71fbc9e04d3eff7425e1771eb595150"; + var commitPointedTo2 = "c82fb078a192ea221c9f1093c64321c60d64aa0d"; var tagMessage = "This is an annotated tag\n"; function testTag(tag, name) { @@ -23,10 +25,11 @@ describe("Tag", function() { assert.equal(tag.targetType(), Obj.TYPE.COMMIT); assert.equal(tag.message(), tagMessage); - var target = tag.target(); - - assert.ok(target.isCommit()); - assert.equal(target.id().toString(), commitPointedTo); + return tag.target() + .then(function(target) { + assert.ok(target.isCommit()); + assert.equal(target.id().toString(), commitPointedTo); + }); } beforeEach(function() { @@ -41,21 +44,21 @@ describe("Tag", function() { it("can get a tag from a repo via the tag name", function() { return this.repository.getTagByName(tagName) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); it("can get a tag from a repo via the long tag name", function() { return this.repository.getTagByName(tagFullName) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); it("can get a tag from a repo via the tag's OID as a string", function() { return this.repository.getTag(tagOid) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); @@ -64,7 +67,7 @@ describe("Tag", function() { return this.repository.getTag(oid) .then(function(tag) { - testTag(tag); + return testTag(tag); }); }); @@ -79,6 +82,13 @@ describe("Tag", function() { }); }); + it("can list tags of a pattern in a repo", function() { + return Tag.listMatch(tagPattern, this.repository) + .then(function(tagNames) { + assert.equal(tagNames.length, 1); + }); + }); + it("can create a new annotated tag in a repo and delete it", function() { var oid = Oid.fromString(commitPointedTo); var name = "created-annotated-tag"; @@ -86,7 +96,7 @@ describe("Tag", function() { return repository.createTag(oid, name, tagMessage) .then(function(tag) { - testTag(tag, name); + return testTag(tag, name); }) .then(function() { return repository.createTag(oid, name, tagMessage); @@ -145,4 +155,532 @@ describe("Tag", function() { return Promise.resolve(); }); }); + + it("can create a new signed tag with Tag.create and delete it", function() { + var name = "created-signed-tag-create"; + var repository = this.repository; + var signature = null; + var commit = null; + var commit2 = null; + + return Signature.default(repository) + .then(function(signatureResult) { + signature = signatureResult; + return repository.getCommit(commitPointedTo); + }) + .then(function(theCommit) { + commit = theCommit; + return repository.getCommit(commitPointedTo2); + }) + .then(function(theCommit2) { + commit2 = theCommit2; + return Tag.create(repository, name, commit, signature, tagMessage, 1); + }) + .then(function(oid) { + return repository.getTag(oid); + }) + .then(function(tag) { + assert(tag.tagger(), signature); + return testTag(tag, name); + }) + .then(function() { + // overwriting is okay + return Tag.create(repository, name, commit2, signature, tagMessage, 1); + }) + .then(function() { + // overwriting is not okay + return Tag.create(repository, name, commit, signature, tagMessage, 0); + }) + .then(function() { + return Promise.reject(new Error("should not be able to create the '" + + name + "' tag twice")); + }, function() { + return Promise.resolve() + .then(function() { + return repository.deleteTagByName(name); + }) + .then(function() { + return Reference.lookup(repository, "refs/tags/" + name); + }) + .then(function() { + return Promise.reject(new Error("the tag '" + name + + "' should not exist")); + }, function() { + return Promise.resolve(); + }); + }); + }); + + it("can create a Tag buffer", function() { + const targetOid = Oid.fromString(commitPointedTo); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + + return Tag.createBuffer(repository, name, targetOid, signature, message) + .then((tagBuffer) => { + const lines = tagBuffer.split("\n"); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + }); + }); + + it("can create a Tag from a Tag buffer", function() { + const targetOid = Oid.fromString(commitPointedTo); + const otherTargetOid = Oid.fromString(commitPointedTo2); + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + + let odb; + let buffer; + let otherBuffer; + + return repository.odb() + .then((odbResult) => { + odb = odbResult; + return Tag.createBuffer( + repository, + name, + targetOid, + signature, + message + ); + }) + .then((bufferResult) => { + buffer = bufferResult; + return Tag.createBuffer( + repository, + name, + otherTargetOid, + signature, + message + ); + }) + .then((bufferResult) => { + otherBuffer = bufferResult; + return Tag.createFromBuffer(repository, buffer, 1); + }) + .then((oid) => { + return odb.read(oid); + }) + .then((object) => { + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + }) + .then(() => { + // overwriting is okay + return Tag.createFromBuffer(repository, otherBuffer, 1); + }) + .then(() => { + // overwriting is not okay + return Tag.createFromBuffer(repository, buffer, 0); + }) + .then(() => { + return Promise.reject( + new Error("should not be able to create the '" + name + "' tag twice") + ); + }, + () => { + return Promise.resolve(); + }); + }); + + describe("createWithSignature and extractSignature", function() { + it( + "can create a tag with a signature and extract the signature", + function() { + var targetCommit; + var otherTargetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const signatureLines = [ + "-----BEGIN PGP SIGNATURE-----", + "iQIzBAABCAAdFiEEKdxGpJ93wnkLaBKfURjJKedOfEMFAlxR4JUACgkQURjJKedO", + "fEN+8A//cXmkRmhzQMdTEdrxty7tVKQ7lVhL7r7e+cB84hO7WrDn8549c7/Puflu", + "idanWfyoAEMSNWDgY84lx/t3I3YYKXsLDPT93HiMhCXmPVZcfLxlARRL1rrNZV4q", + "L9hhqb9bFrRNBn6YebhygeLXLHlDKEZzx8W9jnDLU8Px8UTkwdQIDnPDfT7UOPPU", + "MYDgP3OwWwoG8dUlZXaHjtFz29wPlJo177MwdLYwn4zpEIysoY1ev5IKWD+LPW4g", + "vdQnaK1x3dozmG8YLUZw5iW7ap9DpahbAGQgdy1z1ypiNUjNuhaP8zkG1ci6X88N", + "6MIoQ+YqfowRJJTIr1lzssxsRI1syjfS6smnI4ZNE6S+6mIKN96ES2OZF+rn4xnD", + "PofR9Qh2gPq++ULriPE/cX7ZkZ0/ZDZGDfIGvricB8JEJhISZn/VMX/KScJs+rFq", + "KWN5Au6Uc2pEqeq5OP4y2k0QUmKQT9sh9OepnPmfqF8hG6wI8nM67jT/FEOcpr0v", + "qoN2NRXrcq3iZAp07AGq9IdpYhBcEW7MFmOcNt+Zb8SbTMp6DawnREg9xzz1SIkZ", + "Cdp1XoJ6mkVvzBB4T/Esp7j1VztinTX2PpX7C1CE5LC76UfCiEjEWOmWrVuPuA5a", + "oRrJvgPJg8gpVj04r2m8nvUK1gwhxg9ZB+SK+nd3OAd0dnbJwTE=", + "=dW3g", + "-----END PGP SIGNATURE-----" + ]; + const message = "I'm a teapot"; + const signingCallback = (message) => ({ + code: NodeGit.Error.CODE.OK, + signedData: signatureLines.join("\n") + }); + + let odb; + let oid; + let object; + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return repository.getCommit(commitPointedTo2); + }).then((commit) => { + otherTargetCommit = commit; + return repository.odb(); + }).then((odbResult) => { + odb = odbResult; + + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then((oidResult) => { + oid = oidResult; + return odb.read(oid); + }) + .then((objectResult) => { + object = objectResult; + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(signatureLines.length + 7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + for (let i = 6; i < 6 + signatureLines.length; i++) { + assert.equal(lines[i], signatureLines[i - 6]); + } + assert.equal(lines[6 + signatureLines.length], ""); + + return Tag.lookup(repository, oid); + }) + .then((tag) => { + return tag.extractSignature(); + }) + .then((tagSignature) => { + assert.equal(tagSignature, signatureLines.join("\n")); + }) + .then(() => { + // overwriting is okay + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then(() => { + // overwriting is not okay + return Tag.createWithSignature( + repository, + name, + otherTargetCommit, + signature, + message, + 0, + signingCallback + ); + }) + .then(() => { + return Promise.reject( + new Error( + "should not be able to create the '" + name + "' tag twice" + ) + ); + }, + () => { + return Promise.resolve(); + }); + } + ); + + it("can optionally skip the signing process", function() { + var targetCommit; + var otherTargetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.PASSTHROUGH + }); + + let odb; + let oid; + let object; + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return repository.getCommit(commitPointedTo2); + }).then((commit) => { + otherTargetCommit = commit; + return repository.odb(); + }).then((odbResult) => { + odb = odbResult; + + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then((oidResult) => { + oid = oidResult; + return odb.read(oid); + }) + .then((objectResult) => { + object = objectResult; + const lines = object.toString().split("\n"); + assert(object.type(), Obj.TYPE.TAG); + assert.equal(7, lines.length); + assert.equal(lines[0], `object ${commitPointedTo}`); + assert.equal(lines[1], "type commit"); + assert.equal(lines[2], `tag ${name}`); + assert.equal( + lines[3], + "tagger Shaggy Rogers 987654321 +0130" + ); + assert.equal(lines[4], ""); + assert.equal(lines[5], message); + assert.equal(lines[6], ""); + + return Tag.lookup(repository, oid); + }) + .then((tag) => { + return tag.extractSignature(); + }) + .then(function() { + assert.fail("Tag should not have been signed."); + }, function(error) { + if (error && error.message === "this tag is not signed") { + return; + } + + throw error; + }) + .then(() => { + // overwriting is okay + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }) + .then(() => { + // overwriting is not okay + return Tag.createWithSignature( + repository, + name, + otherTargetCommit, + signature, + message, + 0, + signingCallback + ); + }) + .then(() => { + return Promise.reject( + new Error("should not be able to create the '" + name + "' tag twice") + ); + }, + () => { + return Promise.resolve(); + }); + }); + + it("will throw if signing callback returns an error code", function() { + var targetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return Tag.createWithSignature( + repository, + name, + targetCommit, + signature, + message, + 1, + signingCallback + ); + }).then(function() { + assert.fail("Should not have been able to create tag"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + }); + + it("will show a deprecation warning if createWithSignature use oid instead object", function() { + var targetCommit; + const name = "created-signed-tag-annotationCreate"; + const repository = this.repository; + const signature = Signature.create( + "Shaggy Rogers", + "shaggy@mystery.com", + 987654321, + 90 + ); + const message = "I'm a teapot"; + const signingCallback = () => ({ + code: NodeGit.Error.CODE.ERROR + }); + + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return Tag.createWithSignature( + repository, + name, + targetCommit.id(), + signature, + message, + 1, + signingCallback + ); + }).then(function() { + assert.fail("Should not have been able to create tag"); + }, function(error) { + if (error && error.errno === NodeGit.Error.CODE.ERROR) { + return; + } + throw error; + }); + }); + + it("can create a new signed tag with Tag.annotationCreate", function() { + var targetCommit; + var name = "created-signed-tag-annotationCreate"; + var repository = this.repository; + var signature = null; + var odb = null; + + return repository.getCommit(commitPointedTo).then((commit) => { + targetCommit = commit; + return Signature.default(repository); + }).then(function(signatureResult) { + signature = signatureResult; + return repository.odb(); + }) + .then(function(theOdb) { + odb = theOdb; + }) + .then(function() { + return Tag.annotationCreate( + repository, name, targetCommit, signature, tagMessage); + }) + .then(function(oid) { + return odb.read(oid); + }) + .then(function(object) { + assert(object.type(), Obj.TYPE.TAG); + }); + }); + + it("can peel a tag", function() { + return this.repository.getTagByName(tagName) + .then(function(tag) { + return tag.peel(); + }) + .then(function(object) { + assert.equal(object.isCommit(), true); + }); + }); + + it("can get tag's target id", function() { + return this.repository.getTagByName(tagName) + .then(function(tag) { + assert.equal(commitPointedTo, tag.targetId()); + }); + }); + + it("can get tag's owner", function() { + var repository = this.repository; + return this.repository.getTagByName(tagName) + .then(function(tag) { + var owner = tag.owner(); + assert.ok(owner instanceof Repository); + assert.equal(repository.path(), owner.path()); + }); + }); }); diff --git a/test/tests/tree.js b/test/tests/tree.js new file mode 100644 index 0000000000..052459a80b --- /dev/null +++ b/test/tests/tree.js @@ -0,0 +1,124 @@ +var assert = require("assert"); +var path = require("path"); +var local = path.join.bind(path, __dirname); +var fse = require("fs-extra"); + +describe("Tree", function() { + var NodeGit = require("../../"); + var RepoUtils = require("../utils/repository_setup"); + + var repoPath = local("../repos/tree"); + var existingPath = local("../repos/workdir"); + var oid = "5716e9757886eaf38d51c86b192258c960d9cfea"; + + beforeEach(function() { + var test = this; + return RepoUtils.createRepository(repoPath) + .then(function(repo) { + test.repository = repo; + }).then(function() { + return NodeGit.Repository.open(existingPath); + }).then(function(repository) { + test.existingRepo = repository; + return repository.getCommit(oid); + }).then(function(commit) { + test.commit = commit; + }); + }); + + after(function() { + return fse.remove(repoPath); + }); + + it("gets an entry by name", + function() { + return this.commit.getTree().then(function(tree) { + var entry = tree.entryByName("README.md"); + assert(entry); + }); + }); + + it("updates a tree", function () { + var repo = this.existingRepo; + var update = new NodeGit.TreeUpdate(); + update.action = NodeGit.Tree.UPDATE.REMOVE; + update.path = "README.md"; + return this.commit.getTree().then(function(tree) { + return tree.createUpdated(repo, 1, [update]); + }) + .then(function(treeOid) { + return repo.getTree(treeOid); + }) + .then(function(updatedTree) { + assert.throws(function () { + updatedTree.entryByName("README.md"); + }); + }); + }); + + it("walks its entries and returns the same entries on both progress and end", + function() { + var repo = this.repository; + var file1 = "test.txt"; + var file2 = "foo/bar.txt"; + var expectedPaths = [file1, file2]; + var progressEntries = []; + var endEntries; + + return RepoUtils.commitFileToRepo(repo, file1, "") + .then(function(commit) { + return RepoUtils.commitFileToRepo(repo, file2, "", commit); + }) + .then(function(commit) { + return commit.getTree(); + }) + .then(function(tree) { + assert(tree); + + return new Promise(function (resolve, reject) { + var walker = tree.walk(); + + walker.on("entry", function(entry) { + progressEntries.push(entry); + }); + walker.on("end", function(entries) { + endEntries = entries; + resolve(); + }); + walker.on("error", reject); + + walker.start(); + }); + }) + .then(function() { + assert(progressEntries.length); + assert(endEntries && endEntries.length); + + function getEntryPath(entry) { + return entry.path(); + } + + var progressFilePaths = progressEntries.map(getEntryPath); + var endFilePaths = endEntries.map(getEntryPath); + + assert.deepEqual( + expectedPaths, progressFilePaths, + "progress entry paths do not match expected paths" + ); + + assert.deepEqual( + expectedPaths, endFilePaths, + "end entry paths do not match expected paths" + ); + }); + }); + + it("get all paths from a tree", async function () { + const tree = await this.commit.getTree(); + const paths = await tree.getAllFilepaths(); + assert.equal(paths.length, 512); + assert.equal(paths[0], ".gitignore"); + assert.equal(paths[511], "wscript"); + }); + +}); diff --git a/test/tests/tree_entry.js b/test/tests/tree_entry.js index 2e0620040b..f62f374f04 100644 --- a/test/tests/tree_entry.js +++ b/test/tests/tree_entry.js @@ -2,6 +2,8 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); +var leakTest = require("../utils/leak_test"); + describe("TreeEntry", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; @@ -38,13 +40,51 @@ describe("TreeEntry", function() { }); }); + it("provides the correct length for a file", function() { + return this.commit.getEntry("README.md") + .then(function(entry) { + assert.equal(entry.name().length, 9); + }); + }); + it("provides the filename", function() { return this.commit.getEntry("test/raw-commit.js") .then(function(entry) { - assert.equal(entry.filename(), "raw-commit.js"); + assert.equal(entry.name(), "raw-commit.js"); }); }); + it("provides the full path", function() { + return this.commit.getEntry("test/raw-commit.js") + .then(function(entry) { + assert.equal(entry.path(), "test/raw-commit.js"); + }); + }); + + it("provides the full path when the entry came from a tree", function() { + var testTree = function(tree, _dir) { + var dir = _dir || "", + testPromises = []; + tree.entries().forEach(function(entry) { + var currentPath = path.posix.join(dir, entry.name()); + if (entry.isTree()) { + testPromises.push( + entry.getTree().then(function (subtree) { + return testTree(subtree, currentPath); + }) + ); + } else { + assert.equal(entry.path(), currentPath); + } + }); + + return Promise.all(testPromises); + }; + + return this.commit.getTree() + .then(testTree); + }); + it("provides the blob representation of the entry", function() { return this.commit.getEntry("test/raw-commit.js") .then(function(entry) { @@ -81,10 +121,68 @@ describe("TreeEntry", function() { }); }); - it("can determine if an entry is a directory", function() { + it("can determine if an entry is not a file", function() { return this.commit.getEntry("example") .then(function(entry) { assert.equal(entry.isFile(), false); }); }); + + it("can determine if an entry is a directory", function() { + return this.commit.getEntry("example") + .then(function(entry) { + assert.equal(entry.isDirectory(), true); + }); + }); + + it("can determine if an entry is a submodule", function() { + var repo = this.repository; + return repo.getCommit("878ef6efbc5f85c4f63aeedf41addc262a621308") + .then(function(commit) { + return commit.getEntry("vendor/libgit2") + .then(function(entry) { + assert.equal(entry.isSubmodule(), true); + }); + }); + }); + + it("can determine if an entry is not a submodule", function() { + return this.commit.getEntry("example") + .then(function(entry) { + assert.equal(entry.isSubmodule(), false); + }); + }); + + it("can convert entry into a blob", function() { + var repo = this.repository; + return this.commit.getEntry("README.md") + .then(function(entry) { + return entry.toObject(repo); + }) + .then(function(object) { + assert.equal(object.isBlob(), true); + }); + }); + + it("can convert entry into a tree", function() { + var repo = this.repository; + return this.commit.getEntry("example") + .then(function(entry) { + return entry.toObject(repo); + }) + .then(function(object) { + assert.equal(object.isTree(), true); + }); + }); + + it("does not leak", function() { + var test = this; + + return leakTest(NodeGit.TreeEntry, function() { + return test.commit.getTree() + .then(function(tree) { + return tree.entryByPath("example"); + }); + }); + }); }); diff --git a/test/tests/treebuilder.js b/test/tests/treebuilder.js new file mode 100644 index 0000000000..6462fd9346 --- /dev/null +++ b/test/tests/treebuilder.js @@ -0,0 +1,98 @@ +var assert = require("assert"); +var path = require("path"); +var fse = require("fs-extra"); +var local = path.join.bind(path, __dirname); + +var leakTest = require("../utils/leak_test"); + +describe("TreeBuilder", function(){ + + var Git = require("../../"); + var reposPath = local("../repos/workdir"); + var oid = "111dd657329797f6165f52f5085f61ac976dcf04"; + + //setup test repo each test + beforeEach(function() { + var test = this; + + return Git.Repository.open(reposPath) + .then(function(repo) { + test.repo = repo; + }); + }); + //treebuilder created with no source when creating a new folder + // (each folder in git is a tree) + // or the root folder for a root commit + it("Can create a new treebuilder with no source", function(){ + + return Git.Treebuilder.create(this.repo, null); + }); + //treebuilder created with a source tree can add / read from tree + it("Can create a treebuilder from the latest commit tree", function(){ + + var test = this; + //get latest commit + return test.repo.getHeadCommit() + //get tree of commit + .then(function(commit){ return commit.getTree(); }) + //make treebuilder from tree + .then(function(tree){ return Git.Treebuilder.create(test.repo, tree); }) + //verify treebuilder can do stuff + .then(function(treeBuilder){ + //check + //count how many entries we should have + return fse.readdir(reposPath) + //treebuilder should have all entries in the clean working dir + //(minus .git folder) + .then(function(dirEntries) { + return assert.equal(dirEntries.length-1, treeBuilder.entrycount()); + }); + }); + }); + //adding a tree is adding a folder + it("Can add a new tree to an existing tree", function(){ + + var test = this; + //get latest commit + return test.repo.getHeadCommit() + //get tree of commit + .then(function(commit){ return commit.getTree(); }) + //make treebuilder from tree + .then(function(tree){ return Git.Treebuilder.create(test.repo, tree); }) + //verify treebuilder can do stuff + .then(function(rootTreeBuilder){ + //new dir builder + return Git.Treebuilder.create(test.repo, null) + .then(function(newTreeBuilder) { + return newTreeBuilder.write(); + }) + .then(function(oid) { + return rootTreeBuilder.insert( + "mynewfolder", + oid, + Git.TreeEntry.FILEMODE.TREE + ); + }); + }) + .then(function(newTreeEntry){ + assert(newTreeEntry.isTree(), + "Created a tree (new folder) that is a tree"); + return Git.Tree.lookup(test.repo, newTreeEntry.oid()); + }); + }); + + it("does not leak inserts", function() { + var test = this; + + // The underlying C++ git_tree_entry is owned by the treebuilder that + // creates it. But since git_tree_entry is duplicable the generator will + // duplicate it and mark it as self freeing. + // Validate this with the leakTest. + return leakTest(Git.TreeEntry, function() { + return Git.Treebuilder.create(test.repo, null) + .then(function(builder) { + return builder.insert("test", oid, Git.TreeEntry.FILEMODE.BLOB); + }); + }); + }); +}); diff --git a/test/tests/worker.js b/test/tests/worker.js new file mode 100644 index 0000000000..f39e19e6da --- /dev/null +++ b/test/tests/worker.js @@ -0,0 +1,216 @@ +const path = require("path"); +const assert = require("assert"); +const fse = require("fs-extra"); +const local = path.join.bind(path, __dirname); +const NodeGit = require("../../"); + +let filterName = "psuedo_filter"; +let Worker; + +try { + Worker = require("worker_threads").Worker; +} catch (e) {} + +if (Worker) { + describe("Worker", function() { + const clonePath = local("../repos/clone"); + + // Set a reasonable timeout here now that our repository has grown. + this.timeout(30000); + + beforeEach(function() { + return fse.remove(clonePath).catch(function(err) { + console.log(err); + + throw err; + }); + }); + + afterEach(function() { + return NodeGit.FilterRegistry.unregister(filterName) + .catch(function(error) { + if (error === NodeGit.Error.CODE.ERROR) { + throw new Error("Cannot unregister filter"); + } + }); + }); + + it("can perform basic functionality via worker thread", function(done) { + const workerPath = local("../utils/worker.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "init": + break; + case "success": + done(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code !== 0) { + assert.fail(); + } + }); + }); + + for (let i = 0; i < 5; ++i) { + // disabled until we can address flakiness + it.skip(`can kill worker thread while in use #${i}`, function(done) { // jshint ignore:line + const workerPath = local("../utils/worker.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "init": + setTimeout(() => { worker.terminate(); }, 500); + break; + case "success": + assert.fail(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code === 1) { + done(); + } else { + assert.fail(); + } + }); + }); + } + + // NOTE: first try was to build a test measuring memory used, checking + // that memory allocated by objects was being freed, but it was problematic + // to obtain the memory freed by a different context (a worker) after the + // context was gone, and the data in the tests wasn't consistent. + // So instead this test checks that the count of objects created/destroyed + // during the test match the count of objects being tracked by the + // nodegit::Context, which will be destroyed on context shutdown. To check + // that they are actually being freed can be done with a debugger/profiler. + it("can track objects to free on context shutdown", function(done) { + let testOk; + const workerPath = local("../utils/worker_context_aware.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "numbersMatch": + testOk = true; + worker.terminate(); + break; + case "numbersDoNotMatch": + testOk = false; + worker.terminate(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code === 1 && testOk === true) { + done(); + } + else { + assert.fail(); + } + }); + }); + + // This tests that while calling filter's apply callbacks and the worker + // is terminated, node exits gracefully. To make sure we terminate the + // worker during a checkout, continuous checkouts will be running in a loop. + it("can kill worker thread while doing a checkout and exit gracefully", function(done) { // jshint ignore:line + const workerPath = local("../utils/worker_checkout.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "init": + // give enough time for the worker to start applying the filter + // during continuous checkouts + setTimeout(() => { worker.terminate(); }, 10000); + break; + case "success": + assert.fail(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code == 1) { + done(); + } else { + assert.fail(); + } + }); + }); + + // This tests that after calling filter's apply callbacks and the worker + // is terminated, there will be no memory leaks. + it("can track objects to free on context shutdown after multiple checkouts", function(done) { // jshint ignore:line + let testOk; + const workerPath = local("../utils/worker_context_aware_checkout.js"); + const worker = new Worker(workerPath, { + workerData: { + clonePath, + url: "https://github.com/nodegit/test.git" + } + }); + worker.on("message", (message) => { + switch (message) { + case "numbersMatch": + testOk = true; + worker.terminate(); + break; + case "numbersDoNotMatch": + testOk = false; + worker.terminate(); + break; + case "failure": + assert.fail(); + break; + } + }); + worker.on("error", () => assert.fail()); + worker.on("exit", (code) => { + if (code === 1 && testOk === true) { + done(); + } + else { + assert.fail(); + } + }); + }); + }); +} diff --git a/test/utils/garbage_collect.js b/test/utils/garbage_collect.js new file mode 100644 index 0000000000..a288b99c87 --- /dev/null +++ b/test/utils/garbage_collect.js @@ -0,0 +1,20 @@ +// aggressively collects garbage until we fail to improve terminatingIterations +// times. +function garbageCollect() { + var terminatingIterations = 3; + var usedBeforeGC = Number.MAX_VALUE; + var nondecreasingIterations = 0; + for ( ; ; ) { + global.gc(); + var usedAfterGC = process.memoryUsage().heapUsed; + if (usedAfterGC >= usedBeforeGC) { + nondecreasingIterations++; + if (nondecreasingIterations >= terminatingIterations) { + break; + } + } + usedBeforeGC = usedAfterGC; + } +} + +module.exports = garbageCollect; diff --git a/test/utils/index_setup.js b/test/utils/index_setup.js new file mode 100644 index 0000000000..ab5a75336e --- /dev/null +++ b/test/utils/index_setup.js @@ -0,0 +1,92 @@ +var NodeGit = require("../../"); +var path = require("path"); +var fse = require("fs-extra"); +var RepoUtils = require("../utils/repository_setup"); + +var IndexSetup = { + createConflict: function createConflict( + repository, + _ourBranchName, + _theirBranchName, + _fileName + ) { + var fileName = _fileName || "everyonesFile.txt"; + + var ourBranchName = _ourBranchName || "ours"; + var theirBranchName = _theirBranchName || "theirs"; + + var baseFileContent = "How do you feel about Toll Roads?\n"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!\n"; + var theirFileContent = "I'm skeptical about Toll Roads\n"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var ourCommit; + var ourBranch; + var theirBranch; + + return fse.writeFile( + path.join(repository.workdir(), fileName), + baseFileContent + ) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + return repository.createCommit("HEAD", ourSignature, + ourSignature, "initial commit", oid, []); + }) + .then(function(commitOid) { + return repository.getCommit(commitOid).then(function(commit) { + ourCommit = commit; + }).then(function() { + return repository.createBranch(ourBranchName, commitOid) + .then(function(branch) { + ourBranch = branch; + return repository.createBranch(theirBranchName, commitOid); + }); + }); + }) + .then(function(branch) { + theirBranch = branch; + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + theirFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + return repository.createCommit(theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [ourCommit]); + }) + .then(function(commitOid) { + return fse.writeFile(path.join(repository.workdir(), fileName), + baseFileContent + ourFileContent); + }) + .then(function() { + return RepoUtils.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [ourCommit]); + }) + .then(function() { + return repository.checkoutBranch( + ourBranch, + new NodeGit.CheckoutOptions() + ); + }) + .then(function() { + return repository.mergeBranches(ourBranchName, theirBranchName); + }) + .catch(function(index) { + return NodeGit.Checkout.index(repository, index) + .then(function() { return index; }); + }); + } +}; + +module.exports = IndexSetup; diff --git a/test/utils/leak_test.js b/test/utils/leak_test.js new file mode 100644 index 0000000000..a784facb19 --- /dev/null +++ b/test/utils/leak_test.js @@ -0,0 +1,33 @@ +var assert = require("assert"); + +var garbageCollect = require("./garbage_collect"); + +function leakTest(Type, getInstance) { + garbageCollect(); + var startSelfFreeingCount = Type.getSelfFreeingInstanceCount(); + var startNonSelfFreeingCount = Type.getNonSelfFreeingConstructedCount(); + + var resolve; + var promise = new Promise(function(_resolve) { resolve = _resolve; }); + + getInstance() + .then(function() { + var selfFreeingCount = Type.getSelfFreeingInstanceCount(); + assert.equal(startSelfFreeingCount + 1, selfFreeingCount); + // get out of this promise chain to help GC get rid of the commit + setTimeout(resolve, 0); + }); + + return promise + .then(function() { + garbageCollect(); + var endSelfFreeingCount = Type.getSelfFreeingInstanceCount(); + var endNonSelfFreeingCount = Type.getNonSelfFreeingConstructedCount(); + // any new self-freeing commits should have been freed + assert.equal(startSelfFreeingCount, endSelfFreeingCount); + // no new non-self-freeing commits should have been constructed + assert.equal(startNonSelfFreeingCount, endNonSelfFreeingCount); + }); +} + +module.exports = leakTest; diff --git a/test/utils/loop_checkout.js b/test/utils/loop_checkout.js new file mode 100644 index 0000000000..f6e6c07360 --- /dev/null +++ b/test/utils/loop_checkout.js @@ -0,0 +1,91 @@ +const fse = require("fs-extra"); +const path = require("path"); +const NodeGit = require("../../"); + +const getDirExtFiles = function(dir, ext, done) { + let results = []; + fse.readdir(dir, function(err, list) { + if (err) { + return done(err); + } + let i = 0; + (function next() { + let file = list[i++]; + if (!file) { + return done(null, results); + } + file = path.resolve(dir, file); + fse.stat(file, function(err, stat) { + if (stat && stat.isDirectory()) { + getDirExtFiles(file, ext, function(err, res) { + results = results.concat(res); + next(); + }); + } else { + if (path.extname(file) == ".".concat(ext)) { + results.push(file); + } + next(); + } + }); + })(); + }); +}; + +const getDirFilesToChange = function(dir, ext) { + return new Promise(function(resolve, reject) { + getDirExtFiles(dir, ext, function(err, results) { + if (err) { + reject(err); + } + resolve(results); + }); + }); +}; + +// Changes the content of files with extension 'ext' +// in directory 'dir' recursively. +// Returns relative file paths +const changeDirExtFiles = function (dir, ext, newText) { + let filesChanged = []; + return getDirFilesToChange(dir, ext) + .then(function(filesWithExt) { + filesWithExt.forEach(function(file) { + fse.writeFile( + file, + newText, + { encoding: "utf-8" } + ); + filesChanged.push(path.relative(dir, file)); + }); + return filesChanged; + }) + .catch(function(err) { + throw new Error("Error getting files with extension .".concat(ext)); + }); +}; + +// 'times' to limit the number of iterations in the loop. +// 0 means no limit. +const loopingCheckoutHead = async function(repoPath, repo, times) { + const text0 = "Text0: changing content to trigger checkout"; + const text1 = "Text1: changing content to trigger checkout"; + + let iteration = 0; + for (let i = 0; true; i = ++i%2) { + const newText = (i == 0) ? text0 : text1; + const jsRelativeFilePahts = await changeDirExtFiles(repoPath, "js", newText); // jshint ignore:line + let checkoutOpts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE, + paths: jsRelativeFilePahts + }; + await NodeGit.Checkout.head(repo, checkoutOpts); + + if (++iteration == times) { + break; + } + } + return; +}; + +module.exports = loopingCheckoutHead; \ No newline at end of file diff --git a/test/utils/repository_setup.js b/test/utils/repository_setup.js new file mode 100644 index 0000000000..5a36bf7460 --- /dev/null +++ b/test/utils/repository_setup.js @@ -0,0 +1,200 @@ +var assert = require("assert"); +var NodeGit = require("../../"); +var path = require("path"); +var fse = require("fs-extra"); + +var RepositorySetup = { + addFileToIndex: + function addFileToIndex(repository, fileName) { + return repository.refreshIndex() + .then(function(index) { + return index.addByPath(fileName) + .then(function() { + return index.write(); + }) + .then(function() { + return index.writeTree(); + }); + }); + }, + + commitFileToRepo: + function commitFileToRepo(repository, fileName, fileContent, parentCommit) { + var repoWorkDir = repository.workdir(); + var signature = NodeGit.Signature.create("Foo bar", + "foo@bar.com", 123456789, 60); + + var filePath = path.join(repoWorkDir, fileName); + var parents = []; + if (parentCommit) { + parents.push(parentCommit); + } + + // fse.ensure allows us to write files inside new folders + return fse.ensureFile(filePath) + .then(function() { + return fse.writeFile(filePath, fileContent); + }) + .then(function() { + return RepositorySetup.addFileToIndex(repository, fileName); + }) + .then(function(oid) { + return repository.createCommit("HEAD", signature, signature, + "initial commit", oid, parents); + }) + .then(function(commitOid) { + return repository.getCommit(commitOid); + }); + }, + + createRepository: + function createRepository(repoPath, isBare){ + // Create a new repository in a clean directory + return fse.remove(repoPath) + .then(function() { + return fse.ensureDir(repoPath); + }) + .then(function() { + var bare = typeof isBare !== "undefined" ? isBare : 0; + return NodeGit.Repository.init(repoPath, bare); + }); + }, + + // Expects empty repo + setupBranches: + function setupBranches(repository, checkoutOurs) { + var repoWorkDir = repository.workdir(); + + var ourBranchName = "ours"; + var theirBranchName = "theirs"; + + var baseFileName = "baseNewFile.txt"; + var ourFileName = "ourNewFile.txt"; + var theirFileName = "theirNewFile.txt"; + + var baseFileContent = "How do you feel about Toll Roads?"; + var ourFileContent = "I like Toll Roads. I have an EZ-Pass!"; + var theirFileContent = "I'm skeptical about Toll Roads"; + + var ourSignature = NodeGit.Signature.create + ("Ron Paul", "RonPaul@TollRoadsRBest.info", 123456789, 60); + var theirSignature = NodeGit.Signature.create + ("Greg Abbott", "Gregggg@IllTollYourFace.us", 123456789, 60); + + var initialCommit; + var ourBranch; + var theirBranch; + + var ret = { + ourBranchName: ourBranchName, + theirBranchName: theirBranchName, + + ourSignature: ourSignature, + theirSignature: theirSignature, + + ourFileName: ourFileName, + theirFileName: theirFileName, + + ourFileContent: ourFileContent, + theirFileContent: theirFileContent + }; + + return Promise.all([ + fse.writeFile(path.join(repoWorkDir, baseFileName), + baseFileContent), + fse.writeFile(path.join(repoWorkDir, ourFileName), + ourFileContent), + fse.writeFile(path.join(repoWorkDir, theirFileName), + theirFileContent) + ]) + .then(function() { + return RepositorySetup.addFileToIndex(repository, baseFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "b5cdc109d437c4541a13fb7509116b5f03d5039a"); + + return repository.createCommit( + "HEAD", ourSignature, ourSignature, + "initial commit", oid, []); + }) + .then(function(commitOid) { + assert.equal(commitOid.toString(), + "be03abdf0353d05924c53bebeb0e5bb129cda44a"); + + return repository.getCommit(commitOid); + }) + .then(function(commit) { + ret.initialCommit = initialCommit = commit; + + return Promise.all([ + repository.createBranch(ourBranchName, initialCommit), + repository.createBranch(theirBranchName, initialCommit) + ]); + }) + .then(function(branches) { + assert(branches[0]); + assert(branches[1]); + + ret.ourBranch = ourBranch = branches[0]; + ret.theirBranch = theirBranch = branches[1]; + + return RepositorySetup.addFileToIndex(repository, ourFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "77867fc0bfeb3f80ab18a78c8d53aa3a06207047"); + + return repository.createCommit(ourBranch.name(), ourSignature, + ourSignature, "we made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + return repository.getCommit(commitOid); + }) + .then(function(commit) { + ret.ourCommit = commit; + return NodeGit.Reset.default( + repository, initialCommit, ourFileName); + }) + .then(function() { + return RepositorySetup.addFileToIndex( + repository, theirFileName); + }) + .then(function(oid) { + assert.equal(oid.toString(), + "be5f0fd38a39a67135ad68921c93cd5c17fefb3d"); + + return repository.createCommit( + theirBranch.name(), theirSignature, + theirSignature, "they made a commit", oid, [initialCommit]); + }) + .then(function(commitOid) { + return repository.getCommit(commitOid); + }) + .then(function(commit) { + ret.theirCommit = commit; + return NodeGit.Reset.default( + repository, initialCommit, theirFileName); + }) + .then(function() { + return Promise.all([ + fse.remove(path.join(repoWorkDir, ourFileName)), + fse.remove(path.join(repoWorkDir, theirFileName)) + ]); + }) + .then(function() { + if (checkoutOurs) { + var opts = { + checkoutStrategy: NodeGit.Checkout.STRATEGY.FORCE + }; + + return repository.checkoutBranch(ourBranchName, opts); + } + }) + .then(function() { + return ret; + }); + } +}; + +module.exports = RepositorySetup; diff --git a/test/utils/worker.js b/test/utils/worker.js new file mode 100644 index 0000000000..6f2d218408 --- /dev/null +++ b/test/utils/worker.js @@ -0,0 +1,38 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const assert = require("assert"); +const NodeGit = require("../../"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +parentPort.postMessage("init"); + +const { clonePath, url } = workerData; +const opts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +return NodeGit.Clone(url, clonePath, opts).then((_repository) => { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return repository.index(); +}).then((index) => { + assert.ok(index instanceof NodeGit.Index); + return repository.getRemoteNames(); +}).then((remotes) => { + assert.ok(Array.isArray(remotes)); + return repository.getCurrentBranch(); +}).then((branch) => { + assert.ok(branch instanceof NodeGit.Reference); + parentPort.postMessage("success"); +}).catch(() => parentPort.postMessage("failure")); diff --git a/test/utils/worker_checkout.js b/test/utils/worker_checkout.js new file mode 100644 index 0000000000..adfb7aa7c7 --- /dev/null +++ b/test/utils/worker_checkout.js @@ -0,0 +1,51 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const assert = require("assert"); +const NodeGit = require("../../"); +const loopingCheckoutHead = require("./loop_checkout.js"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +parentPort.postMessage("init"); + +const { clonePath, url } = workerData; +const cloneOpts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +let filterName = "psuedo_filter"; +let applyCallbackResult = 1; + +return NodeGit.Clone(url, clonePath, cloneOpts) +.then(function(_repository) { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return NodeGit.FilterRegistry.register(filterName, { + apply: function() { + applyCallbackResult = 0; + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0); +}) +.then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return loopingCheckoutHead(clonePath, repository, 0); +}).then(function() { + assert.strictEqual(applyCallbackResult, 0); + parentPort.postMessage("success"); +}) +.catch((err) => { + parentPort.postMessage("failure"); +}); \ No newline at end of file diff --git a/test/utils/worker_context_aware.js b/test/utils/worker_context_aware.js new file mode 100644 index 0000000000..b7784fdaef --- /dev/null +++ b/test/utils/worker_context_aware.js @@ -0,0 +1,74 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const garbageCollect = require("./garbage_collect.js"); +const assert = require("assert"); +const NodeGit = require("../../"); +const { promisify } = require("util"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +const { clonePath, url } = workerData; +const opts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +const oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6"; + +return NodeGit.Clone(url, clonePath, opts) +.then((_repository) => { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return repository.getCommit(oid); +}).then((commit) => { + assert.ok(commit instanceof NodeGit.Commit); + var historyCount = 0; + var history = commit.history(); + + history.on("commit", function(commit) { + // Number of commits is known to be higher than 200 + if (++historyCount == 200) { + // Tracked objects must work too when the Garbage Collector is triggered + garbageCollect(); + + // Count total of objects left after being created/destroyed + const freeingCount = + NodeGit.Cert.getNonSelfFreeingConstructedCount() + + NodeGit.Repository.getSelfFreeingInstanceCount() + + NodeGit.Commit.getSelfFreeingInstanceCount() + + NodeGit.Oid.getSelfFreeingInstanceCount() + + NodeGit.Revwalk.getSelfFreeingInstanceCount(); + + const numberOfTrackedObjects = NodeGit.getNumberOfTrackedObjects(); + + if (freeingCount === numberOfTrackedObjects) { + parentPort.postMessage("numbersMatch"); + } + else { + parentPort.postMessage("numbersDoNotMatch"); + } + } + }); + + history.on("end", function(commits) { + // Test should not get this far + parentPort.postMessage("failure"); + }); + + history.on("error", function(err) { + assert.ok(false); + }); + + history.start(); + + return promisify(setTimeout)(50000); +}).catch(() => parentPort.postMessage("failure")); \ No newline at end of file diff --git a/test/utils/worker_context_aware_checkout.js b/test/utils/worker_context_aware_checkout.js new file mode 100644 index 0000000000..6562915a49 --- /dev/null +++ b/test/utils/worker_context_aware_checkout.js @@ -0,0 +1,66 @@ +const { + isMainThread, + parentPort, + workerData +} = require("worker_threads"); +const garbageCollect = require("./garbage_collect.js"); +const assert = require("assert"); +const NodeGit = require("../../"); +const loopingCheckoutHead = require("./loop_checkout.js"); +const { promisify } = require("util"); + +if (isMainThread) { + throw new Error("Must be run via worker thread"); +} + +const { clonePath, url } = workerData; +const cloneOpts = { + fetchOpts: { + callbacks: { + certificateCheck: () => 0 + } + } +}; + +let repository; +let filterName = "psuedo_filter"; +let applyCallbackResult = 1; + +return NodeGit.Clone(url, clonePath, cloneOpts) +.then(function(_repository) { + repository = _repository; + assert.ok(repository instanceof NodeGit.Repository); + return NodeGit.FilterRegistry.register(filterName, { + apply: function() { + applyCallbackResult = 0; + }, + check: function() { + return NodeGit.Error.CODE.OK; + } + }, 0); +}) +.then(function(result) { + assert.strictEqual(result, NodeGit.Error.CODE.OK); + return loopingCheckoutHead(clonePath, repository, 10); +}).then(function() { + assert.strictEqual(applyCallbackResult, 0); + // Tracked objects must work too when the Garbage Collector is triggered + garbageCollect(); + + // Count total of objects left after being created/destroyed + const freeingCount = + NodeGit.Cert.getNonSelfFreeingConstructedCount() + + NodeGit.FilterSource.getNonSelfFreeingConstructedCount() + + NodeGit.Buf.getNonSelfFreeingConstructedCount() + + NodeGit.Repository.getSelfFreeingInstanceCount(); + + const numberOfTrackedObjects = NodeGit.getNumberOfTrackedObjects(); + + if (freeingCount === numberOfTrackedObjects) { + parentPort.postMessage("numbersMatch"); + } + else { + parentPort.postMessage("numbersDoNotMatch"); + } + return promisify(setTimeout)(50000); +}).catch((err) => parentPort.postMessage("failure")); \ No newline at end of file diff --git a/utils/README.md b/utils/README.md new file mode 100644 index 0000000000..cf046f05b8 --- /dev/null +++ b/utils/README.md @@ -0,0 +1,9 @@ +## /utils + + Contains utilities for NodeGit + + #### buildFlags + Determines how NodeGit should build. Use `BUILD_ONLY` environment variable to build from source. + + ## acquireOpenSSL + Download and compile OpenSSL. diff --git a/utils/acquireOpenSSL.mjs b/utils/acquireOpenSSL.mjs new file mode 100644 index 0000000000..930b5ab33c --- /dev/null +++ b/utils/acquireOpenSSL.mjs @@ -0,0 +1,488 @@ +import crypto from "crypto"; +import { spawn } from "child_process"; +import execPromise from "./execPromise.js"; +import got from "got"; +import path from "path"; +import stream from "stream"; +import tar from "tar-fs"; +import zlib from "zlib"; +import { createWriteStream, promises as fs } from "fs"; +import { performance } from "perf_hooks"; +import { promisify } from "util"; + +import { hostArch, targetArch } from "./buildFlags.js"; + +const pipeline = promisify(stream.pipeline); + +import packageJson from '../package.json' with { type: "json" }; + +const OPENSSL_VERSION = "3.0.18"; +const win32BatPath = path.join(import.meta.dirname, "build-openssl.bat"); +const vendorPath = path.resolve(import.meta.dirname, "..", "vendor"); +const opensslPatchPath = path.join(vendorPath, "patches", "openssl"); +const extractPath = path.join(vendorPath, "openssl"); + +const exists = (filePath) => fs.stat(filePath).then(() => true).catch(() => false); + +const pathsToIncludeForPackage = [ + "include", "lib" +]; + +const getOpenSSLSourceUrl = (version) => `https://www.openssl.org/source/openssl-${version}.tar.gz`; +const getOpenSSLSourceSha256Url = (version) => `${getOpenSSLSourceUrl(version)}.sha256`; + +class HashVerify extends stream.Transform { + constructor(algorithm, onFinal) { + super(); + this.onFinal = onFinal; + this.hash = crypto.createHash(algorithm); + } + + _transform(chunk, encoding, callback) { + this.hash.update(chunk, encoding); + callback(null, chunk); + } + + _final(callback) { + const digest = this.hash.digest("hex"); + const onFinalResult = this.onFinal(digest); + callback(onFinalResult); + } +} + +const makeHashVerifyOnFinal = (expected) => (digest) => { + const digestOk = digest === expected; + return digestOk + ? null + : new Error(`Digest not OK: ${digest} !== ${this.expected}`); +}; + +// currently this only needs to be done on linux +const applyOpenSSLPatches = async (buildCwd, operatingSystem) => { + try { + await fs.access(opensslPatchPath); + + for (const patchFilename of await fs.readdir(opensslPatchPath)) { + const patchTarget = patchFilename.split("-")[1]; + if (patchFilename.split(".").pop() === "patch" && (patchTarget === operatingSystem || patchTarget === "all")) { + console.log(`applying ${patchFilename}`); + await execPromise(`patch -up0 -i ${path.join(opensslPatchPath, patchFilename)}`, { + cwd: buildCwd + }, { pipeOutput: true }); + } + } + } catch(e) { + if (e.code === "ENOENT") { + // no patches to apply + return; + } + + console.log("Patch application failed: ", e); + throw e; + } +} + +const buildDarwin = async (buildCwd, macOsDeploymentTarget) => { + if (!macOsDeploymentTarget) { + throw new Error("Expected macOsDeploymentTarget to be specified"); + } + + const buildConfig = targetArch === "x64" ? "darwin64-x86_64-cc" : "darwin64-arm64-cc"; + + const configureArgs = [ + buildConfig, + // speed up ecdh on little-endian platforms with 128bit int support + "enable-ec_nistp_64_gcc_128", + // compile static libraries + "no-shared", + // disable ssl2, ssl3, and compression + "no-ssl2", + "no-ssl3", + "no-comp", + // disable tty ui since it fails a bunch of tests on GHA runners and we're just gonna link anyways + "no-ui-console", + // set install directory + `--prefix="${extractPath}"`, + `--openssldir="${extractPath}"`, + // set macos version requirement + `-mmacosx-version-min=${macOsDeploymentTarget}` + ]; + + await execPromise(`./Configure ${configureArgs.join(" ")}`, { + cwd: buildCwd + }, { pipeOutput: true }); + + await applyOpenSSLPatches(buildCwd, "darwin"); + + // only build the libraries, not the fuzzer or apps + await execPromise("make build_libs", { + cwd: buildCwd + }, { pipeOutput: true }); + + await execPromise("make test", { + cwd: buildCwd + }, { pipeOutput: true }); + + await execPromise("make install_sw", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 // we should really just use spawn + }, { pipeOutput: true }); +}; + +const buildLinux = async (buildCwd) => { + const buildConfig = targetArch === "x64" ? "linux-x86_64" : "linux-aarch64"; + + const configureArgs = [ + buildConfig, + // disable ssl3, and compression + "no-ssl3", + "no-comp", + // set install directory + `--prefix="${extractPath}"`, + `--openssldir="${extractPath}"`, + "--libdir=lib", + ]; + await execPromise(`./Configure ${configureArgs.join(" ")}`, { + cwd: buildCwd + }, { pipeOutput: true }); + + await applyOpenSSLPatches(buildCwd, "linux"); + + // only build the libraries, not the fuzzer or apps + await execPromise("make build_libs", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 + }, { pipeOutput: true }); + + if (hostArch === targetArch) { + await execPromise("make test", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 + }, { pipeOutput: true }); + } + + // only install software, not the docs + await execPromise("make install_sw", { + cwd: buildCwd, + maxBuffer: 10 * 1024 * 1024 // we should really just use spawn + }, { pipeOutput: true }); +}; + +const buildWin32 = async (buildCwd) => { + let vcvarsallPath = undefined; + + if (process.env.npm_config_vcvarsall_path && await exists(process.env.npm_config_vcvarsall_path)) { + vcvarsallPath = process.env.npm_config_vcvarsall_path; + } else { + const potentialMsvsPaths = []; + + // GYP_MSVS_OVERRIDE_PATH is set by node-gyp so this should cover most cases + if (process.env.GYP_MSVS_OVERRIDE_PATH) { + potentialMsvsPaths.push(process.env.GYP_MSVS_OVERRIDE_PATH); + } + + const packageTypes = ["BuildTools", "Community", "Professional", "Enterprise"]; + const versions = ["2022", "2019"] + + const computePossiblePaths = (parentPath) => { + let possiblePaths = [] + for (const packageType of packageTypes) { + for (const version of versions) { + possiblePaths.push(path.join(parentPath, version, packageType)); + } + } + + return possiblePaths; + } + + if (process.env["ProgramFiles(x86)"]) { + const parentPath = path.join(process.env["ProgramFiles(x86)"], 'Microsoft Visual Studio'); + potentialMsvsPaths.push(...computePossiblePaths(parentPath)); + } + + if (process.env.ProgramFiles) { + const parentPath = path.join(process.env.ProgramFiles, 'Microsoft Visual Studio'); + potentialMsvsPaths.push(...computePossiblePaths(parentPath)); + } + + for (const potentialPath of potentialMsvsPaths) { + const wholePath = path.join(potentialPath, 'VC', 'Auxiliary', 'Build', 'vcvarsall.bat'); + console.log("checking", wholePath); + if (await exists(wholePath)) { + vcvarsallPath = wholePath; + break; + } + } + + if (!vcvarsallPath) { + throw new Error(`vcvarsall.bat not found`); + } + } + + let vcTarget; + switch (targetArch) { + case "x64": + vcTarget = "VC-WIN64A"; + break; + + case "x86": + vcTarget = "VC-WIN32"; + break; + + case "arm64": + vcTarget = "VC-WIN64-ARM"; + break; + } + + let vsBuildArch = hostArch === targetArch + ? hostArch + : `${hostArch}_${targetArch}`; + + console.log("Using vcvarsall.bat at: ", vcvarsallPath); + console.log("Using vsBuildArch: ", vsBuildArch); + console.log("Using vcTarget: ", vcTarget); + + await new Promise((resolve, reject) => { + const buildProcess = spawn(`"${win32BatPath}" "${vcvarsallPath}" ${vsBuildArch} ${vcTarget}`, { + cwd: buildCwd, + shell: process.platform === "win32", + env: { + ...process.env, + NODEGIT_SKIP_TESTS: targetArch !== hostArch ? "1" : undefined + } + }); + + buildProcess.stdout.on("data", function(data) { + console.info(data.toString().trim()); + }); + + buildProcess.stderr.on("data", function(data) { + console.error(data.toString().trim()); + }); + + buildProcess.on("close", function(code) { + if (!code) { + resolve(); + } else { + reject(code); + } + }); + }); + + +}; + +const removeOpenSSLIfOudated = async (openSSLVersion) => { + try { + let openSSLResult; + try { + const openSSLPath = path.join(extractPath, "bin", "openssl"); + openSSLResult = await execPromise(`${openSSLPath} version`); + } catch { + /* if we fail to get the version, assume removal not required */ + } + + if (!openSSLResult) { + return; + } + + const versionMatch = openSSLResult.match(/^OpenSSL (\d\.\d\.\d[a-z]*)/); + const installedVersion = versionMatch && versionMatch[1]; + if (!installedVersion || installedVersion === openSSLVersion) { + return; + } + + console.log("Removing outdated OpenSSL at: ", extractPath); + await fs.rm(extractPath, { recursive: true, force: true }); + console.log("Outdated OpenSSL removed."); + } catch (err) { + console.log("Remove outdated OpenSSL failed: ", err); + } +}; + +const makeOnStreamDownloadProgress = () => { + let lastReport = performance.now(); + return ({ percent, transferred, total }) => { + const currentTime = performance.now(); + if (currentTime - lastReport > 1 * 1000) { + lastReport = currentTime; + console.log(`progress: ${transferred}/${total} (${(percent * 100).toFixed(2)}%)`) + } + }; +}; + +const buildOpenSSLIfNecessary = async ({ + macOsDeploymentTarget, + openSSLVersion +}) => { + if (process.platform !== "darwin" && process.platform !== "win32" && process.platform !== "linux") { + console.log(`Skipping OpenSSL build, not required on ${process.platform}`); + return; + } + + await removeOpenSSLIfOudated(openSSLVersion); + + try { + await fs.stat(extractPath); + console.log("Skipping OpenSSL build, dir exists"); + return; + } catch {} + + const openSSLUrl = getOpenSSLSourceUrl(openSSLVersion); + const openSSLSha256Url = getOpenSSLSourceSha256Url(openSSLVersion); + + const openSSLSha256 = (await got(openSSLSha256Url)).body.trim().split(' ')[0]; + + const downloadStream = got.stream(openSSLUrl); + downloadStream.on("downloadProgress", makeOnStreamDownloadProgress()); + + await pipeline( + downloadStream, + new HashVerify("sha256", makeHashVerifyOnFinal(openSSLSha256)), + zlib.createGunzip(), + tar.extract(extractPath) + ); + + console.log(`OpenSSL ${openSSLVersion} download + extract complete: SHA256 OK.`); + + const buildCwd = path.join(extractPath, `openssl-${openSSLVersion}`); + + if (process.platform === "darwin") { + await buildDarwin(buildCwd, macOsDeploymentTarget); + } else if (process.platform === "linux") { + await buildLinux(buildCwd); + } else if (process.platform === "win32") { + await buildWin32(buildCwd); + } else { + throw new Error(`Unknown platform: ${process.platform}`); + } + + console.log("Build finished."); +} + +const downloadOpenSSLIfNecessary = async ({ + downloadBinUrl, + maybeDownloadSha256, + maybeDownloadSha256Url +}) => { + if (process.platform !== "darwin" && process.platform !== "win32" && process.platform !== "linux") { + console.log(`Skipping OpenSSL download, not required on ${process.platform}`); + return; + } + + try { + await fs.stat(extractPath); + console.log("Skipping OpenSSL download, dir exists"); + return; + } catch {} + + if (maybeDownloadSha256Url) { + maybeDownloadSha256 = (await got(maybeDownloadSha256Url)).body.trim(); + } + + const downloadStream = got.stream(downloadBinUrl); + downloadStream.on("downloadProgress", makeOnStreamDownloadProgress()); + + const pipelineSteps = [ + downloadStream, + maybeDownloadSha256 + ? new HashVerify("sha256", makeHashVerifyOnFinal(maybeDownloadSha256)) + : null, + zlib.createGunzip(), + tar.extract(extractPath) + ].filter(step => step !== null); + await pipeline( + ...pipelineSteps + ); + + console.log(`OpenSSL download + extract complete${maybeDownloadSha256 ? ": SHA256 OK." : "."}`); + console.log("Download finished."); +} + +export const getOpenSSLPackageName = () => { + return `openssl-${OPENSSL_VERSION}-${process.platform}-${targetArch}.tar.gz`; +} + +export const getOpenSSLPackagePath = () => path.join(import.meta.dirname, getOpenSSLPackageName()); + +const getOpenSSLPackageUrl = () => { + const hostUrl = new URL(packageJson.binary.host); + hostUrl.pathname = getOpenSSLPackageName(); + return hostUrl.toString(); +}; + +const buildPackage = async () => { + let resolve, reject; + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + await pipeline( + tar.pack(extractPath, { + entries: pathsToIncludeForPackage, + ignore: (name) => { + // Ignore pkgconfig files + return path.extname(name) === ".pc" + || path.basename(name) === "pkgconfig"; + }, + dmode: 0o0755, + fmode: 0o0644 + }), + zlib.createGzip(), + new HashVerify("sha256", (digest) => { + resolve(digest); + }), + createWriteStream(getOpenSSLPackagePath()) + ); + const digest = await promise; + await fs.writeFile(`${getOpenSSLPackagePath()}.sha256`, digest); +}; + +const acquireOpenSSL = async () => { + try { + const downloadBinUrl = process.env.npm_config_openssl_bin_url + || (['win32', 'darwin'].includes(process.platform) ? getOpenSSLPackageUrl() : undefined); + if (downloadBinUrl && downloadBinUrl !== 'skip' && !process.env.NODEGIT_OPENSSL_BUILD_PACKAGE) { + const downloadOptions = { downloadBinUrl }; + if (process.env.npm_config_openssl_bin_sha256 !== 'skip') { + if (process.env.npm_config_openssl_bin_sha256) { + downloadOptions.maybeDownloadSha256 = process.env.npm_config_openssl_bin_sha256; + } else { + downloadOptions.maybeDownloadSha256Url = `${getOpenSSLPackageUrl()}.sha256`; + } + } + + await downloadOpenSSLIfNecessary(downloadOptions); + return; + } + + let macOsDeploymentTarget; + if (process.platform === "darwin") { + macOsDeploymentTarget = process.argv[2] ?? process.env.OPENSSL_MACOS_DEPLOYMENT_TARGET + if (!macOsDeploymentTarget || !macOsDeploymentTarget.match(/\d+\.\d+/)) { + throw new Error(`Invalid macOsDeploymentTarget: ${macOsDeploymentTarget}`); + } + } + + await buildOpenSSLIfNecessary({ + openSSLVersion: OPENSSL_VERSION, + macOsDeploymentTarget + }); + if (process.env.NODEGIT_OPENSSL_BUILD_PACKAGE) { + await buildPackage(); + } + } catch (err) { + console.error("Acquire failed: ", err); + process.exit(1); + } +}; + +if (process.argv[1] === import.meta.filename) { + try { + await acquireOpenSSL(); + } + catch(error) { + console.error("Acquire OpenSSL failed: ", error); + process.exit(1); + } +} diff --git a/utils/build-openssl.bat b/utils/build-openssl.bat new file mode 100644 index 0000000000..af8063d7c4 --- /dev/null +++ b/utils/build-openssl.bat @@ -0,0 +1,22 @@ +rem Build OpenSSL for Windows +rem %1 - path to vcvarsall.bat +rem %2 - architecture argument for vcvarsall.bat +rem %3 - OpenSSL Configure target + +@call %1 %2 + +perl .\Configure %3 no-shared no-ssl2 no-ssl3 no-comp --prefix="%cd%\.." --openssldir="%cd%\.." || goto :error + +nmake || goto :error + +if "%NODEGIT_SKIP_TESTS%" NEQ "1" ( + nmake test || goto :error +) + +nmake install || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% \ No newline at end of file diff --git a/utils/buildFlags.js b/utils/buildFlags.js new file mode 100644 index 0000000000..7ea87428ba --- /dev/null +++ b/utils/buildFlags.js @@ -0,0 +1,41 @@ +var fs = require("fs"); +var path = require("path"); + +var isGitRepo; + +try { + fs.statSync(path.join(__dirname, "..", ".git")); + isGitRepo = true; +} catch (e) { + isGitRepo = false; +} + +const convertArch = (archStr) => { + const convertedArch = { + 'ia32': 'x86', + 'x86': 'x86', + 'x64': 'x64', + 'arm64': 'arm64' + }[archStr]; + + if (!convertedArch) { + throw new Error('unsupported architecture'); + } + + return convertedArch; +} + +const hostArch = convertArch(process.arch); +const targetArch = process.env.npm_config_arch + ? convertArch(process.env.npm_config_arch) + : hostArch; + +module.exports = { + hostArch, + targetArch, + debugBuild: !!process.env.BUILD_DEBUG, + isElectron: process.env.npm_config_runtime === "electron", + isGitRepo: isGitRepo, + isNwjs: process.env.npm_config_runtime === "node-webkit", + mustBuild: !!(isGitRepo || process.env.BUILD_DEBUG || process.env.BUILD_ONLY) +}; diff --git a/utils/configureLibssh2.js b/utils/configureLibssh2.js new file mode 100644 index 0000000000..95fd5d3649 --- /dev/null +++ b/utils/configureLibssh2.js @@ -0,0 +1,57 @@ +var cp = require("child_process"); +var fse = require("fs-extra"); +var path = require("path"); + +const { hostArch, targetArch } = require("./buildFlags"); + +const opensslVendorDirectory = path.resolve(__dirname, "..", "vendor", "openssl"); +const libssh2VendorDirectory = path.resolve(__dirname, "..", "vendor", "libssh2"); +const libssh2ConfigureScript = path.join(libssh2VendorDirectory, "configure"); +const libssh2StaticConfigDirectory = path.resolve(__dirname, "..", "vendor", "static_config", "libssh2"); + +module.exports = function retrieveExternalDependencies() { + console.info("[nodegit] Configuring libssh2."); + + // Copy Windows / Mac preconfigured files + if (process.platform === "win32" || process.platform === "darwin") { + return fse.copy( + path.join(libssh2StaticConfigDirectory, process.platform), + path.join(libssh2VendorDirectory, "src") + ); + } + + // Run the `configure` script on Linux + let cpArgs = ` --with-libssl-prefix=${opensslVendorDirectory}`; + + const archConfigMap = { + 'x64': 'x86_64-linux-gnu', + 'arm64': 'aarch64-linux-gnu' + }; + + cpArgs += ` --build=${archConfigMap[hostArch]}`; + cpArgs += ` --host=${archConfigMap[targetArch]}`; + + return new Promise(function(resolve, reject) { + cp.exec( + `${libssh2ConfigureScript}${cpArgs}`, + { + cwd: libssh2VendorDirectory + }, + function(err, stdout, stderr) { + if (err) { + console.error(err); + console.error(stderr); + reject(err, stderr); + } + else { + resolve(stdout); + } + } + ); + }); +}; + +// Called on the command line +if (require.main === module) { + module.exports(); +} diff --git a/utils/defaultCxxStandard.js b/utils/defaultCxxStandard.js new file mode 100644 index 0000000000..5a7d7beb5a --- /dev/null +++ b/utils/defaultCxxStandard.js @@ -0,0 +1,24 @@ +const targetSpecified = process.argv[2] !== 'none'; + +let cxxStandard = '14'; + +if (targetSpecified) { + // Assume electron if target is specified. + // If building node 18 / 19 via target, will need to specify C++ standard manually + const majorVersion = process.argv[2].split('.')[0]; + if (Number.parseInt(majorVersion) >= 32) { + cxxStandard = '20'; + } else if (Number.parseInt(majorVersion) >= 21) { + cxxStandard = '17'; + } +} else { + const abiVersion = Number.parseInt(process.versions.modules) ?? 0; + // Node 18 === 108 + if (abiVersion >= 131) { + cxxStandard = '20'; + } else if (abiVersion >= 108) { + cxxStandard = '17'; + } +} + +process.stdout.write(cxxStandard); diff --git a/utils/execPromise.js b/utils/execPromise.js new file mode 100644 index 0000000000..acdc785ec6 --- /dev/null +++ b/utils/execPromise.js @@ -0,0 +1,24 @@ +var cp = require('child_process'); + +// We have to manually promisify this because at this is required in lifecycle +// methods and we are not guaranteed that any 3rd party packages are installed +// at this point +module.exports = function(command, opts, extraOpts = {}) { + return new Promise(function(resolve, reject) { + const childProcess = cp.exec(command, opts, function(err, result) { + if (err) { + reject(err); + } + else { + resolve(result); + } + }); + + if (extraOpts.pipeOutput) { + childProcess.stdout.pipe(process.stdout); + childProcess.stderr.pipe(process.stderr); + } + + return childProcess; + }); +}; diff --git a/utils/getElectronOpenSSLRoot.js b/utils/getElectronOpenSSLRoot.js new file mode 100644 index 0000000000..a8ccc09b7b --- /dev/null +++ b/utils/getElectronOpenSSLRoot.js @@ -0,0 +1,10 @@ +const path = require("path"); + +if (process.argv.length < 3) { + process.exit(1); +} + +const [, , moduleRootDir] = process.argv; + +const openSSLRoot = process.env.npm_config_openssl_dir || path.join(moduleRootDir, 'vendor', 'openssl'); +process.stdout.write(openSSLRoot); diff --git a/utils/gitExecutableLocation.js b/utils/gitExecutableLocation.js new file mode 100644 index 0000000000..48316510f6 --- /dev/null +++ b/utils/gitExecutableLocation.js @@ -0,0 +1,23 @@ +var cp = require("child_process"); + +module.exports = function gitExecutableLocation() { + return new Promise(function(resolve, reject) { + var cmd; + + if (process.platform === "win32") { + cmd = "where git"; + } + else { + cmd = "which git"; + } + + cp.exec(cmd, function(err, stdout, stderr) { + if (err) { + reject(err, stderr); + } + else { + resolve(stdout); + } + }); + }); +}; diff --git a/utils/isBuildingForElectron.js b/utils/isBuildingForElectron.js new file mode 100644 index 0000000000..295f6ab1fb --- /dev/null +++ b/utils/isBuildingForElectron.js @@ -0,0 +1,30 @@ +const fs = require("fs") +const JSON5 = require("json5"); +const path = require("path"); + +if (process.argv.length < 3) { + process.exit(1); +} + +const last = arr => arr[arr.length - 1]; +const [, , nodeRootDir] = process.argv; + +let isElectron = last(nodeRootDir.split(path.sep)).startsWith("iojs"); + +if (!isElectron) { + try { + // Not ideal, would love it if there were a full featured gyp package to do this operation instead. + const { variables: { built_with_electron } } = JSON5.parse( + fs.readFileSync( + path.resolve(nodeRootDir, "include", "node", "config.gypi"), + "utf8" + ) + ); + + if (built_with_electron) { + isElectron = true; + } + } catch (e) {} +} + +process.stdout.write(isElectron ? "1" : "0"); diff --git a/utils/retry.js b/utils/retry.js new file mode 100644 index 0000000000..c7a57fb065 --- /dev/null +++ b/utils/retry.js @@ -0,0 +1,51 @@ +const { spawn } = require('child_process'); + +const [, , cmd, ...args] = process.argv; +if (!cmd) { + process.exit(-1); +} + +const once = (fn) => { + let runOnce = false; + return (...args) => { + if (runOnce) { + return; + } + + runOnce = true; + fn(...args); + } +}; + +const retry = (numRetries = 3) => { + const child = spawn(cmd, args, { + shell: process.platform === 'win32', + stdio: [0, 'pipe', 'pipe'] + }); + + child.setMaxListeners(0); + + child.stdout.setEncoding('utf8'); + child.stderr.setEncoding('utf8'); + + child.stdout.pipe(process.stdout); + child.stderr.pipe(process.stderr); + + const cleanupAndExit = once((error, status) => { + child.kill(); + if (numRetries > 0 && (error || status !== 0)) { + retry(numRetries - 1); + } else if (error) { + console.log(error); + process.exit(-1); + } else { + process.exit(status); + } + }); + const onClose = status => cleanupAndExit(null, status); + + child.on('close', onClose); + child.on('error', cleanupAndExit); +}; + +retry(); diff --git a/utils/uploadOpenSSL.mjs b/utils/uploadOpenSSL.mjs new file mode 100644 index 0000000000..5de760462e --- /dev/null +++ b/utils/uploadOpenSSL.mjs @@ -0,0 +1,32 @@ +import aws from 'aws-sdk'; +import fs from "fs"; +import path from "path"; + +import pkgJson from '../package.json' with { type: "json" }; +import { getOpenSSLPackagePath, getOpenSSLPackageName } from './acquireOpenSSL.mjs'; + +const s3 = new aws.S3(); + +const uploadBinaryToS3 = (fileName, bucketName, pathToFile) => + s3.upload({ + Body: fs.createReadStream(pathToFile), + Bucket: bucketName, + Key: fileName, + ACL: "public-read" + }).promise(); + +export const uploadOpenSSL = async () => { + const packageName = path.basename(getOpenSSLPackageName()); + const packagePath = getOpenSSLPackagePath(); + console.log(`Uploading ${packagePath} to s3://${pkgJson.binary.bucket_name}/${packageName}`); + await uploadBinaryToS3(packageName, pkgJson.binary.bucket_name, packagePath); + const sha256PackageName = `${packageName}.sha256`; + await uploadBinaryToS3(sha256PackageName, pkgJson.binary.bucket_name, `${packagePath}.sha256`); +}; + +if (process.argv[1] === import.meta.filename) { + uploadOpenSSL().catch((error) => { + console.error('Push to S3 failed: ', error); + process.exit(1); + }); +} diff --git a/vendor/http_parser b/vendor/http_parser new file mode 160000 index 0000000000..39c2c1e573 --- /dev/null +++ b/vendor/http_parser @@ -0,0 +1 @@ +Subproject commit 39c2c1e5733eb2cb7397a370cf50508ea1214bf7 diff --git a/vendor/libgit2 b/vendor/libgit2 new file mode 160000 index 0000000000..2644628edb --- /dev/null +++ b/vendor/libgit2 @@ -0,0 +1 @@ +Subproject commit 2644628edb8742338a952d40f5e9549b17480e3a diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index afdfc620ea..aff29d76a2 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -7,7 +7,10 @@ "library%": "static_library", "openssl_enable_asm%": 0, # only supported with the Visual Studio 2012 (VC11) toolchain. "gcc_version%": 0, + "is_electron%": "=43", { - "cflags": [ - "-Wno-old-style-declaration" - ], - }], - ["OS=='solaris'", { - "defines": [ - "__EXTENSIONS__" - ], - }], - ["target_arch=='arm'", { - "sources": [ - "openssl/openssl/crypto/armcap.c" + ["OS=='linux'", { + "conditions": [ + ["<(is_electron) == 1", { + "include_dirs": ["<(electron_openssl_root)/include"] + }] ], - }], - ], + "sources": [ + "libgit2/deps/ntlmclient/crypt_openssl.c", + ], + "defines": [ + "CRYPT_OPENSSL" + ] + }] + ] }, + { + "target_name": "pcre", + "type": "static_library", + "sources": [ + "libgit2/deps/pcre/pcre_byte_order.c", + "libgit2/deps/pcre/pcre_chartables.c", + "libgit2/deps/pcre/pcre_compile.c", + "libgit2/deps/pcre/pcre_config.c", + "libgit2/deps/pcre/pcre_dfa_exec.c", + "libgit2/deps/pcre/pcre_exec.c", + "libgit2/deps/pcre/pcre_fullinfo.c", + "libgit2/deps/pcre/pcre_get.c", + "libgit2/deps/pcre/pcre_globals.c", + "libgit2/deps/pcre/pcre_jit_compile.c", + "libgit2/deps/pcre/pcre_maketables.c", + "libgit2/deps/pcre/pcre_newline.c", + "libgit2/deps/pcre/pcre_ord2utf8.c", + "libgit2/deps/pcre/pcreposix.c", + "libgit2/deps/pcre/pcre_printint.c", + "libgit2/deps/pcre/pcre_refcount.c", + "libgit2/deps/pcre/pcre_string_utils.c", + "libgit2/deps/pcre/pcre_study.c", + "libgit2/deps/pcre/pcre_tables.c", + "libgit2/deps/pcre/pcre_ucd.c", + "libgit2/deps/pcre/pcre_valid_utf8.c", + "libgit2/deps/pcre/pcre_version.c", + "libgit2/deps/pcre/pcre_xclass.c", + ], + "conditions": [ + ["OS=='linux' or OS.endswith('bsd') or <(is_IBMi) == 1", { + "defines": [ + "HAVE_DIRENT_H", + "HAVE_SYS_STAT_H", + "HAVE_SYS_TYPES_H", + "HAVE_UNISTD_H", + "HAVE_STDINT_H", + "HAVE_INTTYPES_H", + "HAVE_BCOPY", + "HAVE_MEMMOVE", + "HAVE_STRERROR", + "HAVE_STRTOLL", + "HAVE_STRTOQ", + "SUPPORT_PCRE8", + "NO_RECURSE", + "HAVE_LONG_LONG", + "HAVE_UNSIGNED_LONG_LONG", + "NEWLINE=10", + "POSIX_MALLOC_THRESHOLD=10", + "LINK_SIZE=2", + "PARENS_NEST_LIMIT=250", + "MATCH_LIMIT=10000000", + "MATCH_LIMIT_RECURSION=10000000", + "PCREGREP_BUFSIZE", + "MAX_NAME_SIZE=32", + "MAX_NAME_COUNT=10000" + ] + }], + ["OS=='win'", { + "defines": [ + "HAVE_SYS_STAT_H", + "HAVE_SYS_TYPES_H", + "HAVE_WINDOWS_H", + "HAVE_STDINT_H", + "HAVE_INTTYPES_H", + "HAVE_MEMMOVE", + "HAVE_STRERROR", + "HAVE_STRTOLL", + "HAVE__STRTOI64", + "SUPPORT_PCRE8", + "NO_RECURSE", + "HAVE_LONG_LONG", + "HAVE_UNSIGNED_LONG_LONG", + "NEWLINE=10", + "POSIX_MALLOC_THRESHOLD=10", + "LINK_SIZE=2", + "PARENS_NEST_LIMIT=250", + "MATCH_LIMIT=10000000", + "MATCH_LIMIT_RECURSION=10000000", + "PCREGREP_BUFSIZE", + "MAX_NAME_SIZE=32", + "MAX_NAME_COUNT=10000" + ] + }] + ] + } ] } diff --git a/vendor/libssh2.gyp b/vendor/libssh2.gyp new file mode 100644 index 0000000000..1067eeeae2 --- /dev/null +++ b/vendor/libssh2.gyp @@ -0,0 +1,38 @@ +{ + "variables": { + "is_electron%": " +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided +# that the following conditions are met: +# +# Redistributions of source code must retain the above +# copyright notice, this list of conditions and the +# following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# Neither the name of the copyright holder nor the names +# of any other contributors may be used to endorse or +# promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + +cmake_minimum_required(VERSION 2.8.11) + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +project(libssh2 C) +set(PROJECT_URL "https://www.libssh2.org/") +set(PROJECT_DESCRIPTION "The SSH library") + +if (CMAKE_VERSION VERSION_LESS "3.1") + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + set (CMAKE_C_FLAGS "--std=gnu90 ${CMAKE_C_FLAGS}") + endif() +else() + set (CMAKE_C_STANDARD 90) +endif() + +option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) + +# Parse version + +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/include/libssh2.h _HEADER_CONTENTS) +string( + REGEX REPLACE ".*#define LIBSSH2_VERSION[ \t]+\"([^\"]+)\".*" "\\1" + LIBSSH2_VERSION "${_HEADER_CONTENTS}") +string( + REGEX REPLACE ".*#define LIBSSH2_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" + LIBSSH2_VERSION_MAJOR "${_HEADER_CONTENTS}") +string( + REGEX REPLACE ".*#define LIBSSH2_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" + LIBSSH2_VERSION_MINOR "${_HEADER_CONTENTS}") +string( + REGEX REPLACE ".*#define LIBSSH2_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" + LIBSSH2_VERSION_PATCH "${_HEADER_CONTENTS}") + +if(NOT LIBSSH2_VERSION OR + NOT LIBSSH2_VERSION_MAJOR MATCHES "^[0-9]+$" OR + NOT LIBSSH2_VERSION_MINOR MATCHES "^[0-9]+$" OR + NOT LIBSSH2_VERSION_PATCH MATCHES "^[0-9]+$") + message( + FATAL_ERROR + "Unable to parse version from" + "${CMAKE_CURRENT_SOURCE_DIR}/include/libssh2.h") +endif() + +include(GNUInstallDirs) +install( + FILES docs/AUTHORS COPYING docs/HACKING README RELEASE-NOTES NEWS + DESTINATION ${CMAKE_INSTALL_DOCDIR}) + +include(max_warnings) +include(FeatureSummary) + +add_subdirectory(src) + +option(BUILD_EXAMPLES "Build libssh2 examples" ON) +if(BUILD_EXAMPLES) + add_subdirectory(example) +endif() + +option(BUILD_TESTING "Build libssh2 test suite" ON) +if(BUILD_TESTING) + enable_testing() + add_subdirectory(tests) +endif() + +option(LINT "Check style while building" OFF) +if(LINT) + add_custom_target(lint ALL + ./ci/checksrc.sh + WORKING_DIRECTORY ${libssh2_SOURCE_DIR}) + add_dependencies(libssh2 lint) +endif() + +add_subdirectory(docs) + +feature_summary(WHAT ALL) + +set(CPACK_PACKAGE_VERSION_MAJOR ${LIBSSH2_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${LIBSSH2_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${LIBSSH2_VERSION_PATCH}) +set(CPACK_PACKAGE_VERSION ${LIBSSH2_VERSION}) +include(CPack) diff --git a/vendor/libssh2/COPYING b/vendor/libssh2/COPYING new file mode 100644 index 0000000000..937ed32e3a --- /dev/null +++ b/vendor/libssh2/COPYING @@ -0,0 +1,44 @@ +/* Copyright (c) 2004-2007 Sara Golemon + * Copyright (c) 2005,2006 Mikhail Gusarov + * Copyright (c) 2006-2007 The Written Word, Inc. + * Copyright (c) 2007 Eli Fant + * Copyright (c) 2009-2021 Daniel Stenberg + * Copyright (C) 2008, 2009 Simon Josefsson + * Copyright (c) 2000 Markus Friedl + * Copyright (c) 2015 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, + * with or without modification, are permitted provided + * that the following conditions are met: + * + * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the copyright holder nor the names + * of any other contributors may be used to endorse or + * promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + */ + diff --git a/vendor/libssh2/ChangeLog b/vendor/libssh2/ChangeLog new file mode 100644 index 0000000000..404c887c29 --- /dev/null +++ b/vendor/libssh2/ChangeLog @@ -0,0 +1 @@ +see NEWS diff --git a/vendor/libssh2/Makefile.OpenSSL.inc b/vendor/libssh2/Makefile.OpenSSL.inc new file mode 100644 index 0000000000..1e4e8f0bbb --- /dev/null +++ b/vendor/libssh2/Makefile.OpenSSL.inc @@ -0,0 +1,3 @@ +CRYPTO_CSOURCES = openssl.c +CRYPTO_HHEADERS = openssl.h +CRYPTO_LTLIBS = $(LTLIBSSL) diff --git a/vendor/libssh2/Makefile.WinCNG.inc b/vendor/libssh2/Makefile.WinCNG.inc new file mode 100644 index 0000000000..bbcb82bfde --- /dev/null +++ b/vendor/libssh2/Makefile.WinCNG.inc @@ -0,0 +1,3 @@ +CRYPTO_CSOURCES = wincng.c +CRYPTO_HHEADERS = wincng.h +CRYPTO_LTLIBS = $(LTLIBBCRYPT) $(LTLIBCRYPT32) diff --git a/vendor/libssh2/Makefile.am b/vendor/libssh2/Makefile.am new file mode 100644 index 0000000000..986441bd68 --- /dev/null +++ b/vendor/libssh2/Makefile.am @@ -0,0 +1,154 @@ +AUTOMAKE_OPTIONS = foreign nostdinc + +SUBDIRS = src tests docs +if BUILD_EXAMPLES +SUBDIRS += example +endif + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libssh2.pc + +include_HEADERS = \ + include/libssh2.h \ + include/libssh2_publickey.h \ + include/libssh2_sftp.h + +NETWAREFILES = nw/keepscreen.c \ + nw/nwlib.c \ + nw/GNUmakefile \ + nw/test/GNUmakefile + +DSP = win32/libssh2.dsp +VCPROJ = win32/libssh2.vcproj + +DISTCLEANFILES = $(DSP) + +VMSFILES = vms/libssh2_make_example.dcl vms/libssh2_make_help.dcl \ +vms/libssh2_make_kit.dcl vms/libssh2_make_lib.dcl vms/man2help.c \ +vms/readme.vms vms/libssh2_config.h + +WIN32FILES = win32/GNUmakefile win32/test/GNUmakefile \ +win32/libssh2_config.h win32/config.mk win32/rules.mk \ +win32/Makefile.Watcom win32/libssh2.dsw win32/tests.dsp $(DSP) \ +win32/msvcproj.head win32/msvcproj.foot win32/libssh2.rc + +OS400FILES = os400/README400 os400/initscript.sh os400/make.sh \ +os400/make-src.sh os400/make-rpg.sh os400/make-include.sh \ +os400/os400sys.c os400/ccsid.c \ +os400/libssh2_config.h os400/macros.h os400/libssh2_ccsid.h \ +os400/include/alloca.h os400/include/sys/socket.h os400/include/stdio.h \ +os400/libssh2rpg/libssh2.rpgle.in \ +os400/libssh2rpg/libssh2_ccsid.rpgle.in \ +os400/libssh2rpg/libssh2_publickey.rpgle \ +os400/libssh2rpg/libssh2_sftp.rpgle \ +Makefile.os400qc3.inc + +EXTRA_DIST = $(WIN32FILES) $(NETWAREFILES) get_ver.awk \ + maketgz NMakefile RELEASE-NOTES libssh2.pc.in $(VMSFILES) config.rpath \ + CMakeLists.txt cmake $(OS400FILES) + +ACLOCAL_AMFLAGS = -I m4 + +.PHONY: ChangeLog +ChangeLog: + echo "see NEWS" > ./ChangeLog +DISTCLEANFILES += ChangeLog + +dist-hook: + rm -rf $(top_builddir)/tests/log + find $(distdir) -name "*.dist" -exec rm {} \; + (distit=`find $(srcdir) -name "*.dist"`; \ + for file in $$distit; do \ + strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ + cp $$file $(distdir)$$strip; \ + done) + +# Code Coverage + +init-coverage: + make clean + lcov --directory . --zerocounters + +COVERAGE_CCOPTS ?= "-g --coverage" +COVERAGE_OUT ?= docs/coverage + +build-coverage: + make CFLAGS=$(COVERAGE_CCOPTS) check + mkdir -p $(COVERAGE_OUT) + lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \ + --capture + +gen-coverage: + genhtml --output-directory $(COVERAGE_OUT) \ + $(COVERAGE_OUT)/$(PACKAGE).info \ + --highlight --frames --legend \ + --title "$(PACKAGE_NAME)" + +coverage: init-coverage build-coverage gen-coverage + +# DSP/VCPROJ generation adapted from libcurl +# only OpenSSL and WinCNG are supported with this build system +CRYPTO_CSOURCES = openssl.c wincng.c mbedtls.c +CRYPTO_HHEADERS = openssl.h wincng.h mbedtls.h +# Makefile.inc provides the CSOURCES and HHEADERS defines +include Makefile.inc + +WIN32SOURCES = $(CSOURCES) +WIN32HEADERS = $(HHEADERS) libssh2_config.h + +$(DSP): win32/msvcproj.head win32/msvcproj.foot Makefile.am + echo "creating $(DSP)" + @( (cat $(srcdir)/win32/msvcproj.head; \ + echo "# Begin Group \"Source Files\""; \ + echo ""; \ + echo "# PROP Default_Filter \"cpp;c;cxx\""; \ + win32_srcs='$(WIN32SOURCES)'; \ + sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ + for file in $$sorted_srcs; do \ + echo "# Begin Source File"; \ + echo ""; \ + echo "SOURCE=..\\src\\"$$file; \ + echo "# End Source File"; \ + done; \ + echo "# End Group"; \ + echo "# Begin Group \"Header Files\""; \ + echo ""; \ + echo "# PROP Default_Filter \"h;hpp;hxx\""; \ + win32_hdrs='$(WIN32HEADERS)'; \ + sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ + for file in $$sorted_hdrs; do \ + echo "# Begin Source File"; \ + echo ""; \ + if [ "$$file" = "libssh2_config.h" ]; \ + then \ + echo "SOURCE=.\\"$$file; \ + else \ + echo "SOURCE=..\\src\\"$$file; \ + fi; \ + echo "# End Source File"; \ + done; \ + echo "# End Group"; \ + cat $(srcdir)/win32/msvcproj.foot) | \ + awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ ) + +$(VCPROJ): win32/vc8proj.head win32/vc8proj.foot Makefile.am + echo "creating $(VCPROJ)" + @( (cat $(srcdir)/vc8proj.head; \ + win32_srcs='$(WIN32SOURCES)'; \ + sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ + for file in $$sorted_srcs; do \ + echo ""; \ + done; \ + echo ""; \ + win32_hdrs='$(WIN32HEADERS)'; \ + sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ + for file in $$sorted_hdrs; do \ + echo ""; \ + done; \ + cat $(srcdir)/vc8proj.foot) | \ + awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ ) + +checksrc: + perl src/checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF -ACOPYRIGHT \ + -AFOPENMODE -Wsrc/libssh2_config.h src/*.[ch] include/*.h example/*.c \ + tests/*.[ch] diff --git a/vendor/libssh2/Makefile.in b/vendor/libssh2/Makefile.in new file mode 100644 index 0000000000..c60873ab8e --- /dev/null +++ b/vendor/libssh2/Makefile.in @@ -0,0 +1,1079 @@ +# Makefile.in generated by automake 1.16.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@BUILD_EXAMPLES_TRUE@am__append_1 = example +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/libssh2_config.h +CONFIG_CLEAN_FILES = libssh2.pc +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(includedir)" +DATA = $(pkgconfig_DATA) +HEADERS = $(include_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +DIST_SUBDIRS = src tests docs example +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.inc \ + $(srcdir)/libssh2.pc.in COPYING ChangeLog NEWS README compile \ + config.guess config.rpath config.sub depcomp install-sh \ + ltmain.sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_LIBBCRYPT = @HAVE_LIBBCRYPT@ +HAVE_LIBCRYPT32 = @HAVE_LIBCRYPT32@ +HAVE_LIBGCRYPT = @HAVE_LIBGCRYPT@ +HAVE_LIBMBEDCRYPTO = @HAVE_LIBMBEDCRYPTO@ +HAVE_LIBSSL = @HAVE_LIBSSL@ +HAVE_LIBZ = @HAVE_LIBZ@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBBCRYPT = @LIBBCRYPT@ +LIBBCRYPT_PREFIX = @LIBBCRYPT_PREFIX@ +LIBCRYPT32 = @LIBCRYPT32@ +LIBCRYPT32_PREFIX = @LIBCRYPT32_PREFIX@ +LIBGCRYPT = @LIBGCRYPT@ +LIBGCRYPT_PREFIX = @LIBGCRYPT_PREFIX@ +LIBMBEDCRYPTO = @LIBMBEDCRYPTO@ +LIBMBEDCRYPTO_PREFIX = @LIBMBEDCRYPTO_PREFIX@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSREQUIRED = @LIBSREQUIRED@ +LIBSSH2VER = @LIBSSH2VER@ +LIBSSL = @LIBSSL@ +LIBSSL_PREFIX = @LIBSSL_PREFIX@ +LIBTOOL = @LIBTOOL@ +LIBZ = @LIBZ@ +LIBZ_PREFIX = @LIBZ_PREFIX@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBBCRYPT = @LTLIBBCRYPT@ +LTLIBCRYPT32 = @LTLIBCRYPT32@ +LTLIBGCRYPT = @LTLIBGCRYPT@ +LTLIBMBEDCRYPTO = @LTLIBMBEDCRYPTO@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBSSL = @LTLIBSSL@ +LTLIBZ = @LTLIBZ@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SSHD = @SSHD@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign nostdinc +SUBDIRS = src tests docs $(am__append_1) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libssh2.pc +include_HEADERS = \ + include/libssh2.h \ + include/libssh2_publickey.h \ + include/libssh2_sftp.h + +NETWAREFILES = nw/keepscreen.c \ + nw/nwlib.c \ + nw/GNUmakefile \ + nw/test/GNUmakefile + +DSP = win32/libssh2.dsp +VCPROJ = win32/libssh2.vcproj +DISTCLEANFILES = $(DSP) ChangeLog +VMSFILES = vms/libssh2_make_example.dcl vms/libssh2_make_help.dcl \ +vms/libssh2_make_kit.dcl vms/libssh2_make_lib.dcl vms/man2help.c \ +vms/readme.vms vms/libssh2_config.h + +WIN32FILES = win32/GNUmakefile win32/test/GNUmakefile \ +win32/libssh2_config.h win32/config.mk win32/rules.mk \ +win32/Makefile.Watcom win32/libssh2.dsw win32/tests.dsp $(DSP) \ +win32/msvcproj.head win32/msvcproj.foot win32/libssh2.rc + +OS400FILES = os400/README400 os400/initscript.sh os400/make.sh \ +os400/make-src.sh os400/make-rpg.sh os400/make-include.sh \ +os400/os400sys.c os400/ccsid.c \ +os400/libssh2_config.h os400/macros.h os400/libssh2_ccsid.h \ +os400/include/alloca.h os400/include/sys/socket.h os400/include/stdio.h \ +os400/libssh2rpg/libssh2.rpgle.in \ +os400/libssh2rpg/libssh2_ccsid.rpgle.in \ +os400/libssh2rpg/libssh2_publickey.rpgle \ +os400/libssh2rpg/libssh2_sftp.rpgle \ +Makefile.os400qc3.inc + +EXTRA_DIST = $(WIN32FILES) $(NETWAREFILES) get_ver.awk \ + maketgz NMakefile RELEASE-NOTES libssh2.pc.in $(VMSFILES) config.rpath \ + CMakeLists.txt cmake $(OS400FILES) + +ACLOCAL_AMFLAGS = -I m4 + +# DSP/VCPROJ generation adapted from libcurl +# only OpenSSL and WinCNG are supported with this build system +CRYPTO_CSOURCES = openssl.c wincng.c mbedtls.c +CRYPTO_HHEADERS = openssl.h wincng.h mbedtls.h +CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \ + packet.c publickey.c scp.c session.c sftp.c userauth.c transport.c \ + version.c knownhost.c agent.c $(CRYPTO_CSOURCES) pem.c keepalive.c global.c \ + blowfish.c bcrypt_pbkdf.c agent_win.c + +HHEADERS = libssh2_priv.h $(CRYPTO_HHEADERS) transport.h channel.h comp.h \ + mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h blf.h agent.h + +# Makefile.inc provides the CSOURCES and HHEADERS defines +WIN32SOURCES = $(CSOURCES) +WIN32HEADERS = $(HHEADERS) libssh2_config.h +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.inc $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; +$(srcdir)/Makefile.inc $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +libssh2.pc: $(top_builddir)/config.status $(srcdir)/libssh2.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-includeHEADERS install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-includeHEADERS uninstall-pkgconfigDATA + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ + dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-libtool distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-includeHEADERS uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + + +.PHONY: ChangeLog +ChangeLog: + echo "see NEWS" > ./ChangeLog + +dist-hook: + rm -rf $(top_builddir)/tests/log + find $(distdir) -name "*.dist" -exec rm {} \; + (distit=`find $(srcdir) -name "*.dist"`; \ + for file in $$distit; do \ + strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ + cp $$file $(distdir)$$strip; \ + done) + +# Code Coverage + +init-coverage: + make clean + lcov --directory . --zerocounters + +COVERAGE_CCOPTS ?= "-g --coverage" +COVERAGE_OUT ?= docs/coverage + +build-coverage: + make CFLAGS=$(COVERAGE_CCOPTS) check + mkdir -p $(COVERAGE_OUT) + lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \ + --capture + +gen-coverage: + genhtml --output-directory $(COVERAGE_OUT) \ + $(COVERAGE_OUT)/$(PACKAGE).info \ + --highlight --frames --legend \ + --title "$(PACKAGE_NAME)" + +coverage: init-coverage build-coverage gen-coverage + +$(DSP): win32/msvcproj.head win32/msvcproj.foot Makefile.am + echo "creating $(DSP)" + @( (cat $(srcdir)/win32/msvcproj.head; \ + echo "# Begin Group \"Source Files\""; \ + echo ""; \ + echo "# PROP Default_Filter \"cpp;c;cxx\""; \ + win32_srcs='$(WIN32SOURCES)'; \ + sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ + for file in $$sorted_srcs; do \ + echo "# Begin Source File"; \ + echo ""; \ + echo "SOURCE=..\\src\\"$$file; \ + echo "# End Source File"; \ + done; \ + echo "# End Group"; \ + echo "# Begin Group \"Header Files\""; \ + echo ""; \ + echo "# PROP Default_Filter \"h;hpp;hxx\""; \ + win32_hdrs='$(WIN32HEADERS)'; \ + sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ + for file in $$sorted_hdrs; do \ + echo "# Begin Source File"; \ + echo ""; \ + if [ "$$file" = "libssh2_config.h" ]; \ + then \ + echo "SOURCE=.\\"$$file; \ + else \ + echo "SOURCE=..\\src\\"$$file; \ + fi; \ + echo "# End Source File"; \ + done; \ + echo "# End Group"; \ + cat $(srcdir)/win32/msvcproj.foot) | \ + awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ ) + +$(VCPROJ): win32/vc8proj.head win32/vc8proj.foot Makefile.am + echo "creating $(VCPROJ)" + @( (cat $(srcdir)/vc8proj.head; \ + win32_srcs='$(WIN32SOURCES)'; \ + sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ + for file in $$sorted_srcs; do \ + echo ""; \ + done; \ + echo ""; \ + win32_hdrs='$(WIN32HEADERS)'; \ + sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ + for file in $$sorted_hdrs; do \ + echo ""; \ + done; \ + cat $(srcdir)/vc8proj.foot) | \ + awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ ) + +checksrc: + perl src/checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF -ACOPYRIGHT \ + -AFOPENMODE -Wsrc/libssh2_config.h src/*.[ch] include/*.h example/*.c \ + tests/*.[ch] + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/vendor/libssh2/Makefile.inc b/vendor/libssh2/Makefile.inc new file mode 100644 index 0000000000..20d2ebeeb2 --- /dev/null +++ b/vendor/libssh2/Makefile.inc @@ -0,0 +1,7 @@ +CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \ + packet.c publickey.c scp.c session.c sftp.c userauth.c transport.c \ + version.c knownhost.c agent.c $(CRYPTO_CSOURCES) pem.c keepalive.c global.c \ + blowfish.c bcrypt_pbkdf.c agent_win.c + +HHEADERS = libssh2_priv.h $(CRYPTO_HHEADERS) transport.h channel.h comp.h \ + mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h blf.h agent.h diff --git a/vendor/libssh2/Makefile.libgcrypt.inc b/vendor/libssh2/Makefile.libgcrypt.inc new file mode 100644 index 0000000000..0a3aae9aad --- /dev/null +++ b/vendor/libssh2/Makefile.libgcrypt.inc @@ -0,0 +1,3 @@ +CRYPTO_CSOURCES = libgcrypt.c +CRYPTO_HHEADERS = libgcrypt.h +CRYPTO_LTLIBS = $(LTLIBGCRYPT) diff --git a/vendor/libssh2/Makefile.mbedTLS.inc b/vendor/libssh2/Makefile.mbedTLS.inc new file mode 100644 index 0000000000..b9f19fce1a --- /dev/null +++ b/vendor/libssh2/Makefile.mbedTLS.inc @@ -0,0 +1,3 @@ +CRYPTO_CSOURCES = mbedtls.c +CRYPTO_HHEADERS = mbedtls.h +CRYPTO_LTLIBS = $(LTLIBMBEDCRYPTO) diff --git a/vendor/libssh2/Makefile.os400qc3.inc b/vendor/libssh2/Makefile.os400qc3.inc new file mode 100644 index 0000000000..e55094d9bd --- /dev/null +++ b/vendor/libssh2/Makefile.os400qc3.inc @@ -0,0 +1,2 @@ +CRYPTO_CSOURCES = os400qc3.c +CRYPTO_HHEADERS = os400qc3.h diff --git a/vendor/libssh2/NEWS b/vendor/libssh2/NEWS new file mode 100644 index 0000000000..7e22b3dd85 --- /dev/null +++ b/vendor/libssh2/NEWS @@ -0,0 +1,6831 @@ + Changelog for the libssh2 project. Generated with git2news.pl + +Daniel Stenberg (29 Aug 2021) +- [Will Cosgrove brought this change] + + updated docs for 1.10.0 release + +Marc Hörsken (30 May 2021) +- [Laurent Stacul brought this change] + + [tests] Try several times to connect the ssh server + + Sometimes, as the OCI container is run in detached mode, it is possible + the actual server is not ready yet to handle SSH traffic. The goal of + this PR is to try several times (max 3). The mechanism is the same as + for the connection to the docker machine. + +- [Laurent Stacul brought this change] + + Remove openssh_server container on test exit + +- [Laurent Stacul brought this change] + + Allow the tests to run inside a container + + The current tests suite starts SSH server as OCI container. This commit + add the possibility to run the tests in a container provided that: + + * the docker client is installed builder container + * the host docker daemon unix socket has been mounted in the builder + container (with, if needed, the DOCKER_HOST environment variable + accordingly set, and the permission to write on this socket) + * the builder container is run on the default bridge network, or the + host network. This PR does not handle the case where the builder + container is on another network. + +Marc Hoersken (28 May 2021) +- CI/appveyor: run SSH server for tests on GitHub Actions (#607) + + No longer rely on DigitalOcean to host the Docker container. + + Unfortunately we require a small dispatcher script that has + access to a GitHub access token with scope repo in order to + trigger the daemon workflow on GitHub Actions also for PRs. + + This script is hosted by myself for the time being until GitHub + provides a tighter scope to trigger the workflow_dispatch event. + +GitHub (26 May 2021) +- [Will Cosgrove brought this change] + + openssl.c: guards around calling FIPS_mode() #596 (#603) + + Notes: + FIPS_mode() is not implemented in LibreSSL and this API is removed in OpenSSL 3.0 and was introduced in 0.9.7. Added guards around making this call. + + Credit: + Will Cosgrove + +- [Will Cosgrove brought this change] + + configure.ac: don't undefine scoped variable (#594) + + * configure.ac: don't undefine scoped variable + + To get this script to run with Autoconf 2.71 on macOS I had to remove the undefine of the backend for loop variable. It seems scoped to the for loop and also isn't referenced later in the script so it seems OK to remove it. + + * configure.ac: remove cygwin specific CFLAGS #598 + + Notes: + Remove cygwin specific Win32 CFLAGS and treat the build like a posix build + + Credit: + Will Cosgrove, Brian Inglis + +- [Laurent Stacul brought this change] + + tests: Makefile.am: Add missing tests client keys in distribution tarball (#604) + + Notes: + Added missing test keys. + + Credit: + Laurent Stacul + +- [Laurent Stacul brought this change] + + Makefile.am: Add missing test keys in the distribution tarball (#601) + + Notes: + Fix tests missing key to build the OCI image + + Credit: + Laurent Stacul + +Daniel Stenberg (16 May 2021) +- dist: add src/agent.h + + Fixes #597 + Closes #599 + +GitHub (12 May 2021) +- [Will Cosgrove brought this change] + + packet.c: Reset read timeout after received a packet (#576) (#586) + + File: + packet.c + + Notes: + Attempt keyboard interactive login (Azure AD 2FA login) and use more than 60 seconds to complete the login, the connection fails. + + The _libssh2_packet_require function does almost the same as _libssh2_packet_requirev but this function sets state->start = 0 before returning. + + Credit: + teottin, Co-authored-by: Tor Erik Ottinsen + +- [kkoenig brought this change] + + Support ECDSA certificate authentication (#570) + + Files: hostkey.c, userauth.c, test_public_key_auth_succeeds_with_correct_ecdsa_key.c + + Notes: + Support ECDSA certificate authentication + + Add a test for: + - Existing ecdsa basic public key authentication + - ecdsa public key authentication with a signed public key + + Credit: + kkoenig + +- [Gabriel Smith brought this change] + + agent.c: Add support for Windows OpenSSH agent (#517) + + Files: agent.c, agent.h, agent_win.c + + Notes: + * agent: Add support for Windows OpenSSH agent + + The implementation was partially taken and modified from that found in + the Portable OpenSSH port to Win32 by the PowerShell team, but mostly + based on the existing Unix OpenSSH agent support. + + https://github.com/PowerShell/openssh-portable + + Regarding the partial transfer support implementation: partial transfers + are easy to deal with, but you need to track additional state when + non-blocking IO enters the picture. A tracker of how many bytes have + been transfered has been placed in the transfer context struct as that's + where it makes most sense. This tracker isn't placed behind a WIN32 + #ifdef as it will probably be useful for other agent implementations. + + * agent: win32 openssh: Disable overlapped IO + + Non-blocking IO is not currently supported by the surrounding agent + code, despite a lot of the code having everything set up to handle it. + + Credit: + Co-authored-by: Gabriel Smith + +- [Zenju brought this change] + + Fix detailed _libssh2_error being overwritten (#473) + + Files: openssl.c, pem.c, userauth.c + + Notes: + * Fix detailed _libssh2_error being overwritten by generic errors + * Unified error handling + + Credit: + Zenju + +- [Paul Capron brought this change] + + Fix _libssh2_random() silently discarding errors (#520) + + Notes: + * Make _libssh2_random return code consistent + + Previously, _libssh2_random was advertized in HACKING.CRYPTO as + returning `void` (and was implemented that way in os400qc3.c), but that + was in other crypto backends a lie; _libssh2_random is (a macro + expanding) to an int-value expression or function. + + Moreover, that returned code was: + — 0 or success, -1 on error for the MbedTLS & WinCNG crypto backends + But also: + — 1 on success, -1 or 0 on error for the OpenSSL backend! + – 1 on success, error cannot happen for libgcrypt! + + This commit makes explicit that _libssh2_random can fail (because most of + the underlying crypto functions can indeed fail!), and it makes its result + code consistent: 0 on success, -1 on error. + + This is related to issue #519 https://github.com/libssh2/libssh2/issues/519 + It fixes the first half of it. + + * Don't silent errors of _libssh2_random + + Make sure to check the returned code of _libssh2_random(), and + propagates any failure. + + A new LIBSSH_ERROR_RANDGEN constant is added to libssh2.h + None of the existing error constants seemed fit. + + This commit is related to d74285b68450c0e9ea6d5f8070450837fb1e74a7 + and to https://github.com/libssh2/libssh2/issues/519 (see the issue + for more info.) It closes #519. + + Credit: + Paul Capron + +- [Gabriel Smith brought this change] + + ci: Remove caching of docker image layers (#589) + + Notes: + continued ci reliability work. + + Credit: + Gabriel Smith + +- [Gabriel Smith brought this change] + + ci: Speed up docker builds for tests (#587) + + Notes: + The OpenSSH server docker image used for tests is pre-built to prevent + wasting time building it during a test, and unneeded rebuilds are + prevented by caching the image layers. + + Credit: + Gabriel Smith + +- [Will Cosgrove brought this change] + + userauth.c: don't error if using keys without RSA (#555) + + file: userauth.c + + notes: libssh2 now supports many other key types besides RSA, if the library is built without RSA support and a user attempts RSA auth it shouldn't be an automatic error + + credit: + Will Cosgrove + +- [Marc brought this change] + + openssl.c: Avoid OpenSSL latent error in FIPS mode (#528) + + File: + openssl.c + + Notes: + Avoid initing MD5 digest, which is not permitted in OpenSSL FIPS certified cryptography mode. + + Credit: + Marc + +- [Laurent Stacul brought this change] + + openssl.c: Fix EVP_Cipher interface change in openssl 3 #463 + + File: + openssl.c + + Notes: + Fixes building with OpenSSL 3, #463. + + The change is described there: + https://github.com/openssl/openssl/commit/f7397f0d58ce7ddf4c5366cd1846f16b341fbe43 + + Credit: + Laurent Stacul, reported by Sergei + +- [Gabriel Smith brought this change] + + openssh_fixture.c: Fix potential overwrite of buffer when reading stdout of command (#580) + + File: + openssh_fixture.c + Notes: + If reading the full output from the executed command took multiple + passes (such as when reading multiple lines) the old code would read + into the buffer starting at the some position (the start) every time. + The old code only works if fgets updated p or had an offset parameter, + both of which are not true. + + Credit: + Gabriel Smith + +- [Gabriel Smith brought this change] + + ci: explicitly state the default branch (#585) + + Notes: + It looks like the $default-branch macro only works in templates, not + workflows. This is not explicitly stated anywhere except the linked PR + comment. + + https://github.com/actions/starter-workflows/pull/590#issuecomment-672360634 + + credit: + Gabriel Smith + +- [Gabriel Smith brought this change] + + ci: Swap from Travis to Github Actions (#581) + + Files: ci files + + Notes: + Move Linux CI using Github Actions + + Credit: + Gabriel Smith, Marc Hörsken + +- [Mary brought this change] + + libssh2_priv.h: add iovec on 3ds (#575) + + file: libssh2_priv.h + note: include iovec for 3DS + credit: Mary Mstrodl + +- [Laurent Stacul brought this change] + + Tests: Fix unused variables warning (#561) + + file: test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c + + notes: fixed unused vars + + credit: + Laurent Stacul + +- [Viktor Szakats brought this change] + + bcrypt_pbkdf.c: fix clang10 false positive warning (#563) + + File: bcrypt_pbkdf.c + + Notes: + blf_enc() takes a number of 64-bit blocks to encrypt, but using + sizeof(uint64_t) in the calculation triggers a warning with + clang 10 because the actual data type is uint32_t. Pass + BCRYPT_BLOCKS / 2 for the number of blocks like libc bcrypt(3) + does. + + Ref: https://github.com/openbsd/src/commit/04a2240bd8f465bcae6b595d912af3e2965856de + + Fixes #562 + + Credit: + Viktor Szakats + +- [Will Cosgrove brought this change] + + transport.c: release payload on error (#554) + + file: transport.c + notes: If the payload is invalid and there is an early return, we could leak the payload + credit: + Will Cosgrove + +- [Will Cosgrove brought this change] + + ssh2_client_fuzzer.cc: fixed building + + The GitHub web editor did some funky things + +- [Will Cosgrove brought this change] + + ssh_client_fuzzer.cc: set blocking mode on (#553) + + file: ssh_client_fuzzer.cc + + notes: the session needs blocking mode turned on to avoid EAGAIN being returned from libssh2_session_handshake() + + credit: + Will Cosgrove, reviewed by Michael Buckley + +- [Etienne Samson brought this change] + + Add a LINT option to CMake (#372) + + * ci: make style-checking available locally + + * cmake: add a linting target + + * tests: check test suite syntax with checksrc.pl + +- [Will Cosgrove brought this change] + + kex.c: kex_agree_instr() improve string reading (#552) + + * kex.c: kex_agree_instr() improve string reading + + file: kex.c + notes: if haystack isn't null terminated we should use memchr() not strchar(). We should also make sure we don't walk off the end of the buffer. + credit: + Will Cosgrove, reviewed by Michael Buckley + +- [Will Cosgrove brought this change] + + kex.c: use string_buf in ecdh_sha2_nistp (#551) + + * kex.c: use string_buf in ecdh_sha2_nistp + + file: kex.c + + notes: + use string_buf in ecdh_sha2_nistp() to avoid attempting to parse malformed data + +- [Will Cosgrove brought this change] + + kex.c: move EC macro outside of if check #549 (#550) + + File: kex.c + + Notes: + Moved the macro LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY outside of the LIBSSH2_ECDSA since it's also now used by the ED25519 code. + + Sha 256, 384 and 512 need to be defined for all backends now even if they aren't used directly. I believe this is already the case, but just a heads up. + + Credit: + Stefan-Ghinea + +- [Tim Gates brought this change] + + kex.c: fix simple typo, niumber -> number (#545) + + File: kex.c + + Notes: + There is a small typo in src/kex.c. + + Should read `number` rather than `niumber`. + + Credit: + Tim Gates + +- [Tseng Jun brought this change] + + session.c: Correct a typo which may lead to stack overflow (#533) + + File: session.c + + Notes: + Seems the author intend to terminate banner_dup buffer, later, print it to the debug console. + + Author: + Tseng Jun + +Marc Hoersken (10 Oct 2020) +- wincng: fix random big number generation to match openssl + + The old function would set the least significant bits in + the most significant byte instead of the most significant bits. + + The old function would also zero pad too much bits in the + most significant byte. This lead to a reduction of key space + in the most significant byte according to the following listing: + - 8 bits reduced to 0 bits => eg. 2048 bits to 2040 bits DH key + - 7 bits reduced to 1 bits => eg. 2047 bits to 2041 bits DH key + - 6 bits reduced to 2 bits => eg. 2046 bits to 2042 bits DH key + - 5 bits reduced to 3 bits => eg. 2045 bits to 2043 bits DH key + + No change would occur for the case of 4 significant bits. + For 1 to 3 significant bits in the most significant byte + the DH key would actually be expanded instead of reduced: + - 3 bits expanded to 5 bits => eg. 2043 bits to 2045 bits DH key + - 2 bits expanded to 6 bits => eg. 2042 bits to 2046 bits DH key + - 1 bits expanded to 7 bits => eg. 2041 bits to 2047 bits DH key + + There is no case of 0 significant bits in the most significant byte + since this would be a case of 8 significant bits in the next byte. + + At the moment only the following case applies due to a fixed + DH key size value currently being used in libssh2: + + The DH group_order is fixed to 256 (bytes) which leads to a + 2047 bits DH key size by calculating (256 * 8) - 1. + + This means the DH keyspace was previously reduced from 2047 bits + to 2041 bits (while the top and bottom bits are always set), so the + keyspace is actually always reduced from 2045 bits to 2039 bits. + + All of this is only relevant for Windows versions supporting the + WinCNG backend (Vista or newer) before Windows 10 version 1903. + + Closes #521 + +Daniel Stenberg (28 Sep 2020) +- libssh2_session_callback_set.3: explain the recv/send callbacks + + Describe how to actually use these callbacks. + + Closes #518 + +GitHub (23 Sep 2020) +- [Will Cosgrove brought this change] + + agent.c: formatting + + Improved formatting of RECV_SEND_ALL macro. + +- [Will Cosgrove brought this change] + + CMakeLists.txt: respect install lib dir #405 (#515) + + Files: + CMakeLists.txt + + Notes: + Use CMAKE_INSTALL_LIBDIR directory + + Credit: Arfrever + +- [Will Cosgrove brought this change] + + kex.c: group16-sha512 and group18-sha512 support #457 (#468) + + Files: kex.c + + Notes: + Added key exchange group16-sha512 and group18-sha512. As a result did the following: + + Abstracted diffie_hellman_sha256() to diffie_hellman_sha_algo() which is now algorithm agnostic and takes the algorithm as a parameter since we needed sha512 support. Unfortunately it required some helper functions but they are simple. + Deleted diffie_hellman_sha1() + Deleted diffie_hellman_sha1 specific macro + Cleaned up some formatting + Defined sha384 in os400 and wincng backends + Defined LIBSSH2_DH_MAX_MODULUS_BITS to abort the connection if we receive too large of p from the server doing sha1 key exchange. + Reorder the default key exchange list to match OpenSSH and improve security + + Credit: + Will Cosgrove + +- [Igor Klevanets brought this change] + + agent.c: Recv and send all bytes via network in agent_transact_unix() (#510) + + Files: agent.c + + Notes: + Handle sending/receiving partial packet replies in agent.c API. + + Credit: Klevanets Igor + +- [Daniel Stenberg brought this change] + + Makefile.am: include all test files in the dist #379 + + File: + Makefile.am + + Notes: + No longer conditionally include OpenSSL specific test files, they aren't run if we're not building against OpenSSL 1.1.x anyway. + + Credit: + Daniel Stenberg + +- [Max Dymond brought this change] + + Add support for an OSS Fuzzer fuzzing target (#392) + + Files: + .travis.yml, configure.ac, ossfuzz + + Notes: + This adds support for an OSS-Fuzz fuzzing target in ssh2_client_fuzzer, + which is a cut down example of ssh2.c. Future enhancements can improve + coverage. + + Credit: + Max Dymond + +- [Sebastián Katzer brought this change] + + mbedtls.c: ECDSA support for mbed TLS (#385) + + Files: + mbedtls.c, mbedtls.h, .travis.yml + + Notes: + This PR adds support for ECDSA for both key exchange and host key algorithms. + + The following elliptic curves are supported: + + 256-bit curve defined by FIPS 186-4 and SEC1 + 384-bit curve defined by FIPS 186-4 and SEC1 + 521-bit curve defined by FIPS 186-4 and SEC1 + + Credit: + Sebastián Katzer + +Marc Hoersken (1 Sep 2020) +- buildconf: exec autoreconf to avoid additional process (#512) + + Also make buildconf exit with the return code of autoreconf. + + Follow up to #224 + +- scp.c: fix indentation in shell_quotearg documentation + +- wincng: make more use of new helper functions (#496) + +- wincng: make sure algorithm providers are closed once (#496) + +GitHub (10 Jul 2020) +- [David Benjamin brought this change] + + openssl.c: clean up curve25519 code (#499) + + File: openssl.c, openssl.h, crypto.h, kex.c + + Notes: + This cleans up a few things in the curve25519 implementation: + + - There is no need to create X509_PUBKEYs or PKCS8_PRIV_KEY_INFOs to + extract key material. EVP_PKEY_get_raw_private_key and + EVP_PKEY_get_raw_public_key work fine. + + - libssh2_x25519_ctx was never used (and occasionally mis-typedefed to + libssh2_ed25519_ctx). Remove it. The _libssh2_curve25519_new and + _libssh2_curve25519_gen_k interfaces use the bytes. Note, if it needs + to be added back, there is no need to roundtrip through + EVP_PKEY_new_raw_private_key. EVP_PKEY_keygen already generated an + EVP_PKEY. + + - Add some missing error checks. + + Credit: + David Benjamin + +- [Will Cosgrove brought this change] + + transport.c: socket is disconnected, return error (#500) + + File: transport.c + + Notes: + This is to fix #102, instead of continuing to attempt to read a disconnected socket, it will now error out. + + Credit: + TDi-jonesds + +- [Will Cosgrove brought this change] + + stale.yml + + Increasing stale values. + +Marc Hoersken (6 Jul 2020) +- wincng: try newer DH API first, fallback to legacy RSA API + + Avoid the use of RtlGetVersion or similar Win32 functions, + since these depend on version information from manifests. + + This commit makes the WinCNG backend first try to use the + new DH algorithm API with the raw secret derivation feature. + In case this feature is not available the WinCNG backend + will fallback to the classic approach of using RSA-encrypt + to perform the required modular exponentiation of BigNums. + + The feature availability test is done during the first handshake + and the result is stored in the crypto backends global state. + + Follow up to #397 + Closes #484 + +- wincng: fix indentation of function arguments and comments + + Follow up to #397 + +- [Wez Furlong brought this change] + + wincng: use newer DH API for Windows 8.1+ + + Since Windows 1903 the approach used to perform DH kex with the CNG + API has been failing. + + This commit switches to using the `DH` algorithm provider to perform + generation of the key pair and derivation of the shared secret. + + It uses a feature of CNG that is not yet documented. The sources of + information that I've found on this are: + + * https://stackoverflow.com/a/56378698/149111 + * https://github.com/wbenny/mini-tor/blob/5d39011e632be8e2b6b1819ee7295e8bd9b7a769/mini/crypto/cng/dh.inl#L355 + + With this change I am able to successfully connect from Windows 10 to my + ubuntu system. + + Refs: https://github.com/alexcrichton/ssh2-rs/issues/122 + Fixes: https://github.com/libssh2/libssh2/issues/388 + Closes: https://github.com/libssh2/libssh2/pull/397 + +GitHub (1 Jul 2020) +- [Zenju brought this change] + + comp.c: Fix name clash with ZLIB macro "compress" (#418) + + File: comp.c + + Notes: + * Fix name clash with ZLIB macro "compress". + + Credit: + Zenju + +- [yann-morin-1998 brought this change] + + buildsystem: drop custom buildconf script, rely on autoreconf (#224) + + Notes: + The buildconf script is currently required, because we need to copy a + header around, because it is used both from the library and the examples + sources. + + However, having a custom 'buildconf'-like script is not needed if we can + ensure that the header exists by the time it is needed. For that, we can + just append the src/ directory to the headers search path for the + examples. + + And then it means we no longer need to generate the same header twice, + so we remove the second one from configure.ac. + + Now, we can just call "autoreconf -fi" to generate the autotools files, + instead of relying on the canned sequence in "buildconf", since + autoreconf has now long known what to do at the correct moment (future + versions of autotools, automake, autopoint, autoheader etc... may + require an other ordering, or other intermediate steps, etc...). + + Eventually, get rid of buildconf now it is no longer needed. In fact, we + really keep it for legacy, but have it just call autoreconf (and print a + nice user-friendly warning). Don't include it in the release tarballs, + though. + + Update doc, gitignore, and travis-CI jobs accordingly. + + Credit: + Signed-off-by: "Yann E. MORIN" + Cc: Sam Voss + +- [Will Cosgrove brought this change] + + libssh2.h: Update Diffie Hellman group values (#493) + + File: libssh2.h + + Notes: + Update the min, preferred and max DH group values based on RFC 8270. + + Credit: + Will Cosgrove, noted from email list by Mitchell Holland + +Marc Hoersken (22 Jun 2020) +- travis: use existing Makefile target to run checksrc + +- Makefile: also run checksrc on test source files + +- tests: avoid use of deprecated function _sleep (#490) + +- tests: avoid use of banned function strncat (#489) + +- tests: satisfy checksrc regarding max line length of 79 chars + + Follow up to 2764bc8e06d51876b6796d6080c6ac51e20f3332 + +- tests: satisfy checksrc with whitespace only fixes + + checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF + -ACOPYRIGHT -AFOPENMODE tests/*.[ch] + +- tests: add support for ports published via Docker for Windows + +- tests: restore retry behaviour for docker-machine ip command + +- tests: fix mix of declarations and code failing C89 compliance + +- wincng: add and improve checks in bit counting function + +- wincng: align bits to bytes calculation in all functions + +- wincng: do not disable key validation that can be enabled + + The modular exponentiation also works with key validation enabled. + +- wincng: fix return value in _libssh2_dh_secret + + Do not ignore return value of modular exponentiation. + +- appveyor: build and run tests for WinCNG crypto backend + +GitHub (1 Jun 2020) +- [suryakalpo brought this change] + + INSTALL_CMAKE.md: Update formatting (#481) + + File: INSTALL_CMAKE.md + + Notes: + Although the original text would be immediately clear to seasoned users of CMAKE and/or Unix shell, the lack of newlines may cause some confusion for newcomers. Hence, wrapping the texts in a md code-block such that the newlines appear as intended. + + credit: + suryakalpo + +Marc Hoersken (31 May 2020) +- src: add new and align include guards in header files (#480) + + Make sure all include guards exist and follow the same format. + +- wincng: fix multiple definition of `_libssh2_wincng' (#479) + + Add missing include guard and move global state + from header to source file by using extern. + +GitHub (28 May 2020) +- [Will Cosgrove brought this change] + + transport.c: moving total_num check from #476 (#478) + + file: transport.c + + notes: + moving total_num zero length check from #476 up to the prior bounds check which already includes a total_num check. Makes it slightly more readable. + + credit: + Will Cosgrove + +- [lutianxiong brought this change] + + transport.c: fix use-of-uninitialized-value (#476) + + file:transport.c + + notes: + return error if malloc(0) + + credit: + lutianxiong + +- [Dr. Koutheir Attouchi brought this change] + + libssh2_sftp.h: Changed type of LIBSSH2_FX_* constants to unsigned long, fixes #474 + + File: + libssh2_sftp.h + + Notes: + Error constants `LIBSSH2_FX_*` are only returned by `libssh2_sftp_last_error()` which returns `unsigned long`. + Therefore these constants should be defined as unsigned long literals, instead of int literals. + + Credit: + Dr. Koutheir Attouchi + +- [monnerat brought this change] + + os400qc3.c: constify libssh2_os400qc3_hash_update() data parameter. (#469) + + Files: os400qc3.c, os400qc3.h + + Notes: + Fixes building on OS400. #426 + + Credit: + Reported-by: hjindra on github, dev by Monnerat + +- [monnerat brought this change] + + HACKING.CRYPTO: keep up to date with new crypto definitions from code. (#466) + + File: HACKING.CRYPTO + + Notes: + This commit updates the HACKING.CRYPTO documentation file in an attempt to make it in sync with current code. + New documented features are: + + SHA384 + SHA512 + ECDSA + ED25519 + + Credit: + monnerat + +- [Harry Sintonen brought this change] + + kex.c: Add diffie-hellman-group14-sha256 Key Exchange Method (#464) + + File: kex.c + + Notes: Added diffie-hellman-group14-sha256 kex + + Credit: Harry Sintonen + +- [Will Cosgrove brought this change] + + os400qc3.h: define sha512 macros (#465) + + file: os400qc3.h + notes: fixes for building libssh2 1.9.x + +- [Will Cosgrove brought this change] + + os400qc3.h: define EC types to fix building #426 (#462) + + File: os400qc3.h + Notes: define missing EC types which prevents building + Credit: hjindra + +- [Brendan Shanks brought this change] + + hostkey.c: Fix 'unsigned int'/'uint32_t' mismatch (#461) + + File: hostkey.c + + Notes: + These types are the same size so most compilers are fine with it, but CodeWarrior (on classic MacOS) throws an â€illegal implicit conversion’ error + + Credit: Brendan Shanks + +- [Thomas Klausner brought this change] + + Makefile.am: Fix unportable test(1) operator. (#459) + + file: Makefile.am + + Notes: + The POSIX comparison operator for test(1) is =; bash supports == but not even test from GNU coreutils does. + + Credit: + Thomas Klausner + +- [Tseng Jun brought this change] + + openssl.c: minor changes of coding style (#454) + + File: openssl.c + + Notes: + minor changes of coding style and align preprocessor conditional for #439 + + Credit: + Tseng Jun + +- [Hans Meier brought this change] + + openssl.c: Fix for use of uninitialized aes_ctr_cipher.key_len (#453) + + File: + Openssl.c + + Notes: + * Fix for use of uninitialized aes_ctr_cipher.key_len when using HAVE_OPAQUE_STRUCTS, regression from #439 + + Credit: + Hans Meirer, Tseng Jun + +- [Zenju brought this change] + + agent.c: Fix Unicode builds on Windows (#417) + + File: agent.c + + Notes: + Fixes unicode builds for Windows in Visual Studio 16.3.2. + + Credit: + Zenju + +- [Hans Meier brought this change] + + openssl.c: Fix use-after-free crash in openssl backend without memory leak (#439) + + Files: openssl.c + + Notes: + Fixes memory leaks and use after free AES EVP_CIPHER contexts when using OpenSSL 1.0.x. + + Credit: + Hans Meier + +- [Romain Geissler @ Amadeus brought this change] + + Session.c: Fix undefined warning when mixing with LTO-enabled libcurl. (#449) + + File: Session.c + + Notes: + With gcc 9, libssh2, libcurl and LTO enabled for all binaries I see this + warning (error with -Werror): + + vssh/libssh2.c: In function â€ssh_statemach_act’: + /data/mwrep/rgeissler/ospack/ssh2/BUILD/libssh2-libssh2-03c7c4a/src/session.c:579:9: error: â€seconds_to_next’ is used uninitialized in this function [-Werror=uninitialized] + 579 | int seconds_to_next; + | ^ + lto1: all warnings being treated as errors + + Gcc normally issues -Wuninitialized when it is sure there is a problem, + and -Wmaybe-uninitialized when it's not sure, but it's possible. Here + the compiler seems to have find a real case where this could happen. I + looked in your code and overall it seems you always check if the return + code is non null, not often that it's below zero. I think we should do + the same here. With this patch, gcc is fine. + + Credit: + Romain-Geissler-1A + +- [Zenju brought this change] + + transport.c: Fix crash with delayed compression (#443) + + Files: transport.c + + Notes: + Fixes crash with delayed compression option using Bitvise server. + + Contributor: + Zenju + +- [Will Cosgrove brought this change] + + Update INSTALL_MAKE path to INSTALL_MAKE.md (#446) + + Included for #429 + +- [Will Cosgrove brought this change] + + Update INSTALL_CMAKE filename to INSTALL_CMAKE.md (#445) + + Fixing for #429 + +- [Wallace Souza brought this change] + + Rename INSTALL_CMAKE to INTALL_CMAKE.md (#429) + + Adding Markdown file extension in order to Github render the instructions properly + +Will Cosgrove (17 Dec 2019) +- [Daniel Stenberg brought this change] + + include/libssh2.h: fix comment: the known host key uses 4 bits (#438) + +- [Zenju brought this change] + + ssh-ed25519: Support PKIX + calc pubkey from private (#416) + + Files: openssl.c/h + Author: Zenju + Notes: + Adds support for PKIX key reading by fixing: + + _libssh2_pub_priv_keyfile() is missing the code to extract the ed25519 public key from a given private key + + _libssh2_ed25519_new_private_frommemory is only parsing the openssh key format but does not understand PKIX (as retrieved via PEM_read_bio_PrivateKey) + +GitHub (15 Oct 2019) +- [Will Cosgrove brought this change] + + .travis.yml: Fix Chrome and 32 bit builds (#423) + + File: .travis.yml + + Notes: + * Fix Chrome installing by using Travis build in directive + * Update to use libgcrypt20-dev package to fix 32 bit builds based on comments found here: + https://launchpad.net/ubuntu/xenial/i386/libgcrypt11-dev + +- [Will Cosgrove brought this change] + + packet.c: improved parsing in packet_x11_open (#410) + + Use new API to parse data in packet_x11_open() for better bounds checking. + +Will Cosgrove (12 Sep 2019) +- [Michael Buckley brought this change] + + knownhost.c: Double the static buffer size when reading and writing known hosts (#409) + + Notes: + We had a user who was being repeatedly prompted to accept a server key repeatedly. It turns out the base64-encoded key was larger than the static buffers allocated to read and write known hosts. I doubled the size of these buffers. + + Credit: + Michael Buckley + +GitHub (4 Sep 2019) +- [Will Cosgrove brought this change] + + packet.c: improved packet parsing in packet_queue_listener (#404) + + * improved bounds checking in packet_queue_listener + + file: packet.c + + notes: + improved parsing packet in packet_queue_listener + +- [Will Cosgrove brought this change] + + packet.c: improve message parsing (#402) + + * packet.c: improve parsing of packets + + file: packet.c + + notes: + Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST. + +- [Will Cosgrove brought this change] + + misc.c: _libssh2_ntohu32 cast bit shifting (#401) + + To quite overly aggressive analyzers. + + Note, the builds pass, Travis is having some issues with Docker images. + +- [Will Cosgrove brought this change] + + kex.c: improve bounds checking in kex_agree_methods() (#399) + + file: kex.c + + notes: + use _libssh2_get_string instead of kex_string_pair which does additional checks + +Will Cosgrove (23 Aug 2019) +- [Fabrice Fontaine brought this change] + + acinclude.m4: add mbedtls to LIBS (#371) + + Notes: + This is useful for static builds so that the Libs.private field in + libssh2.pc contains correct info for the benefit of pkg-config users. + Static link with libssh2 requires this information. + + Signed-off-by: Baruch Siach + [Retrieved from: + https://git.buildroot.net/buildroot/tree/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch] + Signed-off-by: Fabrice Fontaine + + Credit: + Fabrice Fontaine + +- [jethrogb brought this change] + + Generate debug info when building with MSVC (#178) + + files: CMakeLists.txt + + notes: Generate debug info when building with MSVC + + credit: + jethrogb + +- [Panos brought this change] + + Add agent forwarding implementation (#219) + + files: channel.c, test_agent_forward_succeeds.c, libssh2_priv.h, libssh2.h, ssh2_agent_forwarding.c + + notes: + * Adding SSH agent forwarding. + * Fix agent forwarding message, updated example. + Added integration test code and cmake target. Added example to cmake list. + + credit: + pkittenis + +GitHub (2 Aug 2019) +- [Will Cosgrove brought this change] + + Update EditorConfig + + Added max_line_length = 80 + +- [Will Cosgrove brought this change] + + global.c : fixed call to libssh2_crypto_exit #394 (#396) + + * global.c : fixed call to libssh2_crypto_exit #394 + + File: global.c + + Notes: Don't call `libssh2_crypto_exit()` until `_libssh2_initialized` count is down to zero. + + Credit: seba30 + +Will Cosgrove (30 Jul 2019) +- [hlefebvre brought this change] + + misc.c : Add an EWOULDBLOCK check for better portability (#172) + + File: misc.c + + Notes: Added support for all OS' that implement EWOULDBLOCK, not only VMS + + Credit: hlefebvre + +- [Etienne Samson brought this change] + + userauth.c: fix off by one error when loading public keys with no id (#386) + + File: userauth.c + + Credit: + Etienne Samson + + Notes: + Caught by ASAN: + + ================================================================= + ==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8 + READ of size 69 at 0x60700001bcf0 thread T0 + 2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797] + #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) + #1 0x1000f8e66 in file_read_publickey userauth.c:633 + #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513 + #3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590 + #4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69 + #5 0x1000090c3 in clar_run_test clar.c:260 + #6 0x1000038f3 in clar_run_suite clar.c:343 + #7 0x100003272 in clar_test_run clar.c:522 + #8 0x10000c3cc in main runner.c:60 + #9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4) + + 0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0) + allocated by thread T0 here: + #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053) + #1 0x1000b4978 in libssh2_default_alloc session.c:67 + #2 0x1000f8aba in file_read_publickey userauth.c:597 + #3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513 + #4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590 + #5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69 + #6 0x1000090c3 in clar_run_test clar.c:260 + #7 0x1000038f3 in clar_run_suite clar.c:343 + #8 0x100003272 in clar_test_run clar.c:522 + #9 0x10000c3cc in main runner.c:60 + #10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4) + + SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr + Shadow bytes around the buggy address: + 0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd + 0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00 + 0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00 + 0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd + 0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa + =>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa + 0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + Shadow byte legend (one shadow byte represents 8 application bytes): + Addressable: 00 + Partially addressable: 01 02 03 04 05 06 07 + Heap left redzone: fa + Freed heap region: fd + Stack left redzone: f1 + Stack mid redzone: f2 + Stack right redzone: f3 + Stack after return: f5 + Stack use after scope: f8 + Global redzone: f9 + Global init order: f6 + Poisoned by user: f7 + Container overflow: fc + Array cookie: ac + Intra object redzone: bb + ASan internal: fe + Left alloca redzone: ca + Right alloca redzone: cb + Shadow gap: cc + +- [Thilo Schulz brought this change] + + openssl.c : Fix use-after-free crash on reinitialization of openssl backend + + file : openssl.c + + notes : + libssh2's openssl backend has a use-after-free condition if HAVE_OPAQUE_STRUCTS is defined and you call libssh2_init() again after prior initialisation/deinitialisation of libssh2 + + credit : Thilo Schulz + +- [axjowa brought this change] + + openssl.h : Use of ifdef where if should be used (#389) + + File : openssl.h + + Notes : + LIBSSH2_ECDSA and LIBSSH2_ED25519 are always defined so the #ifdef + checks would never be false. + + This change makes it possible to build libssh2 against OpenSSL built + without EC support. + + Change-Id: I0a2f07c2d80178314dcb7d505d1295d19cf15afd + + Credit : axjowa + +- [Zenju brought this change] + + Agent.c : Preserve error info from agent_list_identities() (#374) + + Files : agent.c + + Notes : + Currently the error details as returned by agent_transact_pageant() are overwritten by a generic "agent list id failed" message by int agent_list_identities(LIBSSH2_AGENT* agent). + + Credit : + Zenju + +- [Who? Me?! brought this change] + + Channel.c: Make sure the error code is set in _libssh2_channel_open() (#381) + + File : Channel.c + + Notes : + if _libssh2_channel_open() fails, set the error code. + + Credit : + mark-i-m + +- [Orgad Shaneh brought this change] + + Kex.c, Remove unneeded call to strlen (#373) + + File : Kex.c + + Notes : + Removed call to strlen + + Credit : + Orgad Shaneh + +- [Pedro Monreal brought this change] + + Spelling corrections (#380) + + Files : + libssh2.h, libssh2_sftp.h, bcrypt_pbkdf.c, mbedtls.c, sftp.c, ssh2.c + + Notes : + * Fixed misspellings + + Credit : + Pedro Monreal + +- [Sebastián Katzer brought this change] + + Fix Potential typecast error for `_libssh2_ecdsa_key_get_curve_type` (#383) + + Issue : #383 + + Files : hostkey.c, crypto.h, openssl.c + + Notes : + * Fix potential typecast error for `_libssh2_ecdsa_key_get_curve_type` + * Rename _libssh2_ecdsa_key_get_curve_type to _libssh2_ecdsa_get_curve_type + + Credit : + Sebastián Katzer + +GitHub (20 Jun 2019) +- [Will Cosgrove brought this change] + + bump copyright date + +Version 1.9.0 (19 Jun 2019) + +GitHub (19 Jun 2019) +- [Will Cosgrove brought this change] + + 1.9 Formatting + +- [Will Cosgrove brought this change] + + 1.9 Release notes + +Will Cosgrove (17 May 2019) +- [Alexander Curtiss brought this change] + + libgcrypt.c : Fixed _libssh2_rsa_sha1_sign memory leak. (#370) + + File: libgcrypt.c + + Notes : Added calls to gcry_sexp_release to free memory allocated by gcry_sexp_find_token + + Credit : + Reporter : beckmi + PR by: Alexander Curtiss + +- [Orivej Desh brought this change] + + libssh2_priv.h : Fix musl build warning on sys/poll.h (#346) + + File : libssh2_priv.h + + Notes : + musl prints `redirecting incorrect #include to ` + http://git.musl-libc.org/cgit/musl/commit/include/sys/poll.h?id=54446d730cfb17c5f7bcf57f139458678f5066cc + + poll is defined by POSIX to be in poll.h: + http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.html + + Credit : Orivej Desh + +GitHub (1 May 2019) +- [Will Cosgrove brought this change] + + kex.c : additional bounds checks in diffie_hellman_sha1/256 (#361) + + Files : kex.c, misc.c, misc.h + + Notes : + Fixed possible out of bounds memory access when reading malformed data in diffie_hellman_sha1() and diffie_hellman_sha256(). + + Added _libssh2_copy_string() to misc.c to return an allocated and filled char buffer from a string_buf offset. Removed no longer needed s var in kmdhgGPshakex_state_t. + +Will Cosgrove (26 Apr 2019) +- [Tseng Jun brought this change] + + sftp.c : sftp_bin2attr() Correct attrs->gid assignment (#366) + + Regression with fix for #339 + + Credit : Tseng Jun + +- [Tseng Jun brought this change] + + kex.c : Correct type cast in curve25519_sha256() (#365) + +GitHub (24 Apr 2019) +- [Will Cosgrove brought this change] + + transport.c : scope local total_num var (#364) + + file : transport.c + notes : move local `total_num` variable inside of if block to prevent scope access issues which caused #360. + +Will Cosgrove (24 Apr 2019) +- [doublex brought this change] + + transport.c : fixes bounds check if partial packet is read + + Files : transport.c + + Issue : #360 + + Notes : + 'p->total_num' instead of local value total_num when doing bounds check. + + Credit : Doublex + +GitHub (23 Apr 2019) +- [Will Cosgrove brought this change] + + Editor config file for source files (#322) + + Simple start to an editor config file when editing source files to make sure they are configured correctly. + +- [Will Cosgrove brought this change] + + misc.c : String buffer API improvements (#332) + + Files : misc.c, hostkey.c, kex.c, misc.h, openssl.c, sftp.c + + Notes : + * updated _libssh2_get_bignum_bytes and _libssh2_get_string. Now pass in length as an argument instead of returning it to keep signedness correct. Now returns -1 for failure, 0 for success. + + _libssh2_check_length now returns 0 on success and -1 on failure to match the other string_buf functions. Added comment to _libssh2_check_length. + + Credit : Will Cosgrove + +Will Cosgrove (19 Apr 2019) +- [doublex brought this change] + + mbedtls.c : _libssh2_mbedtls_rsa_new_private_frommemory() allow private-key from memory (#359) + + File : mbedtls.c + + Notes: _libssh2_mbedtls_rsa_new_private_frommemory() fixes private-key from memory reading to by adding NULL terminator before parsing; adds passphrase support. + + Credit: doublex + +- [Ryan Kelley brought this change] + + Session.c : banner_receive() from leaking when accessing non ssh ports (#356) + + File : session.c + + Release previous banner in banner_receive() if the session is reused after a failed connection. + + Credit : Ryan Kelley + +GitHub (11 Apr 2019) +- [Will Cosgrove brought this change] + + Formatting in agent.c + + Removed whitespace. + +- [Will Cosgrove brought this change] + + Fixed formatting in agent.c + + Quiet linter around a couple if blocks and pointer. + +Will Cosgrove (11 Apr 2019) +- [Zhen-Huan HWANG brought this change] + + sftp.c : discard and reset oversized packet in sftp_packet_read() (#269) + + file : sftp.c + + notes : when sftp_packet_read() encounters an sftp packet which exceeds SFTP max packet size it now resets the reading state so it can continue reading. + + credit : Zhen-Huan HWANG + +GitHub (11 Apr 2019) +- [Will Cosgrove brought this change] + + Add agent functions libssh2_agent_get_identity_path() and libssh2_agent_set_identity_path() (#308) + + File : agent.c + + Notes : + Libssh2 uses the SSH_AUTH_SOCK env variable to read the system agent location. However, when using a custom agent path you have to set this value using setenv which is not thread-safe. The new functions allow for a way to set a custom agent socket path in a thread safe manor. + +- [Will Cosgrove brought this change] + + Simplified _libssh2_check_length (#350) + + * Simplified _libssh2_check_length + + misc.c : _libssh2_check_length() + + Removed cast and improved bounds checking and format. + + Credit : Yuriy M. Kaminskiy + +- [Will Cosgrove brought this change] + + _libssh2_check_length() : additional bounds check (#348) + + Misc.c : _libssh2_check_length() + + Ensure the requested length is less than the total length before doing the additional bounds check + +Daniel Stenberg (25 Mar 2019) +- misc: remove 'offset' from string_buf + + It isn't necessary. + + Closes #343 + +- sftp: repair mtime from e1ead35e475 + + A regression from e1ead35e4759 broke the SFTP mtime logic in + sftp_bin2attr + + Also simplified the _libssh2_get_u32/u64 functions slightly. + + Closes #342 + +- session_disconnect: don't zero state, just clear the right bit + + If we clear the entire field, the freeing of data in session_free() is + skipped. Instead just clear the bit that risk making the code get stuck + in the transport functions. + + Regression from 4d66f6762ca3fc45d9. + + Reported-by: dimmaq on github + Fixes #338 + Closes #340 + +- libssh2_sftp.h: restore broken ABI + + Commit 41fbd44 changed variable sizes/types in a public struct which + broke the ABI, which breaks applications! + + This reverts that change. + + Closes #339 + +- style: make includes and examples code style strict + + make travis and the makefile rule verify them too + + Closes #334 + +GitHub (21 Mar 2019) +- [Daniel Stenberg brought this change] + + create a github issue template + +Daniel Stenberg (21 Mar 2019) +- stale-bot: activated + + The stale bot will automatically mark stale issues (inactive for 90 + days) and if still untouched after 21 more days, close them. + + See https://probot.github.io/apps/stale/ + +- libssh2_session_supported_algs.3: fix formatting mistakes + + Reported-by: Max Horn + Fixes #57 + +- [Zenju brought this change] + + libssh2.h: Fix Error C2371 'ssize_t': redefinition + + Closes #331 + +- travis: add code style check + + Closes #324 + +- code style: unify code style + + Indent-level: 4 + Max columns: 79 + No spaces after if/for/while + Unified brace positions + Unified white spaces + +- src/checksrc.pl: code style checker + + imported as-is from curl + +Will Cosgrove (19 Mar 2019) +- Merge branch 'MichaelBuckley-michaelbuckley-security-fixes' + +- Silence unused var warnings (#329) + + Silence warnings about unused variables in this test + +- Removed unneeded > 0 check + + When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero. + +- [Matthew D. Fuller brought this change] + + Spell OpenSS_H_ right when talking about their specific private key (#321) + + Good catch, thanks. + +GitHub (19 Mar 2019) +- [Will Cosgrove brought this change] + + Silence unused var warnings (#329) + + Silence warnings about unused variables in this test + +Michael Buckley (19 Mar 2019) +- Fix more scope and printf warning errors + +- Silence unused variable warning + +GitHub (19 Mar 2019) +- [Will Cosgrove brought this change] + + Removed unneeded > 0 check + + When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero. + +Will Cosgrove (19 Mar 2019) +- [Matthew D. Fuller brought this change] + + Spell OpenSS_H_ right when talking about their specific private key (#321) + + Good catch, thanks. + +Michael Buckley (18 Mar 2019) +- Fix errors identified by the build process + +- Fix casting errors after merge + +GitHub (18 Mar 2019) +- [Michael Buckley brought this change] + + Merge branch 'master' into michaelbuckley-security-fixes + +Michael Buckley (18 Mar 2019) +- Move fallback SIZE_MAX and UINT_MAX to libssh2_priv.h + +- Fix type and logic issues with _libssh2_get_u64 + +Daniel Stenberg (17 Mar 2019) +- examples: fix various compiler warnings + +- lib: fix various compiler warnings + +- session: ignore pedantic warnings for funcpointer <=> void * + +- travis: add a build using configure + + Closes #320 + +- configure: provide --enable-werror + +- appveyor: remove old builds that mostly cause failures + + ... and only run on master branch. + + Closes #323 + +- cmake: add two missing man pages to get installed too + + Both libssh2_session_handshake.3 and + libssh2_userauth_publickey_frommemory.3 were installed by the configure + build already. + + Reported-by: Arfrever on github + Fixes #278 + +- include/libssh2.h: warning: "_WIN64" is not defined, evaluates to 0 + + We don't use #if for defines that might not be defined. + +- pem: //-comments are not allowed + +Will Cosgrove (14 Mar 2019) +- [Daniel Stenberg brought this change] + + userauth: fix "Function call argument is an uninitialized value" (#318) + + Detected by scan-build. + +- fixed unsigned/signed issue + +Daniel Stenberg (15 Mar 2019) +- session_disconnect: clear state + + If authentication is started but not completed before the application + gives up and instead wants to shut down the session, the '->state' field + might still be set and thus effectively dead-lock session_disconnect. + + This happens because both _libssh2_transport_send() and + _libssh2_transport_read() refuse to do anything as long as state is set + without the LIBSSH2_STATE_KEX_ACTIVE bit. + + Reported in curl bug https://github.com/curl/curl/issues/3650 + + Closes #310 + +Will Cosgrove (14 Mar 2019) +- Release notes from 1.8.1 + +Michael Buckley (14 Mar 2019) +- Use string_buf in sftp_init(). + +- Guard against out-of-bounds reads in publickey.c + +- Guard against out-of-bounds reads in session.c + +- Guard against out-of-bounds reads in userauth.c + +- Use LIBSSH2_ERROR_BUFFER_TOO_SMALL instead of LIBSSH2_ERROR_OUT_OF_BOUNDARY in sftp.c + +- Additional bounds checking in sftp.c + +- Additional length checks to prevent out-of-bounds reads and writes in _libssh2_packet_add(). https://libssh2.org/CVE-2019-3862.html + +- Add a required_size parameter to sftp_packet_require et. al. to require callers of these functions to handle packets that are too short. https://libssh2.org/CVE-2019-3860.html + +- Check the length of data passed to sftp_packet_add() to prevent out-of-bounds reads. + +- Prevent zero-byte allocation in sftp_packet_read() which could lead to an out-of-bounds read. https://libssh2.org/CVE-2019-3858.html + +- Sanitize padding_length - _libssh2_transport_read(). https://libssh2.org/CVE-2019-3861.html + + This prevents an underflow resulting in a potential out-of-bounds read if a server sends a too-large padding_length, possibly with malicious intent. + +- Defend against writing beyond the end of the payload in _libssh2_transport_read(). + +- Defend against possible integer overflows in comp_method_zlib_decomp. + +GitHub (14 Mar 2019) +- [Will Cosgrove brought this change] + + Security fixes (#315) + + * Bounds checks + + Fixes for CVEs + https://www.libssh2.org/CVE-2019-3863.html + https://www.libssh2.org/CVE-2019-3856.html + + * Packet length bounds check + + CVE + https://www.libssh2.org/CVE-2019-3855.html + + * Response length check + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + * Bounds check + + CVE + https://www.libssh2.org/CVE-2019-3857.html + + * Bounds checking + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + and additional data validation + + * Check bounds before reading into buffers + + * Bounds checking + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + * declare SIZE_MAX and UINT_MAX if needed + +- [Will Cosgrove brought this change] + + fixed type warnings (#309) + +- [Will Cosgrove brought this change] + + Bumping version number for pending 1.8.1 release + +Will Cosgrove (4 Mar 2019) +- [Daniel Stenberg brought this change] + + _libssh2_string_buf_free: use correct free (#304) + + Use LIBSSH2_FREE() here, not free(). We allow memory function + replacements so free() is rarely the right choice... + +GitHub (26 Feb 2019) +- [Will Cosgrove brought this change] + + Fix for building against libreSSL #302 + + Changed to use the check we use elsewhere. + +- [Will Cosgrove brought this change] + + Fix for when building against LibreSSL #302 + +Will Cosgrove (25 Feb 2019) +- [gartens brought this change] + + docs: update libssh2_hostkey_hash.3 [ci skip] (#301) + +GitHub (21 Feb 2019) +- [Will Cosgrove brought this change] + + fix malloc/free mismatches #296 (#297) + +- [Will Cosgrove brought this change] + + Replaced malloc with calloc #295 + +- [Will Cosgrove brought this change] + + Abstracted OpenSSL calls out of hostkey.c (#294) + +- [Will Cosgrove brought this change] + + Fix memory dealloc impedance mis-match #292 (#293) + + When using ed25519 host keys and a custom memory allocator. + +- [Will Cosgrove brought this change] + + Added call to OpenSSL_add_all_digests() #288 + + For OpenSSL 1.0.x we need to call OpenSSL_add_all_digests(). + +Will Cosgrove (12 Feb 2019) +- [Zhen-Huan HWANG brought this change] + + SFTP: increase maximum packet size to 256K (#268) + + to match implementations like OpenSSH. + +- [Zenju brought this change] + + Fix https://github.com/libssh2/libssh2/pull/271 (#284) + +GitHub (16 Jan 2019) +- [Will Cosgrove brought this change] + + Agent NULL check in shutdown #281 + +Will Cosgrove (15 Jan 2019) +- [Adrian Moran brought this change] + + mbedtls: Fix leak of 12 bytes by each key exchange. (#280) + + Correctly free ducts by calling _libssh2_mbedtls_bignum_free() in dtor. + +- [alex-weaver brought this change] + + Fix error compiling on Win32 with STDCALL=ON (#275) + +GitHub (8 Nov 2018) +- [Will Cosgrove brought this change] + + Allow default permissions to be used in sftp_mkdir (#271) + + Added constant LIBSSH2_SFTP_DEFAULT_MODE to use the server default permissions when making a new directory + +Will Cosgrove (13 Sep 2018) +- [Giulio Benetti brought this change] + + openssl: fix dereferencing ambiguity potentially causing build failure (#267) + + When dereferencing from *aes_ctr_cipher, being a pointer itself, + ambiguity can occur; fixed possible build errors. + +Viktor Szakats (12 Sep 2018) +- win32/GNUmakefile: define HAVE_WINDOWS_H + + This macro was only used in test/example code before, now it is + also used in library code, but only defined automatically by + automake/cmake, so let's do the same for the standalone win32 + make file. + + It'd be probably better to just rely on the built-in _WIN32 macro + to detect the presence of windows.h though. It's already used + in most of libssh2 library code. There is a 3rd, similar macro + named LIBSSH2_WIN32, which might also be replaced with _WIN32. + + Ref: https://github.com/libssh2/libssh2/commit/8b870ad771cbd9cd29edbb3dbb0878e950f868ab + Closes https://github.com/libssh2/libssh2/pull/266 + +Marc Hoersken (2 Sep 2018) +- Fix conditional check for HAVE_DECL_SECUREZEROMEMORY + + "Unlike the other `AC_CHECK_*S' macros, when a symbol is not declared, + HAVE_DECL_symbol is defined to `0' instead of leaving HAVE_DECL_symbol + undeclared. When you are sure that the check was performed, + use HAVE_DECL_symbol in #if." + + Source: autoconf documentation for AC_CHECK_DECLS. + +- Fix implicit declaration of function 'SecureZeroMemory' + + Include window.h in order to use SecureZeroMemory on Windows. + +- Fix implicit declaration of function 'free' by including stdlib.h + +GitHub (27 Aug 2018) +- [Will Cosgrove brought this change] + + Use malloc abstraction function in pem parse + + Fix warning on WinCNG build. + +- [Will Cosgrove brought this change] + + Fixed possible junk memory read in sftp_stat #258 + +- [Will Cosgrove brought this change] + + removed INT64_C define (#260) + + No longer used. + +- [Will Cosgrove brought this change] + + Added conditional around engine.h include + +Will Cosgrove (6 Aug 2018) +- [Alex Crichton brought this change] + + Fix OpenSSL link error with `no-engine` support (#259) + + This commit fixes linking against an OpenSSL library that was compiled with + `no-engine` support by bypassing the initialization routines as they won't be + available anyway. + +GitHub (2 Aug 2018) +- [Will Cosgrove brought this change] + + ED25519 Key Support #39 (#248) + + OpenSSH Key and ED25519 support #39 + Added _libssh2_explicit_zero() to explicitly zero sensitive data in memory #120 + + * ED25519 Key file support - Requires OpenSSL 1.1.1 or later + * OpenSSH Key format reading support - Supports RSA/DSA/ECDSA/ED25519 types + * New string buffer reading functions - These add build-in bounds checking and convenance methods. Used for OpenSSL PEM file reading. + * Added new tests for OpenSSH formatted Keys + +- [Will Cosgrove brought this change] + + ECDSA key types are now explicit (#251) + + * ECDSA key types are now explicit + + Issue was brough up in pull request #248 + +Will Cosgrove (2 May 2018) +- [Jakob Egger brought this change] + + Add Instructions for building from Master (#249) + +GitHub (27 Apr 2018) +- [Will Cosgrove brought this change] + + Initialize sb_intl #226 + +Will Cosgrove (19 Apr 2018) +- [doublex brought this change] + + buffer overflow (valgrind) (#159) + +- [Brendan Shanks brought this change] + + mbedTLS: Remove some C99-style intermingled variable declarations (#196) + +GitHub (18 Apr 2018) +- [Will Cosgrove brought this change] + + fix for #160 + +Will Cosgrove (18 Apr 2018) +- [doublex brought this change] + + fix memory leak when using mbedtls backend (#158) + + _libssh2_bn_init_from_bin/_libssh2_bn_free would leak bignum from mbedtls_calloc(). + +- [Brendan Shanks brought this change] + + mbedTLS: Avoid multiple definition errors for context handles (#197) + +- [Tseng Jun brought this change] + + Fix the EVP cipher meth memory leakage problem (#244) + + * Fix the EVP cipher meth memory leakage problem + + Looks good, thanks for the fixes. + +Marc Hörsken (31 Mar 2018) +- [Will Cosgrove brought this change] + + Added ECDSA defines for WinCNG (#245) + + Fixed missing defines preventing building using WinCNG + +GitHub (30 Mar 2018) +- [Will Cosgrove brought this change] + + Fix for _libssh2_rsa_new with OpenSSL 1.0.x + + missing d value assignment. + +Will Cosgrove (20 Mar 2018) +- [Etienne Samson brought this change] + + A collection of small fixes (#198) + + * tests: Remove if-pyramids + + * tests: Switch run_command arguments + + * tests: Make run_command a vararg function + + * tests: Xcode doesn't obey CMake's test working directory + + * openssl: move manual AES-CTR cipher into crypto init + + * cmake: Move our include dir before all other include paths + +GitHub (15 Mar 2018) +- [Will Cosgrove brought this change] + + Fixes incorrect indexing of KEX prefs string + + After stripping out an invalid KEX pref entry, it would incorrectly advance again leaving invalid values in the list. + +Viktor Szakats (13 Mar 2018) +- tests: fix checksrc warnings + + Also: + * add 'static' qualifier to file-wide const buffers + * fix a non-ANSI C89 comment + * silence a mismatched fprintf() mask warning by adding a cast + +- cmake: recognize OpenSSL 1.1 .dll names + + Also fix some comment typos and a stray tab. + +- docs: update an URL [ci skip] + +Daniel Stenberg (12 Mar 2018) +- docs/SECURITY: the max embargo is 14 days now + +Viktor Szakats (12 Mar 2018) +- docs: spelling fixes [ci skip] + + Closes https://github.com/libssh2/libssh2/pull/222 + +GitHub (12 Mar 2018) +- [Will Cosgrove brought this change] + + Fixed minor tabs/spacing issues + +- [Will Cosgrove brought this change] + + Update kex.c + +- [Will Cosgrove brought this change] + + Added basic bounds checking #206 + + Basic bounds checking in ecdh_sha2_nistp() + +- [Will Cosgrove brought this change] + + Fixed Clang warning #206 + + Fixed possible garbage value for secret in an error case + +- [Will Cosgrove brought this change] + + Fixed incorrect #if to #ifdef #206 + + When checking HAVE_OPAQUE_STRUCTS. + +Viktor Szakats (12 Mar 2018) +- src: suppress two checksrc warnings + + Ref: https://github.com/libssh2/libssh2/pull/235 + +- src: address fopen() warnings, add missing copyright headers + + Ref: https://github.com/libssh2/libssh2/pull/235 + +- src: replace sprintf() with snprintf() + + Ref: https://github.com/libssh2/libssh2/pull/235 + +- src: fix checksrc warnings + + Use checksrc.pl from the curl project, with (for now) + suppressed long line warnings and indentation set to + 4 spaces. Fixes are whitespace for the most part. + + Warning count went down from 2704 to 12. + + Also fix codespell typos, two non-ANSI C89 comments + and a stray tab in include/libssh2.h. + + Ref: https://github.com/libssh2/libssh2/pull/235 + +- checksrc: add source style checker + + This is a slightly extended version of this original source + from the curl project: + https://github.com/curl/curl/blob/8b754c430b9a4c51aa606c687ee5014faf7c7b06/lib/checksrc.pl + + This version adds the following options to customize it for + libssh2 (plus some whitespace formatting): + + `-i` to override indentation spaces (2) + `-m` to override maximum line length (79) + + Command-line used to check libssh2 sources: + + $ ./checksrc.pl -i4 -m500 *.c *.h + + Closes https://github.com/libssh2/libssh2/pull/236 + +- src: add static qualifier + + To private, const strings. + + Closes https://github.com/libssh2/libssh2/pull/237 + +- [Will Cosgrove brought this change] + + Add support for ECDSA keys and host keys (#41) + + This commit lands full ECDSA key support when using the OpenSSL + backend. Which includes: + + New KEX methods: + ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521 + + Can now read OpenSSL formatted ECDSA key files. + + Now supports known host keys of type ecdsa-sha2-nistp256. + + New curve types: + NID_X9_62_prime256v1, NID_secp384r1, NID_secp521r1 + + Default host key preferred ordering is now nistp256, nistp384, + nistp521, rsa, dss. + + Ref: https://github.com/libssh2/libssh2/issues/41 + + Closes https://github.com/libssh2/libssh2/pull/206 + +GitHub (15 Dec 2017) +- [Will Cosgrove brought this change] + + Fixed possible crash when decoding invalid data + + When trying to decode invalid data, it frees the buffer but doesn't nil it so the caller gets a junk memory pointer which they could potentially double free. + +- [Will Cosgrove brought this change] + + Remove call to OpenSSL_add_all_ciphers() + + Now lives in libssh2 init() from PR #189 + +- [Will Cosgrove brought this change] + + Fixed incorrect reference to decrypted block + + Fixed incorrectly copied memory from p->buf into init instead of from the decrypted buffer block. The only reason this worked was because the crypt() function decrypts the value in-place and overwrites p->buf. I'm working on a fork that no longer does this and exposed this bug. + +Will Cosgrove (20 Oct 2017) +- [Pan brought this change] + + Fix typo in crypt.c (#218) + +Kamil Dudka (17 Oct 2017) +- session: avoid printing misleading debug messages + + ... while throwing LIBSSH2_ERROR_EAGAIN out of session_startup() + + If the session runs in blocking mode, LIBSSH2_ERROR_EAGAIN never reaches + the libssh2 API boundary and, in non-blocking mode, these messages are + suppressed by the condition in _libssh2_error_flags() anyway. + + Closes #211 + +Viktor Szakats (15 Oct 2017) +- win32/GNUmakefile: allow customizing dll suffixes + + - New `LIBSSH2_DLL_SUFFIX` envvar will add a suffix to the generated + libssh2 dll name. Useful to add `-x64` to 64-bit builds so that + it can live in the same directory as the 32-bit one. By default + this is empty. + + - New `LIBSSH2_DLL_A_SUFFIX` envvar to customize the suffix of the + generated import library (implib) for libssh2 .dll. It defaults + to `dll`, and it's useful to modify that to `.dll` to have the + standard naming scheme for mingw-built .dlls, i.e. `libssh2.dll.a`. + + Ref: https://github.com/curl/curl/commit/aaa16f80256abc1463fd9374815130a165222257 + + Closes https://github.com/libssh2/libssh2/pull/215 + +- makefile.m32: allow to override gcc, ar and ranlib + + Allow to ovverride certain build tools, making it possible to + use LLVM/Clang to build libssh2. The default behavior is unchanged. + To build with clang (as offered by MSYS2), these settings can + be used: + + LIBSSH2_CC=clang + LIBSSH2_AR=llvm-ar + LIBSSH2_RANLIB=llvm-ranlib + + Also adjust ranlib parameters to be compatible with LLVM/Clang's + ranlib tool. + + Closes https://github.com/libssh2/libssh2/pull/214 + +GitHub (27 Sep 2017) +- [Will Cosgrove brought this change] + + Fixes out of bounds memory access (#210) + + If an invalid PEM file is read and the lines are longer than 128 characters it will go out of bounds and crash on line 91. + +Will Cosgrove (11 Sep 2017) +- [Kamil Dudka brought this change] + + scp: do not NUL-terminate the command for remote exec (#208) + + It breaks SCP download/upload from/to certain server implementations. + + The bug does not manifest with OpenSSH, which silently drops the NUL + byte (eventually with any garbage that follows the NUL byte) before + executing it. + + Bug: https://bugzilla.redhat.com/1489736 + +GitHub (21 Aug 2017) +- [Viktor Szakats brought this change] + + openssl.c: remove no longer used variable (#204) + + after e378d2e30a40bd9bcee06dc3a4250f269098e200 + +- [Will Cosgrove brought this change] + + Fix for #188 (#189) + + * Update openssl.c + + * Create openssl.h + +Will Cosgrove (24 May 2017) +- [Marcel Raad brought this change] + + openssl: fix build with OpenSSL 1.1 API (#176) + + When building with OPENSSL_API_COMPAT=0x10100000L, OpenSSL_add_all_algorithms + and OpenSSL_add_all_ciphers don't exist. The corresponding functionality is + handled automatically with OpenSSL 1.1. + +- [Sune Bredahl brought this change] + + Add support for SHA256 hostkey fingerprints (#180) + + Looks good, thanks! + +GitHub (12 May 2017) +- [Will Cosgrove brought this change] + + Fix memory leak of crypt_ctx->h using openSSL 1.1+ (#177) + + Need to use EVP_CIPHER_CTX_free instead of EVP_CIPHER_CTX_reset. + +Marc Hoersken (2 Mar 2017) +- tests/openssh_server/authorized_keys: add key_rsa_encrypted.pub + +- tests: add simple test for passphrase-protected PEM file support + +- os400qc3: enable passphrase-protected PEM file support using pem.c + +- pem: fix indentation and replace assert after 386e012292 + +- [Keno Fischer brought this change] + + pem: add passphrase-protected PEM file support for libgcrypt and wincng + + Since they use our own PEM parser which did not support encrypted + PEM files, trying to use such files on these backends failed. + Fix that by augmenting the PEM parser to support encrypted PEM files. + +- [Thomas brought this change] + + misc: use time constant implementation for AES CTR increment + +- [Thomas brought this change] + + wincng: add AES CTR mode support (aes128-ctr, aes192-ctr, aes256-ctr) + +- [Thomas brought this change] + + openssl: move shared AES-CTR code into misc + +Daniel Stenberg (20 Dec 2016) +- [Alex Crichton brought this change] + + kex: acknowledge error code from libssh2_dh_key_pair() + + Fixes a segfault using ssh-agent on Windows + + This commit fixes a segfault seen dereferencing a null pointer on + Windows when using ssh-agent. The problem ended up being that errors + weren't being communicated all the way through, causing null pointers to + be used when functions should have bailed out sooner. + + The `_libssh2_dh_key_pair` function for WinCNG was modified to propagate + errors, and then the two callsites in kex.c of + `diffie_hellman_sha{1,256}` were updated to recognize this error and + bail out. + + Fixes #162 + Closes #163 + +Alexander Lamaison (27 Nov 2016) +- [monnerat brought this change] + + Implement Diffie-Hellman computations in crypto backends. (#149) + + Not all backends feature the low level API needed to compute a Diffie-Hellman + secret, but some of them directly implement Diffie-Hellman support with opaque + private data. The later approach is now generalized and backends are + responsible for all Diffie Hellman computations. + As a side effect, procedures/macros _libssh2_bn_rand and _libssh2_bn_mod_exp + are no longer needed outside the backends. + +Peter Stuge (16 Nov 2016) +- acinclude.m4: The mbedtls crypto backend actually requires libmbedcrypto + + Examples can't be linked with libmbedtls but need libmbedcrypto, and + any users of libssh2 which use libtool and libssh2.la would encounter + the same problem. + + This changes the mbedtls detection to search for libmbedcrypto, which + is the actual dependency for the backend. + +- acinclude.m4: Add CPPFLAGS=-I$prefix-dir/include in LIBSSH2_LIB_HAVE_LINKFLAGS + + This is absolutely neccessary for header files to be found when + AC_LIB_HAVE_LINKFLAGS searches for libraries. + +- acinclude.m4: Make saved variables in LIBSSH2_LIB_HAVE_LINKFLAGS uniform + +- docs/HACKING.CRYPTO: Improve documentation for autoconf build system + +Alexander Lamaison (16 Nov 2016) +- [Alex Arslan brought this change] + + Check for netinet/in.h in the tests cmake file (#148) + +- [Patrick Monnerat brought this change] + + Define new Diffie-Hellman context for mbedTLS + +- [monnerat brought this change] + + Make libssh2 work again on os400. (#118) + + * os400: minimum supported OS version is now V6R1. + Do not log compiler informational messages. + + * Implement crypto backend specific Diffie-Hellman computation. + + This feature is now needed on os400 because the QC3 library does not + implement bn_mod_exp() natively. Up to now, this function was emulated using + an RSA encryption, but commits ca5222ea819cc5ed797860070b4c6c1aeeb28420 and + 7934c9ce2a029c43e3642a492d3b9e494d1542be (CVE-2016-0787) broke the emulation + because QC3 only supports RSA exponents up to 512 bits. + + Happily, QC3 supports a native API for Diffie-Hellman computation, with + opaque random value: this commit implements the use of this API and, as a + side effect, enables support of this feature for any other crypto backend that + would use it. + + A "generic" Diffie-Hellman computation internal API supports crypto backends + not implementing their own: this generic API uses the same functions as before. + + * Fix typos in docs/HACKING.CRYPTO. + +- [Peter Stuge brought this change] + + acinclude.m4: Fixup OpenSSL EVP_aes_128_ctr() detection + +- [Peter Stuge brought this change] + + configure.ac: Add --with-crypto= instead of many different --with-$backend + + The new --with-crypto option replaces the previous backend-specific + --with-{openssl,libgcrypt,mbedtls,wincng} options and fixes some issues. + + * libgcrypt or mbedtls would previously be used whenever found, even + if configure was passed --without-libgcrypt or --without-mbedtls. + + * If --with-$backend was specified then configure would not fail even + if that library could not be found, and would instead use whichever + crypto library was found first. + + The new option defaults to `auto`, which makes configure check for all + supported crypto libraries in turn, choosing the first one found, or + exiting with an error if none can be found. + +- [Tony Kelman brought this change] + + Build mbedtls from source on Travis (#133) + + * Revert "Revert "travis: Test mbedtls too"" + + This reverts commit c4c60eac5ca756333034b07dd9e0b97741493ed3. + + * travis: Build mbedtls from source on Travis + + Use TOOLCHAIN_OPTION when calling cmake on mbedtls + + * tests: only run DSA tests for non-mbedtls + + crypto backends + +- [Peter Stuge brought this change] + + configure.ac src/Makefile.am: Remove dead AM_CONDITIONAL(OS400QC3) + + According to os400/README400 this backend can not be built + with configure+make, and the conditional is hard coded to false. + +- [Peter Stuge brought this change] + + configure.ac: Add -DNDEBUG to CPPFLAGS in non-debug builds + + There are a few uses of assert() in channel.c, sftp.c and transport.c. + +- [Peter Stuge brought this change] + + src/global.c: Fix conditional AES-CTR support + + Most of libssh2 already has conditional support for AES-CTR according to + the LIBSSH2_AES_CTR crypto backend #define, but global.c needed fixing. + +- [Peter Stuge brought this change] + + src/crypto.h src/userauth.c: Fix conditional RSA support + + Most of libssh2 already has conditional support for RSA according to + the LIBSSH2_RSA crypto backend #define, but crypto.h and userauth.c + needed a few small fixes. + +- [Peter Stuge brought this change] + + src/kex.c: Cast libssh2_sha{1,256}_update data arguments properly + + The update functions take a const unsigned char * but were called + with (const) char * in some places, causing unneccessary warnings. + +- [Peter Stuge brought this change] + + docs/HACKING.CRYPTO: Fix two type typos + +- [Sergei Trofimovich brought this change] + + acinclude.m4: fix ./configure --with-libgcrypt + + The change fixes passing of bogus gcrypt prefix. + Reproducible as: + + $ ./configure --with-libgcrypt + $ make V=1 + ... + /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -Iyes/include -version-info 1:1:0 -no-undefined -export-symbols-regex '^libssh2_.*' -lgcrypt -lz -Lyes/lib -o libssh2.la -rpath /usr/local/lib channel.lo comp.lo crypt.lo hostkey.lo kex.lo mac.lo misc.lo packet.lo publickey.lo scp.lo session.lo sftp.lo userauth.lo transport.lo version.lo knownhost.lo agent.lo libgcrypt.lo pem.lo keepalive.lo global.lo -lgcrypt + ../libtool: line 7475: cd: yes/lib: No such file or directory + libtool: error: cannot determine absolute directory name of 'yes/lib' + + These + -Iyes/include + -Lyes/lib + come from libgcrypt code autodetection: + if test -n "$use_libgcrypt" && test "$use_libgcrypt" != "no"; then + LDFLAGS="$LDFLAGS -L$use_libgcrypt/lib" + CFLAGS="$CFLAGS -I$use_libgcrypt/include" + + I assume it's a typo to use yes/no flag as a prefix and changed + it to '$with_libgcrypt_prefix'. + + Reported-by: Mikhail Pukhlikov + Signed-off-by: Sergei Trofimovich + +- [Zenju brought this change] + + libssh2_sftp_init hang: last error not set + + The problem is that the original if statement simply returns NULL, but does not set the session last error code. The consequence is that libssh2_sftp_init() also returns NULL and libssh2_session_last_errno(sshSession) == LIBSSH2_ERROR_NONE. + + In my test the LIBSSH2_ERROR_EAGAIN is coming from sftp.c row 337: + if(4 != sftp->partial_size_len) + /* we got a short read for the length part */ + return LIBSSH2_ERROR_EAGAIN; + + with "partial_size_len == 0". Not sure if this is expected. + +- [Aidan Hobson Sayers brought this change] + + docs: correctly describe channel_wait_eof + + channel_wait_eof waits for channel->remote.eof, which is set on + receiving a `SSH_MSG_CHANNEL_EOF` message. This message is sent + when a party has no more data to send on a channel. + +- [Zenju brought this change] + + Fix MSVC 14 compilation warning (#92) + + 1> sftp.c + 1>libssh2-files\src\sftp.c(3393): warning C4456: declaration of 'retcode' hides previous local declaration + 1> libssh2-files\src\sftp.c(3315): note: see declaration of 'retcode' + +- [Salvador Fandino brought this change] + + LIBSSH2_ERROR_CHANNEL_WINDOW_FULL: add new error code + + In order to signal that the requested operation can not succeed + because the receiving window had been exhausted, the error code + LIBSSH2_ERROR_BUFFER_TOO_SMALL has been reused but I have found + that in certain context it may be ambigous. + + This patch introduces a new error code, + LIBSSH2_ERROR_CHANNEL_WINDOW_FULL, exclusive to signal that condition. + +- [Salvador Fandino brought this change] + + channel_wait_eof: handle receive window exhaustion + + Until now, in blocking mode, if the remote receiving window is + exhausted this function hangs forever as data is not read and the + remote side just keeps waiting for the window to grow before sending + more data. + + This patch, makes this function check for that condition and abort + with an error when it happens. + +- [Salvador Fandino brought this change] + + channel_wait_closed: don't fail when unread data is queued + + This function was calling channel_wait_eof to ensure that the EOF + packet has already been received, but that function also checks that + the read data queue is empty before reporting the EOF. That caused + channel_wait_closed to fail with a LIBSSH2_ERROR_INVAL when some data + was queued even after a successful call to libssh2_channel_wait_eof. + + This patch changes libssh2_channel_wait_closed to look directly into + channel->remote.eof so that both libssh2_channel_wait_eof and + libssh2_channel_wait_closed bahave consistently. + +- [Salvador Fandino brought this change] + + channel_wait_eof: fix debug message + +Daniel Stenberg (25 Oct 2016) +- libssh2.h: start working on 1.8.1 + +Version 1.8.0 (25 Oct 2016) + +Daniel Stenberg (25 Oct 2016) +- RELEASE-NOTES: adjusted for 1.8.0 + +Kamil Dudka (20 Oct 2016) +- Revert "aes: the init function fails when OpenSSL has AES support" + + This partially reverts commit f4f2298ef3635acd031cc2ee0e71026cdcda5864 + because it caused the compatibility code to call initialization routines + redundantly, leading to memory leakage with OpenSSL 1.1 and broken curl + test-suite in Fedora: + + 88 bytes in 1 blocks are definitely lost in loss record 5 of 8 + at 0x4C2DB8D: malloc (vg_replace_malloc.c:299) + by 0x72C607D: CRYPTO_zalloc (mem.c:100) + by 0x72A2480: EVP_CIPHER_meth_new (cmeth_lib.c:18) + by 0x4E5A550: make_ctr_evp.isra.0 (openssl.c:407) + by 0x4E5A8E8: _libssh2_init_aes_ctr (openssl.c:471) + by 0x4E5BB5A: libssh2_init (global.c:49) + +Daniel Stenberg (19 Oct 2016) +- [Charles Collicutt brought this change] + + libssh2_wait_socket: Fix comparison with api_timeout to use milliseconds (#134) + + Fixes #74 + +- [Charles Collicutt brought this change] + + Set err_msg on _libssh2_wait_socket errors (#135) + +- Revert "travis: Test mbedtls too" + + This reverts commit 3e6de50a24815e72ec5597947f1831f6083b7da8. + + Travis doesn't seem to support the mbedtls-dev package + +- maketgz: support "only" to only update version number locally + + and fix the date output locale + +- configure: make the --with-* options override the OpenSSL default + + ... previously it would default to OpenSSL even with the --with-[crypto] + options used unless you specificly disabled OpenSSL. Now, enabling another + backend will automatically disable OpenSSL if the other one is found. + +- [Keno Fischer brought this change] + + docs: Add documentation on new cmake/configure options + +- [Keno Fischer brought this change] + + configure: Add support for building with mbedtls + +- [wildart brought this change] + + travis: Test mbedtls too + +- [wildart brought this change] + + crypto: add support for the mbedTLS backend + + Closes #132 + +- [wildart brought this change] + + cmake: Add CLEAR_MEMORY option, analogously to that for autoconf + +- README.md: fix link typo + +- README: markdown version to look nicer on github + +Viktor Szakats (5 Sep 2016) +- [Taylor Holberton brought this change] + + openssl: add OpenSSL 1.1.0 compatibility + +Daniel Stenberg (4 Sep 2016) +- [Antenore Gatta brought this change] + + tests: HAVE_NETINET_IN_H was not defined correctly (#127) + + Fixes #125 + +- SECURITY: fix web site typo + +- SECURITY: security process + +GitHub (14 Aug 2016) +- [Alexander Lamaison brought this change] + + Basic dockerised test suite. + + This introduces a test suite for libssh2. It runs OpenSSH in a Docker + container because that works well on Windows (via docker-machine) as + well as Linux. Presumably it works on Mac too with docker-machine, but + I've not tested that. + + Because the test suite is docker-machine aware, you can also run it + against a cloud provider, for more realistic network testing, by setting + your cloud provider as your active docker machine. The Appveyor CI setup + in this commit does that because Appveyor doesn't support docker + locally. + +Kamil Dudka (3 Aug 2016) +- [Viktor Szakats brought this change] + + misc.c: Delete unused static variables + + Closes #114 + +Daniel Stenberg (9 Apr 2016) +- [Will Cosgrove brought this change] + + Merge pull request #103 from willco007/patch-2 + + Fix for security issue CVE-2016-0787 + +Alexander Lamaison (2 Apr 2016) +- [Zenju brought this change] + + Fix MSVC 14 compilation errors + + For _MSC_VER == 1900 these macros are not needed and create problems: + + + + 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition (compiling source file libssh2-files\src\mac.c) + + 1> \win32\libssh2_config.h(27): note: see previous definition of 'snprintf' (compiling source file libssh2-files\src\mac.c) + + 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (compiling source file libssh2-files\src\mac.c) + +Daniel Stenberg (26 Mar 2016) +- [Brad Harder brought this change] + + _libssh2_channel_open: speeling error fixed in channel error message + +Alexander Lamaison (15 Mar 2016) +- Link with crypt32.lib on Windows. + + Makes linking with static OpenSSL work again. Although it's not + required for dynamic OpenSSL, it does no harm. + + Fixes #98. + +- [Craig A. Berry brought this change] + + Tweak VMS help file building. + + Primarily this is handling cases where top-level files moved into + the docs/ directory. I also corrected a typo and removed the + claim that libssh2 is public domain. + +- [Craig A. Berry brought this change] + + Build with standard stat structure on VMS. + + This gets us large file support, is available on any VMS release + in the last decade and more, and gives stat other modern features + such as 64-bit ino_t. + +- [Craig A. Berry brought this change] + + Update vms/libssh2_config.h. + + VMS does have stdlib.h, gettimeofday(), and OpenSSL. The latter + is appropriate to hard-wire in the configuration because it's + installed by default as part of the base operating system and + there is currently no libgcrypt port. + +- [Craig A. Berry brought this change] + + VMS can't use %zd for off_t format. + + %z is a C99-ism that VMS doesn't currently have; even though the + compiler is C99-compliant, the library isn't quite. The off_t used + for the st_size element of the stat can be 32-bit or 64-bit, so + detect what we've got and pick a format accordingly. + +- [Craig A. Berry brought this change] + + Normalize line endings in libssh2_sftp_get_channel.3. + + Somehow it got Windows-style CRLF endings so convert to just LF, + for consistency as well as not to confuse tools that will regard + the \r as content (e.g. the OpenVMS help librarian). + +Dan Fandrich (29 Feb 2016) +- libgcrypt: Fixed a NULL pointer dereference on OOM + +Daniel Stenberg (24 Feb 2016) +- [Viktor Szakats brought this change] + + url updates, HTTP => HTTPS + + Closes #87 + +Dan Fandrich (23 Feb 2016) +- RELEASE-NOTES: removed some duplicated names + +Version 1.7.0 (23 Feb 2016) + +Daniel Stenberg (23 Feb 2016) +- web: the site is now HTTPS + +- RELEASE-NOTES: 1.7.0 release + +- diffie_hellman_sha256: convert bytes to bits + + As otherwise we get far too small numbers. + + Reported-by: Andreas Schneider + + CVE-2016-0787 + +Alexander Lamaison (18 Feb 2016) +- Allow CI failures with VS 2008 x64. + + Appveyor doesn't support this combination. + +Daniel Stenberg (16 Feb 2016) +- [Viktor Szakats brought this change] + + GNUmakefile: list system libs after user libs + + Otherwise some referenced WinSock functions will fail to + resolve when linking against LibreSSL 2.3.x static libraries + with mingw. + + Closes #80 + +- [Viktor Szakats brought this change] + + openssl: apply new HAVE_OPAQUE_STRUCTS macro + + Closes #81 + +- [Viktor Szakats brought this change] + + openssl: fix LibreSSL support after OpenSSL 1.1.0-pre1/2 support + +Alexander Lamaison (14 Feb 2016) +- sftp.h: Fix non-C90 type. + + uint64_t does not exist in C90. Use libssh2_uint64_t instead. + +- Exclude sshd tests from AppVeyor. + + They fail complaining that sshd wasn't invoked with an absolute path. + +- Test on more versions of Visual Studio. + +- Fix Appveyor builds. + +Daniel Stenberg (14 Feb 2016) +- [Viktor Szakats brought this change] + + openssl: add OpenSSL 1.1.0-pre3-dev compatibility + + by using API instead of accessing an internal structure. + + Closes #83 + +- RELEASE-NOTES: synced with 996b04ececdf + +- include/libssh2.h: next version is 1.7.0 + +- configure: build "silent" if possible + +- sftp: re-indented some minor stuff + +- [Jakob Egger brought this change] + + sftp.c: ensure minimum read packet size + + For optimum performance we need to ensure we don't request tiny packets. + +- [Jakob Egger brought this change] + + sftp.c: Explicit return values & sanity checks + +- [Jakob Egger brought this change] + + sftp.c: Check Read Packet File Offset + + This commit adds a simple check to see if the offset of the read + request matches the expected file offset. + + We could try to recover, from this condition at some point in the future. + Right now it is better to return an error instead of corrupted data. + +- [Jakob Egger brought this change] + + sftp.c: Don't return EAGAIN if data was written to buffer + +- [Jakob Egger brought this change] + + sftp.c: Send at least one read request before reading + + This commit ensures that we have sent at least one read request before + we try to read data in sftp_read(). + + Otherwise sftp_read() would return 0 bytes (indicating EOF) if the + socket is not ready for writing. + +- [Jakob Egger brought this change] + + sftp.c: stop reading when buffer is full + + Since we can only store data from a single chunk in filep, + we have to stop receiving data as soon as the buffer is full. + + This adresses the following bug report: + https://github.com/libssh2/libssh2/issues/50 + +Salvador Fandiño (21 Jan 2016) +- agent_disconnect_unix: unset the agent fd after closing it + + "agent_disconnect_unix", called by "libssh2_agent_disconnect", was + leaving the file descriptor in the agent structure unchanged. Later, + "libssh2_agent_free" would call again "libssh2_agent_disconnect" under + the hood and it would try to close again the same file descriptor. In + most cases that resulted in just a harmless error, but it is also + possible that the file descriptor had been reused between the two + calls resulting in the closing of an unrelated file descriptor. + + This patch sets agent->fd to LIBSSH2_INVALID_SOCKET avoiding that + issue. + + Signed-off-by: Salvador Fandiño + +Daniel Stenberg (18 Jan 2016) +- [Patrick Monnerat brought this change] + + os400qc3: support encrypted private keys + + PKCS#8 EncryptedPrivateKeyinfo structures are recognized and decoded to get + values accepted by the Qc3 crypto library. + +- [Patrick Monnerat brought this change] + + os400qc3: New PKCS#5 decoder + + The Qc3 library is not able to handle PKCS#8 EncryptedPrivateKeyInfo structures + by itself. It is only capable of decrypting the (encrypted) PrivateKeyInfo + part, providing a key encryption key and an encryption algorithm are given. + Since the encryption key and algorithm description part in a PKCS#8 + EncryptedPrivateKeyInfo is a PKCS#5 structure, such a decoder is needed to + get the derived key method and hash, as well as encryption algorith and + initialisation vector. + +- [Patrick Monnerat brought this change] + + os400qc3: force continuous update on non-final hash/hmac computation + +- [Patrick Monnerat brought this change] + + os400qc3: Be sure hmac keys have a minimum length + + The Qc3 library requires a minimum key length depending on the target + hash algorithm. Append binary zeroes to the given key if not long enough. + This matches RFC 2104 specifications. + +- [Patrick Monnerat brought this change] + + os400qc3: Slave descriptor for key encryption key + + The Qc3 library requires the key encryption key to exist as long as + the encrypted key is used. Its descriptor token is then kept as an + "encrypted key slave" for recursive release. + +- [Patrick Monnerat brought this change] + + os400qc3.c: comment PEM/DER decoding + +- [Patrick Monnerat brought this change] + + os400qc3.c: improve ASN.1 header byte checks + +- [Patrick Monnerat brought this change] + + os400qc3.c: improve OID matching + +- [Patrick Monnerat brought this change] + + os400: os400qc3.c: replace malloc by LIBSSH2_ALLOC or alloca where possible + +- [Patrick Monnerat brought this change] + + os400: asn1_new_from_bytes(): use data from a single element only + +- [Patrick Monnerat brought this change] + + os400: fix an ILE/RPG prototype + +- [Patrick Monnerat brought this change] + + os400: implement character encoding conversion support + +- [Patrick Monnerat brought this change] + + os400: do not miss some external prototypes + + Build procedure extproto() did not strip braces from header files, thus + possibly prepended them to true prototypes. This prevented the prototype to + be recognized as such. + The solution implemented here is to map braces to semicolons, effectively + considering them as potential prototype delimiters. + +- [Patrick Monnerat brought this change] + + os400: Really add specific README + +- [Patrick Monnerat brought this change] + + os400: Add specific README and include new files in dist tarball + +- [Patrick Monnerat brought this change] + + os400: add compilation scripts + +- [Patrick Monnerat brought this change] + + os400: include files for ILE/RPG + + In addition, file os400/macros.h declares all procedures originally + defined as macros. It must not be used for real inclusion and is only + intended to be used as a `database' for macro wrapping procedures generation. + +- [Patrick Monnerat brought this change] + + os400: add supplementary header files/wrappers. Define configuration. + +- [Patrick Monnerat brought this change] + + Protect callback function calls from macro substitution + + Some structure fields holding callback addresses have the same name as the + underlying system function (connect, send, recv). Set parentheses around + their reference to suppress a possible macro substitution. + + Use a macro for connect() on OS/400 to resolve a const/nonconst parameter + problem. + +- [Patrick Monnerat brought this change] + + Add interface for OS/400 crypto library QC3 + +- [Patrick Monnerat brought this change] + + misc: include stdarg.h for debug code + +- [Patrick Monnerat brought this change] + + Document crypto library interface + +- [Patrick Monnerat brought this change] + + Feature an optional crypto-specific macro to rsa sign a data fragment vector + + OS/400 crypto library is unable to sign a precomputed SHA1 hash: however + it does support a procedure that hashes data fragments and rsa signs. + If defined, the new macro _libssh2_rsa_sha1_signv() implements this function + and disables use of _libssh2_rsa_sha1_sign(). + + The function described above requires that the struct iovec unused slacks are + cleared: for this reason, macro libssh2_prepare_iovec() has been introduced. + It should be defined as empty for crypto backends that are not sensitive + to struct iovec unused slack values. + +- [Patrick Monnerat brought this change] + + Fold long lines in include files + +- [Viktor Szakats brought this change] + + kex.c: fix indentation + + Closes #71 + +- [Viktor Szakats brought this change] + + add OpenSSL-1.1.0-pre2 compatibility + + Closes #70 + +- [Viktor Szakats brought this change] + + add OpenSSL 1.1.0-pre1 compatibility + + * close https://github.com/libssh2/libssh2/issues/69 + * sync a declaration with the rest of similar ones + * handle EVP_MD_CTX_new() returning NULL with OpenSSL 1.1.0 + * fix potential memory leak with OpenSSL 1.1.0 in + _libssh2_*_init() functions, when EVP_MD_CTX_new() succeeds, + but EVP_DigestInit() fails. + +Marc Hoersken (22 Dec 2015) +- wincng.c: fixed _libssh2_wincng_hash_final return value + + _libssh2_wincng_hash_final was returning the internal BCRYPT + status code instead of a valid libssh2 return value (0 or -1). + + This also means that _libssh2_wincng_hash never returned 0. + +- wincng.c: fixed possible memory leak in _libssh2_wincng_hash + + If _libssh2_wincng_hash_update failed _libssh2_wincng_hash_final + would never have been called before. + + Reported by Zenju. + +Kamil Dudka (15 Dec 2015) +- [Paul Howarth brought this change] + + libssh2.pc.in: fix the output of pkg-config --libs + + ... such that it does not include LDFLAGS used to build libssh2 itself. + There was a similar fix in the curl project long time ago: + + https://github.com/bagder/curl/commit/curl-7_19_7-56-g4c8adc8 + + Bug: https://bugzilla.redhat.com/1279966 + Signed-off-by: Kamil Dudka + +Marc Hoersken (6 Dec 2015) +- hostkey.c: align code path of ssh_rsa_init to ssh_dss_init + +- hostkey.c: fix invalid memory access if libssh2_dsa_new fails + + Reported by dimmaq, fixes #66 + +Daniel Stenberg (3 Nov 2015) +- [Will Cosgrove brought this change] + + gcrypt: define libssh2_sha256_ctx + + Looks like it didn't make it into the latest commit for whatever reason. + + Closes #58 + +- [Salvador Fandino brought this change] + + libssh2_session_set_last_error: Add function + + Net::SSH2, the Perl wrapping module for libssh2 implements several features* + on top of libssh2 that can fail and so need some mechanism to report the error + condition to the user. + + Until now, besides the error state maintained internally by libssh2, another + error state was maintained at the Perl level for every session object and then + additional logic was used to merge both error states. That is a maintenance + nighmare, and actually there is no way to do it correctly and consistently. + + In order to allow the high level language to add new features to the library + but still rely in its error reporting features the new function + libssh2_session_set_last_error (that just exposses _libssh2_error_flags) is + introduced. + + *) For instance, connecting to a remote SSH service giving the hostname and + port. + + Signed-off-by: Salvador Fandino + Signed-off-by: Salvador Fandiño + +- [Salvador Fandino brought this change] + + _libssh2_error: Support allocating the error message + + Before this patch "_libssh2_error" required the error message to be a + static string. + + This patch adds a new function "_libssh2_error_flags" accepting an + additional "flags" argument and specifically the flag + "LIBSSH2_ERR_FLAG_DUP" indicating that the passed string must be + duplicated into the heap. + + Then, the method "_libssh2_error" has been rewritten to use that new + function under the hood. + + Signed-off-by: Salvador Fandino + Signed-off-by: Salvador Fandiño + +- [Will Cosgrove brought this change] + + added engine.h include to fix warning + +- [sune brought this change] + + kex.c: removed dupe entry from libssh2_kex_methods[] + + Closes #51 + +- [Salvador Fandiño brought this change] + + userauth: Fix off by one error when reading public key file + + After reading the public key from file the size was incorrectly + decremented by one. + + This was usually a harmless error as the last character on the public + key file is an unimportant EOL. But if due to some error the public key + file is empty, the public key size becomes (uint)(0 - 1), resulting in + an unrecoverable out of memory error later. + + Signed-off-by: Salvador Fandi??o + +- [Salvador Fandino brought this change] + + channel: Detect bad usage of libssh2_channel_process_startup + + A common novice programmer error (at least among those using the + wrapping Perl module Net::SSH2), is to try to reuse channels. + + This patchs detects that incorrect usage and fails with a + LIBSSH2_ERROR_BAD_USE error instead of hanging. + + Signed-off-by: Salvador Fandino + +- [Will Cosgrove brought this change] + + kex: Added diffie-hellman-group-exchange-sha256 support + + ... and fixed HMAC_Init depricated usage + + Closes #48 + +Alexander Lamaison (21 Sep 2015) +- Prefixed new #defines to prevent collisions. + + Other libraries might have their own USE_WIN32_*FILES. + +- [keith-daigle brought this change] + + Update examples/scp.c to fix bug where large files on win32 would cause got to wrap and go negative + +- [David Byron brought this change] + + add libssh2_scp_recv2 to support large (> 2GB) files on windows + +Daniel Stenberg (17 Sep 2015) +- [sune brought this change] + + WinCNG: support for SHA256/512 HMAC + + Closes #47 + +- [brian m. carlson brought this change] + + Add support for HMAC-SHA-256 and HMAC-SHA-512. + + Implement support for these algorithms and wire them up to the libgcrypt + and OpenSSL backends. Increase the maximum MAC buffer size to 64 bytes + to prevent buffer overflows. Prefer HMAC-SHA-256 over HMAC-SHA-512, and + that over HMAC-SHA-1, as OpenSSH does. + + Closes #40 + +- [Zenju brought this change] + + kex: free server host key before allocating it (again) + + Fixes a memory leak when Synology server requests key exchange + + Closes #43 + +- [Viktor Szakats brought this change] + + GNUmakefile: up OpenSSL version + + closes #23 + +- [Viktor Szakats brought this change] + + GNUmakefile: add -m64 CFLAGS when targeting mingw64, add -m32/-m64 to LDFLAGS + + libssh2 equivalent of curl patch https://github.com/bagder/curl/commit/d21b66835f2af781a3c2a685abc92ef9f0cd86be + + This allows to build for the non-default target when using a multi-target mingw distro. + Also bump default OpenSSL dependency path to 1.0.2c. + +- [Viktor Szakats brought this change] + + GNUmakefile: add support for LIBSSH2_LDFLAG_EXTRAS + + It is similar to existing LIBSSH2_CFLAG_EXTRAS, but for + extra linker options. + + Also delete some line/file ending whitespace. + + closes #27 + +- [nasacj brought this change] + + hostkey.c: Fix compiling error when OPENSSL_NO_MD5 is defined + + Closes #32 + +- [Mizunashi Mana brought this change] + + openssl.h: adjust the rsa/dsa includes + + ... to work when built without DSA support. + + Closes #36 + +Alexander Lamaison (26 Jul 2015) +- Let CMake build work as a subproject. + + Patch contributed by JasonHaslam. + +- Fix builds with Visual Studio 2015. + + VS2015 moved stdio functions to the header files as inline function. That means check_function_exists can't detect them because it doesn't use header files - just does a link check. Instead we need to use check_symbol_exists with the correct headers. + +Kamil Dudka (2 Jul 2015) +- cmake: include CMake files in the release tarballs + + Despite we announced the CMake support in libssh2-1.6.0 release notes, + the files required by the CMake build system were not included in the + release tarballs. Hence, the only way to use CMake for build was the + upstream git repository. + + This commit makes CMake actually supported in the release tarballs. + +- tests/mansyntax.sh: fix 'make distcheck' with recent autotools + + Do not create symbolic links off the build directory. Recent autotools + verify that out-of-source build works even if the source directory tree + is not writable. + +- openssl: fix memleak in _libssh2_dsa_sha1_verify() + +Daniel Stenberg (12 Jun 2015) +- openssl: make libssh2_sha1 return error code + + - use the internal prefix _libssh2_ for non-exported functions + + - removed libssh2_md5() since it wasn't used + + Reported-by: Kamil Dudka + +- [LarsNordin-LNdata brought this change] + + SFTP: Increase speed and datasize in SFTP read + + The function sftp_read never return more then 2000 bytes (as it should + when I asked Daniel). I increased the MAX_SFTP_READ_SIZE to 30000 but + didn't get the same speed as a sftp read in SecureSSH. I analyzed the + code and found that a return always was dona when a chunk has been read. + I changed it to a sliding buffer and worked on all available chunks. I + got an increase in speed and non of the test I have done has failed + (both local net and over Internet). Please review and test. I think + 30000 is still not the optimal MAX_SFTP_READ_SIZE, my next goal is to + make an API to enable changing this value (The SecureSSH sftp_read has + more complete filled packages when comparing the network traffic) + +- bump: start working on 1.6.1 + +Version 1.6.0 (5 Jun 2015) + +Daniel Stenberg (5 Jun 2015) +- RELEASE-NOTES: synced with 858930cae5c6a + +Marc Hoersken (19 May 2015) +- wincng.c: fixed indentation + +- [sbredahl brought this change] + + wincng.c: fixed memleak in (block) cipher destructor + +Alexander Lamaison (6 May 2015) +- [Jakob Egger brought this change] + + libssh2_channel_open: more detailed error message + + The error message returned by libssh2_channel_open in case of a server side channel open failure is now more detailed and includes the four standard error conditions in RFC 4254. + +- [Hannes Domani brought this change] + + kex: fix libgcrypt memory leaks of bignum + + Fixes #168. + +Marc Hoersken (3 Apr 2015) +- configure.ac: check for SecureZeroMemory for clear memory feature + +- Revert "wincng.c: fix clear memory feature compilation with mingw" + + This reverts commit 2d2744efdd0497b72b3e1ff6e732aa4c0037fc43. + + Autobuilds show that this did not solve the issue. + And it seems like RtlFillMemory is defined to memset, + which would be optimized out by some compilers. + +- wincng.c: fix clear memory feature compilation with mingw + +Alexander Lamaison (1 Apr 2015) +- [LarsNordin-LNdata brought this change] + + Enable use of OpenSSL that doesn't have DSA. + + Added #if LIBSSH2_DSA for all DSA functions. + +- [LarsNordin-LNdata brought this change] + + Use correct no-blowfish #define with OpenSSL. + + The OpenSSL define is OPENSSL_NO_BF, not OPENSSL_NO_BLOWFISH. + +Marc Hoersken (25 Mar 2015) +- configure: error if explicitly enabled clear-memory is not supported + + This takes 22bd8d81d8fab956085e2079bf8c29872455ce59 and + b8289b625e291bbb785ed4add31f4759241067f3 into account, + but still makes it enabled by default if it is supported + and error out in case it is unsupported and was requested. + +Daniel Stenberg (25 Mar 2015) +- configure: make clear-memory default but only WARN if backend unsupported + + ... instead of previous ERROR. + +Marc Hoersken (24 Mar 2015) +- wincng.h: fix warning about computed return value not being used + +- nonblocking examples: fix warning about unused tvdiff on Mac OS X + +Daniel Stenberg (24 Mar 2015) +- openssl: fix compiler warnings + +- cofigure: fix --disable-clear-memory check + +Marc Hoersken (23 Mar 2015) +- scp.c: improved command length calculation + + Reduced number of calls to strlen, because shell_quotearg already + returns the length of the resulting string (e.q. quoted path) + which we can add to the existing and known cmd_len. + Removed obsolete call to memset again, because we can put a final + NULL-byte at the end of the string using the calculated length. + +- scp.c: improved and streamlined formatting + +- scp.c: fix that scp_recv may transmit not initialised memory + +- scp.c: fix that scp_send may transmit not initialised memory + + Fixes ticket 244. Thanks Torsten. + +- kex: do not ignore failure of libssh2_sha1_init() + + Based upon 43b730ce56f010e9d33573fcb020df49798c1ed8. + Fixes ticket 290. Thanks for the suggestion, mstrsn. + +- wincng.h: fix return code of libssh2_md5_init() + +- openssl.c: fix possible segfault in case EVP_DigestInit fails + +- wincng.c: fix possible use of uninitialized variables + +- wincng.c: fix unused argument warning if clear memory is not enabled + +- wincng: Added explicit clear memory feature to WinCNG backend + + This re-introduces the original feature proposed during + the development of the WinCNG crypto backend. It still needs + to be added to libssh2 itself and probably other backends. + + Memory is cleared using the function SecureZeroMemory which is + available on Windows systems, just like the WinCNG backend. + +- wincng.c: fixed mixed line-endings + +- wincng.c: fixed use of invalid parameter types in a8d14c5dcf + +- wincng.c: only try to load keys corresponding to the algorithm + +- wincng.c: moved PEM headers into definitions + +- wincng.h: fixed invalid parameter name + +- wincng: fixed mismatch with declarations in crypto.h + +- userauth.c: fixed warning C6001: using uninitialized sig and sig_len + +- pem.c: fixed warning C6269: possible incorrect order of operations + +- wincng: add support for authentication keys to be passed in memory + + Based upon 18cfec8336e and daa2dfa2db. + +- pem.c: add _libssh2_pem_parse_memory to parse PEM from memory + + Requirement to implement 18cfec8336e for Libgcrypt and WinCNG. + +- pem.c: fix copy and paste mistake from 55d030089b8 + +- userauth.c: fix another possible dereference of a null pointer + +- userauth.c: fix possible dereference of a null pointer + +- pem.c: reduce number of calls to strlen in readline + +Alexander Lamaison (17 Mar 2015) +- [Will Cosgrove brought this change] + + Initialise HMAC_CTX in more places. + + Missed a couple more places we init ctx to avoid openssl threading crash. + +- Build build breakage in WinCNG backend caused when adding libssh2_userauth_publickey_frommemory. + + The new feature isn't implemented for the WinCNG backend currently, but the WinCNG backend didn't contain any implementation of the required backend functions - even ones that returns an error. That caused link errors. + + This change fixes the problem by providing an implementation of the backend functions that returns an error. + +- Fix breakage in WinCNG backend caused by introducing libssh2_hmac_ctx_init. + + The macro was defined to nothing for the libgcrypt backend, but not for WinCNG. This brings the latter into line with the former. + +Daniel Stenberg (15 Mar 2015) +- userauth_publickey_frommemory.3: add AVAILABILITY + + ... it will be added in 1.6.0 + +- libssh2: next version will be called 1.6.0 + + ... since we just added a new function. + +- docs: add libssh2_userauth_publickey_frommemory.3 to dist + + The function and man page were added in commit 18cfec8336e + +- [Jakob Egger brought this change] + + direct_tcpip: Fixed channel write + + There were 3 bugs in this loop: + 1) Started from beginning after partial writes + 2) Aborted when 0 bytes were sent + 3) Ignored LIBSSH2_ERROR_EAGAIN + + See also: + https://trac.libssh2.org/ticket/281 + https://trac.libssh2.org/ticket/293 + +Alexander Lamaison (15 Mar 2015) +- [Will Cosgrove brought this change] + + Must init HMAC_CTX before using it. + + Must init ctx before using it or openssl will reuse the hmac which is not thread safe and causes a crash. + Added libssh2_hmac_ctx_init macro. + +- Add continuous integration configurations. + + Linux-based CI is done by Travis CI. Windows-based CI is done by Appveyor. + +- [David Calavera brought this change] + + Allow authentication keys to be passed in memory. + + All credits go to Joe Turpin, I'm just reaplying and cleaning his patch: + http://www.libssh2.org/mail/libssh2-devel-archive-2012-01/0015.shtml + + * Use an unimplemented error for extracting keys from memory with libgcrypt. + +Daniel Stenberg (14 Mar 2015) +- docs: include the renamed INSTALL* files in dist + +Alexander Lamaison (13 Mar 2015) +- Prevent collisions between CMake and Autotools in examples/ and tests/. + +- Avoid clash between CMake build and Autotools. + + Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates. But the CMake build system has its CMake-specific version of the file at this path. This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template. + + See https://github.com/libssh2/libssh2/pull/8. + +- Merge pull request #8 from alamaison/cmake + + CMake build system. + +- CMake build system. + + Tested: + - Windows: + - Visual C++ 2005/2008/2010/2012/2013/MinGW-w64 + - static/shared + - 32/64-bit + - OpenSSL/WinCNG + - Without zlib + - Linux: + - GCC 4.6.3/Clang 3.4 + - static/shared + - 32/64-bit + - OpenSSL/Libgcrypt + - With/Without zlib + - MacOS X + - AppleClang 6.0.0 + - static + - 64-bit + - OpenSSL + - Without zlib + + Conflicts: + README + +- Man man syntax tests fail gracefully if man version is not suitable. + +- Return valid code from test fixture on failure. + + The sshd test fixture was returning -1 if an error occurred, but negative error codes aren't technically valid (google it). Bash on Windows converted them to 0 which made setup failure look as though all tests were passing. + +- Let mansyntax.sh work regardless of where it is called from. + +Daniel Stenberg (12 Mar 2015) +- [Viktor Szakáts brought this change] + + mingw build: allow to pass custom CFLAGS + + Allow to pass custom `CFLAGS` options via environment variable + `LIBSSH2_CFLAG_EXTRAS`. Default and automatically added options of + `GNUmakefile` have preference over custom ones. This addition is useful + for passing f.e. custom CPU tuning or LTO optimization (`-flto + -ffat-lto-objects`) options. The only current way to do this is to edit + `GNUmakefile`. This patch makes it unnecessary. + + This is a mirror of similar libcurl patch: + https://github.com/bagder/curl/pull/136 + +- [Will Cosgrove brought this change] + + userauth: Fixed prompt text no longer being copied to the prompts struct + + Regression from 031566f9c + +- README: update the git repo locations + +- wait_socket: wrong use of difftime() + + With reversed arguments it would always return a negative value... + + Bug: https://github.com/bagder/libssh2/issues/1 + +- bump: start working toward 1.5.1 now + +Version 1.5.0 (11 Mar 2015) + +Daniel Stenberg (11 Mar 2015) +- RELEASE-NOTES: 1.5.0 release + +- [Mariusz Ziulek brought this change] + + kex: bail out on rubbish in the incoming packet + + CVE-2015-1782 + + Bug: http://www.libssh2.org/adv_20150311.html + +- docs: move INSTALL, AUTHORS, HACKING and TODO to docs/ + + And with this, cleanup README to be shorter and mention the new source + code home. + +- .gitignore: don't ignore INSTALL + +Dan Fandrich (4 Mar 2015) +- examples/x11.c: include sys/select.h for improved portability + +Daniel Stenberg (4 Mar 2015) +- RELEASE-NOTES: synced with a8473c819bc068 + + In preparation for the upcoming 1.5.0 release. + +Guenter Knauf (8 Jan 2015) +- NetWare build: added some missing exports. + +Marc Hoersken (29 Dec 2014) +- knownhost.c: fix use of uninitialized argument variable wrote + + Detected by clang scan in line 1195, column 18. + +- examples/x11.c: fix result of operation is garbage or undefined + + Fix use of uninitialized structure w_size_bck. + Detected by clang scan in line 386, column 28. + +- examples/x11.c: remove dead assigments of some return values + + Detected by clang scan in line 212, column 9. + Detected by clang scan in line 222, column 13. + Detected by clang scan in line 410, column 13. + +- examples/x11.c: fix possible memory leak if read fails + + Detected by clang scan in line 224, column 21. + +- examples/x11.c: fix invalid removal of first list element + + Fix use of memory after it was being freed. + Detected by clang scan in line 56, column 12. + +- userauth.c: make sure that sp_len is positive and avoid overflows + + ... if the pointer subtraction of sp1 - pubkey - 1 resulted in a + negative or larger value than pubkey_len, memchr would fail. + + Reported by Coverity CID 89846. + +- channel.c: remove logically dead code, host cannot be NULL here + + ... host cannot be NULL in line 525, because it is always + valid (e.g. at least set to "0.0.0.0") after lines 430 and 431. + + Reported by Coverity CID 89807. + +- session.c: check return value of session_nonblock during startup + + Reported by Coverity CID 89803. + +- session.c: check return value of session_nonblock in debug mode + + Reported by Coverity CID 89805. + +- pem.c: fix mixed line-endings introduced with 8670f5da24 + +- pem.c: make sure there's a trailing zero and b64data is not NULL + + ... if there is no base64 data between PEM header and footer. + Reported by Coverity CID 89823. + +- kex.c: make sure mlist is not set to NULL + + ... if the currently unsupported LANG methods are called. + Reported by Coverity CID 89834. + +- packet.c: i < 256 was always true and i would overflow to 0 + + Visualize that the 0-termination is intentional, because the array + is later passed to strlen within _libssh2_packet_askv. + +- silence multiple data conversion warnings + +Daniel Stenberg (23 Dec 2014) +- agent_connect_unix: make sure there's a trailing zero + + ... if the path name was too long. Reported by Coverity CID 89801. + +Marc Hoersken (22 Dec 2014) +- examples on Windows: use native SOCKET-type instead of int + + And check return values accordingly. + +- userauth.c: improve readability and clarity of for-loops + +Daniel Stenberg (22 Dec 2014) +- calloc: introduce LIBSSH2_CALLOC() + + A simple function using LIBSSH2_ALLOC + memset, since this pattern was + used in multiple places and this simplies code in general. + +Marc Hoersken (15 Dec 2014) +- libssh2_priv.h: Ignore session, context and format parameters + +- x11 example: check return value of socket function + +- examples: fixed mixed line-endings introduced with aedfba25b8 + +- wincng.c: explicitly ignore BCrypt*AlgorithmProvider return codes + + Fixes VS2012 code analysis warning C6031: + return value ignored: could return unexpected value + +- wincng.c: fix possible invalid memory write access + + Fixes VS2012 code analysis warning C6386: + buffer overrun: accessing 'pbOutput', the writable size is + 'cbOutput' bytes, but '3' bytes may be written: libssh2 wincng.c 610 + +- tests on Windows: check for WSAStartup return code + + Fixes VS2012 code analysis warning C6031: + return value ignored: could return unexpected value + +- wincng.c: fix possible NULL pointer de-reference of bignum + + Fixes VS2012 code analysis warning C6011: + dereferencing NULL pointer 'bignum'. libssh2 wincng.c 1567 + +- wincng.c: fix possible use of uninitialized memory + + Fixes VS2012 code analysis warning C6001: + using uninitialized memory 'cbDecoded'. libssh2 wincng.c 553 + +- packet.c: fix possible NULL pointer de-reference within listen_state + + Fixes VS2012 code analysis warning C6011: + dereferencing NULL pointer 'listen_state->channel'. libssh2 packet.c 221 + +- kex.c: fix possible NULL pointer de-reference with session->kex + + Fixes VS2012 code analysis warning C6011: + dereferencing NULL pointer 'session->kex'. libssh2 kex.c 1761 + +- agent.c: check return code of MapViewOfFile + + Fixes VS2012 code analysis warning C6387: 'p+4' may be '0': + this does not adhere to the specification for the function + 'memcpy': libssh2 agent.c 330 + + Fixes VS2012 code analysis warning C6387: 'p' may be '0': + this does not adhere to the specification for the function + 'UnmapViewOfFile': libssh2 agent.c 333 + +- examples on Windows: check for socket return code + + Fixes VS2012 code analysis warning C28193: + The variable holds a value that must be examined + +- examples on Windows: check for WSAStartup return code + + Fixes VS2012 code analysis warning C6031: + return value ignored: could return unexpected value + +Guenter Knauf (11 Dec 2014) +- wincng.c: silent some more gcc compiler warnings. + +- wincng.c: silent gcc compiler warnings. + +- Watcom build: added support for WinCNG build. + +- build: updated dependencies in makefiles. + +Daniel Stenberg (4 Dec 2014) +- configure: change LIBS not LDFLAGS when checking for libs + + Closes #289 + + Patch-by: maurerpe + +Guenter Knauf (3 Dec 2014) +- MinGW build: some more GNUMakefile tweaks. + + test/GNUmakefile: added architecture autodetection; added switches to + CFLAGS and RCFLAGS to make sure that the right architecture is used. + Added support to build with WinCNG. + +- sftpdir.c: added authentication method detection. + + Stuff copied over from ssh2.c to make testing a bit easier. + +- NMake build: fixed LIBS settings. + +- NMake build: added support for WinCNG build. + +- MinGW build: some GNUMakefile tweaks. + + Added architecture autodetection; added switches to CFLAGS and + RCFLAGS to make sure that the right architecture is used. + Added support to build with WinCNG. + +- MinGW build: Fixed redefine warnings. + +- Updated copyright year. + +Daniel Stenberg (31 Aug 2014) +- COPYING: bump the copyright year + +Dan Fandrich (28 Jul 2014) +- docs: fixed a bunch of typos + +- docs: added missing libssh2_session_handshake.3 file + +Marc Hoersken (19 May 2014) +- wincng.c: specify the required libraries for dependencies using MSVC + + Initially reported by Bob Kast as "for MS VS builds, specify the + libraries that are required so they don't need to go into all + project files that may use this library". Thanks a lot. + +- [Bob Kast brought this change] + + windows build: do not export externals from static library + + If you are building a DLL, then you need to explicitly export each + entry point. When building a static library, you should not. + + libssh2 was exporting the entry points whether it was building a DLL or a + static library. To elaborate further, if libssh2 was used as a static + library, which was being linked into a DLL, the libssh2 API would be + exported from that separate DLL. + +Daniel Stenberg (19 May 2014) +- [Mikhail Gusarov brought this change] + + Fix typos in manpages + +Marc Hoersken (18 May 2014) +- wincng.c: Fixed memory leak in case of an error during ASN.1 decoding + +- configure: Display individual crypto backends on separate lines + + This avoids line-wrapping in between parameters and makes the + error message look like the following: + + configure: error: No crypto library found! + Try --with-libssl-prefix=PATH + or --with-libgcrypt-prefix=PATH + or --with-wincng on Windows + +- [Bob Kast brought this change] + + libssh2_priv.h: a 1 bit bit-field should be unsigned + + some compilers may not like this + +- knownhost.c: Fixed warning that pointer targets differ in signedness + +- wincng.c: Fixed warning about pointer targets differing in signedness + +- tcpip-forward.c: Fixed warning that pointer targets differ in signedness + + libssh2_channel_forward_listen_ex uses ints instead of unsigned ints. + +- misc.c: Fixed warning about mixed declarations and code + +- libgcrypt.h: Fixed warning about pointer targets differing in signedness + +- wincng.h: Fixed warning about pointer targets differing in signedness + +- misc.c: Fixed warning about unused parameter abstract + +- tcpip-forward.c: Removed unused variables shost, sport and sockopt + +- wincng.h: Added forward declarations for all WinCNG functions + + Initially reported by Bob Kast as "Wincng - define function + prototypes for wincng routines". Thanks a lot. + + Also replaced structure definitions with type definitions. + +- [Bob Kast brought this change] + + libssh2.h: on Windows, a socket is of type SOCKET, not int + +- win32: Added WinCNG targets to generated Visual Studio project + + Inspired by Bob Kast's reports, this commit enables the compilation + of libssh2 with WinCNG using the generated Visual Studio project files. + This commit adds WinCNG support to parts of the existing Win32 build + infrastructure, until new build systems, like pre-defined VS project + files or CMake files may be added. + + This commit and b20bfeb3e519119a48509a1099c06d65aa7da1d7 raise one + question: How to handle build systems, like VS project files, that + need to include all source files regardless of the desired target, + including all supported crypto backends? For now the mentioned commit + added a check for LIBSSH2_OPENSSL to openssl.c and with this commit + the supported crypto backends are hardcoded within Makefile.am. + +- libssh2_priv msvc: Removed redundant definition of inline keyword + + Initially reported by Bob Kast as "Remove redundant 'inline' define". + Thanks a lot. + +- wincng: Made data parameter to hash update function constant + + Initially reported by Bob Kast as "formal parameter must be const + since it is used in contexts where the actual parameter may be const". + Thanks a lot. + +- wincng: fix cross-compilation against the w64 mingw-runtime package + +- openssl: Check for LIBSSH2_OPENSSL in order to compile with openssl + +- wincng: Fixed use of possible uninitialized variable pPaddingInfo + + Reported by Bob Kast, thanks a lot. + +- wincng: Added cast for double to unsigned long conversion + +- wincng: Cleaned up includes and check NTSTATUS using macro + + Removed header file combination that is not supported on a real + Windows platform and can only be compiled using MinGW. Replaced + custom NTSTATUS return code checks with BCRYPT_SUCCESS macro. + +Daniel Stenberg (16 Mar 2014) +- userauth_hostbased_fromfile: zero assign to avoid uninitialized use + + Detected by clang-analyze + +- channel_receive_window_adjust: store windows size always + + Avoid it sometimes returning without storing it, leaving calling + functions with unknown content! + + Detected by clang-analyzer + +- publickey_packet_receive: avoid junk in returned pointers + + clang-analyzer found this risk it would return a non-initialized pointer + in a success case + +Peter Stuge (16 Mar 2014) +- [Marc Hoersken brought this change] + + Added Windows Cryptography API: Next Generation based backend + +- [Marc Hoersken brought this change] + + knownhost.c: fixed that 'key_type_len' may be used uninitialized + + ../src/knownhost.c: In function 'libssh2_knownhost_readline': + ../src/knownhost.c:651:16: warning: 'key_type_len' may be used + uninitialized in this function [-Wmaybe-uninitialized] + rc = knownhost_add(hosts, hostbuf, NULL, + ^ + ../src/knownhost.c:745:12: note: 'key_type_len' was declared here + size_t key_type_len; + ^ + +- [Marc Hoersken brought this change] + + pem.c: always compile pem.c independently of crypto backend + +- Fix non-autotools builds: Always define the LIBSSH2_OPENSSL CPP macro + + Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 introduced a crypto + library abstraction in the autotools build system, to allow us to more + easily support new crypto libraries. In that process it was found that + all other build system which we support are hard-coded to build with + OpenSSL. Commit f5c1a0d98bd51aeb24aca3d49c7c81dcf8bd858d fixes automake + introduced into non-autotools build systems but still overlooked the + CPP macro saying that we are using OpenSSL. + + Thanks to Marc Hörsken for identifying this issue and proposing a fix + for win32/{GNUmakefile,config.mk}. This commit uses a slightly different + approach but the end result is the same. + +Dan Fandrich (15 Mar 2014) +- channel_close: Close the channel even in the case of errors + +- sftp_close_handle: ensure the handle is always closed + + Errors are reported on return, but otherwise the close path is + completed as much as possible and the handle is freed on exit. + +Alexander Lamaison (6 Mar 2014) +- knownhost: Restore behaviour of `libssh2_knownhost_writeline` with short buffer. + + Commit 85c6627c changed the behaviour of `libssh2_knownhost_writeline` so that it stopped returning the number of bytes needed when the given buffer was too small. Also, the function changed such that is might write to part of the buffer before realising it is too small. + + This commit restores the original behaviour, whilst keeping the unknown-key-type functionality that 85c6627c. Instead of writing to the buffer piecemeal, the length of the various parts is calculated up front and the buffer written only if there is enough space. The calculated necessary size is output in `outlen` regardless of whether the buffer was written to. + + The main use-case for the original behaviour that this commit restores is to allow passing in a NULL buffer to get the actual buffer size needed, before calling the function again with the buffer allocated to the exact size required. + +- knownhost: Fix DSS keys being detected as unknown. + + I missing `else` meant ssh-dss format keys were being re-detected as unknown format. + +Dan Fandrich (6 Mar 2014) +- knownhosts: Abort if the hosts buffer is too small + + This could otherwise cause a match on the wrong host + +- agent_list_identities: Fixed memory leak on OOM + +- Fixed a few typos + +- userauth: Fixed an attempt to free from stack on error + +- Fixed a few memory leaks in error paths + +- Fixed two potential use-after-frees of the payload buffer + + The first might occur if _libssh2_packet_add returns an error, as + fullpacket_state wasn't reset to idle so if it were possible for + fullpacket to be called again, it would return to the same state + handler and re-use the freed p->packet buffer. + + The second could occur if decrypt returned an error, as it freed the + packet buffer but did not clear total_num, meaning that freed buffer + could be written into again later. + +Alexander Lamaison (28 Nov 2013) +- Fix missing `_libssh2_error` in `_libssh2_channel_write`. + + In one case, the error code from `_libssh2_transport_read` was being returned from `_libssh2_channel_write` without setting it as the last error by calling `_libssh2_error`. This commit fixes that. + + Found when using a session whose socket had been inadvertently destroyed. The calling code got confused because via `libssh2_session_last_error` it appeared no error had occurred, despite one being returned from the previous function. + +Kamil Dudka (21 Nov 2013) +- [Mark McPherson brought this change] + + openssl: initialise the digest context before calling EVP_DigestInit() + + When using the OpenSSL libraries in FIPS mode, the function call + EVP_DigestInit() is actually #defined to FIPS_digestinit(). + Unfortunately wheres EVP_DigestInit() initialises the context and then + calls EVP_DigestInit_ex(), this function assumes that the context has + been pre-initialised and crashes when it isn't. + + Bug: https://trac.libssh2.org/ticket/279 + + Fixes #279 + +- [Marc Hörsken brought this change] + + .gitignore: Ignore files like src/libssh2_config.h.in~ + +Peter Stuge (13 Nov 2013) +- Move automake conditionals added by commit d512b25f out of Makefile.inc + + Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 added automake + conditionals to Makefile.inc but since Makefile.inc is included + from Makefile for all other build systems that does not work. + + This commit instead adds Makefile.OpenSSL.inc and Makefile.libgcrypt.inc + and moves the automake conditional to its proper place, src/Makefile.am. + + The automake conditional includes the correct Makefile.$name.inc per + the crypto library selection/detection done by configure. + + All non-autotools build system files in libssh2 are hardcoded to use + OpenSSL and do not get a conditional but at least there is some reuse + because they can all include the new Makefile.OpenSSL.inc. + +Daniel Stenberg (27 Oct 2013) +- [Salvador Fandino brought this change] + + Set default window size to 2MB + + The default channel window size used until now was 256KB. This value is + too small and results on a bottleneck on real-life networks where + round-trip delays can easily reach 300ms. + + The issue was not visible because the configured channel window size + was being ignored and a hard-coded value of ~22MB being used instead, + but that was fixed on a previous commit. + + This patch just changes the default window size + (LIBSSH2_CHANNEL_WINDOW_DEFAULT) to 2MB. It is the same value used by + OpenSSH and in our opinion represents a good compromise between memory + used and transfer speed. + + Performance tests were run to determine the optimum value. The details + and related discussion are available from the following thread on the + libssh2 mailing-list: + + http://www.libssh2.org/mail/libssh2-devel-archive-2013-10/0018.shtml + http://article.gmane.org/gmane.network.ssh.libssh2.devel/6543 + + An excerpt follows: + + "I have been running some transfer test and measuring their speed. + + My setup was composed of a quad-core Linux machine running Ubuntu 13.10 + x86_64 with a LXC container inside. The data transfers were performed + from the container to the host (never crossing through a physical + network device). + + Network delays were simulated using the tc tool. And ping was used to + verify that they worked as intended during the tests. + + The operation performed was the equivalent to the following ssh command: + + $ ssh container "dd bs=16K count=8K if=/dev/zero" >/dev/null + + Though, establishment and closing of the SSH connection was excluded + from the timings. + + I run the tests several times transferring files of sizes up to 128MB + and the results were consistent between runs. + + The results corresponding to the 128MB transfer are available here: + + https://docs.google.com/spreadsheet/ccc?key=0Ao1yRmX6PQQzdG5wSFlrZl9HRWNET3ZyN0hnaGo5ZFE&usp=sharing + + It clearly shows that 256KB is too small as the default window size. + Moving to a 512MB generates a great improvement and after the 1MB mark + the returns rapidly diminish. Other factors (TCP window size, probably) + become more limiting than the channel window size + + For comparison I also performed the same transfers using OpenSSH. Its + speed is usually on par with that of libssh2 using a window size of 1MB + (even if it uses a 2MB window, maybe it is less aggressive sending the + window adjust msgs)." + + Signed-off-by: Salvador Fandino + +- [Salvador brought this change] + + _libssh2_channel_read: Honour window_size_initial + + _libssh2_channel_read was using an arbitrary hard-coded limit to trigger + the window adjusting code. The adjustment used was also hard-coded and + arbitrary, 15MB actually, which would limit the usability of libssh2 on + systems with little RAM. + + This patch, uses the window_size parameter passed to + libssh2_channel_open_ex (stored as remote.window_size_initial) plus the + buflen as the base for the trigger and the adjustment calculation. + + The memory usage when using the default window size is reduced from 22MB + to 256KB per channel (actually, if compression is used, these numbers + should be incremented by ~50% to account for the errors between the + decompressed packet sizes and the predicted sizes). + + My tests indicate that this change does not impact the performance of + transfers across localhost or a LAN, being it on par with that of + OpenSSH. On the other hand, it will probably slow down transfers on + networks with high bandwidth*delay when the default window size + (LIBSSH2_CHANNEL_WINDOW_DEFAULT=256KB) is used. + + Signed-off-by: Salvador Fandino + +- [Salvador Fandino brought this change] + + knownhosts: handle unknown key types + + Store but don't use keys of unsupported types on the known_hosts file. + + Currently, when libssh2 parses a known_host file containing keys of some + type it doesn't natively support, it stops reading the file and returns + an error. + + That means, that the known_host file can not be safely shared with other + software supporting other key types (i.e. OpenSSH). + + This patch adds support for handling keys of unknown type. It can read + and write them, even if they are never going to be matched. + + At the source level the patch does the following things: + + - add a new unknown key type LIBSSH2_KNOWNHOST_KEY_UNKNOWN + + - add a new slot (key_type_name) on the known_host struct that is + used to store the key type in ascii form when it is not supported + + - parse correctly known_hosts entries with unknown key types and + populate the key_type_name slot + + - print correctly known_hosts entries of unknown type + + - when checking a host key ignore keys that do not match the key + + Fixes #276 + +- windows build: fix build errors + + Fixes various link errors with VS2010 + + Reported-by: "kdekker" + Fixes #272 + +- man page: add missing function argument + + for libssh2_userauth_publickey_fromfile_ex() + + Reported-by: "pastey" + + Fixes #262 + +- [Salvador brought this change] + + Fix zlib deflate usage + + Deflate may return Z_OK even when not all data has been compressed + if the output buffer becomes full. + + In practice this is very unlikely to happen because the output buffer + size is always some KBs larger than the size of the data passed for + compression from the upper layers and I think that zlib never expands + the data so much, even on the worst cases. + + Anyway, this patch plays on the safe side checking that the output + buffer is not exhausted. + + Signed-off-by: Salvador + +- [Salvador brought this change] + + comp_method_zlib_decomp: Improve buffer growing algorithm + + The old algorithm was O(N^2), causing lots and lots of reallocations + when highly compressed data was transferred. + + This patch implements a simpler one that just doubles the buffer size + everytime it is exhausted. It results in O(N) complexity. + + Also a smaller inflate ratio is used to calculate the initial size (x4). + + Signed-off-by: Salvador + +- [Salvador brought this change] + + Fix zlib usage + + Data may remain in zlib internal buffers when inflate() returns Z_OK + and avail_out == 0. In that case, inflate has to be called again. + + Also, once all the data has been inflated, it returns Z_BUF_ERROR to + signal that the input buffer has been exhausted. + + Until now, the way to detect that a packet payload had been completely + decompressed was to check that no data remained on the input buffer + but that didn't account for the case where data remained on the internal + zlib buffers. + + That resulted in packets not being completely decompressed and the + missing data reappearing on the next packet, though the bug was masked + by the buffer allocation algorithm most of the time and only manifested + when transferring highly compressible data. + + This patch fixes the zlib usage. + + Signed-off-by: Salvador + +- [Salvador brought this change] + + _libssh2_channel_read: fix data drop when out of window + + After filling the read buffer with data from the read queue, when the + window size was too small, "libssh2_channel_receive_window_adjust" was + called to increase it. In non-blocking mode that function could return + EAGAIN and, in that case, the EAGAIN was propagated upwards and the data + already read on the buffer lost. + + The function was also moving between the two read states + "libssh2_NB_state_idle" and "libssh2_NB_state_created" both of which + behave in the same way (excepting a debug statment). + + This commit modifies "_libssh2_channel_read" so that the + "libssh2_channel_receive_window_adjust" call is performed first (when + required) and if everything goes well, then it reads the data from the + queued packets into the read buffer. + + It also removes the useless "libssh2_NB_state_created" read state. + + Some rotted comments have also been updated. + + Signed-off-by: Salvador + +- [Salvador Fandino brought this change] + + window_size: redid window handling for flow control reasons + + Until now, the window size (channel->remote.window_size) was being + updated just after receiving the packet from the transport layer. + + That behaviour is wrong because the channel queue may grow uncontrolled + when data arrives from the network faster that the upper layer consumes + it. + + This patch adds a new counter, read_avail, which keeps a count of the + bytes available from the packet queue for reading. Also, now the window + size is adjusted when the data is actually read by an upper layer. + + That way, if the upper layer stops reading data, the window will + eventually fill and the remote host will stop sending data. When the + upper layers reads enough data, a window adjust packet is delivered and + the transfer resumes. + + The read_avail counter is used to detect the situation when the remote + server tries to send data surpassing the window size. In that case, the + extra data is discarded. + + Signed-off-by: Salvador + +Peter Stuge (15 Sep 2013) +- configure.ac: Call zlib zlib and not libz in text but keep option names + +- configure.ac: Reorder --with-* options in --help output + +- configure.ac: Rework crypto library detection + + This further simplifies adding new crypto libraries. + +- Clean up crypto library abstraction in build system and source code + + libssh2 used to explicitly check for libgcrypt and default to OpenSSL. + + Now all possible crypto libraries are checked for explicitly, making + the addition of further crypto libraries both simpler and cleaner. + +- configure.ac: Add zlib to Requires.private in libssh2.pc if using zlib + +- Revert "Added Windows Cryptography API: Next Generation based backend" + + This reverts commit d385230e15715e67796f16f3e65fd899f21a638b. + +Daniel Stenberg (7 Sep 2013) +- [Leif Salomonsson brought this change] + + sftp_statvfs: fix for servers not supporting statfvs extension + + Fixes issue arising when server does not support statfvs and or fstatvfs + extensions. sftp_statvfs() and sftp_fstatvfs() after this patch will + handle the case when SSH_FXP_STATUS is returned from server. + +- [Marc Hoersken brought this change] + + Added Windows Cryptography API: Next Generation based backend + +- [Kamil Dudka brought this change] + + partially revert "window_size: explicit adjustments only" + + This partially reverts commit 03ca9020756a4e16f0294e5b35e9826ee6af2364 + in order to fix extreme slowdown when uploading to localhost via SFTP. + + I was able to repeat the issue on RHEL-7 on localhost only. It did not + occur when uploading via network and it did not occur on a RHEL-6 box + with the same version of libssh2. + + The problem was that sftp_read() used a read-ahead logic to figure out + the window_size, but sftp_packet_read() called indirectly from + sftp_write() did not use any read-ahead logic. + +- _libssh2_channel_write: client spins on write when window full + + When there's no window to "write to", there's no point in waiting for + the socket to become writable since it most likely just will continue to + be. + + Patch-by: ncm + Fixes #258 + +- _libssh2_channel_forward_cancel: avoid memory leaks on error + + Fixes #257 + +- _libssh2_packet_add: avoid using uninitialized memory + + In _libssh2_packet_add, called by _libssh2_packet_read, a call to + _libssh2_packet_send that is supposed to send a one-byte message + SSH_MSG_REQUEST_FAILURE would send an uninitialized byte upon re-entry + if its call to _send returns _EAGAIN. + + Fixes #259 + +- _libssh2_channel_forward_cancel: accessed struct after free + + ... and the assignment was pointless anyway since the struct was about + to be freed. Bug introduced in dde2b094. + + Fixes #268 + +Peter Stuge (2 Jun 2013) +- [Marc Hoersken brought this change] + + Fixed compilation using mingw-w64 + +- [Marc Hoersken brought this change] + + knownhost.c: use LIBSSH2_FREE macro instead of free + + Use LIBSSH2_FREE instead of free since + _libssh2_base64_encode uses LIBSSH2_ALLOC + +Daniel Stenberg (18 May 2013) +- [Matthias Kerestesch brought this change] + + libssh2_agent_init: init ->fd to LIBSSH2_INVALID_SOCKET + + ... previously it was left at 0 which is a valid file descriptor! + + Bug: https://trac.libssh2.org/ticket/265 + + Fixes #265 + +- userauth_password: pass on the underlying error code + + _libssh2_packet_requirev() may return different errors and we pass that + to the parent instead of rewriting it. + + Bug: http://libssh2.org/mail/libssh2-devel-archive-2013-04/0029.shtml + Reported by: Cosmin + +Peter Stuge (9 May 2013) +- [Marc Hoersken brought this change] + + libcrypt.c: Fix typo in _libssh2_rsa_sha1_sign() parameter type + +Kamil Dudka (4 May 2013) +- configure.ac: replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS + + Reported by: Quintus + Bug: https://trac.libssh2.org/ticket/261 + +Guenter Knauf (12 Apr 2013) +- Fixed copyright string for NetWare build. + +Daniel Stenberg (9 Apr 2013) +- [Richard W.M. Jones brought this change] + + sftp: Add support for fsync (OpenSSH extension). + + The new libssh2_sftp_fsync API causes data and metadata in the + currently open file to be committed to disk at the server. + + This is an OpenSSH extension to the SFTP protocol. See: + + https://bugzilla.mindrot.org/show_bug.cgi?id=1798 + +- [Richard W.M. Jones brought this change] + + sftp: statvfs: Along error path, reset the correct 'state' variable. + +- [Richard W.M. Jones brought this change] + + sftp: seek: Don't flush buffers on same offset + + Signed-off-by: Richard W.M. Jones + +Guenter Knauf (9 Feb 2013) +- Updated dependency libs. + +- Fixed tool macro names. + +Daniel Stenberg (29 Nov 2012) +- [Seth Willits brought this change] + + compiler warnings: typecast strlen in macros + + ... in macro parameters to avoid compiler warnings about lost precision. + + Several macros in libssh2.h call strlen and pass the result directly to + unsigned int parameters of other functions, which warns about precision + loss because strlen returns size_t which is unsigned long on at least + some platforms (such as OS X). The fix is to simply typecast the + strlen() result to unsigned int. + +- libssh2.h: bump version to 1.4.4-DEV + +Version 1.4.3 (27 Nov 2012) + +Daniel Stenberg (27 Nov 2012) +- RELEASE-NOTES: fixed for 1.4.3 + +- sftp_read: return error if a too large package arrives + +Peter Stuge (13 Nov 2012) +- Only define _libssh2_dsa_*() functions when building with DSA support + +Guenter Knauf (8 Nov 2012) +- Added .def file to output. + +Kamil Dudka (1 Nov 2012) +- libssh2_hostkey_hash.3: update the description of return value + + The function returns NULL also if the hash algorithm is not available. + +Guenter Knauf (24 Oct 2012) +- Fixed mode acciedently committed. + +- Ignore generated file. + +- Added hack to make use of Makefile.inc. + + This should avoid further maintainance of the objects list. + +- Fixed MSVC NMakefile. + + Added missing source files; added resource for DLL. + +Kamil Dudka (22 Oct 2012) +- examples: use stderr for messages, stdout for data + + Reported by: Karel Srot + Bug: https://bugzilla.redhat.com/867462 + +- openssl: do not leak memory when handling errors + + ,.. in aes_ctr_init(). Detected by Coverity. + +- channel: fix possible NULL dereference + + ... in libssh2_channel_get_exit_signal(). Detected by Coverity. + +- Revert "aes: the init function fails when OpenSSL has AES support" + + This partially reverts commit f4f2298ef3635acd031cc2ee0e71026cdcda5864. + + We need to use the EVP_aes_???_ctr() functions in FIPS mode. + +- crypt: use hard-wired cipher block sizes consistently + +- openssl: do not ignore failure of EVP_CipherInit() + +- kex: do not ignore failure of libssh2_md5_init() + + The MD5 algorithm is disabled when running in FIPS mode. + +Daniel Stenberg (21 Aug 2012) +- [Peter Krempa brought this change] + + known_hosts: Fail when parsing unknown keys in known_hosts file. + + libssh2_knownhost_readfile() silently ignored problems when reading keys + in unsupported formats from the known hosts file. When the file is + written again from the internal structures of libssh2 it gets truntcated + to the point where the first unknown key was located. + + * src/knownhost.c:libssh2_knownhost_readfile() - return error if key + parsing fails + +- AUTHORS: synced with 42fec44c8a4 + + 31 recent authors added + +- [Dave Hayden brought this change] + + compression: add support for zlib@openssh.com + + Add a "use_in_auth" flag to the LIBSSH2_COMP_METHOD struct and a + separate "zlib@openssh.com" method, along with checking session->state + for LIBSSH2_STATE_AUTHENTICATED. Appears to work on the OpenSSH servers + I've tried against, and it should work as before with normal zlib + compression. + +- [Dmitry Smirnov brought this change] + + configure: gcrypt doesn't come with pkg-config support + + ... so use plain old -lgcrypt to the linker to link with it. + + Fixes #225 + +- sftp_read: Value stored to 'next' is never read + + Detected by clang-analyzer + +- publickey_init: errors are negative, fix check + + Detected by clang-analyzer. + +- [Maxime Larocque brought this change] + + session_free: wrong variable used for keeping state + + If libssh2_session_free is called without the channel being freed + previously by libssh2_channel_free a memory leak could occur. + + A mismatch of states variables in session_free() prevent the call to + libssh2_channel_free function. session->state member is used instead of + session->free_state. + + It causes a leak of around 600 bytes on every connection on my systems + (Linux, x64 and PPC). + + (Debugging done under contract for Accedian Networks) + + Fixes #246 + +Guenter Knauf (29 Jun 2012) +- Small NetWare makefile tweak. + +- Some small Win32 makefile fixes. + +Daniel Stenberg (19 Jun 2012) +- libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL + +- comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating + + When using libssh2 to perform an SFTP file transfer from the "JSCAPE MFT + Server" (http://www.jscape.com) the transfer failed. The default JSCAPE + configuration is to enforce zlib compression on SSH2 sessions so the + session was compressed. The relevant part of the debug trace contained: + + [libssh2] 1.052750 Transport: unhandled zlib error -5 + [libssh2] 1.052750 Failure Event: -29 - decompression failure + + The trace comes from comp_method_zlib_decomp() in comp.c. The "unhandled + zlib error -5" is the status returned from the zlib function + inflate(). The -5 status corresponds to "Z_BUF_ERROR". + + The inflate() function takes a pointer to a z_stream structure and + "inflates" (decompresses) as much as it can. The relevant fields of the + z_stream structure are: + + next_in - pointer to the input buffer containing compressed data + avail_in - the number of bytes available at next_in + next_out - pointer to the output buffer to be filled with uncompressed + data + avail_out - how much space available at next_out + + To decompress data you set up a z_stream struct with the relevant fields + filled in and pass it to inflate(). On return the fields will have been + updated so next_in and avail_in show how much compressed data is yet to + be processed and next_out and avail_out show how much space is left in + the output buffer. + + If the supplied output buffer is too small then on return there will be + compressed data yet to be processed (avail_in != 0) and inflate() will + return Z_OK. In this case the output buffer must be grown, avail_out + updated and inflate() called again. + + If the supplied output buffer was big enough then on return the + compressed data will have been exhausted (avail_in == 0) and inflate() + will return Z_OK, so the data has all been uncompressed. + + There is a corner case where inflate() makes no progress. That is, there + may be unprocessed compressed data and space available in the output + buffer and yet the function does nothing. In this case inflate() will + return Z_BUF_ERROR. From the zlib documentation and the source code it + is not clear under what circumstances this happens. It could be that it + needs to write multiple bytes (all in one go) from its internal state to + the output buffer before processing the next chunk of input but but + can't because there is not enough space (though my guesses as to the + cause are not really relevant). Recovery from Z_BUF_ERROR is pretty + simple - just grow the output buffer, update avail_out and call + inflate() again. + + The comp_method_zlib_decomp() function does not handle the case when + inflate() returns Z_BUF_ERROR. It treats it as a non-recoverable error + and basically aborts the session. + + Fixes #240 + +Guenter Knauf (12 Jun 2012) +- MinGW makefile tweaks. + + Use GNU tools when compiling on Linux. + Fixed dist and dev targets. + +- NetWare makefile tweaks. + + Changed to use Windows commandline tools instead of + GNU tools when compiling on Windows. Fixed dist and + dev targets. Enabled nlmconv error for unresolved + symbols. + +Daniel Stenberg (11 Jun 2012) +- Revert "config.rpath: generated file, no need to keep in git" + + This reverts commit 1ac7bd09cc685755577fb2c8829adcd081e7ab3c. + + This file still used by lib/*m4 functions so we need to keep the file + around. + +- BINDINGS: added PySsh2, a Python-ctypes binding + +Guenter Knauf (8 Jun 2012) +- Fixed MinGW debug build. + +Daniel Stenberg (5 Jun 2012) +- BINDINGS: Added the Cocoa/Objective-C one + + ... and sorted the bindings after the languages, alphabetically + + Reported by: Mike Abdullah + +- BINDINGS: document the bindings we know of + +Guenter Knauf (4 Jun 2012) +- Fixed LIBSSH2_INT64_T_FORMAT macro. + + Usually a format macro should hold the whole format, otherwise + it should be named a prefix. Also fixed usage of this macro in + scp.c for a signed var where it was used as prefix for unsigned. + +- Removed obsolete define from makefiles. + +- Renamed NetWare makefiles. + +- Renamed NetWare makefiles. + +- Synced MinGW makefiles with 56c64a6..39e438f. + + Also synced MinGW test makefile with b092696..f8cb874. + +Peter Stuge (30 May 2012) +- Revert "sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN" + + This reverts commit 04e79e0c798674a0796be8a55f63dd92e6877790. + +- sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN + + This works around a protocol violation in the ProFTPD 1.3.4 mod_sftp + server, as reported by Will Cosgrove in: + + http://libssh2.org/mail/libssh2-devel-archive-2012-05/0079.shtml + + Based on a suggested fix by TJ Saunders in: + + http://libssh2.org/mail/libssh2-devel-archive-2012-05/0104.shtml + +Guenter Knauf (28 May 2012) +- Try to detect OpenSSL build type automatically. + + Also fixed recently added libgdi32 linkage which is only + required when OpenSSL libs are linked statically. + +Daniel Stenberg (25 May 2012) +- config.rpath: generated file, no need to keep in git + +Guenter Knauf (22 May 2012) +- Updated dependency libary versions. + +Daniel Stenberg (18 May 2012) +- 1.4.3: towards the future + +Version 1.4.2 (18 May 2012) + +Daniel Stenberg (18 May 2012) +- RELEASE-NOTES: synced with 92a9f952794 + +Alexander Lamaison (15 May 2012) +- win32/libssh2_config.h: Remove hardcoded #define LIBSSH2_HAVE_ZLIB. + + Rationale: Everything else in this file states a fact about the win32 + platform that is unconditional for that platform. There is nothing + unconditional about the presence of zlib. It is neither included with + Windows nor with the platform SDK. Therefore, this is not an appropriate + place to assert its presence. Especially as, once asserted, it cannot be + overridden using a compiler flag. + + In contrast, if it is omitted, then it can easily be reasserted by adding + a compiler flag defining LIBSSH2_HAVE_ZLIB. + +Daniel Stenberg (14 May 2012) +- RELEASE-NOTES: synced with 69a3354467c + +- _libssh2_packet_add: SSH_MSG_CHANNEL_REQUEST default to want_reply + + RFC4254 says the default 'want_reply' is TRUE but the code defaulted to + FALSE. Now changed. + + Fixes #233 + +- gettimeofday: no need for a replacement under cygwin + + Fixes #224 + +Alexander Lamaison (13 May 2012) +- Prevent sftp_packet_read accessing freed memory. + + sftp_packet_add takes ownership of the packet passed to it and (now that we + handle zombies) might free the packet. sftp_packet_read uses the packet type + byte as its return code but by this point sftp_packet_add might have freed + it. This change fixes the problem by caching the packet type before calling + sftp_packet_add. + + I don't understand why sftp_packet_read uses the packet type as its return + code. A future change might get rid of this entirely. + +Daniel Stenberg (12 May 2012) +- sftp_packet_flush: flush zombies too + + As this function is called when the SFTP session is closed, it needs to + also kill all zombies left in the SFTP session to avoid leaking memory + just in case some zombie would still be in there. + +- sftp_packetlist_flush: zombies must not have responses already + + When flushing the packetlist, we must only add the request as a zombie + if no response has already been received. Otherwise we could wrongly + make it a zombie even though the response was already received and then + we'd get a zombie stuck there "forever"... + +- sftp_read: on EOF remove packet before flush + + Since the sftp_packetlist_flush() function will move all the existing + FXP_READ requests in this handle to the zombie list we must first remove + this just received packet as it is clearly not a zombie. + +- sftp_packet_require: sftp_packet_read() returning 0 is not an error + + Exactly as the comment in the code said, checking the return code from + sftp_packet_read() with <= was wrong and it should be < 0. With the new + filtering on incoming packets that are "zombies" we can now see this + getting zero returned. + +- sftp_packetlist_flush: only make it zombie if it was sent + + The list of outgoing packets may also contain packets that never were + sent off and we better not make them zombies too. + +- [Alexander Lamaison brought this change] + + Mark outstanding read requests after EOF as zombies. + + In order to be fast, sftp_read sends many read requests at once. With a small + file, this can mean that when EOF is received back, many of these requests are + still outstanding. Responses arriving after we close the file and abandon the + file handle are queued in the SFTP packet queue and never collected. This + causes transfer speed to drop as a progressively longer queue must be searched + for every packet. + + This change introduces a zombie request-ID list in the SFTP session that is + used to recognise these outstanding requests and prevent them being added to + the queue. + +Peter Stuge (23 Apr 2012) +- [Rafael Kitover brought this change] + + Update win32/GNUmakefile to use OpenSSL 1.0.1a + + libcrypto on win32 now depends on gdi32.dll, so move the OpenSSL LDLIBS + block to before the compiler definitions, so that libcrypto gets added + first, and then add -lgdi32 into the following common LDLIBS for gcc. + +Guenter Knauf (23 Apr 2012) +- Changed 'Requires' to 'Requires.private'. + + Only static builds need to link against the crypto libs. + +- Fixed 'Requires:' names. + + The 'Requires:' line lists the names of the .pc files. + +- Added 'Requires:' line to libssh2.pc. + + This is necessary so that other libs which lookup libssh2 info + via pkg-config can add the right crypto lib dependencies. + +- Updated dependency lib versions. + +Peter Stuge (18 Apr 2012) +- configure.ac: Add option to disable build of the example applications + + Examples are built by default. Any of the following options on the + configure command line will skip building them: + + --disable-examples-build + --enable-examples-build=no + --enable-examples-build=false + +- userauth.c: fread() from public key file to correctly detect any errors + + If the filename parameter for file_read_publickey() was the name of a + directory instead of a file then libssh2 would spin trying to fgetc() + from the FILE * for the opened directory when trying to determine the + length of the encoded public key, since fgetc() can't report errors. + + Use fread() instead to correctly detect this error condition along + with many others. + + This fixes the problem reported in + http://www.libssh2.org/mail/libssh2-devel-archive-2012-04/0021.shtml + + Reported-by: Oleksiy Zagorskyi + +- Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner + +Guenter Knauf (17 Apr 2012) +- Fixed copyright year. + +- Updated dependency lib versions in static makefiles. + +Daniel Stenberg (6 Apr 2012) +- version: bump to 1.4.2 + + We're on the 1.4.2 track now (at least) + +Version 1.4.1 (4 Apr 2012) + +Daniel Stenberg (4 Apr 2012) +- RELEASE-NOTES: updated for 1.4.1 release + +- always do "forced" window updates + + When calling _libssh2_channel_receive_window_adjust() internally, we now + always use the 'force' option to prevent libssh2 to avoid sending the + update if the update isn't big enough. + + It isn't fully analyzed but we have seen corner cases which made a + necessary window update not get send due to this and then the other side + doesn't send data our side then sits waiting for forever. + +- channel_read: force window adjusts! + + if there's not enough room to receive the data that's being requested, + the window adjustment needs to be sent to the remote and thus the force + option has to be used. _libssh2_channel_receive_window_adjust() would + otherwise "queue" small window adjustments for a later packet but that + is really terribly for the small buffer read that for example is the + final little piece of a very large file as then there is no logical next + packet! + + Reported by: Armen Babakhanian + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0130.shtml + +- [Paul Howarth brought this change] + + aes: the init function fails when OpenSSL has AES support + + The internal init function only worked fine when the configure script + didn't detect the OpenSSL AES_CTR function! + + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0111.shtml + Reported by: Paul Howarth + +- [Matthew Booth brought this change] + + transport_send: Finish in-progress key exchange before sending data + + _libssh2_channel_write() first reads outstanding packets before writing + new data. If it reads a key exchange request, it will immediately start + key re-exchange, which will require sending a response. If the output + socket is full, this will result in a return from + _libssh2_transport_read() of LIBSSH2_ERROR_EAGAIN. In order not to block + a write because there is no data to read, this error is explicitly + ignored and the code continues marshalling a packet for sending. When it + is sent, the remote end immediately drops the connection because it was + expecting a continuation of the key exchange, but got a data packet. + + This change adds the same check for key exchange to + _libssh2_transport_send() that is in _libssh2_transport_read(). This + ensures that key exchange is completed before any data packet is sent. + +- channel_write: acknowledge transport errors + + When draining data off the socket with _libssh2_transport_read() (which + in turn has to be done so that we can be sure to have read any possible + window-increasing packets), this code previously ignored errors which + could lead to nasty loops. Now all error codes except EAGAIN will cause + the error to be returned at once. + + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0068.shtml + Reported by: Matthew Booth + +- [Steven Dake brought this change] + + In examples/x11.c, Make sure sizeof passed to read operation is correct + + sizeof(buf) expands to 8 or 4 (since its a pointer). This variable may + have been static in the past, leading to this error. + + Signed-off-by: Steven Dake + +- [Steven Dake brought this change] + + Fix suspicious sizeof usage in examples/x11.c + + In the x11 example, sizeof(buf) = 8UL (on x86_64), when this should + probably represent the buffer size available. I am not sure how to + test that this change is actually correct, however. + + Signed-off-by: Steven Dake + +- sftp_packet_read: follow-up fix for EAGAIN/window adjust + + The commit in 7194a9bd7ba45 wasn't complete. This change makes sure + variables are initialized properly before used in the EAGAIN and window + adjust cases. + +- sftp_packet_add: use named error code instead of number + +- sftp_packet_add: verify the packet before accepting it + + In order to bail out as quickly as possible when things are wrong and + out of sync, make sure the SFTP message is one we understand. + +- SFTP: preserve the original error code more + + Lots of places in the code translated the original error into the more + generic LIBSSH2_ERROR_SOCKET_TIMEOUT but this turns out to distort the + original error reason a lot and makes tracking down the real origin of a + problem really hard. This change makes the original error code be + preserved to a larger extent when return up to the parent function. + +- sftp_packet_read: adjust window size as necessary + + Commit 03ca9020756 tried to simplify the window sizing logic but broke + SFTP readdir as there was no window sizing code left there so large + directory listings no longer worked. + + This change introduces window sizing logic to the sftp_packet_read() + function so that it now tells the remote about the local size having a + window size that suffice when it is about to ask for directory data. + + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0069.shtml + Reported by: Eric + +- [Steven Dake brought this change] + + Tell C compiler we don't care about return code of libssh2_init + + The call of libssh2_init returns a return code, but nothing could be done + within the _libssh2_init_if_needed execution path. + + Signed-off-by: Steven Dake + +- [Steven Dake brought this change] + + Add comment indicating a resource leak is not really a resource leak + + While possibly obvious to those investigating the code, coverity complains + about this out of scope leak. + + Signed-off-by: Steven Dake + +- [Steven Dake brought this change] + + Use safer snprintf rather then sprintf in scp_send() + + Signed-off-by: Steven Dake + +- [Steven Dake brought this change] + + Use safer snprintf rather then sprintf in scp_recv() + + While the buffer is indeed allocated to a safe length, better safe then sorry. + + Signed-off-by: Steven Dake + +- [Steven Dake brought this change] + + use snprintf in knownhost_writeline() rather then sprintf + + Although the function checks the length, if the code was in error, there + could potentially be a buffer overrun with the use of sprintf. Instead replace + with snprintf. + + Signed-off-by: Steven Dake + +- [Steven Dake brought this change] + + Add tracing to print packets left on session at libssh2_session_free + + Signed-off-by: Steven Dake + +Peter Stuge (2 Mar 2012) +- Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET + + INVALID_SOCKET is a special value in Windows representing a + non-valid socket identifier. We were #defining this to -1 on + non-Windows platforms, causing unneccessary namespace pollution. + Let's have our own identifier instead. + + Thanks to Matt Lawson for pointing this out. + +- nw/Makefile.netware: Fix project name typo to avoid needless confusion + +- example/x11: Set raw terminal mode manually instead of with cfmakeraw() + + OpenSolaris has no cfmakeraw() so to make the example more portable + we simply do the equivalent operations on struct termios ourselves. + + Thanks to Tom Weber for reporting this problem, and finding a solution. + +Daniel Stenberg (17 Feb 2012) +- sftp_write: cannot return acked data *and* EAGAIN + + Whenever we have acked data and is about to call a function that *MAY* + return EAGAIN we must return the number now and wait to get called + again. Our API only allows data *or* EAGAIN and we must never try to get + both. + +Peter Stuge (13 Feb 2012) +- example/x11: Build only when sys/un.h is found by configure + + The example can't be built on systems without AF_UNIX sockets. + +Daniel Stenberg (10 Feb 2012) +- [Alexander Lamaison brought this change] + + Simplified sftp_read. + + Removed the total_read variable that originally must have tracked how + much data had been written to the buffer. With non-blocking reads, we + must return straight away once we have read data into the buffer so this + variable served not purpose. + + I think it was still hanging around in case the initial processing of + 'leftover' data meant we wrote to the buffer but this case, like the + others, must return immediately. Now that it does, the last remaining + need for the variable is gone. + +- [Alexander Lamaison brought this change] + + Cleaned up sftp_read and added more explanation. + + Replaced the gotos which were implementing the state machine with + a switch statement which makes the states more explicit. + +- sftp_read: avoid data *and* EAGAIN + + Whenever we have data and is about to call a function that *MAY* return + EAGAIN we must return the data now and wait to get called again. Our API + only allows data *or* EAGAIN and we must never try to get both. + +Peter Stuge (2 Feb 2012) +- Add a tcpip-forward example which demonstrates remote port forwarding + +- libssh2.h: Add missing prototype for libssh2_session_banner_set() + +- example/subsystem_netconf.c: Return error when read buffer is too small + + Also remove a little redundancy in the read loop condition. + +- example/subsystem_netconf.c: Add a missing newline in an error message + +- Fix undefined reference to _libssh_error in libgcrypt backend + + Commit 209de22299b4b58e582891dfba70f57e1e0492db introduced a function + call to a non-existing function, and since then the libgcrypt backend + has not been buildable. + +Version 1.4.0 (31 Jan 2012) + +Daniel Stenberg (31 Jan 2012) +- RELEASE-NOTES: synced with 6bd584d29 for 1.4.0 + +- s/1.3.1/1.4.0 + + We're bumping the minor number + +- [Jernej Kovacic brought this change] + + libssh2_session_supported_algs: fix compiler warning + +- [Jernej Kovacic brought this change] + + session_supported_algs docs: added an example + +- [Gellule Xg brought this change] + + sftp-seek: clear EOF flag + + Set the EOF flag to False when calling seek64 to be able to get some + data back on a following read + +- [Peter Krempa brought this change] + + userauth: Provide more informations if ssh pub key extraction fails + + If the function that extracts/computes the public key from a private key + fails the errors it reports were masked by the function calling it. This + patch modifies the key extraction function to return errors using + _libssh_error() function. The error messages are tweaked to contain + reference to the failed operaton in addition to the reason. + + * AUTHORS: - add my name + * libgcrypt.c: _libssh2_pub_priv_keyfile(): - return a more verbose + error using + _libssh2_error() func. + * openssl.c: - modify call graph of _libssh2_pub_priv_keyfile() to use + _libssh2_error for error reporting(); + * userauth.c: - tweak functions calling _libssh2_pub_priv_keyfile() not + to shadow error messages + +- TODO: remove issues we (sort of) did already + +- ssh2_exec: skip error outputs for EAGAIN + + Since the example uses non-blocking mode, it will just flood the output + with this "nonsense" error. + +Guenter Knauf (30 Nov 2011) +- Some NetWare makefile tweaks. + +Daniel Stenberg (18 Nov 2011) +- LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000 + + Some SFTP servers send SFTP packets larger than 40000. Since the limit + is only present to avoid insane sizes anyway, we can easily bump it. + + The define was formerly in the public header libssh2_sftp.h but served + no external purpose and was moved into the source dir. + + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-11/0004.shtml + Reported by: Michael Harris + +Alexander Lamaison (18 Nov 2011) +- [Peter Krempa brought this change] + + knownhost_check(): Don't dereference ext if NULL is passed + + Documentation for libssh2_knownhost_checkp() and related functions + states that the last argument is filled with data if non-NULL. + + "knownhost if set to non-NULL, it must be a pointer to a 'struct + libssh2_knownhost' pointer that gets filled in to point to info about a + known host that matches or partially matches." + + In this function ext is dereferenced even if set to NULL, causing + segfault in applications not needing the extra data. + +Daniel Stenberg (11 Nov 2011) +- [Peter Krempa brought this change] + + knownhost_add: Avoid dereferencing uninitialized memory on error path. + + In function knownhost_add, memory is alocated for a new entry. If normal + alocation is used, memory is not initialized to 0 right after, but a + check is done to verify if correct key type is passed. This test is done + BEFORE setting the memory to null, and on the error path function + free_host() is called, that tries to dereference unititialized memory, + resulting into a glibc abort(). + + * knownhost.c - knownhost_add(): - move typemask check before alloc + +- windows build: add define to avoid compiler warning + + A recent mingw compiler has started to complain on "#warning Please + include winsock2.h before windows.h" unless the magic define is set + first. + + Reported by: Vincent Torri + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-10/0064.shtml + +Henrik Nordstrom (31 Oct 2011) +- [Vincent Torri brought this change] + + Correct Windows include file name case, simplifying cross-compilation + + When cross compiling to Windows, libssh2.h include Windows header files + with upper case filenames : BaseTsd.h and WinSock2.h. + + These files have lowercase names with mingw-w64 (iirc, it's the same with + mingw). And as on Windows, being lowercase or uppercase does not matter. + +Daniel Stenberg (25 Oct 2011) +- [Jernej Kovacic brought this change] + + libssh2_session_supported_algs: added + +- [Kamil Dudka brought this change] + + example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGAIN + + Bug: https://bugzilla.redhat.com/745420 + +Peter Stuge (5 Oct 2011) +- example/ssh2_agent: Print host key fingerprint before authentication + + Also moves the comment about not being authenticated to before the + agent authentication takes place, so that it better matches the code. + +Daniel Stenberg (29 Sep 2011) +- OpenSSL EVP: fix threaded use of structs + + Make sure we don't clear or reset static structs after first init so + that they work fine even when used from multiple threads. Init the + structs in the global init. + + Help and assistance by: John Engstrom + + Fixes #229 (again) + +- openssl: don't init static structs differently + + make_ctr_evp() is changed to take a struct pointer, and then each + _libssh2_EVP_aes_[keylen]_ctr function is made to pass in their own + static struct + + Reported by: John Engstrom + Fixes #229 + +Guenter Knauf (27 Sep 2011) +- Removed obsolete include path. + +Daniel Stenberg (21 Sep 2011) +- read_state: clear the state variable better + + Set read_state back to idle before trying to send anything so that if + the state somehow is wrongly set. + + Also, avoid such a case of confusion by resetting the read_state when an + sftp handle is closed. + +- sftp_read: remove leftover fprintf + + Reported by: Alexander Lamaison + +- sftp.h: fix the #ifdef to prevent multiple inclusions + +- sftp_read: use a state variable to avoid bad writes + + When a channel_write call has gotten an EAGAIN back, we try harder to + continue the same write in the subsequent invoke. + +- window_size: explicit adjustments only + + Removed the automatic window_size adjustments from + _libssh2_channel_read() and instead all channel readers must now make + sure to enlarge the window sizes properly themselves. + + libssh2_channel_read_ex() - the public function, now grows the window + size according to the requested buffer size. Applications can still opt + to grow the window more on demand. Larger windows tend to give higher + performance. + + sftp_read() now uses the read-ahead logic to figure out a window_size. + +- libssh2.h: bump the default window size to 256K + +- libssh2_userauth_keyboard_interactive.3: fix man warning + + It seemed to occur due to the excessive line length + +- [Mikhail Gusarov brought this change] + + Add missing .gitignore entries + +- [Mikhail Gusarov brought this change] + + Add manpage syntax checker to 'check' target + + In virtually every libssh2 release Debian's lintian catches syntax errors in + manpages. Prevent it by checking manpages as a part of testsuite. + +- libssh2_banner_set.3: fix nroff syntax mistake + +Guenter Knauf (10 Sep 2011) +- Use predefined resource compiler macro. + +- Added casts to silent compiler warnings. + +- Fixed uint64_t printf. + +- Fixed macro function signatures. + +- NetWare makefile tweaks. + +- Removed unused var. + +- Added 2 samples not mentioned. + +- Dont build x11 sample with MinGW. + +- Fixed executable file description. + +- Removed unused var. + +- Kill stupid gcc 3.x uninitialized warning. + +- Build all examples. + +- More MinGW makefile tweaks. + + Renamed *.mingw makefiles to GNUmakefile since GNU make picks these + up automatically, and therefore win32/Makefile removed. + +- Removed forgotten WINSOCK_VERSION defines. + +Daniel Stenberg (9 Sep 2011) +- libssh2_session_startup(3) => libssh2_session_handshake(3) + + Propagate for the current function in docs and examples. + libssh2_session_startup() is deprecated. + +- libssh2_banner_set => libssh2_session_banner_get + + Marked the old function as deprecated. Added the new name in the correct + name space with the same arguments and functionality. + +- new function: libssh2_session_banner_get + + Returns the banner from the server handshake + + Fixes #226 + +- libssh2.h: bump version to 1.4.0 for new function(s) + +- remove embedded CVS/svn tags + +- [liuzl brought this change] + + API add:libssh2_sftp_get_channel + + Return the channel of sftp, then caller can + control the channel's behavior. + + Signed-off-by: liuzl + +- _libssh2_channel_read: react on errors from receive_window_adjust + + Previously the function would ignore all errors except for EAGAIN. + +- sftp_read: extend and clarify the documentation + +- sftp_read: cap the read ahead maximum amount + + Now we only go up to LIBSSH2_CHANNEL_WINDOW_DEFAULT*30 bytes SFTP read + ahead, which currently equals 64K*30 == 1966080 bytes. + +- _libssh2_channel_read: fix non-blocking window adjusting + + If EAGAIN is returned when adjusting the receive window, we must not + read from the transport directly until we've finished the adjusting. + +Guenter Knauf (8 Sep 2011) +- Fix for systems which need sys/select.h. + +- The files were not gone but renamed ... + +Daniel Stenberg (6 Sep 2011) +- sftp_read: added documenting comment + + Taken from some recent email conversations I added some descriptions of + the logic in sftp_read() to aid readers. + +- 1.3.1: start the work + +Version 1.3.0 (6 Sep 2011) + +Daniel Stenberg (6 Sep 2011) +- Makefile.am: the Makefile.win32 files are gone + +- RELEASE-NOTES: updated for 1.3.0 + +- sftp_read: a short read is not end of file + + A returned READ packet that is short will now only reduce the + offset. + + This is a temporary fix as it is slightly better than the previous + approach but still not very good. + +- [liuzl brought this change] + + _libssh2_packet_add: adjust window size when truncating + + When receiving more data than what the window size allows on a + particular channel, make sure that the window size is adjusted in that + case too. Previously it would only adjust the window in the non-error + case. + +Guenter Knauf (29 Aug 2011) +- Silent compiler warning with MinGW64. + +- Fixed link to native Win32 awk tool. + +- Renamed MinGW makefiles. + +- Some MinGW makefile tweaks. + + Enable build without GNU tools and with MinGW64 compiler. + +- Fixed aes_ctr_do_cipher() signature. + +Daniel Stenberg (26 Aug 2011) +- [liuzl brought this change] + + libssh2_sftp_seek64: flush packetlist and buffered data + + When seeking to a new position, flush the packetlist and buffered data + to prevent already received or pending data to wrongly get used when + sftp-reading from the new offset within the file. + +- sftp_read: advance offset correctly for buffered copies + + In the case where a read packet has been received from the server, but + the entire contents couldn't be copied to the user-buffer, the data is + instead buffered and copied to the user's buffer in the next invocation + of sftp_read(). When that "extra" copy is made, the 'offset' pointer was + not advanced accordingly. + + The biggest impact of this flaw was that the 'already' variable at the + top of the function that figures out how much data "ahead" that has + already been asked for would slowly go more and more out of sync, which + could lead to the file not being read all the way to the end. + + This problem was most noticable in cases where the application would + only try to read the exact file size amount, like curl does. In the + examples libssh2 provides the sftp read function is most often called + with a fixed size large buffer and then the bug would not appear as + easily. + + This bug was introduced in the SFTP rewrite in 1.2.8. + + Bug: http://curl.haxx.se/mail/lib-2011-08/0305.html + http://www.libssh2.org/mail/libssh2-devel-archive-2011-08/0085.shtml + +- wrap some long lines < 80 columns + +- LIBSSH2_RECV: fix typo, use the RECV_FD macro + +- subsystem_netconf.c: fix compiler warnings + +- [Henrik Nordstrom brought this change] + + Custom callbacks for performing low level socket I/O + +- version bump: start working towards 1.3.0 + +Version 1.2.9 (16 Aug 2011) + +Daniel Stenberg (16 Aug 2011) +- RELEASE-NOTES: synced with 95d69d3a81261 + +- [Henrik Nordstrom brought this change] + + Document prototypes for macro defined functions + +- [Henrik Nordstrom brought this change] + + Avoid reuse after free when closing X11 channels + +- _libssh2_channel_write: handle window_size == 0 better + + When about to send data on the channel and the window size is 0, we must + not just return 0 if the transport_read() function returned EAGAIN as it + then causes a busy-loop. + + Bug: http://libssh2.org/mail/libssh2-devel-archive-2011-08/0011.shtml + +- gettimeofday: fix name space pollution + + For systems without its own gettimeofday() implementation, we still must + not provide one outside our namespace. + + Reported by: Bill Segall + +Dan Fandrich (5 Aug 2011) +- libssh2.pc.in: Fixed spelling in pkgconfig file + +Peter Stuge (17 Jul 2011) +- example/subsystem_netconf.c: Add missing #include + +- example/subsystem_netconf.c: Discard ]]>]]> and return only XML response + +- example/subsystem_netconf.c: Fix uninitialized variable bug + +- example: Add subsystem_netconf.c + + This example demonstrates how to use libssh2 to send a request to + the NETCONF subsystem available e.g. in JunOS. + + See also http://tools.ietf.org/html/draft-ietf-netconf-ssh-06 + +Daniel Stenberg (16 Jul 2011) +- man page cleanups: non-existing functions need no man pages + +- libssh2_new_host_entry.3: removed + + This is just junk leftovers. + +- userauth_keyboard_interactive: fix buffer overflow + + Partly reverse 566894494b4972ae12 which was simplifying the code far too + much and ended up overflowing a buffer within the LIBSSH2_SESSION + struct. Back to allocating the buffer properly like it used to do. + + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-06/0032.shtml + Reported by: Alfred Gebert + +- keyboard-interactive man page: cleaned up + +- [Alfred Gebert brought this change] + + _libssh2_recv(): handle ENOENT error as EAGAIN + + A sftp session failed with error "failure establishing ssh session" on + Solaris and HP-UX. Sometimes the first recv() function call sets errno + to ENOENT. In the man pages for recv of Solaris and HP-UX the error + ENOENT is not documented. + + I tested Solaris SPARC and x86, HP-UX i64, AIX, Windows and Linux. + +- agent_list_identities: fix out of scope access + + An auto variable out of scope was being referenced and used. + + fixes #220 + +- _libssh2_wait_socket: fix timeouts for poll() uses + +- windows: inclusion fix + + include winsock2.h for all windows compilers + +- keyb-interactive: add the fixed buffer + + Belongs to commit 5668944 + +- code cleanup: don't use C99/c++ comments + + We aim for C89 compliance + +- keyb-interactive: allow zero length fields + + Allow zero length fields so they don't cause malloc(0) calls + + Avoid free()ing NULL pointers + + Avoid a malloc of a fixed 5 byte buffer. + +- libssh2_channel_process_startup.3: clean up + + Remove the references to the macro-fied shortcuts as they have their own + individual man pages. + + Made the prototype different and more readable. + +- man page: fix .BR lines + + We don't use \fI etc on .BR lines + +- userauth_keyboard_interactive: skip code on zero length auth + +- libssh2_channel_forward_accept.3: mention how to get error + + Since this returns a pointer, libssh2_session_last_errno() must be used + to get the actual error code and it wasn't that clear before. + +- timeout docs: mention they're added in 1.2.9 + +- sftp_write_sliding.c: indent fix + + Use the standard indenting and removed CVS leftover comment + +- [zl liu brought this change] + + sftp_write_sliding: send the complete file + + When reaching the end of file there can still be data left not sent. + +- [Douglas Masterson brought this change] + + session_startup: init state properly + + libssh2_session_startup() didn't set the state correctly so it could get + confused. + + Fixes #218 + +- timeout: added man pages + +- BLOCK_ADJUST_ERRNO: move rc to right level + + We can't declare the variable within the block and use it in the final + do-while() expression to be properly portable C89. + +- [Matt Lilley brought this change] + + adds a timeout to blocking calls + + Fixes bug #160 as per Daniel's suggestion + + Adds libssh2_session_set_timeout() and libssh2_session_get_timeout() + +- SCP: fix incorrect error code + + After an error occurs in libssh2_scp_recv() or libssh2_scp_send(), the + function libssh2_session_last_error() would return + LIBSSH2_ERROR_SOCKET_NONE on error. + + Bug: http://trac.libssh2.org/ticket/216 + Patch by: "littlesavage" + + Fixes #216 + +Guenter Knauf (19 Apr 2011) +- Updated default (recommended) dependency versions. + +Daniel Stenberg (17 Apr 2011) +- libssh2_session_block_directions: fix mistake + + The last LIBSSH2_SESSION_BLOCK_INBOUND should be + LIBSSH2_SESSION_BLOCK_OUTBOUND + + And I shortened the short description + + Reported by: "drswinghead" + +- msvcproj: added libs and debug stuff + + Added libraries needed to link whether using openssl dynamically or + statically + + Added LIBSSH2DEBUG define to debug versions to enable tracing + + URL: http://trac.libssh2.org/ticket/215 + Patch by: Mark Smith + +- sftp_write: clean offsets on error + + When an error has occurred on FXP_WRITE, we must make sure that the + offset, sent offset and acked counter are reset properly. + +- example/.gitignore: ignore built binaries + +- sftp_write: flush the packetlist on error + + When an error occurs during write, flush the entire list of pending + outgoing SFTP packets. + +- keepalive: add first basic man pages + + Someone on IRC pointed out that we don't have these documented so I + wrote up a first set based on the information in the wiki: + http://trac.libssh2.org/wiki/KeepAlive + +- scp_write_nonblock.c: remove pointless check + + libssh2_channel_write() cannot return a value that is larger than the + input length value + +Mikhail Gusarov (9 Apr 2011) +- s/\.NF/.nf/ to fix wrong macro name caught by man --warnings + +Daniel Stenberg (6 Apr 2011) +- version: bump to 1.2.9_dev + + Also update the copyright year range to include 2011 + +- configure: fix $VERSION + + Stop using the $VERSION variable as it seems to be magically used by + autoconfig itself and thus gets set to the value set in AC_INIT() + without us wanting that. $LIBSSH2VER is now the libssh2 version as + detected. + + Reported by: Paul Howarth + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-04/0008.shtml + +- maketgz: use git2news.pl by the correct name + +Version 1.2.8 (4 Apr 2011) + +Daniel Stenberg (4 Apr 2011) +- RELEASE-NOTES: synced with fabf1a45ee + +- NEWS: auto-generated from git + + Starting now, the NEWS file is generated from git using the git2news.pl + script. This makes it always accurate and up-to-date, even for daily + snapshots etc. + +- sftp_write: handle FXP_WRITE errors + + When an sftp server returns an error back on write, make sure the + function bails out and returns the proper error. + +- configure: stop using the deprecated AM_INIT_AUTOMAKE syntax + +Alexander Lamaison (13 Mar 2011) +- Support unlimited number of host names in a single line of the known_hosts file. + + Previously the code assumed either a single host name or a hostname,ip-address pair. However, according to the spec [1], there can be any number of comma separated host names or IP addresses. + + [1] http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8 + +Daniel Stenberg (26 Feb 2011) +- libssh2_knownhost_readfile.3: clarify return value + + This function returns the number of parsed hosts on success, not just + zero as previously documented. + +Peter Stuge (26 Feb 2011) +- Don't save allocated packet size until it has actually been allocated + + The allocated packet size is internal state which needs to match reality + in order to avoid problems. This commit fixes #211. + +Daniel Stenberg (21 Feb 2011) +- [Alfred Gebert brought this change] + + session_startup: manage server data before server identification + + Fix the bug that libssh2 could not connect if the sftp server + sends data before sending the version string. + + http://tools.ietf.org/html/rfc4253#section-4.2 + + "The server MAY send other lines of data before sending the version + string. Each line SHOULD be terminated by a Carriage Return and Line + Feed. Such lines MUST NOT begin with "SSH-", and SHOULD be encoded + in ISO-10646 UTF-8 [RFC3629] (language is not specified). Clients + MUST be able to process such lines." + +- [Alfred Gebert brought this change] + + fullpacket: decompression only after init + + The buffer for the decompression (remote.comp_abstract) is initialised + in time when it is needed. With this fix decompression is disabled when + the buffer (remote.comp_abstract) is not initialised. + + Bug: http://trac.libssh2.org/ticket/200 + +- _libssh2_channel_read: store last error + + When the transport layer returns EAGAIN this function didn't call + _libssh2_error() which made the last_error not get set. + +- sftp_write: clarified the comment header + +- sftp_read: avoid wrapping counter to insanity + + As pointed out in bug #206, if a second invoke of libssh2_sftp_read() + would shrink the buffer size, libssh2 would go nuts and send out read + requests like crazy. This was due to an unsigned variable turning + "negative" by some wrong math, and that value would be the amount of + data attempt to pre-buffer! + + Bug: http://trac.libssh2.org/ticket/206 + +- sftp_packet_read: use 32bit variables for 32bit data + +- libssh2_sftp_stat_ex.3: cleaned up, extended + + Removed the macros from it as they have their own man pages. + + Added the LIBSSH2_SFTP_ATTRIBUTES struct in here for easier reference. + +- sftp_readdir: return error if buffer is too small + + If asked to read data into a buffer and the buffer is too small to hold + the data, this function now returns an error instead of as previously + just copy as much as fits. + +- sftp_symlink: return error if receive buffer too small + + and clean up some variable type mismatches + + Discussion: http://www.libssh2.org/mail/libssh2-devel-archive-2011-01/0001.shtml + +- docs: clarify what happens with a too small buffer + + This flaw is subject to change, but I figured it might be valuable to + users of existing code to know how it works. + +- channel_request_pty_size: fix reqPTY_state + + The state variable isn't properly set so every other call to the + function fails! + + Bug: http://libssh2.org/mail/libssh2-devel-archive-2010-12/0096.shtml + Reported by: Steve Legg + +- data size: cleanup + + Fix 64bit warnings by using (s)size_t and dedicated uint32_t types more. + +- [Pierre Joye brought this change] + + ssize_t: proper typedef with MSVC compilers + + As discussed on the mailing list, it was wrong for win64 and using the + VC-provided type is the safest approach instead of second- guessing + which one it should be. + +Guenter Knauf (22 Dec 2010) +- Updated OpenSSL version. + +- Expanded tabs to spaces. + +Peter Stuge (21 Dec 2010) +- [Joey Degges brought this change] + + _libssh2_ntohu64: fix conversion from network bytes to uint64 + + Cast individual bytes to uint64 to avoid overflow in arithmetic. + +Daniel Stenberg (20 Dec 2010) +- libssh2_userauth_list: language fix + + "faily" is not a good English word, and I also cleaned up some other minor + mistakes + +- crypto: unify the generic functions + + Added crypto.h that is the unified header to include when using crypto + functionality. It should be the only header that needs to adapt to the + underlying crypto library in use. It provides the set of prototypes that + are library agnostic. + +- [Mark Smith brought this change] + + userauth: derive publickey from private + + Pass a NULL pointer for the publickey parameter of + libssh2_userauth_publickey_fromfile and + libssh2_userauth_hostbased_fromfile functions. In this case, the + functions recompute the public key from the private key file data. + + This is work done by Jean-Louis CHARTON + , then adapted by Mark Smith and + slightly edited further by me Daniel. + + WARNING: this does leave the feature NOT WORKING when libssh2 is built + to use libgcrypt instead of OpenSSL simply due to lack of + implementation. + +- ssh2_echo: Value stored to 'exitcode' is never read + +- _libssh2_packet_add: fix SSH_MSG_DEBUG weirdness + + I believe I may have caused this weird typo style error when I cleaned + up this function a while ago. Corrected now. + +- uint32: more longs converted to proper types + + I also moved the MAC struct over to the mac.h header file and made sure + that the users of that struct include that file. + +- SFTP: more types to uint32_t + + The 'num_names' field in the SSH_FXP_NAME response is an unsigned 32bit + value so we make sure to treat it like that. + +- SFTP: request_ids are uint32_t + + I went over the code and made sure we use uint32_t all over for the + request_id data. It is an unsigned 32bit value on the wire. + +- SFTP: store request_id separately in packets + + By using a new separate struct for incoming SFTP packets and not sharing + the generic packet struct, we can get rid of an unused field and add a + new one dedicated for holding the request_id for the incoming + package. As sftp_packet_ask() is called fairly often, a "mere" integer + comparison is MUCH faster than the previous memcmp() of (typically) 5 + bytes. + +- libssh2_sftp_open_ex: man page extended and cleaned up + + I added the missing documentation for the 'flags' argument. + +- SFTP: unify the READ/WRITE chunk structs + +- SFTP: fix memory leaks + + Make sure that we cleanup remainders when the handle is closed and when + the subsystem is shutdown. + + Existing flaw: if a single handle sends packets that haven't been + replied to yet at the time when the handle is closed, those packets will + arrive later and end up in the generic packet brigade queue and they + will remain in there until flushed. They will use unnecessary memory, + make things slower and they will ruin the SFTP handling if the + request_id counter ever wraps (highly unlikely to every happen). + +- sftp_close_handle: packet list is generic + + Fix comment, simplify the loop logic + +- sftp_read: pipeline reads + + The SFTP read function now does transfers the same way the SFTP write + function was made to recently: it creates a list of many outgoing + FXP_READ packets that each asks for a small data chunk. The code then + tries to keep sending read request while collecting the acks for the + previous requests and returns the received data. + +- sftp_write: removed unused variable + +- _libssh2_channel_close: don't call transport read if disconnected + + The loop that waits for remote.close to get set may end up looping + forever since session->socket_state gets set to + LIBSSH2_SOCKET_DISCONNECTED by the packet_add() function called from the + transport_read() function and after having been set to + LIBSSH2_SOCKET_DISCONNECTED, the transport_read() function will only + return 0. + + Bug: http://trac.libssh2.org/ticket/198 + +- libssh2_sftp_seek64: new man page + + Split off libssh2_sftp_seek64 from the libssh2_sftp_seek man page, and + mentioned that we consider the latter deprecated. Also added a mention + about the dangers of doing seek during writing or reading. + +- sftp_seek: fix + + The new SFTP write code caused a regression as the seek function no + longer worked as it didn't set the write position properly. + + It should be noted that seeking is STRONGLY PROHIBITED during upload, as + the upload magic uses two different offset positions and the multiple + outstanding packets etc make them sensitive to change in the midst of + operations. + + This functionality was just verified with the new example code + sftp_append. This bug was filed as bug #202: + + Bug: http://trac.libssh2.org/ticket/202 + +- sftp_append: new example doing SFTP append + +- MAX_SFTP_OUTGOING_SIZE: 30000 + + I ran SFTP upload tests against localhost. It showed that to make the + app reach really good speeds, I needed to do a little code tweak and + change MAX_SFTP_OUTGOING_SIZE from 4000 to 30000. The tests I did before + with the high latency tests didn't show any real difference whatever I + had that size set to. + + This number is the size in bytes that libssh2 cuts off the large input + buffer and sends off as an individual sftp packet. + +- sftp_write_sliding.c: new example + + This is an example that is very similar to sftp_write_nonblock.c, with + the exception that this uses + + 1 - a larger upload buffer + + 2 - a sliding buffer mechnism to allow the app to keep sending lots of + data to libssh2 without having to first drain the buffer. + + These are two key issues to make libssh2 SFTP uploads really perform + well at this point in time. + +- cpp: s/#elsif/#elif + + This looks like a typo as #elsif is not really C... + +- _libssh2_channel_write: revert channel_write() use + + The attempts made to have _libssh2_channel_write() accept larger pieces + of data and split up the data by itself into 32700 byte chunks and pass + them on to channel_write() in a loop as a way to do faster operations on + larger data blocks was a failed attempt. + + The reason why it is difficult: + + The API only allows EAGAIN or a length to be returned. When looping over + multiple blocks to get sent, one block can get sent and the next might + not. And yet: when transport_send() has returned EAGAIN we must not call + it again with new data until it has returned OK on the existing data it + is still working on. This makes it a mess and we do get a much easier + job by simply returning the bytes or EAGAIN at once, as in the EAGAIN + case we can assume that we will be called with the same arguments again + and transport_send() will be happy. + + Unfortunately, I think we take a small performance hit by not being able + to do this. + +- ssh2_echo: new example + + This is a new example snippet. The code is largely based on ssh2_exec, + and is written by Tommy Lindgren. I edited it into C90 compliance and to + conform to libssh2 indent style and some more. + +- send_existing: return after send_existing + + When a piece of data is sent from the send_existing() function we must + make the parent function return afterwards. Otherwise we risk that the + parent function tries to send more data and ends up getting an EGAIN for + that more data and since it can only return one return code it doesn't + return info for the successfully sent data. + + As this change is a regression I now added a larger comment explaining + why it has to work like this. + +- _libssh2_channel_write: count resent data as written + + In the logic that resends data that was kept for that purpose due to a + previous EAGAIN, the data was not counted as sent causing badness. + +Peter Stuge (13 Nov 2010) +- Use fprintf(stderr, ) instead of write(2, ) for debugging + +- session/transport: Correctly handle when _libssh2_send() returns -EAGAIN + +- src/agent.c: Simplify _libssh2_send() error checking ever so slightly + +Daniel Stenberg (12 Nov 2010) +- send/recv: use _libssh2_recv and _libssh2_send now + + Starting now, we unconditionally use the internal replacement functions + for send() and recv() - creatively named _libssh2_recv() and + _libssh2_send(). + + On errors, these functions return the negative 'errno' value instead of + the traditional -1. This design allows systems that have no "natural" + errno support to not have to invent it. It also means that no code + outside of these two transfer functions should use the errno variable. + +- channel_write: move some logic to _libssh2_channel_write + + Some checks are better done in _libssh2_channel_write just once per + write instead of in channel_write() since the looping will call the + latter function multiple times per _libssh2_channel_write() invoke. + +- sftp_write: handle "left over" acked data + + The SFTP handle struct now buffers number of acked bytes that haven't + yet been returned. The way this is used is as following: + + 1. sftp_write() gets called with a buffer of let say size 32000. We + split 32000 into 8 smaller packets and send them off one by one. One of + them gets acked before the function returns so 4000 is returned. + + 2. sftp_write() gets called again a short while after the previous one, + now with a much smaller size passed in to the function. Lets say 8000. + In the mean-time, all of the remaining packets from the previous call + have been acked (7*4000 = 28000). This function then returns 8000 as all + data passed in are already sent and it can't return any more than what + it got passed in. But we have 28000 bytes acked. We now store the + remaining 20000 in the handle->u.file.acked struct field to add up in + the next call. + + 3. sftp_write() gets called again, and now there's a backlogged 20000 + bytes to return as fine and that will get skipped from the beginning + of the buffer that is passed in. + +- sftp_write: polished and simplified + + Removed unnecessary struct fields and state changes within the function. + + Made the loop that checks for ACKs only check chunks that were fully + sent. + +- SCP: on failure, show the numerical error reason + + By calling libssh2_session_last_errno() + +- SFTP: provide the numerical error reason on failure + +- SCP: clean up failure treatment + + When SCP send or recv fails, it gets a special message from the server + with a warning or error message included. We have no current API to + expose that message but the foundation is there. Removed unnecessary use + of session struct fields. + +- sftp_write: enlarge buffer to perform better + +- packets: code cleanup + + I added size checks in several places. I fixed the code flow to be easier + to read in some places. + + I removed unnecessary zeroing of structs. I removed unused struct fields. + +- LIBSSH2_CALLBACK_MACERROR: clarify return code use + +- _libssh2_userauth_publickey: avoid shadowing + +- packet: avoid shadowing global symbols + +- sftp_readdir: avoid shadowing + +- shadowing: don't shadow the global compress + +- _libssh2_packet_add: turn ifs into a single switch + +- _libssh2_packet_add: check SSH_MSG_GLOBAL_REQUEST packet + +- _libssh2_packet_add: SSH_MSG_DEBUG length checks + + Verify lengths before using them. Read always_display from the correct + index. Don't copy stuff around just to provide zero-termination of the + strings. + +- _libssh2_packet_add: SSH_MSG_IGNORE skip memmove + + There's no promise of a zero termination of the data in the callback so + no longer perform ugly operation in order to provide it. + +- _libssh2_packet_add: SSH_MSG_DISCONNECT length checks + + Verify lengths before trying to read data. + +- indent: break lines at 80 columns + +- SSH_MSG_CHANNEL_OPEN_FAILURE: used defined values + + We don't like magic numbers in the code. Now the acceptable failure + codes sent in the SSH_MSG_CHANNEL_OPEN_FAILURE message are added as + defined values in the private header file. + +- sftp_write: don't return EAGAIN if no EAGAIN was received + + This function now only returns EAGAIN if a lower layer actually returned + EAGAIN to it. If nothing was acked and no EAGAIN was received, it will + now instead return 0. + +- _libssh2_wait_socket: detect nothing-to-wait-for + + If _libssh2_wait_socket() gets called but there's no direction set to + wait for, this causes a "hang". This code now detects this situation, + set a 1 second timeout instead and outputs a debug output about it. + +- decomp: remove the free_dest argument + + Since the decompress function ALWAYS returns allocated memory we get a + lot simpler code by removing the ability to return data unallocated. + +- decomp: cleaned off old compression stuff + + I cleared off legacy code from when the compression and decompression + functions were a single unified function. Makes the code easier to read + too. + +- [TJ Saunders brought this change] + + decomp: increase decompression buffer sizes + +- [TJ Saunders brought this change] + + zlib: Add debug tracing of zlib errors + +- sftp_packet_read: handle partial reads of the length field + + SFTP packets come as [32 bit length][payload] and the code didn't + previously handle that the initial 32 bit field was read only partially + when it was read. + +- [Jasmeet Bagga brought this change] + + kex_agree_hostkey: fix NULL pointer derefence + + While setting up the session, ssh tries to determine the type of + encryption method it can use for the session. This requires looking at + the keys offered by the remote host and comparing these with the methods + supported by libssh2 (rsa & dss). To do this there is an iteration over + the array containing the methods supported by libssh2. + + If there is no agreement on the type of encryption we come to the 3rd + entry of the hostkeyp array. Here hostkeyp is valid but *hostkep is + NULL. Thus when we dereference that in (*hostkeyp)->name there is a + crash + +- _libssh2_transport_send: remove dead assignment + + 'data' isn't accessed beyond this point so there's no need to assign it. + +- scp_recv: remove dead assignment + + Instead of assigning a variable we won't read, we now use the more + explicit (void) prefix. + +- sftp_write: removed superfluous assignment + +- bugfix: avoid use of uninitialized value + +- sftp_packet_require: propagate error codes better + + There were some chances that they would cause -1 to get returned by + public functions and as we're hunting down all such occurances and since + the underlying functions do return valuable information the code now + passes back proper return codes better. + +- [Alfred Gebert brought this change] + + fix memory leaks (two times cipher_data) for each sftp session + +- libssh2_userauth_authenticated: make it work as documented + + The man page clearly says it returns 1 for "already authenticated" but + the code said non-zero. I changed the code to use 1 now, as that is also + non-zero but it gets the benefit that it now matches the documentation. + + Using 1 instead of non-zero is better for two reasons: + + 1. We have the opportunity to introduce other return codes in the future for + things like error and what not. + 2. We don't expose the internal bitmask variable value. + +- userauth_keyboard_interactive: fix indent + +- [Alfred Gebert brought this change] + + fix memory leak in userauth_keyboard_interactive() + + First I wanted to free the memory in session_free() but then + I had still memory leaks because in my test case the function + userauth_keyboard_interactive() is called twice. It is called + twice perhaps because the server has this authentication + methods available: publickey,gssapi-with-mic,keyboard-interactive + The keyboard-interactive method is successful. + +- dist: include sftp.h in dist archives + +Simon Josefsson (27 Oct 2010) +- Update header to match new function prototype, see c48840ba88. + +Daniel Stenberg (26 Oct 2010) +- bugfixes: the transport rearrange left some subtle flaws now gone + +- libssh2_userauth_publickey_fromfile_ex.3: cleaned up looks + +- libssh2_userauth_publickey: add man page + + I found an undocumented public function and we can't have it like + that. The description here is incomplete, but should serve as a template + to allow filling in... + +- libssh2_sftp_write.3: added blurb about the "write ahead" + + Documented the new SFTP write concept + +- sftp_close_handle: free any trailing write chunks + +- _libssh2_channel_write: fix warnings + +- SFTP: bufgix, move more sftp stuff to sftp.h + + The sftp_write function shouldn't assume that the buffer pointer will be + the same in subsequent calls, even if it assumes that the data already + passed in before haven't changed. + + The sftp structs are now moved to sftp.h (which I forgot to add before) + +- SFTP: use multiple outgoing packets when writing + + sftp_write was rewritten to split up outgoing data into multiple packets + and deal with the acks in a more asynchronous manner. This is meant to + help overcome latency and round-trip problems with the SFTP protocol. + +- TODO: implemented a lot of the ideas now + +- _libssh2_channel_write: removed 32500 size limit + + Neither _libssh2_channel_write nor sftp_write now have the 32500 size + limit anymore and instead the channel writing function now has its own + logic to send data in multiple calls until everything is sent. + +- send_existing: don't tell parent to return when drained + + That will just cause unnecessary code execution. + +- _libssh2_channel_write: general code cleanup + + simplified the function and removed some unused struct fields + +- _libssh2_transport_send: replaces _libssh2_transport_write + + The new function takes two data areas, combines them and sends them as a + single SSH packet. This allows several functions to allocate and copy + less data. + + I also found and fixed a mixed up use of the compression function + arguments that I introduced in my rewrite in a recent commit. + +- scp_write_nonblock: use select() instead of busyloop + + Make this example nicer by not busylooping. + +- send_existing: clear olen when the data is sent off + +- _libssh2_transport_write: allow 256 extra bytes around the packet + +- _libssh2_transport_write: remade to send without malloc + +- compress: compression disabled by default + + We now allow libssh2_session_flag() to enable compression with a new + flag and I added documentation for the previous LIBSSH2_FLAG_SIGPIPE + flag which I wasn't really aware of! + +- comp: split the compress function + + It is now made into two separate compress and decompress functions. In + preparation for upcoming further modficications. + +Dan Fandrich (20 Oct 2010) +- Added header file to allow compiling in older environments + +Daniel Stenberg (20 Oct 2010) +- TODO: add a possible new API for SFTP transfers + +- TODO: "New Transport API" added + +- TODO: add buffering plans + +Simon Josefsson (13 Oct 2010) +- Mention libssh2_channel_get_exit_signal and give kudos. + +- [Tommy Lindgren brought this change] + + Add libssh2_channel_get_exit_signal man page. + + Signed-off-by: Simon Josefsson + +- [Tommy Lindgren brought this change] + + Add libssh2_channel_get_exit_signal. + + Signed-off-by: Simon Josefsson + +- Add libssh2_free man page and fix typo. + +- Add libssh2_free. + +Daniel Stenberg (11 Oct 2010) +- scp_recv: improved treatment of channel_read() returning zero + + As a zero return code from channel_read() is not an error we must make + sure that the SCP functions deal with that properly. channel_read() + always returns 0 if the channel is EOFed already so we check for EOF + after 0-reads to be able to return error properly. + +- libssh2_session_methods.3: detail what can be asked for + +- compression: send zlib before none + + As the list of algorithms in a preferred order we should send zlib + before none to increase the chances that the server will let us do + compression. + +- compress: faster check, better return codes + + In the transport functions we avoid a strcmp() now and just check a + boolean instead. + + The compress/decompress function's return code is now acknowledged and + used as actual return code in case of failures. + +- libssh2_session_handshake: replaces libssh2_session_startup() + + The function libssh2_session_startup() is now considered deprecated due + to the portability issue with the socket argument. + libssh2_session_handshake() is the name of the replacement. + +- libssh2_socket_t: now externally visible + + In preparation for upcominig changes, the libssh2_socket_t type is now + typedef'ed in the public header. + +- _libssh2_transport_drain: removed + + This function proved not to be used nor useful. + +- _libssh2_channel_write: don't iterate over transport writes + + When a call to _libssh2_transport_write() succeeds, we must return from + _libssh2_channel_write() to allow the caller to provide the next chunk + of data. + + We cannot move on to send the next piece of data that may already have + been provided in this same function call, as we risk getting EAGAIN for + that and we can't return information both about sent data as well as + EAGAIN. So, by returning short now, the caller will call this function + again with new data to send. + +- _libssh2_transport_write: updated documentation blurb + +- _libssh2_transport_write: remove fprintf remainder + + Mistake from previous debugging + +- session: improved errors + + Replaced -1/SOCKET_NONE errors with appropriate error defines instead. + + Made the verbose trace output during banner receiving less annoying for + non-blocking sessions. + +- crypt_init: use correct error define + +- _libssh2_error: hide EAGAIN for non-blocking sessions + + In an attempt to make the trace output less cluttered for non-blocking + sessions the error function now avoids calling the debug function if the + error is the EAGAIN and the session is non-blocking. + +- agent: use better error defines + +- comp_method_zlib_init: use correct error defines + +- transport: better error codes + + LIBSSH2_SOCKET_NONE (-1) should no longer be used as error code as it is + (too) generic and we should instead use specific and dedicated error + codes to better describe the error. + +- channel: return code and _libssh2_error cleanup + + Made sure that all transport_write() call failures get _libssh2_error + called. + +- _libssh2_channel_write: limit to 32700 bytes + + The well known and used ssh server Dropbear has a maximum SSH packet + length at 32768 by default. Since the libssh2 design current have a + fixed one-to-one mapping from channel_write() to the packet size created + by transport_write() the previous limit of 32768 in the channel layer + caused the transport layer to create larger packets than 32768 at times + which Dropbear rejected forcibly (by closing the connection). + + The long term fix is of course to remove the hard relation between the + outgoing SSH packet size and what the input length argument is in the + transport_write() function call. + +- libssh.h: add more dedicated error codes + +- SCP: allow file names with bytes > 126 + + When parsing the SCP protocol and verifying that the data looks like a + valid file name, byte values over 126 must not be consider illegal since + UTF-8 file names will use such codes. + + Reported by: Uli Zappe + Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2010-08/0112.shtml + +Dan Fandrich (25 Aug 2010) +- Document the three sftp stat constants + +Guenter Knauf (18 Aug 2010) +- Fixed Win32 makefile which was now broken at resource build. + +- It is sufficient to pipe stderr to NUL to get rid of the nasty messages. + +- [Author: Guenter Knauf brought this change] + + Removed Win32 ifdef completely for sys/uio.h. + + No idea why we had this ifdef at all but MSVC, MingW32, Watcom + and Borland all have no sys/uio.h header; so if there's another + Win32 compiler which needs it then it should be added explicitely + instead of this negative list. + +- New files should also be added to Makefile.am. + + Otherwise they will never be included with release and snapshot tarballs ... + +Daniel Stenberg (18 Aug 2010) +- version: bump to 1.2.8_DEV + +Version 1.2.7 (17 Aug 2010) + +Daniel Stenberg (17 Aug 2010) +- release: updated to hold 1.2.7 info + +Guenter Knauf (17 Aug 2010) +- Use the new libssh2.rc file. + +- Added resource file for libssh2.dll (shamelessly stolen from libcurl). + +- Updated Win32 MSVC dependencies versions. + +- Added include for sys/select.h to get fd.set on some platforms. + +- Added Watcom makefile borrowed from libcurl. + + This makefile compiles already all files fine for static lib, but needs + final touch when I have OpenSSL fully working with shared libs and Watcom. + +- Added copyright define to libssh2.h and use it for binary builds. + +- Moved version defines up in order to include from .rc file. + + Blocked rest of header with ifndef so its possible to let + the rc compiler only use the version defines. + +- Some minor makefile tweaks. + +Daniel Stenberg (2 Aug 2010) +- example: treat the libssh2_channel_read() return code properly + + A short read is not an error. Only negative values are errors! + +- libssh2_wait_socket: reset error code to "leak" EAGAIN less + + Since libssh2 often sets LIBSSH2_ERROR_EAGAIN internally before + _libssh2_wait_socket is called, we can decrease some amount of + confusion in user programs by resetting the error code in this function + to reduce the risk of EAGAIN being stored as error when a blocking + function returns. + +- _libssh2_wait_socket: poll needs milliseconds + + As reported on the mailing list, the code path using poll() should + multiple seconds with 1000 to get milliseconds, not divide! + + Reported by: Jan Van Boghout + +- typedef: make ssize_t get typedef without LIBSSH2_WIN32 + + The condition around the ssize_t typedef depended on both LIBSSH2_WIN32 + *and* _MSC_VER being defined when it should be enough to depend on + _MSC_VER only. It also makes it nicer so libssh2-using code builds fine + without having custom defines. + +- [John Little brought this change] + + session_free: free more data to avoid memory leaks + +- channel_free: ignore problems with channel_close() + + As was pointed out in bug #182, we must not return failure from + _libssh2_channel_free() when _libssh2_channel_close() returns an error + that isn't EAGAIN. It can effectively cause the function to never go + through, like it did now in the case where the socket was actually + closed but socket_state still said LIBSSH2_SOCKET_CONNECTED. + + I consider this fix the right thing as it now also survives other + errors, even if making sure socket_state isn't lying is also a good + idea. + +- publickey_list_free: no return value from a void function + + Fixed a compiler warning I introduced previously when checking input + arguments more. I also added a check for the other pointer to avoid NULL + pointer dereferences. + +- [Lars Nordin brought this change] + + openssl: make use of the EVP interface + + Make use of the EVP interface for the AES-funktion. Using this method + supports the use of different ENGINES in OpenSSL for the AES function + (and the direct call to the AES_encrypt should not be used according to + openssl.org) + +Peter Stuge (23 Jun 2010) +- [Tor Arntsen brought this change] + + Don't overflow MD5 server hostkey + + Use SHA_DIGEST_LENGTH and MD5_DIGEST_LENGTH in memcpy instead of hardcoded + values. An incorrect value was used for MD5. + +- Fix message length bugs in libssh2_debug() + + There was a buffer overflow waiting to happen when a debug message was + longer than 1536 bytes. + + Thanks to Daniel who spotted that there was a problem with the message + length passed to a trace handler also after commit + 0f0652a3093111fc7dac0205fdcf8d02bf16e89f. + +- Make libssh2_debug() create a correctly terminated string + + Also use FILE *stderr rather than fd 2, which can very well be something + completely different. + +Daniel Stenberg (23 Jun 2010) +- [TJ Saunders brought this change] + + handshake: Compression enabled at the wrong time + + In KEXINIT messages, the client and server agree on, among other + things, whether to use compression. This method agreement occurs + in src/kex.c's kex_agree_methods() function. However, if + compression is enabled (either client->server, server->client, or + both), then the compression layer is initialized in + kex_agree_methods() -- before NEWKEYS has been received. + + Instead, the initialization of the compression layer should + happen after NEWKEYS has been received. This looks to occur + insrc/kex.c's diffie_hellman_sha1(), which even has the comment: + + /* The first key exchange has been performed, + + switch to active crypt/comp/mac mode */ + + There, after NEWKEYS is received, the cipher and mac algorithms + are initialized, and that is where the compression should be + initialized as well. + + The current implementation fails if server->client compression is + enabled because most server implementations follow OpenSSH's + lead, where compression is initialized after NEWKEYS. Since the + server initializes compression after NEWKEYS, but libssh2 + initializes compression after KEXINIT (i.e. before NEWKEYS), they + are out of sync. + + Reported in bug report #180 + +- [TJ Saunders brought this change] + + userauth_hostbased_fromfile: packet length too short + + The packet length calculated in src/userauth.c's + userauth_hostbased_fromfile() function is too short by 4 bytes; + it forgets to add four bytes for the length of the hostname. + This causes hostbased authentication to fail, since the server + will read junk data. + + verified against proftpd's mod_sftp module + +- _libssh2_userauth_publickey: reject method names longer than the data + + This functions get the method length by looking at the first 32 + bit of data, and I now made it not accept method lengths that are + longer than the whole data set is, as given in the dedicated + function argument. + + This was detected when the function was given bogus public key + data as an ascii string, which caused the first 32bits to create + a HUGE number. + +- NULL resistance: make more public functions survive NULL pointer input + + Sending in NULL as the primary pointer is now dealt with by more + public functions. I also narrowed the userauth.c code somewhat to + stay within 80 columns better. + +- agent: make libssh2_agent_userauth() work blocking properly + + previously it would always work in a non-blocking manner + +Peter Stuge (17 Jun 2010) +- Fix underscore typo for 64-bit printf format specifiers on Windows + + Commit 49ddf447ff4bd80285f926eac0115f4e595f9425 was missing underscores. + +Daniel Stenberg (16 Jun 2010) +- libssh2_session_callback_set: extended the man page diff --git a/vendor/libssh2/NMakefile b/vendor/libssh2/NMakefile new file mode 100644 index 0000000000..07bc2ddad1 --- /dev/null +++ b/vendor/libssh2/NMakefile @@ -0,0 +1,33 @@ +!include "win32/config.mk" + +!if "$(WITH_WINCNG)" == "1" +!include "Makefile.WinCNG.inc" +!else +!include "Makefile.OpenSSL.inc" +!endif +!include "Makefile.inc" + +OBJECTS=$(CSOURCES:.c=.obj) + +# SUBDIRS=src example +SUBDIRS=src + +all-sub: win32\objects.mk + -for %D in ($(SUBDIRS)) do $(MAKE) /nologo /f %D/NMakefile BUILD=$(BUILD) SUBDIR=%D all-sub + +clean: + -rmdir 2>NUL /s/q $(TARGET) + -del 2>NUL win32\objects.mk + +real-clean vclean: clean + -del 2>NUL libssh2.dll + -del 2>NUL libssh2.exp + -del 2>NUL libssh2.ilk + -del 2>NUL libssh2.lib + -del 2>NUL *.pdb + +win32\objects.mk: Makefile.inc + @echo OBJECTS = \>$@ + @for %O in ($(OBJECTS)) do @echo $$(INTDIR)\%O \>>$@ + @echo $$(EOL)>>$@ + diff --git a/vendor/libssh2/README b/vendor/libssh2/README new file mode 100644 index 0000000000..8a148568cf --- /dev/null +++ b/vendor/libssh2/README @@ -0,0 +1,19 @@ +libssh2 - SSH2 library +====================== + +libssh2 is a library implementing the SSH2 protocol, available under +the revised BSD license. + +Web site: https://www.libssh2.org/ + +Mailing list: https://cool.haxx.se/mailman/listinfo/libssh2-devel + +License: see COPYING + +Source code: https://github.com/libssh2/libssh2 + +Web site source code: https://github.com/libssh2/www + +Installation instructions are in: + - docs/INSTALL_CMAKE for CMake + - docs/INSTALL_AUTOTOOLS for Autotools diff --git a/vendor/libssh2/RELEASE-NOTES b/vendor/libssh2/RELEASE-NOTES new file mode 100644 index 0000000000..62064a9fe6 --- /dev/null +++ b/vendor/libssh2/RELEASE-NOTES @@ -0,0 +1,62 @@ +libssh2 1.10 + +This release includes the following enhancements and bugfixes: + + o adds agent forwarding support + o adds OpenSSH Agent support on Windows + o adds ECDSA key support using the Mbed TLS backend + o adds ECDSA cert authentication + o adds diffie-hellman-group14-sha256, diffie-hellman-group16-sha512, + diffie-hellman-group18-sha512 key exchanges + o adds support for PKIX key reading when using ed25519 with OpenSSL + o adds support for EWOULDBLOCK on VMS systems + o adds support for building with OpenSSL 3 + o adds support for using FIPS mode in OpenSSL + o adds debug symbols when building with MSVC + o adds support for building on the 3DS + o adds unicode build support on Windows + o restores os400 building + o increases min, max and opt Diffie Hellman group values + o improves portiablity of the make file + o improves timeout behavior with 2FA keyboard auth + o various improvements to the Wincng backend + o fixes reading parital packet replies when using an agent + o fixes Diffie Hellman key exchange on Windows 1903+ builds + o fixes building tests with older versions of OpenSSL + o fixes possible multiple definition warnings + o fixes potential cast issues _libssh2_ecdsa_key_get_curve_type() + o fixes potential use after free if libssh2_init() is called twice + o improved linking when using Mbed TLS + o fixes call to libssh2_crypto_exit() if crypto hasn't been initialized + o fixes crash when loading public keys with no id + o fixes possible out of bounds read when exchanging keys + o fixes possible out of bounds read when reading packets + o fixes possible out of bounds read when opening an X11 connection + o fixes possible out of bounds read when ecdh host keys + o fixes possible hang when trying to read a disconnected socket + o fixes a crash when using the delayed compression option + o fixes read error with large known host entries + o fixes various warnings + o fixes various small memory leaks + o improved error handling, various detailed errors will now be reported + o builds are now using OSS-Fuzz + o builds now use autoreconf instead of a custom build script + o cmake now respects install directory + o improved CI backend + o updated HACKING-CRYPTO documentation + o use markdown file extensions + o improved unit tests + +This release would not have looked like this without help, code, reports and +advice from friends like these: + + katzer, Orgad Shaneh, mark-i-m, Zenju, axjowa, Thilo Schulz, + Etienne Samson, hlefebvre, seba30, Panos, jethrogb, Fabrice Fontaine, + Will Cosgrove, Daniel Stenberg, Michael Buckley, Wallace Souza Silva, + Romain-Geissler-1A, meierha, Tseng Jun, Thomas Klausner, Brendan Shanks, + Harry Sintonen, monnerat, Koutheir Attouchi, Marc Hörsken, yann-morin-1998, + Wez Furlong, TDi-jonesds, David Benjamin, Max Dymond, Igor Klevanets, + Viktor Szakats, Laurent Stacul, Mstrodl, Gabriel Smith, MarcT512, + Paul Capron, teottin, Tor Erik Ottinsen, Brian Inglis + + (40 contributors) diff --git a/vendor/libssh2/acinclude.m4 b/vendor/libssh2/acinclude.m4 new file mode 100644 index 0000000000..2066f0ec9b --- /dev/null +++ b/vendor/libssh2/acinclude.m4 @@ -0,0 +1,512 @@ + +dnl ********************************************************************** +dnl CURL_DETECT_ICC ([ACTION-IF-YES]) +dnl +dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES +dnl sets the $ICC variable to "yes" or "no" +dnl ********************************************************************** +AC_DEFUN([CURL_DETECT_ICC], +[ + ICC="no" + AC_MSG_CHECKING([for icc in use]) + if test "$GCC" = "yes"; then + dnl check if this is icc acting as gcc in disguise + AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER], + dnl action if the text is found, this it has not been replaced by the + dnl cpp + ICC="no", + dnl the text was not found, it was replaced by the cpp + ICC="yes" + AC_MSG_RESULT([yes]) + [$1] + ) + fi + if test "$ICC" = "no"; then + # this is not ICC + AC_MSG_RESULT([no]) + fi +]) + +dnl We create a function for detecting which compiler we use and then set as +dnl pendantic compiler options as possible for that particular compiler. The +dnl options are only used for debug-builds. + +AC_DEFUN([CURL_CC_DEBUG_OPTS], +[ + if test "z$ICC" = "z"; then + CURL_DETECT_ICC + fi + + if test "$GCC" = "yes"; then + + dnl figure out gcc version! + AC_MSG_CHECKING([gcc version]) + gccver=`$CC -dumpversion` + num1=`echo $gccver | cut -d . -f1` + num2=`echo $gccver | cut -d . -f2` + gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null` + AC_MSG_RESULT($gccver) + + if test "$ICC" = "yes"; then + dnl this is icc, not gcc. + + dnl ICC warnings we ignore: + dnl * 269 warns on our "%Od" printf formatters for curl_off_t output: + dnl "invalid format string conversion" + dnl * 279 warns on static conditions in while expressions + dnl * 981 warns on "operands are evaluated in unspecified order" + dnl * 1418 "external definition with no prior declaration" + dnl * 1419 warns on "external declaration in primary source file" + dnl which we know and do on purpose. + + WARN="-wd279,269,981,1418,1419" + + if test "$gccnum" -gt "600"; then + dnl icc 6.0 and older doesn't have the -Wall flag + WARN="-Wall $WARN" + fi + else dnl $ICC = yes + dnl this is a set of options we believe *ALL* gcc versions support: + WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes" + + dnl -Wcast-align is a bit too annoying on all gcc versions ;-) + + if test "$gccnum" -ge "207"; then + dnl gcc 2.7 or later + WARN="$WARN -Wmissing-declarations" + fi + + if test "$gccnum" -gt "295"; then + dnl only if the compiler is newer than 2.95 since we got lots of + dnl "`_POSIX_C_SOURCE' is not defined" in system headers with + dnl gcc 2.95.4 on FreeBSD 4.9! + WARN="$WARN -Wundef -Wno-long-long -Wsign-compare" + fi + + if test "$gccnum" -ge "296"; then + dnl gcc 2.96 or later + WARN="$WARN -Wfloat-equal" + fi + + if test "$gccnum" -gt "296"; then + dnl this option does not exist in 2.96 + WARN="$WARN -Wno-format-nonliteral" + fi + + dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on + dnl on i686-Linux as it gives us heaps with false positives. + dnl Also, on gcc 4.0.X it is totally unbearable and complains all + dnl over making it unusable for generic purposes. Let's not use it. + + if test "$gccnum" -ge "303"; then + dnl gcc 3.3 and later + WARN="$WARN -Wendif-labels -Wstrict-prototypes" + fi + + if test "$gccnum" -ge "304"; then + # try these on gcc 3.4 + WARN="$WARN -Wdeclaration-after-statement" + fi + + for flag in $CPPFLAGS; do + case "$flag" in + -I*) + dnl Include path, provide a -isystem option for the same dir + dnl to prevent warnings in those dirs. The -isystem was not very + dnl reliable on earlier gcc versions. + add=`echo $flag | sed 's/^-I/-isystem /g'` + WARN="$WARN $add" + ;; + esac + done + + fi dnl $ICC = no + + CFLAGS="$CFLAGS $WARN" + + AC_MSG_NOTICE([Added this set of compiler options: $WARN]) + + else dnl $GCC = yes + + AC_MSG_NOTICE([Added no extra compiler options]) + + fi dnl $GCC = yes + + dnl strip off optimizer flags + NEWFLAGS="" + for flag in $CFLAGS; do + case "$flag" in + -O*) + dnl echo "cut off $flag" + ;; + *) + NEWFLAGS="$NEWFLAGS $flag" + ;; + esac + done + CFLAGS=$NEWFLAGS + +]) dnl end of AC_DEFUN() + +dnl CURL_CHECK_NONBLOCKING_SOCKET +dnl ------------------------------------------------- +dnl Check for how to set a socket to non-blocking state. There seems to exist +dnl four known different ways, with the one used almost everywhere being POSIX +dnl and XPG3, while the other different ways for different systems (old BSD, +dnl Windows and Amiga). +dnl +dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the +dnl O_NONBLOCK define is found but does not work. This condition is attempted +dnl to get caught in this script by using an excessive number of #ifdefs... +dnl +AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], +[ + AC_MSG_CHECKING([non-blocking sockets style]) + + AC_TRY_COMPILE([ +/* headers for O_NONBLOCK test */ +#include +#include +#include +],[ +/* try to compile O_NONBLOCK */ + +#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__SVR4) || defined(__srv4__) +# define PLATFORM_SOLARIS +# else +# define PLATFORM_SUNOS4 +# endif +#endif +#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41) +# define PLATFORM_AIX_V3 +#endif + +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__) +#error "O_NONBLOCK does not work on this platform" +#endif + int socket; + int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); +],[ +dnl the O_NONBLOCK test was fine +nonblock="O_NONBLOCK" +AC_DEFINE(HAVE_O_NONBLOCK, 1, [use O_NONBLOCK for non-blocking sockets]) +],[ +dnl the code was bad, try a different program now, test 2 + + AC_TRY_COMPILE([ +/* headers for FIONBIO test */ +#include +#include +],[ +/* FIONBIO source test (old-style unix) */ + int socket; + int flags = ioctl(socket, FIONBIO, &flags); +],[ +dnl FIONBIO test was good +nonblock="FIONBIO" +AC_DEFINE(HAVE_FIONBIO, 1, [use FIONBIO for non-blocking sockets]) +],[ +dnl FIONBIO test was also bad +dnl the code was bad, try a different program now, test 3 + + AC_TRY_COMPILE([ +/* headers for ioctlsocket test (Windows) */ +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#ifdef HAVE_WINSOCK2_H +#include +#else +#ifdef HAVE_WINSOCK_H +#include +#endif +#endif +#endif +],[ +/* ioctlsocket source code */ + SOCKET sd; + unsigned long flags = 0; + sd = socket(0, 0, 0); + ioctlsocket(sd, FIONBIO, &flags); +],[ +dnl ioctlsocket test was good +nonblock="ioctlsocket" +AC_DEFINE(HAVE_IOCTLSOCKET, 1, [use ioctlsocket() for non-blocking sockets]) +],[ +dnl ioctlsocket didnt compile!, go to test 4 + + AC_TRY_LINK([ +/* headers for IoctlSocket test (Amiga?) */ +#include +],[ +/* IoctlSocket source code */ + int socket; + int flags = IoctlSocket(socket, FIONBIO, (long)1); +],[ +dnl ioctlsocket test was good +nonblock="IoctlSocket" +AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1, [use Ioctlsocket() for non-blocking sockets]) +],[ +dnl Ioctlsocket didnt compile, do test 5! + AC_TRY_COMPILE([ +/* headers for SO_NONBLOCK test (BeOS) */ +#include +],[ +/* SO_NONBLOCK source code */ + long b = 1; + int socket; + int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); +],[ +dnl the SO_NONBLOCK test was good +nonblock="SO_NONBLOCK" +AC_DEFINE(HAVE_SO_NONBLOCK, 1, [use SO_NONBLOCK for non-blocking sockets]) +],[ +dnl test 5 didnt compile! +nonblock="nada" +AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1, [disabled non-blocking sockets]) +]) +dnl end of fifth test + +]) +dnl end of forth test + +]) +dnl end of third test + +]) +dnl end of second test + +]) +dnl end of non-blocking try-compile test + AC_MSG_RESULT($nonblock) + + if test "$nonblock" = "nada"; then + AC_MSG_WARN([non-block sockets disabled]) + fi +]) + +dnl CURL_CHECK_NEED_REENTRANT_SYSTEM +dnl ------------------------------------------------- +dnl Checks if the preprocessor _REENTRANT definition +dnl must be unconditionally done for this platform. +dnl Internal macro for CURL_CONFIGURE_REENTRANT. + +AC_DEFUN([CURL_CHECK_NEED_REENTRANT_SYSTEM], [ + case $host in + *-*-solaris* | *-*-hpux*) + tmp_need_reentrant="yes" + ;; + *) + tmp_need_reentrant="no" + ;; + esac +]) + + +dnl CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT +dnl ------------------------------------------------- +dnl This macro ensures that configuration tests done +dnl after this will execute with preprocessor symbol +dnl _REENTRANT defined. This macro also ensures that +dnl the generated config file defines NEED_REENTRANT +dnl and that in turn setup.h will define _REENTRANT. +dnl Internal macro for CURL_CONFIGURE_REENTRANT. + +AC_DEFUN([CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [ +AC_DEFINE(NEED_REENTRANT, 1, + [Define to 1 if _REENTRANT preprocessor symbol must be defined.]) +cat >>confdefs.h <<_EOF +#ifndef _REENTRANT +# define _REENTRANT +#endif +_EOF +]) + + +dnl CURL_CONFIGURE_REENTRANT +dnl ------------------------------------------------- +dnl This first checks if the preprocessor _REENTRANT +dnl symbol is already defined. If it isn't currently +dnl defined a set of checks are performed to verify +dnl if its definition is required to make visible to +dnl the compiler a set of *_r functions. Finally, if +dnl _REENTRANT is already defined or needed it takes +dnl care of making adjustments necessary to ensure +dnl that it is defined equally for further configure +dnl tests and generated config file. + +AC_DEFUN([CURL_CONFIGURE_REENTRANT], [ + AC_PREREQ([2.50])dnl + # + AC_MSG_CHECKING([if _REENTRANT is already defined]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ +#ifdef _REENTRANT + int dummy=1; +#else + force compilation error +#endif + ]]) + ],[ + AC_MSG_RESULT([yes]) + tmp_reentrant_initially_defined="yes" + ],[ + AC_MSG_RESULT([no]) + tmp_reentrant_initially_defined="no" + ]) + # + if test "$tmp_reentrant_initially_defined" = "no"; then + AC_MSG_CHECKING([if _REENTRANT is actually needed]) + CURL_CHECK_NEED_REENTRANT_SYSTEM + + if test "$tmp_need_reentrant" = "yes"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi + # + AC_MSG_CHECKING([if _REENTRANT is onwards defined]) + if test "$tmp_reentrant_initially_defined" = "yes" || + test "$tmp_need_reentrant" = "yes"; then + CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + # +]) + +dnl LIBSSH2_LIB_HAVE_LINKFLAGS +dnl -------------------------- +dnl Wrapper around AC_LIB_HAVE_LINKFLAGS to also check $prefix/lib, if set. +dnl +dnl autoconf only checks $prefix/lib64 if gcc -print-search-dirs output +dnl includes a directory named lib64. So, to find libraries in $prefix/lib +dnl we append -L$prefix/lib to LDFLAGS before checking. +dnl +dnl For conveniece, $4 is expanded if [lib]$1 is found. + +AC_DEFUN([LIBSSH2_LIB_HAVE_LINKFLAGS], [ + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_lib$1_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_lib$1_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_lib$1_prefix}/lib" + fi + + AC_LIB_HAVE_LINKFLAGS([$1], [$2], [$3]) + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_lib$1" = "yes"; then : + $4 + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi +]) + +AC_DEFUN([LIBSSH2_CHECK_CRYPTO], [ +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "$1"; then +m4_case([$1], +[openssl], [ + LIBSSH2_LIB_HAVE_LINKFLAGS([ssl], [crypto], [#include ], [ + AC_DEFINE(LIBSSH2_OPENSSL, 1, [Use $1]) + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libssl libcrypto" + + # Not all OpenSSL have AES-CTR functions. + libssh2_save_LIBS="$LIBS" + LIBS="$LIBS $LIBSSL" + AC_CHECK_FUNCS(EVP_aes_128_ctr) + LIBS="$libssh2_save_LIBS" + + found_crypto="$1" + found_crypto_str="OpenSSL (AES-CTR: ${ac_cv_func_EVP_aes_128_ctr:-N/A})" + ]) +], + +[libgcrypt], [ + LIBSSH2_LIB_HAVE_LINKFLAGS([gcrypt], [], [#include ], [ + AC_DEFINE(LIBSSH2_LIBGCRYPT, 1, [Use $1]) + found_crypto="$1" + ]) +], + +[mbedtls], [ + LIBSSH2_LIB_HAVE_LINKFLAGS([mbedcrypto], [], [#include ], [ + AC_DEFINE(LIBSSH2_MBEDTLS, 1, [Use $1]) + LIBS="$LIBS -lmbedcrypto" + found_crypto="$1" + support_clear_memory=yes + ]) +], + +[wincng], [ + # Look for Windows Cryptography API: Next Generation + + AC_CHECK_HEADERS([ntdef.h ntstatus.h], [], [], [#include ]) + AC_CHECK_DECLS([SecureZeroMemory], [], [], [#include ]) + + LIBSSH2_LIB_HAVE_LINKFLAGS([crypt32], [], [ + #include + #include + ]) + LIBSSH2_LIB_HAVE_LINKFLAGS([bcrypt], [], [ + #include + #include + ], [ + AC_DEFINE(LIBSSH2_WINCNG, 1, [Use $1]) + found_crypto="$1" + found_crypto_str="Windows Cryptography API: Next Generation" + support_clear_memory="$ac_cv_have_decl_SecureZeroMemory" + ]) +], +) + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No $1 crypto library found! +" +fi +]) + + +dnl LIBSSH2_CHECK_OPTION_WERROR +dnl ------------------------------------------------- +dnl Verify if configure has been invoked with option +dnl --enable-werror or --disable-werror, and set +dnl shell variable want_werror as appropriate. + +AC_DEFUN([LIBSSH2_CHECK_OPTION_WERROR], [ + AC_BEFORE([$0],[LIBSSH2_CHECK_COMPILER])dnl + AC_MSG_CHECKING([whether to enable compiler warnings as errors]) + OPT_COMPILER_WERROR="default" + AC_ARG_ENABLE(werror, +AC_HELP_STRING([--enable-werror],[Enable compiler warnings as errors]) +AC_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]), + OPT_COMPILER_WERROR=$enableval) + case "$OPT_COMPILER_WERROR" in + no) + dnl --disable-werror option used + want_werror="no" + ;; + default) + dnl configure option not specified + want_werror="no" + ;; + *) + dnl --enable-werror option used + want_werror="yes" + ;; + esac + AC_MSG_RESULT([$want_werror]) + + if test X"$want_werror" = Xyes; then + CFLAGS="$CFLAGS -Werror" + fi +]) + diff --git a/vendor/libssh2/aclocal.m4 b/vendor/libssh2/aclocal.m4 new file mode 100644 index 0000000000..fc56a693e4 --- /dev/null +++ b/vendor/libssh2/aclocal.m4 @@ -0,0 +1,1192 @@ +# generated automatically by aclocal 1.16.4 -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.4], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.4])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/autobuild.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([acinclude.m4]) diff --git a/vendor/libssh2/cmake/CheckFunctionExistsMayNeedLibrary.cmake b/vendor/libssh2/cmake/CheckFunctionExistsMayNeedLibrary.cmake new file mode 100644 index 0000000000..8ac61abe5e --- /dev/null +++ b/vendor/libssh2/cmake/CheckFunctionExistsMayNeedLibrary.cmake @@ -0,0 +1,81 @@ +# Copyright (c) 2014 Alexander Lamaison +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided +# that the following conditions are met: +# +# Redistributions of source code must retain the above +# copyright notice, this list of conditions and the +# following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# Neither the name of the copyright holder nor the names +# of any other contributors may be used to endorse or +# promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + + +# - check_function_exists_maybe_need_library( [lib1 ... libn]) +# +# Check if function is available for linking, first without extra libraries, and +# then, if not found that way, linking in each optional library as well. This +# function is similar to autotools AC_SEARCH_LIBS. +# +# If the function if found, this will define . +# +# If the function was only found by linking in an additional library, this +# will define NEED_LIB_LIBX, where LIBX is the one of lib1 to libn that +# makes the function available, in uppercase. +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories +# CMAKE_REQUIRED_LIBRARIES = list of libraries to link +# + +include(CheckFunctionExists) +include(CheckLibraryExists) + +function(check_function_exists_may_need_library function variable) + + check_function_exists(${function} ${variable}) + + if(NOT ${variable}) + foreach(lib ${ARGN}) + string(TOUPPER ${lib} UP_LIB) + # Use new variable to prevent cache from previous step shortcircuiting + # new test + check_library_exists(${lib} ${function} "" HAVE_${function}_IN_${lib}) + if(HAVE_${function}_IN_${lib}) + set(${variable} 1 CACHE INTERNAL + "Function ${function} found in library ${lib}") + set(NEED_LIB_${UP_LIB} 1 CACHE INTERNAL + "Need to link ${lib}") + break() + endif() + endforeach() + endif() + +endfunction() \ No newline at end of file diff --git a/vendor/libssh2/cmake/CheckNonblockingSocketSupport.cmake b/vendor/libssh2/cmake/CheckNonblockingSocketSupport.cmake new file mode 100644 index 0000000000..74f4776a68 --- /dev/null +++ b/vendor/libssh2/cmake/CheckNonblockingSocketSupport.cmake @@ -0,0 +1,119 @@ +include(CheckCSourceCompiles) + +# - check_nonblocking_socket_support() +# +# Check for how to set a socket to non-blocking state. There seems to exist +# four known different ways, with the one used almost everywhere being POSIX +# and XPG3, while the other different ways for different systems (old BSD, +# Windows and Amiga). +# +# One of the following variables will be set indicating the supported +# method (if any): +# HAVE_O_NONBLOCK +# HAVE_FIONBIO +# HAVE_IOCTLSOCKET +# HAVE_IOCTLSOCKET_CASE +# HAVE_SO_NONBLOCK +# HAVE_DISABLED_NONBLOCKING +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories +# CMAKE_REQUIRED_LIBRARIES = list of libraries to link +# +macro(check_nonblocking_socket_support) + # There are two known platforms (AIX 3.x and SunOS 4.1.x) where the + # O_NONBLOCK define is found but does not work. + check_c_source_compiles(" +#include +#include +#include + +#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__SVR4) || defined(__srv4__) +# define PLATFORM_SOLARIS +# else +# define PLATFORM_SUNOS4 +# endif +#endif +#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41) +# define PLATFORM_AIX_V3 +#endif + +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__) +#error \"O_NONBLOCK does not work on this platform\" +#endif + +int main() +{ + int socket; + int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); +}" + HAVE_O_NONBLOCK) + + if(NOT HAVE_O_NONBLOCK) + check_c_source_compiles("/* FIONBIO test (old-style unix) */ +#include +#include + +int main() +{ + int socket; + int flags = ioctl(socket, FIONBIO, &flags); +}" + HAVE_FIONBIO) + + if(NOT HAVE_FIONBIO) + check_c_source_compiles("/* ioctlsocket test (Windows) */ +#undef inline +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include +#include + +int main() +{ + SOCKET sd; + unsigned long flags = 0; + sd = socket(0, 0, 0); + ioctlsocket(sd, FIONBIO, &flags); +}" + HAVE_IOCTLSOCKET) + + if(NOT HAVE_IOCTLSOCKET) + check_c_source_compiles("/* IoctlSocket test (Amiga?) */ +#include + +int main() +{ + int socket; + int flags = IoctlSocket(socket, FIONBIO, (long)1); +}" + HAVE_IOCTLSOCKET_CASE) + + if(NOT HAVE_IOCTLSOCKET_CASE) + check_c_source_compiles("/* SO_NONBLOCK test (BeOS) */ +#include + +int main() +{ + long b = 1; + int socket; + int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); +}" + HAVE_SO_NONBLOCK) + + if(NOT HAVE_SO_NONBLOCK) + # No non-blocking socket method found + set(HAVE_DISABLED_NONBLOCKING 1) + endif() + endif() + endif() + endif() + endif() +endmacro() \ No newline at end of file diff --git a/vendor/libssh2/cmake/CopyRuntimeDependencies.cmake b/vendor/libssh2/cmake/CopyRuntimeDependencies.cmake new file mode 100644 index 0000000000..083f762686 --- /dev/null +++ b/vendor/libssh2/cmake/CopyRuntimeDependencies.cmake @@ -0,0 +1,72 @@ +# Copyright (c) 2014 Alexander Lamaison +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided +# that the following conditions are met: +# +# Redistributions of source code must retain the above +# copyright notice, this list of conditions and the +# following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# Neither the name of the copyright holder nor the names +# of any other contributors may be used to endorse or +# promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + +include(CMakeParseArguments) + +function(ADD_TARGET_TO_COPY_DEPENDENCIES) + set(options) + set(oneValueArgs TARGET) + set(multiValueArgs DEPENDENCIES BEFORE_TARGETS) + cmake_parse_arguments(COPY + "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(NOT COPY_DEPENDENCIES) + return() + endif() + + # Using a custom target to drive custom commands stops multiple + # parallel builds trying to kick off the commands at the same time + add_custom_target(${COPY_TARGET}) + + foreach(target ${COPY_BEFORE_TARGETS}) + add_dependencies(${target} ${COPY_TARGET}) + endforeach() + + foreach(dependency ${COPY_DEPENDENCIES}) + + add_custom_command( + TARGET ${COPY_TARGET} + DEPENDS ${dependency} + # Make directory first otherwise file is copied in place of + # directory instead of into it + COMMAND ${CMAKE_COMMAND} + ARGS -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${dependency} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} + VERBATIM) + + endforeach() + +endfunction() diff --git a/vendor/libssh2/cmake/FindLibgcrypt.cmake b/vendor/libssh2/cmake/FindLibgcrypt.cmake new file mode 100644 index 0000000000..44a79873d6 --- /dev/null +++ b/vendor/libssh2/cmake/FindLibgcrypt.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2014 Alexander Lamaison +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided +# that the following conditions are met: +# +# Redistributions of source code must retain the above +# copyright notice, this list of conditions and the +# following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# Neither the name of the copyright holder nor the names +# of any other contributors may be used to endorse or +# promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + +# - Try to find Libgcrypt +# This will define all or none of: +# LIBGCRYPT_FOUND - if Libgcrypt headers and library was found +# LIBGCRYPT_INCLUDE_DIRS - The Libgcrypt include directories +# LIBGCRYPT_LIBRARIES - The libraries needed to use Libgcrypt + +find_path(LIBGCRYPT_INCLUDE_DIR gcrypt.h) + +find_library(LIBGCRYPT_LIBRARY NAMES gcrypt libgcrypt) + +set(LIBGCRYPT_LIBRARIES ${LIBGCRYPT_LIBRARY}) +set(LIBGCRYPT_INCLUDE_DIRS ${LIBGCRYPT_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libgcrypt DEFAULT_MSG + LIBGCRYPT_LIBRARY LIBGCRYPT_INCLUDE_DIR) + +mark_as_advanced(LIBGCRYPT_INCLUDE_DIR LIBGCRYPT_LIBRARY) \ No newline at end of file diff --git a/vendor/libssh2/cmake/FindmbedTLS.cmake b/vendor/libssh2/cmake/FindmbedTLS.cmake new file mode 100644 index 0000000000..2f4adbc519 --- /dev/null +++ b/vendor/libssh2/cmake/FindmbedTLS.cmake @@ -0,0 +1,64 @@ +# - Try to find mbedTLS +# Once done this will define +# +# Read-Only variables +# MBEDTLS_FOUND - system has mbedTLS +# MBEDTLS_INCLUDE_DIR - the mbedTLS include directory +# MBEDTLS_LIBRARY_DIR - the mbedTLS library directory +# MBEDTLS_LIBRARIES - Link these to use mbedTLS +# MBEDTLS_LIBRARY - path to mbedTLS library +# MBEDX509_LIBRARY - path to mbedTLS X.509 library +# MBEDCRYPTO_LIBRARY - path to mbedTLS Crypto library + +FIND_PATH(MBEDTLS_INCLUDE_DIR mbedtls/version.h) + +IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARIES) + # Already in cache, be silent + SET(MBEDTLS_FIND_QUIETLY TRUE) +ENDIF() + +FIND_LIBRARY(MBEDTLS_LIBRARY NAMES mbedtls libmbedtls libmbedx509) +FIND_LIBRARY(MBEDX509_LIBRARY NAMES mbedx509 libmbedx509) +FIND_LIBRARY(MBEDCRYPTO_LIBRARY NAMES mbedcrypto libmbedcrypto) + +IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY) + SET(MBEDTLS_FOUND TRUE) +ENDIF() + +IF(MBEDTLS_FOUND) + # split mbedTLS into -L and -l linker options, so we can set them for pkg-config + GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_DIR ${MBEDTLS_LIBRARY} PATH) + GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE) + GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE) + GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE) + STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE}) + STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE}) + STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE}) + SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}") + + IF(NOT MBEDTLS_FIND_QUIETLY) + MESSAGE(STATUS "Found mbedTLS:") + FILE(READ ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLSCONTENT) + STRING(REGEX MATCH "MBEDTLS_VERSION_STRING +\"[0-9|.]+\"" MBEDTLSMATCH ${MBEDTLSCONTENT}) + IF (MBEDTLSMATCH) + STRING(REGEX REPLACE "MBEDTLS_VERSION_STRING +\"([0-9|.]+)\"" "\\1" MBEDTLS_VERSION ${MBEDTLSMATCH}) + MESSAGE(STATUS " version ${MBEDTLS_VERSION}") + ENDIF(MBEDTLSMATCH) + MESSAGE(STATUS " TLS: ${MBEDTLS_LIBRARY}") + MESSAGE(STATUS " X509: ${MBEDX509_LIBRARY}") + MESSAGE(STATUS " Crypto: ${MBEDCRYPTO_LIBRARY}") + ENDIF(NOT MBEDTLS_FIND_QUIETLY) +ELSE(MBEDTLS_FOUND) + IF(MBEDTLS_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find mbedTLS") + ENDIF(MBEDTLS_FIND_REQUIRED) +ENDIF(MBEDTLS_FOUND) + +MARK_AS_ADVANCED( + MBEDTLS_INCLUDE_DIR + MBEDTLS_LIBRARY_DIR + MBEDTLS_LIBRARIES + MBEDTLS_LIBRARY + MBEDX509_LIBRARY + MBEDCRYPTO_LIBRARY +) diff --git a/vendor/libssh2/cmake/SocketLibraries.cmake b/vendor/libssh2/cmake/SocketLibraries.cmake new file mode 100644 index 0000000000..bfbbd711e3 --- /dev/null +++ b/vendor/libssh2/cmake/SocketLibraries.cmake @@ -0,0 +1,64 @@ +# Copyright (c) 2014 Alexander Lamaison +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided +# that the following conditions are met: +# +# Redistributions of source code must retain the above +# copyright notice, this list of conditions and the +# following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# Neither the name of the copyright holder nor the names +# of any other contributors may be used to endorse or +# promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + +# Some systems have their socket functions in a library. +# (Solaris -lsocket/-lnsl, Windows -lws2_32). This macro appends those +# libraries to the given list +macro(append_needed_socket_libraries LIBRARIES_LIST) + if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 4) + # x86 Windows uses STDCALL for these functions, so their names are mangled, + # meaning the platform checks don't work. Hardcoding these until we get + # a better solution. + set(HAVE_SOCKET 1) + set(HAVE_SELECT 1) + set(HAVE_INET_ADDR 1) + set(NEED_LIB_WS2_32 1) + else() + check_function_exists_may_need_library(socket HAVE_SOCKET socket ws2_32) + check_function_exists_may_need_library(select HAVE_SELECT ws2_32) + check_function_exists_may_need_library(inet_addr HAVE_INET_ADDR nsl ws2_32) + endif() + + if(NEED_LIB_SOCKET) + list(APPEND ${LIBRARIES_LIST} socket) + endif() + if(NEED_LIB_NSL) + list(APPEND ${LIBRARIES_LIST} nsl) + endif() + if(NEED_LIB_WS2_32) + list(APPEND ${LIBRARIES_LIST} ws2_32) + endif() + +endmacro() \ No newline at end of file diff --git a/vendor/libssh2/cmake/Toolchain-Linux-32.cmake b/vendor/libssh2/cmake/Toolchain-Linux-32.cmake new file mode 100644 index 0000000000..6aad9b1e2d --- /dev/null +++ b/vendor/libssh2/cmake/Toolchain-Linux-32.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2014 Alexander Lamaison +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided +# that the following conditions are met: +# +# Redistributions of source code must retain the above +# copyright notice, this list of conditions and the +# following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# Neither the name of the copyright holder nor the names +# of any other contributors may be used to endorse or +# promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + +# Cross-compile 32-bit binary on 64-bit linux host +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR "i386") + +set(CMAKE_CXX_COMPILER_ARG1 "-m32") +set(CMAKE_C_COMPILER_ARG1 "-m32") \ No newline at end of file diff --git a/vendor/libssh2/cmake/max_warnings.cmake b/vendor/libssh2/cmake/max_warnings.cmake new file mode 100644 index 0000000000..b176d302d3 --- /dev/null +++ b/vendor/libssh2/cmake/max_warnings.cmake @@ -0,0 +1,23 @@ +if(MSVC) + # Use the highest warning level for visual studio. + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif() + if(CMAKE_C_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") + endif() + + # Disable broken warnings + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) +elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + endif() + if(NOT CMAKE_C_FLAGS MATCHES "-Wall") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + endif() +endif() diff --git a/vendor/libssh2/compile b/vendor/libssh2/compile new file mode 100755 index 0000000000..23fcba0113 --- /dev/null +++ b/vendor/libssh2/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/vendor/libssh2/config.guess b/vendor/libssh2/config.guess new file mode 100755 index 0000000000..f50dcdb6de --- /dev/null +++ b/vendor/libssh2/config.guess @@ -0,0 +1,1480 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-02-24' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > "$dummy.c" ; + for c in cc gcc c89 c99 ; do + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval "$set_cc_for_build" + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval "$set_cc_for_build" + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + then + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ "$HP_ARCH" = hppa2.0w ] + then + eval "$set_cc_for_build" + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + i*86:Minix:*:*) + echo "$UNAME_MACHINE"-pc-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + eval "$set_cc_for_build" + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + if objdump -f /bin/sh | grep -q elf32-x86-64; then + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 + else + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + fi + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-functions 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/vendor/libssh2/config.rpath b/vendor/libssh2/config.rpath new file mode 100755 index 0000000000..e082db6bb5 --- /dev/null +++ b/vendor/libssh2/config.rpath @@ -0,0 +1,660 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2006 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + darwin*) + case $cc_basename in + xlc*) + wl='-Wl,' + ;; + esac + ;; + mingw* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux*) + case $cc_basename in + icc* | ecc*) + wl='-Wl,' + ;; + pgcc | pgf77 | pgf90) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + sco3.2v5*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we cannot use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + interix3*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if test "$GCC" = yes ; then + : + else + case $cc_basename in + xlc*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix4* | aix5*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + library_names_spec='$libname.a' + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd1*) + ;; + kfreebsd*-gnu) + library_names_spec='$libname$shrext' + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix3*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux*) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + nto-qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-pc + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2*) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + x64) + basic_machine=x86_64-pc + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases that might get confused + # with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4*) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + pru-*) + os=-elf + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` + ;; +esac + +echo "$basic_machine$os" +exit + +# Local variables: +# eval: (add-hook 'write-file-functions 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/vendor/libssh2/configure b/vendor/libssh2/configure new file mode 100755 index 0000000000..1cbf782b18 --- /dev/null +++ b/vendor/libssh2/configure @@ -0,0 +1,26655 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for libssh2 -. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: libssh2-devel@cool.haxx.se about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libssh2' +PACKAGE_TARNAME='libssh2' +PACKAGE_VERSION='-' +PACKAGE_STRING='libssh2 -' +PACKAGE_BUGREPORT='libssh2-devel@cool.haxx.se' +PACKAGE_URL='' + +ac_unique_file="src" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +ALLOCA +HAVE_SYS_UN_H_FALSE +HAVE_SYS_UN_H_TRUE +USE_OSSFUZZ_STATIC_FALSE +USE_OSSFUZZ_STATIC_TRUE +USE_OSSFUZZ_FLAG_FALSE +USE_OSSFUZZ_FLAG_TRUE +LIB_FUZZING_ENGINE +USE_OSSFUZZERS_FALSE +USE_OSSFUZZERS_TRUE +BUILD_EXAMPLES_FALSE +BUILD_EXAMPLES_TRUE +CPP +LIBSREQUIRED +LIBZ_PREFIX +LTLIBZ +LIBZ +HAVE_LIBZ +WINCNG_FALSE +WINCNG_TRUE +MBEDTLS_FALSE +MBEDTLS_TRUE +LIBGCRYPT_FALSE +LIBGCRYPT_TRUE +OPENSSL_FALSE +OPENSSL_TRUE +LIBBCRYPT_PREFIX +LTLIBBCRYPT +LIBBCRYPT +HAVE_LIBBCRYPT +LIBCRYPT32_PREFIX +LTLIBCRYPT32 +LIBCRYPT32 +HAVE_LIBCRYPT32 +LIBMBEDCRYPTO_PREFIX +LTLIBMBEDCRYPTO +LIBMBEDCRYPTO +HAVE_LIBMBEDCRYPTO +LIBGCRYPT_PREFIX +LTLIBGCRYPT +LIBGCRYPT +HAVE_LIBGCRYPT +LIBSSL_PREFIX +LTLIBSSL +LIBSSL +HAVE_LIBSSL +CXXCPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +LIBTOOL +OBJDUMP +DLLTOOL +AS +SSHD_FALSE +SSHD_TRUE +SSHD +LN_S +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBSSH2VER +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SED +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_silent_rules +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_largefile +with_crypto +enable_rpath +with_libssl_prefix +with_libgcrypt_prefix +with_libmbedcrypto_prefix +with_libcrypt32_prefix +with_libbcrypt_prefix +with_libz +with_libz_prefix +enable_crypt_none +enable_mac_none +enable_gex_new +enable_clear_memory +enable_debug +enable_hidden_symbols +enable_examples_build +enable_ossfuzzers +enable_werror +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +LT_SYS_LIBRARY_PATH +CXXCPP +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libssh2 - to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libssh2] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libssh2 -:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-largefile omit support for large files + --disable-rpath do not hardcode runtime library paths + --enable-crypt-none Permit "none" cipher -- NOT RECOMMENDED + --enable-mac-none Permit "none" MAC -- NOT RECOMMENDED + --disable-gex-new Disable "new" diffie-hellman-group-exchange-sha1 + method + --disable-clear-memory Disable clearing of memory before being freed + --enable-debug Enable pedantic and debug options + --disable-debug Disable debug options + --enable-hidden-symbols Hide internal symbols in library + --disable-hidden-symbols + Leave all symbols with default visibility in library + --enable-examples-build Build example applications (this is the default) + --disable-examples-build + Do not build example applications + --enable-ossfuzzers Whether to generate the fuzzers for OSS-Fuzz + --enable-werror Enable compiler warnings as errors + --disable-werror Disable compiler warnings as errors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-crypto=auto|openssl|libgcrypt|mbedtls|wincng + Select crypto backend (default: auto) + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libssl-prefix[=DIR] search for libssl in DIR/include and DIR/lib + --without-libssl-prefix don't search for libssl in includedir and libdir + --with-libgcrypt-prefix[=DIR] search for libgcrypt in DIR/include and DIR/lib + --without-libgcrypt-prefix don't search for libgcrypt in includedir and libdir + --with-libmbedcrypto-prefix[=DIR] search for libmbedcrypto in DIR/include and DIR/lib + --without-libmbedcrypto-prefix don't search for libmbedcrypto in includedir and libdir + --with-libcrypt32-prefix[=DIR] search for libcrypt32 in DIR/include and DIR/lib + --without-libcrypt32-prefix don't search for libcrypt32 in includedir and libdir + --with-libbcrypt-prefix[=DIR] search for libbcrypt in DIR/include and DIR/lib + --without-libbcrypt-prefix don't search for libbcrypt in includedir and libdir + --with-libz Use libz for compression + --with-libz-prefix[=DIR] search for libz in DIR/include and DIR/lib + --without-libz-prefix don't search for libz in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CXXCPP C++ preprocessor + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libssh2 configure - +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libssh2 $as_me -, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath ltmain.sh compile config.guess config.sub missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_config_headers="$ac_config_headers src/libssh2_config.h" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test ${enable_maintainer_mode+y} +then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else $as_nop + USE_MAINTAINER_MODE=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +# Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SED in + [\\/]* | ?:[\\/]*) + ac_cv_path_SED="$SED" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SED="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed-was-not-found-by-configure" + ;; +esac +fi +SED=$ac_cv_path_SED +if test -n "$SED"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 +printf "%s\n" "$SED" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + +if test "x$SED" = "xsed-was-not-found-by-configure"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: sed was not found, this may ruin your chances to build fine" >&5 +printf "%s\n" "$as_me: WARNING: sed was not found, this may ruin your chances to build fine" >&2;} +fi + +LIBSSH2VER=`$SED -ne 's/^#define LIBSSH2_VERSION *"\(.*\)"/\1/p' ${srcdir}/include/libssh2.h` +am__api_version='1.16' + + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libssh2' + VERSION='-' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking libssh2 version" >&5 +printf %s "checking libssh2 version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSSH2VER" >&5 +printf "%s\n" "$LIBSSH2VER" >&6; } + + + +AB_VERSION=$LIBSSH2VER + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + + + + if test -z "$AB_PACKAGE"; then + AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE} + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5 +printf "%s\n" "$as_me: autobuild project... $AB_PACKAGE" >&6;} + + if test -z "$AB_VERSION"; then + AB_VERSION=${PACKAGE_VERSION:-$VERSION} + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5 +printf "%s\n" "$as_me: autobuild revision... $AB_VERSION" >&6;} + + hostname=`hostname` + if test "$hostname"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5 +printf "%s\n" "$as_me: autobuild hostname... $hostname" >&6;} + fi + + + + date=`date +%Y%m%d-%H%M%S` + if test "$?" != 0; then + date=`date` + fi + if test "$date"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5 +printf "%s\n" "$as_me: autobuild timestamp... $date" >&6;} + fi + + +# Check for the OS. +# Daniel's note: this should not be necessary and we need to work to +# get this removed. + +case "$host" in + *-mingw*) + CFLAGS="$CFLAGS -DLIBSSH2_WIN32" + LIBS="$LIBS -lws2_32" + ;; + *darwin*) + CFLAGS="$CFLAGS -DLIBSSH2_DARWIN" + ;; + *hpux*) + ;; + *osf*) + CFLAGS="$CFLAGS -D_POSIX_PII_SOCKET" + ;; + *) + ;; +esac + + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else $as_nop + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes +then : + +printf "%s\n" "#define HAVE_LONGLONG 1" >>confdefs.h + + longlong="yes" + +fi + + + + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is already defined" >&5 +printf %s "checking if _REENTRANT is already defined... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + +int +main (void) +{ + +#ifdef _REENTRANT + int dummy=1; +#else + force compilation error +#endif + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tmp_reentrant_initially_defined="yes" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tmp_reentrant_initially_defined="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + # + if test "$tmp_reentrant_initially_defined" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is actually needed" >&5 +printf %s "checking if _REENTRANT is actually needed... " >&6; } + + case $host in + *-*-solaris* | *-*-hpux*) + tmp_need_reentrant="yes" + ;; + *) + tmp_need_reentrant="no" + ;; + esac + + + if test "$tmp_need_reentrant" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is onwards defined" >&5 +printf %s "checking if _REENTRANT is onwards defined... " >&6; } + if test "$tmp_reentrant_initially_defined" = "yes" || + test "$tmp_need_reentrant" = "yes"; then + + +printf "%s\n" "#define NEED_REENTRANT 1" >>confdefs.h + +cat >>confdefs.h <<_EOF +#ifndef _REENTRANT +# define _REENTRANT +#endif +_EOF + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + # + + +# Some systems (Solaris?) have socket() in -lsocket. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 +printf %s "checking for library containing socket... " >&6; } +if test ${ac_cv_search_socket+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char socket (); +int +main (void) +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_socket=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_socket+y} +then : + break +fi +done +if test ${ac_cv_search_socket+y} +then : + +else $as_nop + ac_cv_search_socket=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 +printf "%s\n" "$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +# Solaris has inet_addr() in -lnsl. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5 +printf %s "checking for library containing inet_addr... " >&6; } +if test ${ac_cv_search_inet_addr+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char inet_addr (); +int +main (void) +{ +return inet_addr (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_inet_addr=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_inet_addr+y} +then : + break +fi +done +if test ${ac_cv_search_inet_addr+y} +then : + +else $as_nop + ac_cv_search_inet_addr=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5 +printf "%s\n" "$ac_cv_search_inet_addr" >&6; } +ac_res=$ac_cv_search_inet_addr +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +for ac_prog in sshd +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SSHD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SSHD in + [\\/]* | ?:[\\/]*) + ac_cv_path_SSHD="$SSHD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR /usr/sbin$PATH_SEPARATOR/usr/etc$PATH_SEPARATOR/etc +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SSHD="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +SSHD=$ac_cv_path_SSHD +if test -n "$SSHD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SSHD" >&5 +printf "%s\n" "$SSHD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$SSHD" && break +done + + if test -n "$SSHD"; then + SSHD_TRUE= + SSHD_FALSE='#' +else + SSHD_TRUE='#' + SSHD_FALSE= +fi + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf "%s\n" "$AS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +printf "%s\n" "$ac_ct_AS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_reload_flag='-r' +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cr} + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test ${with_sysroot+y} +then : + withval=$with_sysroot; +else $as_nop + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test ${enable_libtool_lock+y} +then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_cc_needs_belf=yes +else $as_nop + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_ld_exported_symbols_list=yes +else $as_nop + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cr libconftest.a conftest.o" >&5 + $AR cr libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[912]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*|11.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi + + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test ${enable_shared+y} +then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test ${enable_static+y} +then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test ${with_pic+y} +then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test ${enable_fast_install+y} +then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_irix_exported_symbol=yes +else $as_nop + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + link_all_deplibs=no + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes +then : + lt_cv_dlopen=shl_load +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main (void) +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_shl_load=yes +else $as_nop + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else $as_nop + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes +then : + lt_cv_dlopen=dlopen +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_svld_dlopen=yes +else $as_nop + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main (void) +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_dld_link=yes +else $as_nop + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs_CXX=no + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else $as_nop + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi +fi + + +# Crypto backends + +found_crypto=none +found_crypto_str="" +support_clear_memory=no +crypto_errors="" + + + + + + + +# Check whether --with-crypto was given. +if test ${with_crypto+y} +then : + withval=$with_crypto; use_crypto=$withval +else $as_nop + use_crypto=auto + +fi + + +case "${use_crypto}" in + auto|openssl|libgcrypt|mbedtls|wincng) + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +printf %s "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else $as_nop + enable_rpath=yes +fi + + + + acl_libdirstem=lib + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + + +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "openssl"; then + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libssl_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libssl_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libssl_prefix}/lib" + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libssl-prefix was given. +if test ${with_libssl_prefix+y} +then : + withval=$with_libssl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBSSL= + LTLIBSSL= + INCSSL= + LIBSSL_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='ssl crypto' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBSSL="${LIBSSL}${LIBSSL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_so" + else + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }$found_a" + else + LIBSSL="${LIBSSL}${LIBSSL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBSSL_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCSSL="${INCSSL}${INCSSL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBSSL="${LIBSSL}${LIBSSL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBSSL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBSSL="${LIBSSL}${LIBSSL:+ }$dep" + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }$dep" + ;; + esac + done + fi + else + LIBSSL="${LIBSSL}${LIBSSL:+ }-l$name" + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSSL="${LIBSSL}${LIBSSL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBSSL="${LIBSSL}${LIBSSL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBSSL="${LTLIBSSL}${LTLIBSSL:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCSSL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libssl" >&5 +printf %s "checking for libssl... " >&6; } +if test ${ac_cv_libssl+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBSSL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libssl=yes +else $as_nop + ac_cv_libssl=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libssl" >&5 +printf "%s\n" "$ac_cv_libssl" >&6; } + if test "$ac_cv_libssl" = yes; then + HAVE_LIBSSL=yes + +printf "%s\n" "#define HAVE_LIBSSL 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libssl" >&5 +printf %s "checking how to link with libssl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSSL" >&5 +printf "%s\n" "$LIBSSL" >&6; } + else + HAVE_LIBSSL=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBSSL= + LTLIBSSL= + LIBSSL_PREFIX= + fi + + + + + + + + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libssl" = "yes"; then : + + +printf "%s\n" "#define LIBSSH2_OPENSSL 1" >>confdefs.h + + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libssl libcrypto" + + # Not all OpenSSL have AES-CTR functions. + libssh2_save_LIBS="$LIBS" + LIBS="$LIBS $LIBSSL" + ac_fn_c_check_func "$LINENO" "EVP_aes_128_ctr" "ac_cv_func_EVP_aes_128_ctr" +if test "x$ac_cv_func_EVP_aes_128_ctr" = xyes +then : + printf "%s\n" "#define HAVE_EVP_AES_128_CTR 1" >>confdefs.h + +fi + + LIBS="$libssh2_save_LIBS" + + found_crypto="openssl" + found_crypto_str="OpenSSL (AES-CTR: ${ac_cv_func_EVP_aes_128_ctr:-N/A})" + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No openssl crypto library found! +" +fi + +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "libgcrypt"; then + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libgcrypt_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libgcrypt_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libgcrypt_prefix}/lib" + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libgcrypt-prefix was given. +if test ${with_libgcrypt_prefix+y} +then : + withval=$with_libgcrypt_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBGCRYPT= + LTLIBGCRYPT= + INCGCRYPT= + LIBGCRYPT_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='gcrypt ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBGCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBGCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_so" + else + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$found_a" + else + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBGCRYPT_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCGCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCGCRYPT="${INCGCRYPT}${INCGCRYPT:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBGCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBGCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$dep" + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }$dep" + ;; + esac + done + fi + else + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }-l$name" + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBGCRYPT="${LIBGCRYPT}${LIBGCRYPT:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBGCRYPT="${LTLIBGCRYPT}${LTLIBGCRYPT:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCGCRYPT; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libgcrypt" >&5 +printf %s "checking for libgcrypt... " >&6; } +if test ${ac_cv_libgcrypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBGCRYPT" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libgcrypt=yes +else $as_nop + ac_cv_libgcrypt=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libgcrypt" >&5 +printf "%s\n" "$ac_cv_libgcrypt" >&6; } + if test "$ac_cv_libgcrypt" = yes; then + HAVE_LIBGCRYPT=yes + +printf "%s\n" "#define HAVE_LIBGCRYPT 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libgcrypt" >&5 +printf %s "checking how to link with libgcrypt... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT" >&5 +printf "%s\n" "$LIBGCRYPT" >&6; } + else + HAVE_LIBGCRYPT=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBGCRYPT= + LTLIBGCRYPT= + LIBGCRYPT_PREFIX= + fi + + + + + + + + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libgcrypt" = "yes"; then : + + +printf "%s\n" "#define LIBSSH2_LIBGCRYPT 1" >>confdefs.h + + found_crypto="libgcrypt" + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No libgcrypt crypto library found! +" +fi + +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "mbedtls"; then + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libmbedcrypto_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libmbedcrypto_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libmbedcrypto_prefix}/lib" + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libmbedcrypto-prefix was given. +if test ${with_libmbedcrypto_prefix+y} +then : + withval=$with_libmbedcrypto_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBMBEDCRYPTO= + LTLIBMBEDCRYPTO= + INCMBEDCRYPTO= + LIBMBEDCRYPTO_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='mbedcrypto ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBMBEDCRYPTO; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBMBEDCRYPTO; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_so" + else + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$found_a" + else + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBMBEDCRYPTO_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCMBEDCRYPTO; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCMBEDCRYPTO="${INCMBEDCRYPTO}${INCMBEDCRYPTO:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBMBEDCRYPTO; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBMBEDCRYPTO; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$dep" + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }$dep" + ;; + esac + done + fi + else + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }-l$name" + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBMBEDCRYPTO="${LIBMBEDCRYPTO}${LIBMBEDCRYPTO:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBMBEDCRYPTO="${LTLIBMBEDCRYPTO}${LTLIBMBEDCRYPTO:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCMBEDCRYPTO; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libmbedcrypto" >&5 +printf %s "checking for libmbedcrypto... " >&6; } +if test ${ac_cv_libmbedcrypto+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBMBEDCRYPTO" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libmbedcrypto=yes +else $as_nop + ac_cv_libmbedcrypto=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libmbedcrypto" >&5 +printf "%s\n" "$ac_cv_libmbedcrypto" >&6; } + if test "$ac_cv_libmbedcrypto" = yes; then + HAVE_LIBMBEDCRYPTO=yes + +printf "%s\n" "#define HAVE_LIBMBEDCRYPTO 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libmbedcrypto" >&5 +printf %s "checking how to link with libmbedcrypto... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBMBEDCRYPTO" >&5 +printf "%s\n" "$LIBMBEDCRYPTO" >&6; } + else + HAVE_LIBMBEDCRYPTO=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBMBEDCRYPTO= + LTLIBMBEDCRYPTO= + LIBMBEDCRYPTO_PREFIX= + fi + + + + + + + + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libmbedcrypto" = "yes"; then : + + +printf "%s\n" "#define LIBSSH2_MBEDTLS 1" >>confdefs.h + + LIBS="$LIBS -lmbedcrypto" + found_crypto="mbedtls" + support_clear_memory=yes + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No mbedtls crypto library found! +" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + + +if test "$use_crypto" = "auto" && test "$found_crypto" = "none" || test "$use_crypto" = "wincng"; then + + # Look for Windows Cryptography API: Next Generation + + ac_fn_c_check_header_compile "$LINENO" "ntdef.h" "ac_cv_header_ntdef_h" "#include +" +if test "x$ac_cv_header_ntdef_h" = xyes +then : + printf "%s\n" "#define HAVE_NTDEF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "ntstatus.h" "ac_cv_header_ntstatus_h" "#include +" +if test "x$ac_cv_header_ntstatus_h" = xyes +then : + printf "%s\n" "#define HAVE_NTSTATUS_H 1" >>confdefs.h + +fi + + ac_fn_check_decl "$LINENO" "SecureZeroMemory" "ac_cv_have_decl_SecureZeroMemory" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_SecureZeroMemory" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_SECUREZEROMEMORY $ac_have_decl" >>confdefs.h + + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libcrypt32_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libcrypt32_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libcrypt32_prefix}/lib" + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libcrypt32-prefix was given. +if test ${with_libcrypt32_prefix+y} +then : + withval=$with_libcrypt32_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBCRYPT32= + LTLIBCRYPT32= + INCCRYPT32= + LIBCRYPT32_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='crypt32 ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBCRYPT32; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBCRYPT32; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_so" + else + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$found_a" + else + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBCRYPT32_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCCRYPT32; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCCRYPT32="${INCCRYPT32}${INCCRYPT32:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBCRYPT32; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBCRYPT32; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$dep" + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }$dep" + ;; + esac + done + fi + else + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }-l$name" + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBCRYPT32="${LIBCRYPT32}${LIBCRYPT32:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBCRYPT32="${LTLIBCRYPT32}${LTLIBCRYPT32:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCCRYPT32; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcrypt32" >&5 +printf %s "checking for libcrypt32... " >&6; } +if test ${ac_cv_libcrypt32+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBCRYPT32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libcrypt32=yes +else $as_nop + ac_cv_libcrypt32=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libcrypt32" >&5 +printf "%s\n" "$ac_cv_libcrypt32" >&6; } + if test "$ac_cv_libcrypt32" = yes; then + HAVE_LIBCRYPT32=yes + +printf "%s\n" "#define HAVE_LIBCRYPT32 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libcrypt32" >&5 +printf %s "checking how to link with libcrypt32... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBCRYPT32" >&5 +printf "%s\n" "$LIBCRYPT32" >&6; } + else + HAVE_LIBCRYPT32=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBCRYPT32= + LTLIBCRYPT32= + LIBCRYPT32_PREFIX= + fi + + + + + + + + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libcrypt32" = "yes"; then : + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + libssh2_save_CPPFLAGS="$CPPFLAGS" + libssh2_save_LDFLAGS="$LDFLAGS" + + if test "${with_libbcrypt_prefix+set}" = set; then + CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I${with_libbcrypt_prefix}/include" + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L${with_libbcrypt_prefix}/lib" + fi + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libbcrypt-prefix was given. +if test ${with_libbcrypt_prefix+y} +then : + withval=$with_libbcrypt_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBBCRYPT= + LTLIBBCRYPT= + INCBCRYPT= + LIBBCRYPT_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='bcrypt ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBBCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBBCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_so" + else + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$found_a" + else + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBBCRYPT_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCBCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCBCRYPT="${INCBCRYPT}${INCBCRYPT:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBBCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBBCRYPT; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$dep" + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }$dep" + ;; + esac + done + fi + else + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }-l$name" + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBBCRYPT="${LIBBCRYPT}${LIBBCRYPT:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBBCRYPT="${LTLIBBCRYPT}${LTLIBBCRYPT:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCBCRYPT; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbcrypt" >&5 +printf %s "checking for libbcrypt... " >&6; } +if test ${ac_cv_libbcrypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBBCRYPT" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libbcrypt=yes +else $as_nop + ac_cv_libbcrypt=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbcrypt" >&5 +printf "%s\n" "$ac_cv_libbcrypt" >&6; } + if test "$ac_cv_libbcrypt" = yes; then + HAVE_LIBBCRYPT=yes + +printf "%s\n" "#define HAVE_LIBBCRYPT 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libbcrypt" >&5 +printf %s "checking how to link with libbcrypt... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBBCRYPT" >&5 +printf "%s\n" "$LIBBCRYPT" >&6; } + else + HAVE_LIBBCRYPT=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBBCRYPT= + LTLIBBCRYPT= + LIBBCRYPT_PREFIX= + fi + + + + + + + + + LDFLAGS="$libssh2_save_LDFLAGS" + + if test "$ac_cv_libbcrypt" = "yes"; then : + + +printf "%s\n" "#define LIBSSH2_WINCNG 1" >>confdefs.h + + found_crypto="wincng" + found_crypto_str="Windows Cryptography API: Next Generation" + support_clear_memory="$ac_cv_have_decl_SecureZeroMemory" + + else + CPPFLAGS="$libssh2_save_CPPFLAGS" + fi + + + test "$found_crypto" = "none" && + crypto_errors="${crypto_errors}No wincng crypto library found! +" +fi + + ;; + yes|"") + crypto_errors="No crypto backend specified!" + ;; + *) + crypto_errors="Unknown crypto backend '${use_crypto}' specified!" + ;; +esac + +if test "$found_crypto" = "none"; then + crypto_errors="${crypto_errors} +Specify --with-crypto=\$backend and/or the neccessary library search prefix. + +Known crypto backends: auto, openssl, libgcrypt, mbedtls, wincng" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: ${crypto_errors}" >&5 +printf "%s\n" "$as_me: ERROR: ${crypto_errors}" >&6;} +else + test "$found_crypto_str" = "" && found_crypto_str="$found_crypto" +fi + + if test "$found_crypto" = "openssl"; then + OPENSSL_TRUE= + OPENSSL_FALSE='#' +else + OPENSSL_TRUE='#' + OPENSSL_FALSE= +fi + + if test "$found_crypto" = "libgcrypt"; then + LIBGCRYPT_TRUE= + LIBGCRYPT_FALSE='#' +else + LIBGCRYPT_TRUE='#' + LIBGCRYPT_FALSE= +fi + + if test "$found_crypto" = "mbedtls"; then + MBEDTLS_TRUE= + MBEDTLS_FALSE='#' +else + MBEDTLS_TRUE='#' + MBEDTLS_FALSE= +fi + + if test "$found_crypto" = "wincng"; then + WINCNG_TRUE= + WINCNG_FALSE='#' +else + WINCNG_TRUE='#' + WINCNG_FALSE= +fi + + + +# libz + + +# Check whether --with-libz was given. +if test ${with_libz+y} +then : + withval=$with_libz; use_libz=$withval +else $as_nop + use_libz=auto +fi + + +found_libz=no +libz_errors="" + +if test "$use_libz" != no; then + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libz-prefix was given. +if test ${with_libz_prefix+y} +then : + withval=$with_libz_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi + +fi + + LIBZ= + LTLIBZ= + INCZ= + LIBZ_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='z ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBZ="${LIBZ}${LIBZ:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBZ="${LTLIBZ}${LTLIBZ:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBZ; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBZ="${LTLIBZ}${LTLIBZ:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBZ="${LIBZ}${LIBZ:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBZ="${LIBZ}${LIBZ:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBZ="${LIBZ}${LIBZ:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBZ; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBZ="${LIBZ}${LIBZ:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBZ="${LIBZ}${LIBZ:+ }$found_so" + else + LIBZ="${LIBZ}${LIBZ:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBZ="${LIBZ}${LIBZ:+ }$found_a" + else + LIBZ="${LIBZ}${LIBZ:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBZ_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCZ; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCZ="${INCZ}${INCZ:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBZ; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBZ="${LIBZ}${LIBZ:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBZ; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBZ="${LTLIBZ}${LTLIBZ:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBZ="${LIBZ}${LIBZ:+ }$dep" + LTLIBZ="${LTLIBZ}${LTLIBZ:+ }$dep" + ;; + esac + done + fi + else + LIBZ="${LIBZ}${LIBZ:+ }-l$name" + LTLIBZ="${LTLIBZ}${LTLIBZ:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBZ="${LIBZ}${LIBZ:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBZ="${LIBZ}${LIBZ:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBZ="${LTLIBZ}${LTLIBZ:+ }-R$found_dir" + done + fi + + + ac_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCZ; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libz" >&5 +printf %s "checking for libz... " >&6; } +if test ${ac_cv_libz+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIBZ" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libz=yes +else $as_nop + ac_cv_libz=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libz" >&5 +printf "%s\n" "$ac_cv_libz" >&6; } + if test "$ac_cv_libz" = yes; then + HAVE_LIBZ=yes + +printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libz" >&5 +printf %s "checking how to link with libz... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBZ" >&5 +printf "%s\n" "$LIBZ" >&6; } + else + HAVE_LIBZ=no + CPPFLAGS="$ac_save_CPPFLAGS" + LIBZ= + LTLIBZ= + LIBZ_PREFIX= + fi + + + + + + + + if test "$ac_cv_libz" != yes; then + if test "$use_libz" = auto; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Cannot find libz, disabling compression" >&5 +printf "%s\n" "$as_me: Cannot find libz, disabling compression" >&6;} + found_libz="disabled; no libz found" + else + libz_errors="No libz found! +Try --with-libz-prefix=PATH if you know that you have it." + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: $libz_errors" >&5 +printf "%s\n" "$as_me: ERROR: $libz_errors" >&6;} + fi + else + +printf "%s\n" "#define LIBSSH2_HAVE_ZLIB 1" >>confdefs.h + + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }zlib" + found_libz="yes" + fi +fi + + + +# +# Optional Settings +# +# Check whether --enable-crypt-none was given. +if test ${enable_crypt_none+y} +then : + enableval=$enable_crypt_none; +printf "%s\n" "#define LIBSSH2_CRYPT_NONE 1" >>confdefs.h + +fi + + +# Check whether --enable-mac-none was given. +if test ${enable_mac_none+y} +then : + enableval=$enable_mac_none; +printf "%s\n" "#define LIBSSH2_MAC_NONE 1" >>confdefs.h + +fi + + +# Check whether --enable-gex-new was given. +if test ${enable_gex_new+y} +then : + enableval=$enable_gex_new; GEX_NEW=$enableval +fi + +if test "$GEX_NEW" != "no"; then + +printf "%s\n" "#define LIBSSH2_DH_GEX_NEW 1" >>confdefs.h + +fi + +# Check whether --enable-clear-memory was given. +if test ${enable_clear_memory+y} +then : + enableval=$enable_clear_memory; CLEAR_MEMORY=$enableval +fi + +if test "$CLEAR_MEMORY" != "no"; then + if test "$support_clear_memory" = "yes"; then + +printf "%s\n" "#define LIBSSH2_CLEAR_MEMORY 1" >>confdefs.h + + enable_clear_memory=yes + else + if test "$CLEAR_MEMORY" = "yes"; then + as_fn_error $? "secure clearing/zeroing of memory is not supported by the selected crypto backend" "$LINENO" 5 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&5 +printf "%s\n" "$as_me: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&2;} + fi + enable_clear_memory=unsupported + fi +else + if test "$support_clear_memory" = "yes"; then + enable_clear_memory=no + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&5 +printf "%s\n" "$as_me: WARNING: secure clearing/zeroing of memory is not supported by the selected crypto backend" >&2;} + enable_clear_memory=unsupported + fi +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable pedantic and debug compiler options" >&5 +printf %s "checking whether to enable pedantic and debug compiler options... " >&6; } +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; case "$enable_debug" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CPPFLAGS="$CPPFLAGS -DNDEBUG" + ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + enable_debug=yes + CPPFLAGS="$CPPFLAGS -DLIBSSH2DEBUG" + CFLAGS="$CFLAGS -g" + + + if test "z$ICC" = "z"; then + + ICC="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icc in use" >&5 +printf %s "checking for icc in use... " >&6; } + if test "$GCC" = "yes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +__INTEL_COMPILER +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "^__INTEL_COMPILER" >/dev/null 2>&1 +then : + ICC="no" +else $as_nop + ICC="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + +fi +rm -rf conftest* + + fi + if test "$ICC" = "no"; then + # this is not ICC + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + fi + + if test "$GCC" = "yes"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5 +printf %s "checking gcc version... " >&6; } + gccver=`$CC -dumpversion` + num1=`echo $gccver | cut -d . -f1` + num2=`echo $gccver | cut -d . -f2` + gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gccver" >&5 +printf "%s\n" "$gccver" >&6; } + + if test "$ICC" = "yes"; then + + + WARN="-wd279,269,981,1418,1419" + + if test "$gccnum" -gt "600"; then + WARN="-Wall $WARN" + fi + else WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes" + + + if test "$gccnum" -ge "207"; then + WARN="$WARN -Wmissing-declarations" + fi + + if test "$gccnum" -gt "295"; then + WARN="$WARN -Wundef -Wno-long-long -Wsign-compare" + fi + + if test "$gccnum" -ge "296"; then + WARN="$WARN -Wfloat-equal" + fi + + if test "$gccnum" -gt "296"; then + WARN="$WARN -Wno-format-nonliteral" + fi + + + if test "$gccnum" -ge "303"; then + WARN="$WARN -Wendif-labels -Wstrict-prototypes" + fi + + if test "$gccnum" -ge "304"; then + # try these on gcc 3.4 + WARN="$WARN -Wdeclaration-after-statement" + fi + + for flag in $CPPFLAGS; do + case "$flag" in + -I*) + add=`echo $flag | sed 's/^-I/-isystem /g'` + WARN="$WARN $add" + ;; + esac + done + + fi + CFLAGS="$CFLAGS $WARN" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added this set of compiler options: $WARN" >&5 +printf "%s\n" "$as_me: Added this set of compiler options: $WARN" >&6;} + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added no extra compiler options" >&5 +printf "%s\n" "$as_me: Added no extra compiler options" >&6;} + + fi + NEWFLAGS="" + for flag in $CFLAGS; do + case "$flag" in + -O*) + ;; + *) + NEWFLAGS="$NEWFLAGS $flag" + ;; + esac + done + CFLAGS=$NEWFLAGS + + + ;; + esac + +else $as_nop + enable_debug=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable hidden symbols in the library" >&5 +printf %s "checking whether to enable hidden symbols in the library... " >&6; } +# Check whether --enable-hidden-symbols was given. +if test ${enable_hidden_symbols+y} +then : + enableval=$enable_hidden_symbols; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports it" >&5 +printf %s "checking whether $CC supports it... " >&6; } + if test "$GCC" = yes ; then + if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define LIBSSH2_API __attribute__ ((visibility (\"default\")))" >>confdefs.h + + CFLAGS="$CFLAGS -fvisibility=hidden" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + else + if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define LIBSSH2_API __global" >>confdefs.h + + CFLAGS="$CFLAGS -xldscope=hidden" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + fi + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi + + +# Build example applications? +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build example applications" >&5 +printf %s "checking whether to build example applications... " >&6; } +# Check whether --enable-examples-build was given. +if test ${enable_examples_build+y} +then : + enableval=$enable_examples_build; case "$enableval" in + no | false) + build_examples='no' + ;; + *) + build_examples='yes' + ;; +esac +else $as_nop + build_examples='yes' +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $build_examples" >&5 +printf "%s\n" "$build_examples" >&6; } + if test "x$build_examples" != "xno"; then + BUILD_EXAMPLES_TRUE= + BUILD_EXAMPLES_FALSE='#' +else + BUILD_EXAMPLES_TRUE='#' + BUILD_EXAMPLES_FALSE= +fi + + + +# Build OSS fuzzing targets? +# Check whether --enable-ossfuzzers was given. +if test ${enable_ossfuzzers+y} +then : + enableval=$enable_ossfuzzers; have_ossfuzzers=yes +else $as_nop + have_ossfuzzers=no +fi + + if test "x$have_ossfuzzers" = "xyes"; then + USE_OSSFUZZERS_TRUE= + USE_OSSFUZZERS_FALSE='#' +else + USE_OSSFUZZERS_TRUE='#' + USE_OSSFUZZERS_FALSE= +fi + + + +# Set the correct flags for the given fuzzing engine. + + if test "x$LIB_FUZZING_ENGINE" = "x-fsanitize=fuzzer"; then + USE_OSSFUZZ_FLAG_TRUE= + USE_OSSFUZZ_FLAG_FALSE='#' +else + USE_OSSFUZZ_FLAG_TRUE='#' + USE_OSSFUZZ_FLAG_FALSE= +fi + + if test -f "$LIB_FUZZING_ENGINE"; then + USE_OSSFUZZ_STATIC_TRUE= + USE_OSSFUZZ_STATIC_FALSE='#' +else + USE_OSSFUZZ_STATIC_TRUE='#' + USE_OSSFUZZ_STATIC_FALSE= +fi + + + +# Checks for header files. +# AC_HEADER_STDC +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" +if test "x$ac_cv_header_stdio_h" = xyes +then : + printf "%s\n" "#define HAVE_STDIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_uio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi + + for ac_header in sys/un.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_un_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h + have_sys_un_h=yes +else $as_nop + have_sys_un_h=no +fi + +done + if test "x$have_sys_un_h" = xyes; then + HAVE_SYS_UN_H_TRUE= + HAVE_SYS_UN_H_FALSE='#' +else + HAVE_SYS_UN_H_TRUE='#' + HAVE_SYS_UN_H_FALSE= +fi + + +case $host in + *-*-cygwin* | *-*-cegcc*) + # These are POSIX-like systems using BSD-like sockets API. + ;; + *) + ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes +then : + printf "%s\n" "#define HAVE_WINDOWS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "#define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi + + ;; +esac + +case $host in + *darwin*|*interix*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: poll use is disabled on this platform" >&5 +printf "%s\n" "$as_me: poll use is disabled on this platform" >&6;} + ;; + *) + ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" +if test "x$ac_cv_func_poll" = xyes +then : + printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h + +fi + + ;; +esac + +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" +if test "x$ac_cv_func_select" = xyes +then : + printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = xyes +then : + printf "%s\n" "#define HAVE_STRTOLL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memset_s" "ac_cv_func_memset_s" +if test "x$ac_cv_func_memset_s" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET_S 1" >>confdefs.h + +fi + + +if test "$ac_cv_func_select" != "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for select in ws2_32" >&5 +printf %s "checking for select in ws2_32... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#endif + +int +main (void) +{ + + select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_SELECT="1" + +printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h + + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_working_alloca_h=yes +else $as_nop + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# else +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +int +main (void) +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_alloca_works=yes +else $as_nop + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi + +if test $ac_cv_func_alloca_works = yes; then + +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + ac_cv_c_stack_direction=0 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_stack_direction=1 +else $as_nop + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + + +# Checks for typedefs, structures, and compiler characteristics. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else $as_nop + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf "%s\n" "#define const /**/" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking non-blocking sockets style" >&5 +printf %s "checking non-blocking sockets style... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* headers for O_NONBLOCK test */ +#include +#include +#include + +int +main (void) +{ + +/* try to compile O_NONBLOCK */ + +#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__SVR4) || defined(__srv4__) +# define PLATFORM_SOLARIS +# else +# define PLATFORM_SUNOS4 +# endif +#endif +#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41) +# define PLATFORM_AIX_V3 +#endif + +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__) +#error "O_NONBLOCK does not work on this platform" +#endif + int socket; + int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +nonblock="O_NONBLOCK" + +printf "%s\n" "#define HAVE_O_NONBLOCK 1" >>confdefs.h + + +else $as_nop + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* headers for FIONBIO test */ +#include +#include + +int +main (void) +{ + +/* FIONBIO source test (old-style unix) */ + int socket; + int flags = ioctl(socket, FIONBIO, &flags); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +nonblock="FIONBIO" + +printf "%s\n" "#define HAVE_FIONBIO 1" >>confdefs.h + + +else $as_nop + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* headers for ioctlsocket test (Windows) */ +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#ifdef HAVE_WINSOCK2_H +#include +#else +#ifdef HAVE_WINSOCK_H +#include +#endif +#endif +#endif + +int +main (void) +{ + +/* ioctlsocket source code */ + SOCKET sd; + unsigned long flags = 0; + sd = socket(0, 0, 0); + ioctlsocket(sd, FIONBIO, &flags); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +nonblock="ioctlsocket" + +printf "%s\n" "#define HAVE_IOCTLSOCKET 1" >>confdefs.h + + +else $as_nop + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* headers for IoctlSocket test (Amiga?) */ +#include + +int +main (void) +{ + +/* IoctlSocket source code */ + int socket; + int flags = IoctlSocket(socket, FIONBIO, (long)1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +nonblock="IoctlSocket" + +printf "%s\n" "#define HAVE_IOCTLSOCKET_CASE 1" >>confdefs.h + + +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* headers for SO_NONBLOCK test (BeOS) */ +#include + +int +main (void) +{ + +/* SO_NONBLOCK source code */ + long b = 1; + int socket; + int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +nonblock="SO_NONBLOCK" + +printf "%s\n" "#define HAVE_SO_NONBLOCK 1" >>confdefs.h + + +else $as_nop + +nonblock="nada" + +printf "%s\n" "#define HAVE_DISABLED_NONBLOCKING 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $nonblock" >&5 +printf "%s\n" "$nonblock" >&6; } + + if test "$nonblock" = "nada"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: non-block sockets disabled" >&5 +printf "%s\n" "$as_me: WARNING: non-block sockets disabled" >&2;} + fi + + +missing_required_deps=0 + +if test "${libz_errors}" != ""; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: ${libz_errors}" >&5 +printf "%s\n" "$as_me: ERROR: ${libz_errors}" >&6;} + missing_required_deps=1 +fi + +if test "$found_crypto" = "none"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ERROR: ${crypto_errors}" >&5 +printf "%s\n" "$as_me: ERROR: ${crypto_errors}" >&6;} + missing_required_deps=1 +fi + +if test $missing_required_deps = 1; then + as_fn_error $? "Required dependencies are missing!" "$LINENO" 5 +fi + +# Configure parameters + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings as errors" >&5 +printf %s "checking whether to enable compiler warnings as errors... " >&6; } + OPT_COMPILER_WERROR="default" + # Check whether --enable-werror was given. +if test ${enable_werror+y} +then : + enableval=$enable_werror; OPT_COMPILER_WERROR=$enableval +fi + + case "$OPT_COMPILER_WERROR" in + no) + want_werror="no" + ;; + default) + want_werror="no" + ;; + *) + want_werror="yes" + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_werror" >&5 +printf "%s\n" "$want_werror" >&6; } + + if test X"$want_werror" = Xyes; then + CFLAGS="$CFLAGS -Werror" + fi + + +ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile tests/ossfuzz/Makefile example/Makefile docs/Makefile libssh2.pc" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SSHD_TRUE}" && test -z "${SSHD_FALSE}"; then + as_fn_error $? "conditional \"SSHD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${OPENSSL_TRUE}" && test -z "${OPENSSL_FALSE}"; then + as_fn_error $? "conditional \"OPENSSL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBGCRYPT_TRUE}" && test -z "${LIBGCRYPT_FALSE}"; then + as_fn_error $? "conditional \"LIBGCRYPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MBEDTLS_TRUE}" && test -z "${MBEDTLS_FALSE}"; then + as_fn_error $? "conditional \"MBEDTLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WINCNG_TRUE}" && test -z "${WINCNG_FALSE}"; then + as_fn_error $? "conditional \"WINCNG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_EXAMPLES_TRUE}" && test -z "${BUILD_EXAMPLES_FALSE}"; then + as_fn_error $? "conditional \"BUILD_EXAMPLES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_OSSFUZZERS_TRUE}" && test -z "${USE_OSSFUZZERS_FALSE}"; then + as_fn_error $? "conditional \"USE_OSSFUZZERS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_OSSFUZZ_FLAG_TRUE}" && test -z "${USE_OSSFUZZ_FLAG_FALSE}"; then + as_fn_error $? "conditional \"USE_OSSFUZZ_FLAG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_OSSFUZZ_STATIC_TRUE}" && test -z "${USE_OSSFUZZ_STATIC_FALSE}"; then + as_fn_error $? "conditional \"USE_OSSFUZZ_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SYS_UN_H_TRUE}" && test -z "${HAVE_SYS_UN_H_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SYS_UN_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libssh2 $as_me -, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +libssh2 config.status - +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/libssh2_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/libssh2_config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/ossfuzz/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ossfuzz/Makefile" ;; + "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "libssh2.pc") CONFIG_FILES="$CONFIG_FILES libssh2.pc" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: summary of build options: + + version: ${LIBSSH2VER} + Host type: ${host} + Install prefix: ${prefix} + Compiler: ${CC} + Compiler flags: ${CFLAGS} + Library types: Shared=${enable_shared}, Static=${enable_static} + Crypto library: ${found_crypto_str} + Clear memory: $enable_clear_memory + Debug build: $enable_debug + Build examples: $build_examples + Path to sshd: $ac_cv_path_SSHD (only for self-tests) + zlib compression: ${found_libz} +" >&5 +printf "%s\n" "$as_me: summary of build options: + + version: ${LIBSSH2VER} + Host type: ${host} + Install prefix: ${prefix} + Compiler: ${CC} + Compiler flags: ${CFLAGS} + Library types: Shared=${enable_shared}, Static=${enable_static} + Crypto library: ${found_crypto_str} + Clear memory: $enable_clear_memory + Debug build: $enable_debug + Build examples: $build_examples + Path to sshd: $ac_cv_path_SSHD (only for self-tests) + zlib compression: ${found_libz} +" >&6;} + diff --git a/vendor/libssh2/configure.ac b/vendor/libssh2/configure.ac new file mode 100644 index 0000000000..c4fc3e4e30 --- /dev/null +++ b/vendor/libssh2/configure.ac @@ -0,0 +1,407 @@ +# AC_PREREQ(2.57) +AC_INIT(libssh2, [-], libssh2-devel@cool.haxx.se) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([src]) +AC_CONFIG_HEADERS([src/libssh2_config.h]) +AM_MAINTAINER_MODE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +dnl SED is needed by some of the tools +AC_PATH_PROG( SED, sed, sed-was-not-found-by-configure, + $PATH:/usr/bin:/usr/local/bin) +AC_SUBST(SED) + +if test "x$SED" = "xsed-was-not-found-by-configure"; then + AC_MSG_WARN([sed was not found, this may ruin your chances to build fine]) +fi + +dnl figure out the libssh2 version +LIBSSH2VER=`$SED -ne 's/^#define LIBSSH2_VERSION *"\(.*\)"/\1/p' ${srcdir}/include/libssh2.h` +AM_INIT_AUTOMAKE +AC_MSG_CHECKING([libssh2 version]) +AC_MSG_RESULT($LIBSSH2VER) + +AC_SUBST(LIBSSH2VER) + +AB_VERSION=$LIBSSH2VER + +AB_INIT + +# Check for the OS. +# Daniel's note: this should not be necessary and we need to work to +# get this removed. +AC_CANONICAL_HOST +case "$host" in + *-mingw*) + CFLAGS="$CFLAGS -DLIBSSH2_WIN32" + LIBS="$LIBS -lws2_32" + ;; + *darwin*) + CFLAGS="$CFLAGS -DLIBSSH2_DARWIN" + ;; + *hpux*) + ;; + *osf*) + CFLAGS="$CFLAGS -D_POSIX_PII_SOCKET" + ;; + *) + ;; +esac + +AC_CHECK_TYPE(long long, + [AC_DEFINE(HAVE_LONGLONG, 1, + [Define to 1 if the compiler supports the 'long long' data type.])] + longlong="yes" +) + +dnl Our configure and build reentrant settings +CURL_CONFIGURE_REENTRANT + +# Some systems (Solaris?) have socket() in -lsocket. +AC_SEARCH_LIBS(socket, socket) + +# Solaris has inet_addr() in -lnsl. +AC_SEARCH_LIBS(inet_addr, nsl) + +AC_SUBST(LIBS) + +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PATH_PROGS(SSHD, [sshd], [], + [$PATH$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR]dnl + [/usr/sbin$PATH_SEPARATOR/usr/etc$PATH_SEPARATOR/etc]) +AM_CONDITIONAL(SSHD, test -n "$SSHD") +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL +AC_C_BIGENDIAN + +dnl check for how to do large files +AC_SYS_LARGEFILE + +# Crypto backends + +found_crypto=none +found_crypto_str="" +support_clear_memory=no +crypto_errors="" + +m4_set_add([crypto_backends], [openssl]) +m4_set_add([crypto_backends], [libgcrypt]) +m4_set_add([crypto_backends], [mbedtls]) +m4_set_add([crypto_backends], [wincng]) + +AC_ARG_WITH([crypto], + AC_HELP_STRING([--with-crypto=auto|]m4_set_contents([crypto_backends], [|]), + [Select crypto backend (default: auto)]), + use_crypto=$withval, + use_crypto=auto +) + +case "${use_crypto}" in + auto|m4_set_contents([crypto_backends], [|])) + m4_set_map([crypto_backends], [LIBSSH2_CHECK_CRYPTO]) + ;; + yes|"") + crypto_errors="No crypto backend specified!" + ;; + *) + crypto_errors="Unknown crypto backend '${use_crypto}' specified!" + ;; +esac + +if test "$found_crypto" = "none"; then + crypto_errors="${crypto_errors} +Specify --with-crypto=\$backend and/or the neccessary library search prefix. + +Known crypto backends: auto, m4_set_contents([crypto_backends], [, ])" + AS_MESSAGE([ERROR: ${crypto_errors}]) +else + test "$found_crypto_str" = "" && found_crypto_str="$found_crypto" +fi + +m4_set_foreach([crypto_backends], [backend], + [AM_CONDITIONAL(m4_toupper(backend), test "$found_crypto" = "backend")] +) + +# libz + +AC_ARG_WITH([libz], + AC_HELP_STRING([--with-libz],[Use libz for compression]), + use_libz=$withval, + use_libz=auto) + +found_libz=no +libz_errors="" + +if test "$use_libz" != no; then + AC_LIB_HAVE_LINKFLAGS([z], [], [#include ]) + if test "$ac_cv_libz" != yes; then + if test "$use_libz" = auto; then + AC_MSG_NOTICE([Cannot find libz, disabling compression]) + found_libz="disabled; no libz found" + else + libz_errors="No libz found! +Try --with-libz-prefix=PATH if you know that you have it." + AS_MESSAGE([ERROR: $libz_errors]) + fi + else + AC_DEFINE(LIBSSH2_HAVE_ZLIB, 1, [Compile in zlib support]) + LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }zlib" + found_libz="yes" + fi +fi + +AC_SUBST(LIBSREQUIRED) + +# +# Optional Settings +# +AC_ARG_ENABLE(crypt-none, + AC_HELP_STRING([--enable-crypt-none],[Permit "none" cipher -- NOT RECOMMENDED]), + [AC_DEFINE(LIBSSH2_CRYPT_NONE, 1, [Enable "none" cipher -- NOT RECOMMENDED])]) + +AC_ARG_ENABLE(mac-none, + AC_HELP_STRING([--enable-mac-none],[Permit "none" MAC -- NOT RECOMMENDED]), + [AC_DEFINE(LIBSSH2_MAC_NONE, 1, [Enable "none" MAC -- NOT RECOMMENDED])]) + +AC_ARG_ENABLE(gex-new, + AC_HELP_STRING([--disable-gex-new],[Disable "new" diffie-hellman-group-exchange-sha1 method]), + [GEX_NEW=$enableval]) +if test "$GEX_NEW" != "no"; then + AC_DEFINE(LIBSSH2_DH_GEX_NEW, 1, [Enable newer diffie-hellman-group-exchange-sha1 syntax]) +fi + +AC_ARG_ENABLE(clear-memory, + AC_HELP_STRING([--disable-clear-memory],[Disable clearing of memory before being freed]), + [CLEAR_MEMORY=$enableval]) +if test "$CLEAR_MEMORY" != "no"; then + if test "$support_clear_memory" = "yes"; then + AC_DEFINE(LIBSSH2_CLEAR_MEMORY, 1, [Enable clearing of memory before being freed]) + enable_clear_memory=yes + else + if test "$CLEAR_MEMORY" = "yes"; then + AC_MSG_ERROR([secure clearing/zeroing of memory is not supported by the selected crypto backend]) + else + AC_MSG_WARN([secure clearing/zeroing of memory is not supported by the selected crypto backend]) + fi + enable_clear_memory=unsupported + fi +else + if test "$support_clear_memory" = "yes"; then + enable_clear_memory=no + else + AC_MSG_WARN([secure clearing/zeroing of memory is not supported by the selected crypto backend]) + enable_clear_memory=unsupported + fi +fi + +dnl ************************************************************ +dnl option to switch on compiler debug options +dnl +AC_MSG_CHECKING([whether to enable pedantic and debug compiler options]) +AC_ARG_ENABLE(debug, +AC_HELP_STRING([--enable-debug],[Enable pedantic and debug options]) +AC_HELP_STRING([--disable-debug],[Disable debug options]), +[ case "$enable_debug" in + no) + AC_MSG_RESULT(no) + CPPFLAGS="$CPPFLAGS -DNDEBUG" + ;; + *) AC_MSG_RESULT(yes) + enable_debug=yes + CPPFLAGS="$CPPFLAGS -DLIBSSH2DEBUG" + CFLAGS="$CFLAGS -g" + + dnl set compiler "debug" options to become more picky, and remove + dnl optimize options from CFLAGS + CURL_CC_DEBUG_OPTS + ;; + esac + ], + enable_debug=no + AC_MSG_RESULT(no) +) + +dnl ************************************************************ +dnl Enable hiding of internal symbols in library to reduce its size and +dnl speed dynamic linking of applications. This currently is only supported +dnl on gcc >= 4.0 and SunPro C. +dnl +AC_MSG_CHECKING([whether to enable hidden symbols in the library]) +AC_ARG_ENABLE(hidden-symbols, +AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library]) +AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_CHECKING([whether $CC supports it]) + if test "$GCC" = yes ; then + if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then + AC_MSG_RESULT(yes) + AC_DEFINE(LIBSSH2_API, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) + CFLAGS="$CFLAGS -fvisibility=hidden" + else + AC_MSG_RESULT(no) + fi + + else + dnl Test for SunPro cc + if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then + AC_MSG_RESULT(yes) + AC_DEFINE(LIBSSH2_API, [__global], [to make a symbol visible]) + CFLAGS="$CFLAGS -xldscope=hidden" + else + AC_MSG_RESULT(no) + fi + fi + ;; + esac ], + AC_MSG_RESULT(no) +) + +# Build example applications? +AC_MSG_CHECKING([whether to build example applications]) +AC_ARG_ENABLE([examples-build], +AC_HELP_STRING([--enable-examples-build], [Build example applications (this is the default)]) +AC_HELP_STRING([--disable-examples-build], [Do not build example applications]), +[case "$enableval" in + no | false) + build_examples='no' + ;; + *) + build_examples='yes' + ;; +esac], [build_examples='yes']) +AC_MSG_RESULT($build_examples) +AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"]) + + +# Build OSS fuzzing targets? +AC_ARG_ENABLE([ossfuzzers], + [AS_HELP_STRING([--enable-ossfuzzers], + [Whether to generate the fuzzers for OSS-Fuzz])], + [have_ossfuzzers=yes], [have_ossfuzzers=no]) +AM_CONDITIONAL([USE_OSSFUZZERS], [test "x$have_ossfuzzers" = "xyes"]) + + +# Set the correct flags for the given fuzzing engine. +AC_SUBST([LIB_FUZZING_ENGINE]) +AM_CONDITIONAL([USE_OSSFUZZ_FLAG], [test "x$LIB_FUZZING_ENGINE" = "x-fsanitize=fuzzer"]) +AM_CONDITIONAL([USE_OSSFUZZ_STATIC], [test -f "$LIB_FUZZING_ENGINE"]) + + +# Checks for header files. +# AC_HEADER_STDC +AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h]) +AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h]) +AC_CHECK_HEADERS([arpa/inet.h netinet/in.h]) +AC_CHECK_HEADERS([sys/un.h], [have_sys_un_h=yes], [have_sys_un_h=no]) +AM_CONDITIONAL([HAVE_SYS_UN_H], test "x$have_sys_un_h" = xyes) + +case $host in + *-*-cygwin* | *-*-cegcc*) + # These are POSIX-like systems using BSD-like sockets API. + ;; + *) + AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h]) + ;; +esac + +case $host in + *darwin*|*interix*) + dnl poll() does not work on these platforms + dnl Interix: "does provide poll(), but the implementing developer must + dnl have been in a bad mood, because poll() only works on the /proc + dnl filesystem here" + dnl Mac OS X's poll has funny behaviors, like: + dnl not being able to do poll on no fildescriptors (10.3?) + dnl not being able to poll on some files (like anything in /dev) + dnl not having reliable timeout support + dnl inconsistent return of POLLHUP where other implementations give POLLIN + AC_MSG_NOTICE([poll use is disabled on this platform]) + ;; + *) + AC_CHECK_FUNCS(poll) + ;; +esac + +AC_CHECK_FUNCS(gettimeofday select strtoll memset_s) + +dnl Check for select() into ws2_32 for Msys/Mingw +if test "$ac_cv_func_select" != "yes"; then + AC_MSG_CHECKING([for select in ws2_32]) + AC_TRY_LINK([ +#ifdef HAVE_WINSOCK2_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#endif + ],[ + select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL); + ],[ + AC_MSG_RESULT([yes]) + HAVE_SELECT="1" + AC_DEFINE_UNQUOTED(HAVE_SELECT, 1, + [Define to 1 if you have the select function.]) + ],[ + AC_MSG_RESULT([no]) + ]) +fi + +AC_FUNC_ALLOCA + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE + +CURL_CHECK_NONBLOCKING_SOCKET + +missing_required_deps=0 + +if test "${libz_errors}" != ""; then + AS_MESSAGE([ERROR: ${libz_errors}]) + missing_required_deps=1 +fi + +if test "$found_crypto" = "none"; then + AS_MESSAGE([ERROR: ${crypto_errors}]) + missing_required_deps=1 +fi + +if test $missing_required_deps = 1; then + AC_MSG_ERROR([Required dependencies are missing!]) +fi + +# Configure parameters +LIBSSH2_CHECK_OPTION_WERROR + +AC_CONFIG_FILES([Makefile + src/Makefile + tests/Makefile + tests/ossfuzz/Makefile + example/Makefile + docs/Makefile + libssh2.pc]) +AC_OUTPUT + +AC_MSG_NOTICE([summary of build options: + + version: ${LIBSSH2VER} + Host type: ${host} + Install prefix: ${prefix} + Compiler: ${CC} + Compiler flags: ${CFLAGS} + Library types: Shared=${enable_shared}, Static=${enable_static} + Crypto library: ${found_crypto_str} + Clear memory: $enable_clear_memory + Debug build: $enable_debug + Build examples: $build_examples + Path to sshd: $ac_cv_path_SSHD (only for self-tests) + zlib compression: ${found_libz} +]) diff --git a/vendor/libssh2/depcomp b/vendor/libssh2/depcomp new file mode 100755 index 0000000000..6b391623c4 --- /dev/null +++ b/vendor/libssh2/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/vendor/libssh2/docs/AUTHORS b/vendor/libssh2/docs/AUTHORS new file mode 100644 index 0000000000..5c7445bf13 --- /dev/null +++ b/vendor/libssh2/docs/AUTHORS @@ -0,0 +1,79 @@ + libssh2 is the result of many friendly people. This list is an attempt to + mention all contributors. If we've missed anyone, tell us! + + This list of names is a-z sorted. + +Adam Gobiowski +Alexander Holyapin +Alexander Lamaison +Alfred Gebert +Ben Kibbey +Bjorn Stenborg +Carlo Bramini +Cristian RodrĂ­guez +Daiki Ueno +Dan Casey +Dan Fandrich +Daniel Stenberg +Dave Hayden +Dave McCaldon +David J Sullivan +David Robins +Dmitry Smirnov +Douglas Masterson +Edink Kadribasic +Erik Brossler +Francois Dupoux +Gellule Xg +Grubsky Grigory +Guenter Knauf +Heiner Steven +Henrik Nordstrom +James Housleys +Jasmeet Bagga +Jean-Louis Charton +Jernej Kovacic +Joey Degges +John Little +Jose Baars +Jussi Mononen +Kamil Dudka +Lars Nordin +Mark McPherson +Mark Smith +Markus Moeller +Matt Lilley +Matthew Booth +Maxime Larocque +Mike Protts +Mikhail Gusarov +Neil Gierman +Olivier Hervieu +Paul Howarth +Paul Querna +Paul Veldkamp +Peter Krempa +Peter O'Gorman +Peter Stuge +Pierre Joye +Rafael Kitover +Romain Bondue +Sara Golemon +Satish Mittal +Sean Peterson +Selcuk Gueney +Simon Hart +Simon Josefsson +Sofian Brabez +Steven Ayre +Steven Dake +Steven Van Ingelgem +TJ Saunders +Tommy Lindgren +Tor Arntsen +Vincent Jaulin +Vincent Torri +Vlad Grachov +Wez Furlong +Yang Tse +Zl Liu diff --git a/vendor/libssh2/docs/BINDINGS b/vendor/libssh2/docs/BINDINGS new file mode 100644 index 0000000000..471f9be8c9 --- /dev/null +++ b/vendor/libssh2/docs/BINDINGS @@ -0,0 +1,29 @@ + +Creative people have written bindings or interfaces for various environments +and programming languages. Using one of these bindings allows you to take +advantage of libssh2 directly from within your favourite language. + +The bindings listed below are not part of the libssh2 distribution archives, +but must be downloaded and installed separately. + +Cocoa/Objective-C + https://github.com/karelia/libssh2_sftp-Cocoa-wrapper + +Haskell + FFI bindings - https://hackage.haskell.org/package/libssh2 + +Perl + Net::SSH2 - https://metacpan.org/pod/Net::SSH2 + +PHP + ssh2 - https://pecl.php.net/package/ssh2 + +Python + pylibssh2 - https://pypi.python.org/pypi/pylibssh2 + +Python-ctypes + + PySsh2 - https://github.com/gellule/PySsh2 + +Ruby + libssh2-ruby - https://github.com/mitchellh/libssh2-ruby diff --git a/vendor/libssh2/docs/CMakeLists.txt b/vendor/libssh2/docs/CMakeLists.txt new file mode 100644 index 0000000000..b69ccced5c --- /dev/null +++ b/vendor/libssh2/docs/CMakeLists.txt @@ -0,0 +1,211 @@ +# Copyright (c) 2014 Alexander Lamaison +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided +# that the following conditions are met: +# +# Redistributions of source code must retain the above +# copyright notice, this list of conditions and the +# following disclaimer. +# +# Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# Neither the name of the copyright holder nor the names +# of any other contributors may be used to endorse or +# promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + +set(MAN_PAGES + libssh2_agent_connect.3 + libssh2_agent_disconnect.3 + libssh2_agent_free.3 + libssh2_agent_get_identity.3 + libssh2_agent_get_identity_path.3 + libssh2_agent_init.3 + libssh2_agent_list_identities.3 + libssh2_agent_set_identity_path.3 + libssh2_agent_userauth.3 + libssh2_banner_set.3 + libssh2_base64_decode.3 + libssh2_channel_close.3 + libssh2_channel_direct_tcpip.3 + libssh2_channel_direct_tcpip_ex.3 + libssh2_channel_eof.3 + libssh2_channel_exec.3 + libssh2_channel_flush.3 + libssh2_channel_flush_ex.3 + libssh2_channel_flush_stderr.3 + libssh2_channel_forward_accept.3 + libssh2_channel_forward_cancel.3 + libssh2_channel_forward_listen.3 + libssh2_channel_forward_listen_ex.3 + libssh2_channel_free.3 + libssh2_channel_get_exit_signal.3 + libssh2_channel_get_exit_status.3 + libssh2_channel_handle_extended_data.3 + libssh2_channel_handle_extended_data2.3 + libssh2_channel_ignore_extended_data.3 + libssh2_channel_open_ex.3 + libssh2_channel_open_session.3 + libssh2_channel_process_startup.3 + libssh2_channel_read.3 + libssh2_channel_read_ex.3 + libssh2_channel_read_stderr.3 + libssh2_channel_receive_window_adjust.3 + libssh2_channel_receive_window_adjust2.3 + libssh2_channel_request_pty.3 + libssh2_channel_request_pty_ex.3 + libssh2_channel_request_pty_size.3 + libssh2_channel_request_pty_size_ex.3 + libssh2_channel_send_eof.3 + libssh2_channel_set_blocking.3 + libssh2_channel_setenv.3 + libssh2_channel_setenv_ex.3 + libssh2_channel_shell.3 + libssh2_channel_subsystem.3 + libssh2_channel_wait_closed.3 + libssh2_channel_wait_eof.3 + libssh2_channel_window_read.3 + libssh2_channel_window_read_ex.3 + libssh2_channel_window_write.3 + libssh2_channel_window_write_ex.3 + libssh2_channel_write.3 + libssh2_channel_write_ex.3 + libssh2_channel_write_stderr.3 + libssh2_channel_x11_req.3 + libssh2_channel_x11_req_ex.3 + libssh2_exit.3 + libssh2_free.3 + libssh2_hostkey_hash.3 + libssh2_init.3 + libssh2_keepalive_config.3 + libssh2_keepalive_send.3 + libssh2_knownhost_add.3 + libssh2_knownhost_addc.3 + libssh2_knownhost_check.3 + libssh2_knownhost_checkp.3 + libssh2_knownhost_del.3 + libssh2_knownhost_free.3 + libssh2_knownhost_get.3 + libssh2_knownhost_init.3 + libssh2_knownhost_readfile.3 + libssh2_knownhost_readline.3 + libssh2_knownhost_writefile.3 + libssh2_knownhost_writeline.3 + libssh2_poll.3 + libssh2_poll_channel_read.3 + libssh2_publickey_add.3 + libssh2_publickey_add_ex.3 + libssh2_publickey_init.3 + libssh2_publickey_list_fetch.3 + libssh2_publickey_list_free.3 + libssh2_publickey_remove.3 + libssh2_publickey_remove_ex.3 + libssh2_publickey_shutdown.3 + libssh2_scp_recv.3 + libssh2_scp_recv2.3 + libssh2_scp_send.3 + libssh2_scp_send64.3 + libssh2_scp_send_ex.3 + libssh2_session_abstract.3 + libssh2_session_banner_get.3 + libssh2_session_banner_set.3 + libssh2_session_block_directions.3 + libssh2_session_callback_set.3 + libssh2_session_disconnect.3 + libssh2_session_disconnect_ex.3 + libssh2_session_flag.3 + libssh2_session_free.3 + libssh2_session_get_blocking.3 + libssh2_session_get_timeout.3 + libssh2_session_handshake.3 + libssh2_session_hostkey.3 + libssh2_session_init.3 + libssh2_session_init_ex.3 + libssh2_session_last_errno.3 + libssh2_session_last_error.3 + libssh2_session_set_last_error.3 + libssh2_session_method_pref.3 + libssh2_session_methods.3 + libssh2_session_set_blocking.3 + libssh2_session_set_timeout.3 + libssh2_session_startup.3 + libssh2_session_supported_algs.3 + libssh2_sftp_close.3 + libssh2_sftp_close_handle.3 + libssh2_sftp_closedir.3 + libssh2_sftp_fsetstat.3 + libssh2_sftp_fstat.3 + libssh2_sftp_fstat_ex.3 + libssh2_sftp_fstatvfs.3 + libssh2_sftp_fsync.3 + libssh2_sftp_get_channel.3 + libssh2_sftp_init.3 + libssh2_sftp_last_error.3 + libssh2_sftp_lstat.3 + libssh2_sftp_mkdir.3 + libssh2_sftp_mkdir_ex.3 + libssh2_sftp_open.3 + libssh2_sftp_open_ex.3 + libssh2_sftp_opendir.3 + libssh2_sftp_read.3 + libssh2_sftp_readdir.3 + libssh2_sftp_readdir_ex.3 + libssh2_sftp_readlink.3 + libssh2_sftp_realpath.3 + libssh2_sftp_rename.3 + libssh2_sftp_rename_ex.3 + libssh2_sftp_rewind.3 + libssh2_sftp_rmdir.3 + libssh2_sftp_rmdir_ex.3 + libssh2_sftp_seek.3 + libssh2_sftp_seek64.3 + libssh2_sftp_setstat.3 + libssh2_sftp_shutdown.3 + libssh2_sftp_stat.3 + libssh2_sftp_stat_ex.3 + libssh2_sftp_statvfs.3 + libssh2_sftp_symlink.3 + libssh2_sftp_symlink_ex.3 + libssh2_sftp_tell.3 + libssh2_sftp_tell64.3 + libssh2_sftp_unlink.3 + libssh2_sftp_unlink_ex.3 + libssh2_sftp_write.3 + libssh2_trace.3 + libssh2_trace_sethandler.3 + libssh2_userauth_authenticated.3 + libssh2_userauth_banner.3 + libssh2_userauth_hostbased_fromfile.3 + libssh2_userauth_hostbased_fromfile_ex.3 + libssh2_userauth_keyboard_interactive.3 + libssh2_userauth_keyboard_interactive_ex.3 + libssh2_userauth_list.3 + libssh2_userauth_password.3 + libssh2_userauth_password_ex.3 + libssh2_userauth_publickey.3 + libssh2_userauth_publickey_fromfile.3 + libssh2_userauth_publickey_fromfile_ex.3 + libssh2_userauth_publickey_frommemory.3 + libssh2_version.3) + +include(GNUInstallDirs) +install(FILES ${MAN_PAGES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) diff --git a/vendor/libssh2/docs/HACKING b/vendor/libssh2/docs/HACKING new file mode 100644 index 0000000000..5da8e66c23 --- /dev/null +++ b/vendor/libssh2/docs/HACKING @@ -0,0 +1,13 @@ + +libssh2 source code style guide: + + - 4 level indent + - spaces-only (no tabs) + - open braces on the if/for line: + + if (banana) { + go_nuts(); + } + + - keep source lines shorter than 80 columns + - See libssh2-style.el for how to achieve this within Emacs diff --git a/vendor/libssh2/docs/HACKING-CRYPTO b/vendor/libssh2/docs/HACKING-CRYPTO new file mode 100644 index 0000000000..85d813aa62 --- /dev/null +++ b/vendor/libssh2/docs/HACKING-CRYPTO @@ -0,0 +1,939 @@ + Definitions needed to implement a specific crypto library + +This document offers some hints about implementing a new crypto library +interface. + +A crypto library interface consists of at least a header file, defining +entities referenced from the libssh2 core modules. +Real code implementation (if needed), is left at the implementor's choice. + +This document lists the entities that must/may be defined in the header file. + +Procedures listed as "void" may indeed have a result type: the void indication +indicates the libssh2 core modules never use the function result. + + +0) Build system. + +Adding a crypto backend to the autotools build system (./configure) is easy: + +0.1) Add one new line in configure.ac + +m4_set_add([crypto_backends], [newname]) + +This automatically creates a --with-crypto=newname option. + +0.2) Add an m4_case stanza to LIBSSH2_CRYPTO_CHECK in acinclude.m4 + +This must check for all required libraries, and if found set and AC_SUBST a +variable with the library linking flags. The recommended method is to use +LIBSSH2_LIB_HAVE_LINKFLAGS from LIBSSH2_CRYPTO_CHECK, which automatically +creates and handles a --with-$newname-prefix option and sets an +LTLIBNEWNAME variable on success. + +0.3) Create Makefile.newname.inc in the top-level directory + +This must set CRYPTO_CSOURCES, CRYPTO_HHEADERS and CRYPTO_LTLIBS. +Set CRYPTO_CSOURCES and CRYPTO_HHEADERS to the new backend source files +and set CRYPTO_LTLIBS to the required library linking parameters, e.g. +$(LTLIBNEWNAME) as generated by by LIBSSH2_LIB_HAVE_LINKFLAGS. + +0.4) Add a new block in src/Makefile.am + +if NEWNAME +include ../Makefile.newname.inc +endif + + +1) Crypto library initialization/termination. + +void libssh2_crypto_init(void); +Initializes the crypto library. May be an empty macro if not needed. + +void libssh2_crypto_exit(void); +Terminates the crypto library use. May be an empty macro if not needed. + + +2) HMAC + +libssh2_hmac_ctx +Type of an HMAC computation context. Generally a struct. +Used for all hash algorithms. + +void libssh2_hmac_ctx_init(libssh2_hmac_ctx ctx); +Initializes the HMAC computation context ctx. +Called before setting-up the hash algorithm. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_update(libssh2_hmac_ctx ctx, + const unsigned char *data, + int datalen); +Continue computation of an HMAC on datalen bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_final(libssh2_hmac_ctx ctx, + unsigned char output[]); +Get the computed HMAC from context ctx into the output buffer. The +minimum data buffer size depends on the HMAC hash algorithm. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_cleanup(libssh2_hmac_ctx *ctx); +Releases the HMAC computation context at ctx. + + +3) Hash algorithms. + +3.1) SHA-1 +Must always be implemented. + +SHA_DIGEST_LENGTH +#define to 20, the SHA-1 digest length. + +libssh2_sha1_ctx +Type of an SHA-1 computation context. Generally a struct. + +int libssh2_sha1_init(libssh2_sha1_ctx *x); +Initializes the SHA-1 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha1_update(libssh2_sha1_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-1 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha1_final(libssh2_sha1_ctx ctx, + unsigned char output[SHA_DIGEST_LEN]); +Get the computed SHA-1 signature from context ctx and store it into the +output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_sha1_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-SHA-1 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.2) SHA-256 +Must always be implemented. + +SHA256_DIGEST_LENGTH +#define to 32, the SHA-256 digest length. + +libssh2_sha256_ctx +Type of an SHA-256 computation context. Generally a struct. + +int libssh2_sha256_init(libssh2_sha256_ctx *x); +Initializes the SHA-256 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha256_update(libssh2_sha256_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-256 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha256_final(libssh2_sha256_ctx ctx, + unsigned char output[SHA256_DIGEST_LENGTH]); +Gets the computed SHA-256 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +int libssh2_sha256(const unsigned char *message, + unsigned long len, + unsigned char output[SHA256_DIGEST_LENGTH]); +Computes the SHA-256 signature over the given message of length len and +store the result into the output buffer. +Return 1 if error, else 0. +Note: Seems unused in current code, but defined in each crypto library backend. + +LIBSSH2_HMAC_SHA256 +#define as 1 if the crypto library supports HMAC-SHA-256, else 0. +If defined as 0, the rest of this section can be omitted. + +void libssh2_hmac_sha256_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-256 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.3) SHA-384 +Mandatory if ECDSA is implemented. Can be omitted otherwise. + +SHA384_DIGEST_LENGTH +#define to 48, the SHA-384 digest length. + +libssh2_sha384_ctx +Type of an SHA-384 computation context. Generally a struct. + +int libssh2_sha384_init(libssh2_sha384_ctx *x); +Initializes the SHA-384 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha384_update(libssh2_sha384_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-384 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha384_final(libssh2_sha384_ctx ctx, + unsigned char output[SHA384_DIGEST_LENGTH]); +Gets the computed SHA-384 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +int libssh2_sha384(const unsigned char *message, + unsigned long len, + unsigned char output[SHA384_DIGEST_LENGTH]); +Computes the SHA-384 signature over the given message of length len and +store the result into the output buffer. +Return 1 if error, else 0. + +3.4) SHA-512 +Must always be implemented. + +SHA512_DIGEST_LENGTH +#define to 64, the SHA-512 digest length. + +libssh2_sha512_ctx +Type of an SHA-512 computation context. Generally a struct. + +int libssh2_sha512_init(libssh2_sha512_ctx *x); +Initializes the SHA-512 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_sha512_update(libssh2_sha512_ctx ctx, + const unsigned char *data, + size_t len); +Continue computation of SHA-512 on len bytes at data using context ctx. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_sha512_final(libssh2_sha512_ctx ctx, + unsigned char output[SHA512_DIGEST_LENGTH]); +Gets the computed SHA-512 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +int libssh2_sha512(const unsigned char *message, + unsigned long len, + unsigned char output[SHA512_DIGEST_LENGTH]); +Computes the SHA-512 signature over the given message of length len and +store the result into the output buffer. +Return 1 if error, else 0. +Note: Seems unused in current code, but defined in each crypto library backend. + +LIBSSH2_HMAC_SHA512 +#define as 1 if the crypto library supports HMAC-SHA-512, else 0. +If defined as 0, the rest of this section can be omitted. + +void libssh2_hmac_sha512_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-512 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.5) MD5 +LIBSSH2_MD5 +#define to 1 if the crypto library supports MD5, else 0. +If defined as 0, the rest of this section can be omitted. + +MD5_DIGEST_LENGTH +#define to 16, the MD5 digest length. + +libssh2_md5_ctx +Type of an MD5 computation context. Generally a struct. + +int libssh2_md5_init(libssh2_md5_ctx *x); +Initializes the MD5 computation context at x. +Returns 1 for success and 0 for failure + +void libssh2_md5_update(libssh2_md5_ctx ctx, + const unsigned char *data, + size_t len); +Continues computation of MD5 on len bytes at data using context ctx. +Returns 1 for success and 0 for failure. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_md5_final(libssh2_md5_ctx ctx, + unsigned char output[MD5_DIGEST_LENGTH]); +Gets the computed MD5 signature from context ctx into the output buffer. +Release the context. +Note: if the ctx parameter is modified by the underlying code, +this procedure must be implemented as a macro to map ctx --> &ctx. + +void libssh2_hmac_md5_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-MD5 computation using the +keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). + +3.6) RIPEMD-160 +LIBSSH2_HMAC_RIPEMD +#define as 1 if the crypto library supports HMAC-RIPEMD-160, else 0. +If defined as 0, the rest of this section can be omitted. + +void libssh2_hmac_ripemd160_init(libssh2_hmac_ctx *ctx, + const void *key, + int keylen); +Setup the HMAC computation context ctx for an HMAC-RIPEMD-160 computation using +the keylen-byte key. Is invoked just after libssh2_hmac_ctx_init(). +Returns 1 for success and 0 for failure. + + +4) Bidirectional key ciphers. + +_libssh2_cipher_ctx +Type of a cipher computation context. + +_libssh2_cipher_type(name); +Macro defining name as storage identifying a cipher algorithm for +the crypto library interface. No trailing semicolon. + +int _libssh2_cipher_init(_libssh2_cipher_ctx *h, + _libssh2_cipher_type(algo), + unsigned char *iv, + unsigned char *secret, + int encrypt); +Creates a cipher context for the given algorithm with the initialization vector +iv and the secret key secret. Prepare for encryption or decryption depending on +encrypt. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_cipher_crypt(_libssh2_cipher_ctx *ctx, + _libssh2_cipher_type(algo), + int encrypt, + unsigned char *block, + size_t blocksize); +Encrypt or decrypt in-place data at (block, blocksize) using the given +context and/or algorithm. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +void _libssh2_cipher_dtor(_libssh2_cipher_ctx *ctx); +Release cipher context at ctx. + +4.1) AES +4.1.1) AES in CBC block mode. +LIBSSH2_AES +#define as 1 if the crypto library supports AES in CBC mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_aes128 +AES-128-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes192 +AES-192-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes256 +AES-256-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.1.2) AES in CTR block mode. +LIBSSH2_AES_CTR +#define as 1 if the crypto library supports AES in CTR mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_aes128ctr +AES-128-CTR algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes192ctr +AES-192-CTR algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +_libssh2_cipher_aes256ctr +AES-256-CTR algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.2) Blowfish in CBC block mode. +LIBSSH2_BLOWFISH +#define as 1 if the crypto library supports blowfish in CBC mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_blowfish +Blowfish-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.3) RC4. +LIBSSH2_RC4 +#define as 1 if the crypto library supports RC4 (arcfour), else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_arcfour +RC4 algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.4) CAST5 in CBC block mode. +LIBSSH2_CAST +#define 1 if the crypto library supports cast, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_cast5 +CAST5-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + +4.5) Tripple DES in CBC block mode. +LIBSSH2_3DES +#define as 1 if the crypto library supports TripleDES in CBC mode, else 0. +If defined as 0, the rest of this section can be omitted. + +_libssh2_cipher_3des +TripleDES-CBC algorithm identifier initializer. +#define with constant value of type _libssh2_cipher_type(). + + +5) Diffie-Hellman support. + +5.1) Diffie-Hellman context. +_libssh2_dh_ctx +Type of a Diffie-Hellman computation context. +Must always be defined. + +5.2) Diffie-Hellman computation procedures. +void libssh2_dh_init(_libssh2_dh_ctx *dhctx); +Initializes the Diffie-Hellman context at `dhctx'. No effective context +creation needed here. + +int libssh2_dh_key_pair(_libssh2_dh_ctx *dhctx, _libssh2_bn *public, + _libssh2_bn *g, _libssh2_bn *p, int group_order, + _libssh2_bn_ctx *bnctx); +Generates a Diffie-Hellman key pair using base `g', prime `p' and the given +`group_order'. Can use the given big number context `bnctx' if needed. +The private key is stored as opaque in the Diffie-Hellman context `*dhctx' and +the public key is returned in `public'. +0 is returned upon success, else -1. + +int libssh2_dh_secret(_libssh2_dh_ctx *dhctx, _libssh2_bn *secret, + _libssh2_bn *f, _libssh2_bn *p, _libssh2_bn_ctx * bnctx) +Computes the Diffie-Hellman secret from the previously created context `*dhctx', +the public key `f' from the other party and the same prime `p' used at +context creation. The result is stored in `secret'. +0 is returned upon success, else -1. + +void libssh2_dh_dtor(_libssh2_dh_ctx *dhctx) +Destroys Diffie-Hellman context at `dhctx' and resets its storage. + + +6) Big numbers. +Positive multi-byte integers support is sufficient. + +6.1) Computation contexts. +This has a real meaning if the big numbers computations need some context +storage. If not, use a dummy type and functions (macros). + +_libssh2_bn_ctx +Type of multiple precision computation context. May not be empty. if not used, +#define as char, for example. + +_libssh2_bn_ctx _libssh2_bn_ctx_new(void); +Returns a new multiple precision computation context. + +void _libssh2_bn_ctx_free(_libssh2_bn_ctx ctx); +Releases a multiple precision computation context. + +6.2) Computation support. +_libssh2_bn +Type of multiple precision numbers (aka bignumbers or huge integers) for the +crypto library. + +_libssh2_bn * _libssh2_bn_init(void); +Creates a multiple precision number (preset to zero). + +_libssh2_bn * _libssh2_bn_init_from_bin(void); +Create a multiple precision number intended to be set by the +_libssh2_bn_from_bin() function (see below). Unlike _libssh2_bn_init(), this +code may be a dummy initializer if the _libssh2_bn_from_bin() actually +allocates the number. Returns a value of type _libssh2_bn *. + +void _libssh2_bn_free(_libssh2_bn *bn); +Destroys the multiple precision number at bn. + +unsigned long _libssh2_bn_bytes(_libssh2_bn *bn); +Get the number of bytes needed to store the bits of the multiple precision +number at bn. + +unsigned long _libssh2_bn_bits(_libssh2_bn *bn); +Returns the number of bits of multiple precision number at bn. + +int _libssh2_bn_set_word(_libssh2_bn *bn, unsigned long val); +Sets the value of bn to val. +Returns 1 on success, 0 otherwise. + +_libssh2_bn * _libssh2_bn_from_bin(_libssh2_bn *bn, int len, + const unsigned char *val); +Converts the positive integer in big-endian form of length len at val +into a _libssh2_bn and place it in bn. If bn is NULL, a new _libssh2_bn is +created. +Returns a pointer to target _libssh2_bn or NULL if error. + +int _libssh2_bn_to_bin(_libssh2_bn *bn, unsigned char *val); +Converts the absolute value of bn into big-endian form and store it at +val. val must point to _libssh2_bn_bytes(bn) bytes of memory. +Returns the length of the big-endian number. + + +7) Private key algorithms. +Format of an RSA public key: +a) "ssh-rsa". +b) RSA exponent, MSB first, with high order bit = 0. +c) RSA modulus, MSB first, with high order bit = 0. +Each item is preceded by its 32-bit byte length, MSB first. + +Format of a DSA public key: +a) "ssh-dss". +b) p, MSB first, with high order bit = 0. +c) q, MSB first, with high order bit = 0. +d) g, MSB first, with high order bit = 0. +e) pub_key, MSB first, with high order bit = 0. +Each item is preceded by its 32-bit byte length, MSB first. + +Format of an ECDSA public key: +a) "ecdsa-sha2-nistp256" or "ecdsa-sha2-nistp384" or "ecdsa-sha2-nistp521". +b) domain: "nistp256", "nistp384" or "nistp521" matching a). +c) raw public key ("octal"). +Each item is preceded by its 32-bit byte length, MSB first. + +Format of an ED25519 public key: +a) "ssh-ed25519". +b) raw key (32 bytes). +Each item is preceded by its 32-bit byte length, MSB first. + +int _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session, + unsigned char **method, + size_t *method_len, + unsigned char **pubkeydata, + size_t *pubkeydata_len, + const char *privatekey, + const char *passphrase); +Reads a private key from file privatekey and extract the public key --> +(pubkeydata, pubkeydata_len). Store the associated method (ssh-rsa or ssh-dss) +into (method, method_len). +Both buffers have to be allocated using LIBSSH2_ALLOC(). +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_pub_priv_keyfilememory(LIBSSH2_SESSION *session, + unsigned char **method, + size_t *method_len, + unsigned char **pubkeydata, + size_t *pubkeydata_len, + const char *privatekeydata, + size_t privatekeydata_len, + const char *passphrase); +Gets a private key from bytes at (privatekeydata, privatekeydata_len) and +extract the public key --> (pubkeydata, pubkeydata_len). Store the associated +method (ssh-rsa or ssh-dss) into (method, method_len). +Both buffers have to be allocated using LIBSSH2_ALLOC(). +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + + +7.1) RSA +LIBSSH2_RSA +#define as 1 if the crypto library supports RSA, else 0. +If defined as 0, the rest of this section can be omitted. + +libssh2_rsa_ctx +Type of an RSA computation context. Generally a struct. + +int _libssh2_rsa_new(libssh2_rsa_ctx **rsa, + const unsigned char *edata, + unsigned long elen, + const unsigned char *ndata, + unsigned long nlen, + const unsigned char *ddata, + unsigned long dlen, + const unsigned char *pdata, + unsigned long plen, + const unsigned char *qdata, + unsigned long qlen, + const unsigned char *e1data, + unsigned long e1len, + const unsigned char *e2data, + unsigned long e2len, + const unsigned char *coeffdata, unsigned long coefflen); +Creates a new context for RSA computations from key source values: + pdata, plen Prime number p. Only used if private key known (ddata). + qdata, qlen Prime number q. Only used if private key known (ddata). + ndata, nlen Modulus n. + edata, elen Exponent e. + ddata, dlen e^-1 % phi(n) = private key. May be NULL if unknown. + e1data, e1len dp = d % (p-1). Only used if private key known (dtata). + e2data, e2len dq = d % (q-1). Only used if private key known (dtata). + coeffdata, coefflen q^-1 % p. Only used if private key known. +Returns 0 if OK. +This procedure is already prototyped in crypto.h. +Note: the current generic code only calls this function with e and n (public +key parameters): unless used internally by the backend, it is not needed to +support the private key and the other parameters here. + +int _libssh2_rsa_new_private(libssh2_rsa_ctx **rsa, + LIBSSH2_SESSION *session, + const char *filename, + unsigned const char *passphrase); +Reads an RSA private key from file filename into a new RSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_rsa_new_private_frommemory(libssh2_rsa_ctx **rsa, + LIBSSH2_SESSION *session, + const char *data, + size_t data_len, + unsigned const char *passphrase); +Gets an RSA private key from data into a new RSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx *rsa, + const unsigned char *sig, + unsigned long sig_len, + const unsigned char *m, unsigned long m_len); +Verify (sig, sig_len) signature of (m, m_len) using an SHA-1 hash and the +RSA context. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_rsa_sha1_signv(LIBSSH2_SESSION *session, + unsigned char **sig, size_t *siglen, + int count, const struct iovec vector[], + libssh2_rsa_ctx *ctx); +RSA signs the SHA-1 hash computed over the count data chunks in vector. +Signature is stored at (sig, siglen). +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +Note: this procedure is optional: if provided, it MUST be defined as a macro. + +int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION *session, + libssh2_rsa_ctx *rsactx, + const unsigned char *hash, + size_t hash_len, + unsigned char **signature, + size_t *signature_len); +RSA signs the (hash, hashlen) SHA-1 hash bytes and stores the allocated +signature at (signature, signature_len). +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. +Note: this procedure is not used if macro _libssh2_rsa_sha1_signv() is defined. + +void _libssh2_rsa_free(libssh2_rsa_ctx *rsactx); +Releases the RSA computation context at rsactx. + +LIBSSH2_RSA_SHA2 +#define as 1 if the crypto library supports RSA SHA2 256/512, else 0. +If defined as 0, the rest of this section can be omitted. + +int _libssh2_rsa_sha2_sign(LIBSSH2_SESSION * session, + libssh2_rsa_ctx * rsactx, + const unsigned char *hash, + size_t hash_len, + unsigned char **signature, + size_t *signature_len); +RSA signs the (hash, hashlen) SHA-2 hash bytes based on hash length and stores +the allocated signature at (signature, signature_len). +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. +Note: this procedure is not used if macro _libssh2_rsa_sha1_signv() is defined. + +int _libssh2_rsa_sha2_verify(libssh2_rsa_ctx * rsa, + size_t hash_len, + const unsigned char *sig, + unsigned long sig_len, + const unsigned char *m, unsigned long m_len); +Verify (sig, sig_len) signature of (m, m_len) using an SHA-2 hash based on +hash length and the RSA context. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +7.2) DSA +LIBSSH2_DSA +#define as 1 if the crypto library supports DSA, else 0. +If defined as 0, the rest of this section can be omitted. + + +libssh2_dsa_ctx +Type of a DSA computation context. Generally a struct. + +int _libssh2_dsa_new(libssh2_dsa_ctx **dsa, + const unsigned char *pdata, + unsigned long plen, + const unsigned char *qdata, + unsigned long qlen, + const unsigned char *gdata, + unsigned long glen, + const unsigned char *ydata, + unsigned long ylen, + const unsigned char *x, unsigned long x_len); +Creates a new context for DSA computations from source key values: + pdata, plen Prime number p. Only used if private key known (ddata). + qdata, qlen Prime number q. Only used if private key known (ddata). + gdata, glen G number. + ydata, ylen Public key. + xdata, xlen Private key. Only taken if xlen non-zero. +Returns 0 if OK. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_new_private(libssh2_dsa_ctx **dsa, + LIBSSH2_SESSION *session, + const char *filename, + unsigned const char *passphrase); +Gets a DSA private key from file filename into a new DSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_new_private_frommemory(libssh2_dsa_ctx **dsa, + LIBSSH2_SESSION *session, + const char *data, + size_t data_len, + unsigned const char *passphrase); +Gets a DSA private key from the data_len-bytes data into a new DSA context. +Must call _libssh2_init_if_needed(). +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx, + const unsigned char *sig, + const unsigned char *m, unsigned long m_len); +Verify (sig, siglen) signature of (m, m_len) using an SHA-1 hash and the +DSA context. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_dsa_sha1_sign(libssh2_dsa_ctx *dsactx, + const unsigned char *hash, + unsigned long hash_len, unsigned char *sig); +DSA signs the (hash, hash_len) data using SHA-1 and store the signature at sig. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +void _libssh2_dsa_free(libssh2_dsa_ctx *dsactx); +Releases the DSA computation context at dsactx. + + +7.3) ECDSA +LIBSSH2_ECDSA +#define as 1 if the crypto library supports ECDSA, else 0. +If defined as 0, _libssh2_ec_key should be defined as void and the rest of +this section can be omitted. + +EC_MAX_POINT_LEN +Maximum point length. Usually defined as ((528 * 2 / 8) + 1) (= 133). + +libssh2_ecdsa_ctx +Type of an ECDSA computation context. Generally a struct. + +_libssh2_ec_key +Type of an elliptic curve key. + +libssh2_curve_type +An enum type defining curve types. Current supported identifiers are: + LIBSSH2_EC_CURVE_NISTP256 + LIBSSH2_EC_CURVE_NISTP384 + LIBSSH2_EC_CURVE_NISTP521 + +int _libssh2_ecdsa_create_key(_libssh2_ec_key **out_private_key, + unsigned char **out_public_key_octal, + size_t *out_public_key_octal_len, + libssh2_curve_type curve_type); +Create a new ECDSA private key of type curve_type and return it at +out_private_key. If out_public_key_octal is not NULL, store an allocated +pointer to the associated public key in "octal" form in it and its length +at out_public_key_octal_len. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_new_private(libssh2_ecdsa_ctx **ec_ctx, + LIBSSH2_SESSION * session, + const char *filename, + unsigned const char *passphrase); +Reads an ECDSA private key from PEM file filename into a new ECDSA context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_new_private_frommemory(libssh2_ecdsa_ctx ** ec_ctx, + LIBSSH2_SESSION * session, + const char *filedata, + size_t filedata_len, + unsigned const char *passphrase); +Builds an ECDSA private key from PEM data at filedata of length filedata_len +into a new ECDSA context stored at ec_ctx. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_curve_name_with_octal_new(libssh2_ecdsa_ctx **ecdsactx, + const unsigned char *k, + size_t k_len, + libssh2_curve_type type); +Stores at ecdsactx a new ECDSA context associated with the given curve type +and with "octal" form public key (k, k_len). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_new_openssh_private(libssh2_ecdsa_ctx **ec_ctx, + LIBSSH2_SESSION * session, + const char *filename, + unsigned const char *passphrase); +Reads a PEM-encoded ECDSA private key from file filename encrypted with +passphrase and stores at ec_ctx a new ECDSA context for it. +Return 0 if OK, else -1. +Currently used only from openssl backend (ought to be private). +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_sign(LIBSSH2_SESSION *session, libssh2_ecdsa_ctx *ec_ctx, + const unsigned char *hash, unsigned long hash_len, + unsigned char **signature, size_t *signature_len); +ECDSA signs the (hash, hashlen) hash bytes and stores the allocated +signature at (signature, signature_len). Hash algorithm used should be +SHA-256, SHA-384 or SHA-512 depending on type stored in ECDSA context at ec_ctx. +Signature buffer must be allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_verify(libssh2_ecdsa_ctx *ctx, + const unsigned char *r, size_t r_len, + const unsigned char *s, size_t s_len, + const unsigned char *m, size_t m_len); +Verify the ECDSA signature made of (r, r_len) and (s, s_len) of (m, m_len) +using the hash algorithm configured in the ECDSA context ctx. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +libssh2_curve_type _libssh2_ecdsa_get_curve_type(libssh2_ecdsa_ctx *ecdsactx); +Returns the curve type associated with given context. +This procedure is already prototyped in crypto.h. + +int _libssh2_ecdsa_curve_type_from_name(const char *name, + libssh2_curve_type *out_type); +Stores in out_type the curve type matching string name of the form +"ecdsa-sha2-nistpxxx". +Return 0 if OK, else -1. +Currently used only from openssl backend (ought to be private). +This procedure is already prototyped in crypto.h. + +void _libssh2_ecdsa_free(libssh2_ecdsa_ctx *ecdsactx); +Releases the ECDSA computation context at ecdsactx. + + +7.4) ED25519 +LIBSSH2_ED25519 +#define as 1 if the crypto library supports ED25519, else 0. +If defined as 0, the rest of this section can be omitted. + + +libssh2_ed25519_ctx +Type of an ED25519 computation context. Generally a struct. + +int _libssh2_curve25519_new(LIBSSH2_SESSION *session, libssh2_ed25519_ctx **ctx, + uint8_t **out_public_key, + uint8_t **out_private_key); +Generates an ED25519 key pair, stores a pointer to them at out_private_key +and out_public_key respectively and stores at ctx a new ED25519 context for +this key. +Argument ctx, out_private_key and out_public key may be NULL to disable storing +the corresponding value. +Length of each key is LIBSSH2_ED25519_KEY_LEN (32 bytes). +Key buffers are allocated and should be released by caller after use. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_new_private(libssh2_ed25519_ctx **ed_ctx, + LIBSSH2_SESSION *session, + const char *filename, + const uint8_t *passphrase); +Reads an ED25519 private key from PEM file filename into a new ED25519 context. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_new_public(libssh2_ed25519_ctx **ed_ctx, + LIBSSH2_SESSION *session, + const unsigned char *raw_pub_key, + const uint8_t key_len); +Stores at ed_ctx a new ED25519 key context for raw public key (raw_pub_key, +key_len). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_new_private_frommemory(libssh2_ed25519_ctx **ed_ctx, + LIBSSH2_SESSION *session, + const char *filedata, + size_t filedata_len, + unsigned const char *passphrase); +Builds an ED25519 private key from PEM data at filedata of length filedata_len +into a new ED25519 context stored at ed_ctx. +Must call _libssh2_init_if_needed(). +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_sign(libssh2_ed25519_ctx *ctx, LIBSSH2_SESSION *session, + uint8_t **out_sig, size_t *out_sig_len, + const uint8_t *message, size_t message_len); +ED25519 signs the (message, message_len) bytes and stores the allocated +signature at (sig, sig_len). +Signature buffer is allocated from the given session. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_ed25519_verify(libssh2_ed25519_ctx *ctx, const uint8_t *s, + size_t s_len, const uint8_t *m, size_t m_len); +Verify (s, s_len) signature of (m, m_len) using the given ED25519 context. +Return 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +int _libssh2_curve25519_gen_k(_libssh2_bn **k, + uint8_t private_key[LIBSSH2_ED25519_KEY_LEN], + uint8_t srvr_public_key[LIBSSH2_ED25519_KEY_LEN]); +Computes a shared ED25519 secret key from the given raw server public key and +raw client public key and stores it as a big number in *k. Big number should +have been initialized before calling this function. +Returns 0 if OK, else -1. +This procedure is already prototyped in crypto.h. + +void _libssh2_ed25519_free(libssh2_ed25519_ctx *ed25519ctx); +Releases the ED25519 computation context at ed25519ctx. + + +8) Miscellaneous + +void libssh2_prepare_iovec(struct iovec *vector, unsigned int len); +Prepare len consecutive iovec slots before using them. +In example, this is needed to preset unused structure slacks on platforms +requiring it. +If this is not needed, it should be defined as an empty macro. + +int _libssh2_random(unsigned char *buf, int len); +Store len random bytes at buf. +Returns 0 if OK, else -1. + +const char * _libssh2_supported_key_sign_algorithms(LIBSSH2_SESSION *session, + unsigned char *key_method, + size_t key_method_len); + +This function is for implementing key hash upgrading as defined in RFC 8332. + +Based on the incoming key_method value, this function will return a +list of supported algorithms that can upgrade the original key method algorithm +as a comma seperated list, if there is no upgrade option this function should +return NULL. diff --git a/vendor/libssh2/docs/INSTALL_AUTOTOOLS b/vendor/libssh2/docs/INSTALL_AUTOTOOLS new file mode 100644 index 0000000000..a75b51814d --- /dev/null +++ b/vendor/libssh2/docs/INSTALL_AUTOTOOLS @@ -0,0 +1,355 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +When Building directly from Master +================================== + +If you want to build directly from the git repository, you must first +generate the configure script and Makefile using autotools. There is +a convenience script that calls all tools in the correct order. Make +sure that autoconf, automake and libtool are installed on your system, +then execute: + + autoreconf -fi + +After executing this script, you can build the project as usual: + + ./configure + make + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + +More configure options +====================== + +Some ./configure options deserve additional comments: + + * --enable-crypt-none + + The SSH2 Transport allows for unencrypted data + transmission using the "none" cipher. Because this is + such a huge security hole, it is typically disabled on + SSH2 implementations and is disabled in libssh2 by + default as well. + + Enabling this option will allow for "none" as a + negotiable method, however it still requires that the + method be advertized by the remote end and that no + more-preferable methods are available. + + * --enable-mac-none + + The SSH2 Transport also allows implementations to + forego a message authentication code. While this is + less of a security risk than using a "none" cipher, it + is still not recommended as disabling MAC hashes + removes a layer of security. + + Enabling this option will allow for "none" as a + negotiable method, however it still requires that the + method be advertized by the remote end and that no + more-preferable methods are available. + + * --disable-gex-new + + The diffie-hellman-group-exchange-sha1 (dh-gex) key + exchange method originally defined an exchange + negotiation using packet type 30 to request a + generation pair based on a single target value. Later + refinement of dh-gex provided for range and target + values. By default libssh2 will use the newer range + method. + + If you experience trouble connecting to an old SSH + server using dh-gex, try this option to fallback on + the older more reliable method. + + * --with-libgcrypt + * --without-libgcrypt + * --with-libgcrypt-prefix=DIR + + libssh2 can use the Libgcrypt library + (https://www.gnupg.org/) for cryptographic operations. + One of the cryptographic libraries is required. + + Configure will attempt to locate Libgcrypt + automatically. + + If your installation of Libgcrypt is in another + location, specify it using --with-libgcrypt-prefix. + + * --with-openssl + * --without-openssl + * --with-libssl-prefix=[DIR] + + libssh2 can use the OpenSSL library + (https://www.openssl.org) for cryptographic operations. + One of the cryptographic libraries is required. + + Configure will attempt to locate OpenSSL in the + default location. + + If your installation of OpenSSL is in another + location, specify it using --with-libssl-prefix. + + * --with-mbedtls + * --without-mbedtls + * --with-libmbedtls-prefix=[DIR] + + libssh2 can use the mbedTLS library + (https://tls.mbed.org) for cryptographic operations. + One of the cryptographic libraries is required. + + Configure will attempt to locate mbedTLS in the + default location. + + If your installation of mbedTLS is in another + location, specify it using --with-libmbedtls-prefix. + + * --with-libz + * --without-libz + * --with-libz-prefix=[DIR] + + If present, libssh2 will attempt to use the zlib + (http://www.zlib.org) for payload compression, however + zlib is not required. + + If your installation of Libz is in another location, + specify it using --with-libz-prefix. + + * --enable-debug + + Will make the build use more pedantic and strict compiler + options as well as enable the libssh2_trace() function (for + showing debug traces). diff --git a/vendor/libssh2/docs/INSTALL_CMAKE.md b/vendor/libssh2/docs/INSTALL_CMAKE.md new file mode 100644 index 0000000000..c136fdcee8 --- /dev/null +++ b/vendor/libssh2/docs/INSTALL_CMAKE.md @@ -0,0 +1,193 @@ +License: see COPYING + +Source code: https://github.com/libssh2/libssh2 + +Web site source code: https://github.com/libssh2/www + +Installation instructions are in docs/INSTALL +======= +To build libssh2 you will need CMake v2.8 or later [1] and one of the +following cryptography libraries: + +* OpenSSL +* Libgcrypt +* WinCNG +* mbedTLS + +Getting started +--------------- + +If you are happy with the default options, make a new build directory, +change to it, configure the build environment and build the project: + +``` + mkdir bin + cd bin + cmake .. + cmake --build . +``` + +libssh2 will be built as a static library and will use any +cryptography library available. The library binary will be put in +`bin/src`, with the examples in `bin/example` and the tests in +`bin/tests`. + +Customising the build +--------------------- + +Of course, you might want to customise the build options. You can +pass the options to CMake on the command line: + + cmake -D