Git interactive commands fail to complete with message "The system cannot find the path specified" on MinGw64 - windows

I'm trying to perform git add --patch -- <file> and the command never completes. The MINGW64 shell just displays "The system cannot find the path specified."
When narrowing down the cause by setting GIT_TRACE=1 and trying to run some of the component commands, I found that the error is caused by the --interactive option and the same effect is seen no matter what git command is being run.
Setting GIT_TRACE=1 on the following interactive command gives the output shown:
$ GIT_TRACE=1 git add --interactive -- .gitignore
19:16:47.185964 git.c:350 trace: built-in: git 'add' '--interactive' '--' '.gitignore'
19:16:47.185964 run-command.c:336 trace: run_command: 'add--interactive' '--' '.gitignore'
19:16:47.215964 git.c:564 trace: exec: 'git-add--interactive' '--' '.gitignore'
19:16:47.215964 run-command.c:336 trace: run_command: 'git-add--interactive' '--' '.gitignore'
19:16:47.345964 git.c:350 trace: built-in: git 'rev-parse' '--git-dir'
19:16:47.375964 git.c:350 trace: built-in: git 'rev-parse' '--show-prefix'
19:16:47.405964 git.c:350 trace: built-in: git 'config' '--get-colorbool' 'color.interactive' 'false'
19:16:47.436965 git.c:350 trace: built-in: git 'config' '--get-colorbool' 'color.diff' 'false'
19:16:47.466965 git.c:350 trace: built-in: git 'config' '--get-color' 'reset'
19:16:47.496965 git.c:350 trace: built-in: git 'config' '--get' 'diff.algorithm'
19:16:47.546965 git.c:350 trace: built-in: git 'config' '--bool' '--get' 'diff.compactionheuristic'
19:16:47.576965 git.c:350 trace: built-in: git 'config' '--get' 'interactive.difffilter'
19:16:47.606965 git.c:350 trace: built-in: git 'config' '--bool' '--get' 'interactive.singlekey'
19:16:47.636965 git.c:350 trace: built-in: git 'rev-parse' '--git-dir'
19:16:47.666965 git.c:350 trace: built-in: git 'update-index' '--refresh'
19:16:47.793965 git.c:350 trace: built-in: git 'ls-files' '--' '.gitignore'
The system cannot find the path specified.
19:16:47.843965 git.c:350 trace: built-in: git 'diff-index' '--cached' '--numstat' '--summary' '4b825dc642cb6eb9a060e54bf8d69288fbee4904' '--' '.gitignore'
19:16:47.873966 git.c:350 trace: built-in: git 'diff-files' '--numstat' '--summary' '--raw' '--' '.gitignore'
Trying to add the file without the interactive option works as expected. The operation only fails when there is an interactive (or patch) option added.
Note that I initially had the following issue when trying to run the command:
Can't locate Git.pm in #INC (you may need to install the Git module) (#INC contains: /mingw64/share/perl5/site_perl D:/Apps/StrawberryPerl/perl/site/lib D:/Apps/StrawberryPerl/perl/vendor/lib D:/Apps/StrawberryPerl/perl/lib) at C:\Program Files\Git\mingw64/libexec/git-core\git-add--interactive line 7.
BEGIN failed--compilation aborted at C:\Program Files\Git\mingw64/libexec/git-core\git-add--interactive line 7.
However after copying the Git.pm and Error.pm modules to the perl include folder, the problem changed to the one described at the top of this question.
Finally, as a further attempt at figuring this out I ran the command in a Windows command prompt (cmd.exe) and had a totally different error:
c:\code\proj>git add --patch .gitignore
error: wrong number of arguments
usage: git config [<options>]
Config file location
--global use global config file
--system use system config file
--local use repository config file
-f, --file <file> use given config file
--blob <blob-id> read config from given blob object
Action
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--get-urlmatch get value specific for the URL: section[.var] URL
--replace-all replace all matching variables: name value
[value_regex]
--add add a new variable: name value
--unset remove a variable: name [value-regex]
--unset-all remove all matches: name [value-regex]
--rename-section rename section: old-name new-name
--remove-section remove a section: name
-l, --list list all
-e, --edit open an editor
--get-color find the color configured: slot [default]
--get-colorbool find the color setting: slot [stdout-is-tty]
Type
--bool value is "true" or "false"
--int value is decimal number
--bool-or-int value is --bool or --int
--path value is a path (file or directory name)
Other
-z, --null terminate values with NUL byte
--name-only show variable names only
--includes respect include directives on lookup
--show-origin show origin of config (file, standard input, blob, command line)
config --get-color color.interactive.prompt bold blue: command returned error: 129
I checked my git config files and I don't set this option so I'm guessing it's a default that's set somewhere.
Apart from the obvious aspect of the question (i.e. getting the --interactive or --patch options to work as expected), I'd also appreciate any advice or tips on debugging this further. The various TRACE options I used didn't really highlight where the problem was, apart from showing me that it was the --interactive option that was the issue.

In short - the answer here was to upgrade the version of Git for Windows used. My version was 2.10.1.windows.1 which is a couple of years old. I upgraded to 2.19.0.windows.1 and all is now working as it should.
So the issue might be because there was an error in that version of git, in which case hopefully this will give anyone else using that version a heads-up. Alternatively, there could have been an issue with my installation somewhere along the line, which was automatically corrected by the new git installation. In that case, consider this an idea of things to try if you are having similar problems.
Not a particularly fulfilling answer - but an answer nonetheless.

Related

go get and AzureDevOps authentication not working

I am desperately trying to figure out why a go get command from a package residing inside a Git repo on AzureDevOps does not work.
Both golang projects (the project where the package resides as well as the consumer trying to import it) are located inside the same AzureDevOps project.
I am attempting to import a package from the one into the other but alas with no avail.
I followed the instructions found here: https://learn.microsoft.com/en-us/azure/devops/repos/git/go-get?view=azure-devops
I have created a PAT and tested that I am able to clone the repo from where I want to import the package from, and that works fine.
git clone https://me:78rt5u89dg635ef4fb30e4b0229e4329756986416673b4e331ag#dev.azure.com/my-comp/my-proj/_git/k8s-team-operator
So I have in my mind (maybe incorrectly so) made the assumption that the PAT is able to authenticate correctly. That said, I unfortunately have to use cntlm proxy to get to the outside, but this works well in general.
In my golang project inside the terminal I have set : export GOPRIVATE=dev.azure.com
In my GitConfig file located at location ~/.gitconfig I have set the following values:
# This is Git's per-user configuration file.
[user]
email = me#my-comp.com
name = Morné Kruger
[core]
editor = vi
[url https://me:78rt5u89dg635ef4fb30e4b0229e4329756986416673b4e331a#dev.azure.com/my-comp/my-proj/_git/k8s-team-operator]
insteadOf = https://dev.azure.com/my-comp/my-proj/_git/k8s-team-operator
I then run the go get command with the verbose flag, and then get the following less positive response:
me#focalfossa:~/dev/my-comp/repos/k8s-teamapi-functions$ go get -x dev.azure.com/my-comp/my-proj/_git/k8s-team-operator.git
# get https://dev.azure.com/my-comp/my-proj/_git?go-get=1
# get https://dev.azure.com/?go-get=1
# get https://dev.azure.com/my-comp?go-get=1
cd .
git ls-remote https://dev.azure.com/my-comp/my-proj/_git/k8s-team-operator
# get https://dev.azure.com/my-comp/my-proj?go-get=1
cd .
git ls-remote git+ssh://dev.azure.com/my-comp/my-proj/_git/k8s-team-operator
# get https://dev.azure.com/?go-get=1: 403 Forbidden (0.274s)
# get https://dev.azure.com/my-comp/my-proj?go-get=1: 203 Non-Authoritative Information (0.307s)
# get https://dev.azure.com/my-comp?go-get=1: 203 Non-Authoritative Information (0.308s)
# get https://dev.azure.com/my-comp/my-proj/_git?go-get=1: 203 Non-Authoritative Information (0.311s)
cd .
git ls-remote ssh://dev.azure.com/my-comp/my-proj/_git/k8s-team-operator
mkdir -p /home/me/go/pkg/mod/cache/vcs # git3 git://dev.azure.com/my-comp/my-proj/_git/k8s-team-operator
# lock /home/me/go/pkg/mod/cache/vcs/540338d35ef4fb30e4b0229e4329756986416673b4e3318516900fca1efcee17.lock# /home/me/go/pkg/mod/cache/vcs/540338d35ef4fb485763tg30417801e630216673b4e3318516900fca1efcee17 for git3 git://dev.azure.com/my-comp/my-proj/_git/k8s-team-operator
cd /home/me/go/pkg/mod/cache/vcs/540338d35ef4fb30e4b02906874yh25630216673b4e3318516900fca1efcee17; git ls-remote -q origin
2.083s # cd /home/me/go/pkg/mod/cache/vcs/540338d35ef49059y87e329e417801e630216673b4e3318516900fca1efcee17; git ls-remote -q origin
go get: module dev.azure.com/my-comp/my-proj/_git/k8s-team-operator.git: git ls-remote -q origin in /home/me/go/pkg/mod/cache/vcs/540338d35ef4fb30e4b022125f7y879430216673b4e3318516900fca1efcee17: exit status 128:
fatal: unable to connect to dev.azure.com:
dev.azure.com[0: 13.107.42.20]: errno=Connection refused
dev.azure.com[1: 2620:1ec:21::20]: errno=Network is unreachable
Versions:
go1.16.5 linux/amd64
Ubuntu 20.04
GoLand 2021.1.2
git version 2.25.1
I would greatly appreciate any tips or troubleshooting ideas that could point out the error in my ways!

Github Action - Error: Process completed with exit code 1

I am trying to setup github actions to deploy my application.
My bash-script to start the deployment process looks like this:
#!/bin/sh
set -e
vendor/bin/phpunit
(git push) || true
git checkout production
git merge master
git push origin production
git checkout master
When executing the above script I get:
My workflows/main.yml file looks like the following:
name: CD
on:
push:
branches: [ production ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
with:
token: ${{ secrets.PUSH_TOKEN }}
# - name: Set up Node
# uses: actions/setup-node#v1
# with:
# node-version: '12.x'
# - run: npm install
# - run: npm run production
- name: Commit built assets
run: |
git config --local user.email "action#github.com"
git config --local user.name "GitHub Action"
git checkout -B deploy
git add -f public/
git commit -m "Build front-end assets"
git push -f origin deploy
- name: Deploy to production
uses: appleboy/ssh-action#master
with:
username: root
host: xx.xx.xxx.xxx
password: ${{ secrets.SSH_PASSWORD }}
script: 'cd /var/www/myProject && ./server_deploy.sh'
When running the script I get the following raw log:
2021-03-14T16:04:06.7573174Z ##[section]Starting: Request a runner to run this job
2021-03-14T16:04:07.1344029Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest'
2021-03-14T16:04:07.1344097Z Can't find any online and idle self-hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest'
2021-03-14T16:04:07.1344652Z Found online and idle hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest'
2021-03-14T16:04:07.2661405Z ##[section]Finishing: Request a runner to run this job
2021-03-14T16:04:17.0975920Z Current runner version: '2.277.1'
2021-03-14T16:04:17.9082004Z ##[group]Operating System
2021-03-14T16:04:17.9083391Z Ubuntu
2021-03-14T16:04:17.9084015Z 20.04.2
2021-03-14T16:04:17.9084509Z LTS
2021-03-14T16:04:17.9085154Z ##[endgroup]
2021-03-14T16:04:17.9085790Z ##[group]Virtual Environment
2021-03-14T16:04:17.9086576Z Environment: ubuntu-20.04
2021-03-14T16:04:17.9087226Z Version: 20210302.0
2021-03-14T16:04:17.9088413Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20210302.0/images/linux/Ubuntu2004-README.md
2021-03-14T16:04:17.9090008Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F
2021-03-14T16:04:17.9091225Z ##[endgroup]
2021-03-14T16:04:17.9093732Z ##[group]GITHUB_TOKEN Permissions
2021-03-14T16:04:17.9095423Z Actions: write
2021-03-14T16:04:17.9096121Z Checks: write
2021-03-14T16:04:17.9096752Z Contents: write
2021-03-14T16:04:17.9097367Z Deployments: write
2021-03-14T16:04:17.9098205Z Issues: write
2021-03-14T16:04:17.9098869Z Metadata: read
2021-03-14T16:04:17.9099572Z OrganizationPackages: write
2021-03-14T16:04:17.9100326Z Packages: write
2021-03-14T16:04:17.9100966Z PullRequests: write
2021-03-14T16:04:17.9101747Z RepositoryProjects: write
2021-03-14T16:04:17.9102476Z SecurityEvents: write
2021-03-14T16:04:17.9103267Z Statuses: write
2021-03-14T16:04:17.9103974Z ##[endgroup]
2021-03-14T16:04:17.9108171Z Prepare workflow directory
2021-03-14T16:04:18.3861957Z Prepare all required actions
2021-03-14T16:04:18.3875377Z Getting action download info
2021-03-14T16:04:18.7415606Z Download action repository 'actions/checkout#v2'
2021-03-14T16:04:19.4196162Z Download action repository 'appleboy/ssh-action#master'
2021-03-14T16:04:20.1340765Z ##[group]Build container for action use: '/home/runner/work/_actions/appleboy/ssh-action/master/Dockerfile'.
2021-03-14T16:04:20.1449431Z ##[command]/usr/bin/docker build -t 5588e4:46e0c05d2f1c4fbf93b7f69ca6a2f1b5 -f "/home/runner/work/_actions/appleboy/ssh-action/master/Dockerfile" "/home/runner/work/_actions/appleboy/ssh-action/master"
2021-03-14T16:04:21.6962547Z Sending build context to Docker daemon 293.9kB
2021-03-14T16:04:21.6963066Z
2021-03-14T16:04:21.6963632Z Step 1/4 : FROM appleboy/drone-ssh:1.6.3-linux-amd64
2021-03-14T16:04:21.6964381Z 1.6.3-linux-amd64: Pulling from appleboy/drone-ssh
2021-03-14T16:04:21.6965036Z 188c0c94c7c5: Pulling fs layer
2021-03-14T16:04:21.6965576Z 66fca843054b: Pulling fs layer
2021-03-14T16:04:21.6966101Z f62e9573bab1: Pulling fs layer
2021-03-14T16:04:21.6966632Z 06a0f34100cd: Pulling fs layer
2021-03-14T16:04:21.6967110Z 06a0f34100cd: Waiting
2021-03-14T16:04:21.6967633Z f62e9573bab1: Verifying Checksum
2021-03-14T16:04:21.6968295Z f62e9573bab1: Download complete
2021-03-14T16:04:21.6968871Z 66fca843054b: Verifying Checksum
2021-03-14T16:04:21.6969544Z 66fca843054b: Download complete
2021-03-14T16:04:21.6970079Z 188c0c94c7c5: Verifying Checksum
2021-03-14T16:04:21.6970589Z 188c0c94c7c5: Download complete
2021-03-14T16:04:21.6971347Z 06a0f34100cd: Verifying Checksum
2021-03-14T16:04:21.6971878Z 06a0f34100cd: Download complete
2021-03-14T16:04:22.0484952Z 188c0c94c7c5: Pull complete
2021-03-14T16:04:22.2702074Z 66fca843054b: Pull complete
2021-03-14T16:04:22.3773889Z f62e9573bab1: Pull complete
2021-03-14T16:04:22.6271473Z 06a0f34100cd: Pull complete
2021-03-14T16:04:22.6379226Z Digest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2021-03-14T16:04:22.6402600Z Status: Downloaded newer image for appleboy/drone-ssh:1.6.3-linux-amd64
2021-03-14T16:04:22.6418359Z ---> 47f94d42e479
2021-03-14T16:04:22.6422631Z Step 2/4 : COPY entrypoint.sh /entrypoint.sh
2021-03-14T16:04:23.2992272Z ---> 894dff86e37f
2021-03-14T16:04:23.3137154Z Step 3/4 : RUN chmod +x /entrypoint.sh
2021-03-14T16:04:23.3492501Z ---> Running in 8b348a5718bd
2021-03-14T16:04:25.0149456Z Removing intermediate container 8b348a5718bd
2021-03-14T16:04:25.0167277Z ---> 2bc40f78951d
2021-03-14T16:04:25.0168110Z Step 4/4 : ENTRYPOINT ["/entrypoint.sh"]
2021-03-14T16:04:25.0374209Z ---> Running in be0a69eed1dc
2021-03-14T16:04:26.0155734Z Removing intermediate container be0a69eed1dc
2021-03-14T16:04:26.0157218Z ---> e08d3462082b
2021-03-14T16:04:26.0218123Z Successfully built e08d3462082b
2021-03-14T16:04:26.0355661Z Successfully tagged 5588e4:46e0c05d2f1c4fbf93b7f69ca6a2f1b5
2021-03-14T16:04:26.0368493Z ##[endgroup]
2021-03-14T16:04:26.0761189Z ##[group]Run actions/checkout#v2
2021-03-14T16:04:26.0761944Z with:
2021-03-14T16:04:26.0763619Z token: ***
2021-03-14T16:04:26.0764261Z repository: myUser/myProject
2021-03-14T16:04:26.0764899Z ssh-strict: true
2021-03-14T16:04:26.0765450Z persist-credentials: true
2021-03-14T16:04:26.0765987Z clean: true
2021-03-14T16:04:26.0766410Z fetch-depth: 1
2021-03-14T16:04:26.0766837Z lfs: false
2021-03-14T16:04:26.0767254Z submodules: false
2021-03-14T16:04:26.0767708Z ##[endgroup]
2021-03-14T16:04:26.5724570Z Syncing repository: myUser/myProject
2021-03-14T16:04:26.5725598Z ##[group]Getting Git version info
2021-03-14T16:04:26.5726878Z Working directory is '/home/runner/work/myProject/myProject'
2021-03-14T16:04:26.5728059Z [command]/usr/bin/git version
2021-03-14T16:04:26.5892765Z git version 2.30.1
2021-03-14T16:04:26.5894282Z ##[endgroup]
2021-03-14T16:04:26.5903587Z Deleting the contents of '/home/runner/work/myProject/myProject'
2021-03-14T16:04:26.5905407Z ##[group]Initializing the repository
2021-03-14T16:04:26.5909187Z [command]/usr/bin/git init /home/runner/work/myProject/myProject
2021-03-14T16:04:26.6029092Z hint: Using 'master' as the name for the initial branch. This default branch name
2021-03-14T16:04:26.6030401Z hint: is subject to change. To configure the initial branch name to use in all
2021-03-14T16:04:26.6031533Z hint: of your new repositories, which will suppress this warning, call:
2021-03-14T16:04:26.6032386Z hint:
2021-03-14T16:04:26.6033943Z hint: git config --global init.defaultBranch <name>
2021-03-14T16:04:26.6034638Z hint:
2021-03-14T16:04:26.6035442Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2021-03-14T16:04:26.6036651Z hint: 'development'. The just-created branch can be renamed via this command:
2021-03-14T16:04:26.6037336Z hint:
2021-03-14T16:04:26.6037909Z hint: git branch -m <name>
2021-03-14T16:04:26.6041711Z Initialized empty Git repository in /home/runner/work/myProject/myProject/.git/
2021-03-14T16:04:26.6053565Z [command]/usr/bin/git remote add origin https://github.com/myUser/myProject
2021-03-14T16:04:26.6112480Z ##[endgroup]
2021-03-14T16:04:26.6113335Z ##[group]Disabling automatic garbage collection
2021-03-14T16:04:26.6121163Z [command]/usr/bin/git config --local gc.auto 0
2021-03-14T16:04:26.6165369Z ##[endgroup]
2021-03-14T16:04:26.6176967Z ##[group]Setting up auth
2021-03-14T16:04:26.6187245Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-03-14T16:04:26.6246287Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-03-14T16:04:26.6900209Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-03-14T16:04:26.6940390Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-03-14T16:04:26.7216178Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2021-03-14T16:04:26.7266677Z ##[endgroup]
2021-03-14T16:04:26.7268826Z ##[group]Fetching the repository
2021-03-14T16:04:26.7277912Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +ea9bc17ea94e3e6c966f65eadaab92e81b90346c:refs/remotes/origin/production
2021-03-14T16:04:27.4292763Z remote: Enumerating objects: 2050, done.
2021-03-14T16:04:27.5051531Z remote: Counting objects: 100% (2050/2050), done.
2021-03-14T16:04:27.6195514Z remote: Compressing objects: 100% (1621/1621), done.
2021-03-14T16:04:28.5762484Z Receiving objects: 100% (2050/2050), 2.44 MiB | 4.84 MiB/s
2021-03-14T16:04:28.5763176Z Receiving objects: 100% (2050/2050), 13.82 MiB | 14.48 MiB/s, done.
2021-03-14T16:04:28.6012285Z Resolving deltas: 100% (469/469)
2021-03-14T16:04:28.6012872Z Resolving deltas: 100% (469/469), done.
2021-03-14T16:04:28.8206899Z From https://github.com/myUser/myProject
2021-03-14T16:04:28.8208438Z * [new ref] ea9bc17ea94e3e6c966f65eadaab92e81b90346c -> origin/production
2021-03-14T16:04:28.8229099Z ##[endgroup]
2021-03-14T16:04:28.8229852Z ##[group]Determining the checkout info
2021-03-14T16:04:28.8232088Z ##[endgroup]
2021-03-14T16:04:28.8232766Z ##[group]Checking out the ref
2021-03-14T16:04:28.8236775Z [command]/usr/bin/git checkout --progress --force -B production refs/remotes/origin/production
2021-03-14T16:04:28.9951267Z Switched to a new branch 'production'
2021-03-14T16:04:28.9952452Z Branch 'production' set up to track remote branch 'production' from 'origin'.
2021-03-14T16:04:28.9961000Z ##[endgroup]
2021-03-14T16:04:29.0014527Z [command]/usr/bin/git log -1 --format='%H'
2021-03-14T16:04:29.0046451Z 'ea9bc17ea94e3e6c966f65eadaab92e81b90346c'
2021-03-14T16:04:29.0162817Z ##[group]Run git config --local user.email "action#github.com"
2021-03-14T16:04:29.0163849Z [36;1mgit config --local user.email "action#github.com"[0m
2021-03-14T16:04:29.0164730Z [36;1mgit config --local user.name "GitHub Action"[0m
2021-03-14T16:04:29.0165375Z [36;1mgit checkout -B deploy[0m
2021-03-14T16:04:29.0165987Z [36;1mgit add -f public/[0m
2021-03-14T16:04:29.0166580Z [36;1mgit commit -m "Build front-end assets"[0m
2021-03-14T16:04:29.0167255Z [36;1mgit push -f origin deploy[0m
2021-03-14T16:04:29.0215326Z shell: /usr/bin/bash -e {0}
2021-03-14T16:04:29.0215807Z ##[endgroup]
2021-03-14T16:04:29.3153383Z Switched to a new branch 'deploy'
2021-03-14T16:04:29.3313550Z On branch deploy
2021-03-14T16:04:29.3316648Z nothing to commit, working tree clean
2021-03-14T16:04:29.3381472Z ##[error]Process completed with exit code 1.
2021-03-14T16:04:29.3653154Z Post job cleanup.
2021-03-14T16:04:29.4723616Z [command]/usr/bin/git version
2021-03-14T16:04:29.4777037Z git version 2.30.1
2021-03-14T16:04:29.4815499Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-03-14T16:04:29.4854852Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-03-14T16:04:29.5117676Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-03-14T16:04:29.5149269Z http.https://github.com/.extraheader
2021-03-14T16:04:29.5160054Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2021-03-14T16:04:29.5197186Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-03-14T16:04:29.5497217Z Cleaning up orphan processes
Currently nothing gets committed on my production branch, as the production action does not start.
Any suggestions what I am doing wrong?
Why do I get this error?
I really appreciate your replies!
Why do I get this error?
"This error", to be clear, is:
2021-03-14T16:04:29.3381472Z ##[error]Process completed with exit code 1.
The process that completed is the shell:
2021-03-14T16:04:29.0215326Z shell: /usr/bin/bash -e {0}
which ran some commands in a script; obviously one of those commands must have exited with status code 1 ("generic failure"), which led bash -e to also exit with status code 1.
We can see each command's output, so we can correlate each command to its output based on knowing what commands print what stuff. Here is the script:
git config --local user.email "action#github.com"
git config --local user.name "GitHub Action"
git checkout -B deploy
git add -f public/
git commit -m "Build front-end assets"
git push -f origin deploy
(I took out the color-changing ESC [ ... m sequences since they just get in the way, and stripped the timestamps since they're not really relevant.) You should recognize these commands: they are the ones you supplied in your YAML file.
Here is the output from each of those commands:
Switched to a new branch 'deploy'
On branch deploy
nothing to commit, working tree clean
Now, git config normally prints nothing, so the two git configs probably succeeded because we saw something printed (the first line). What we saw printed was Switched to a new branch 'deploy'.
This is exactly what the third command, git checkout -B deploy, would print when it succeeds. So we must have reached the third command, which succeeded. That would let us move on to the fourth command, git add -f public/.
The git add command normally prints nothing. So we can't really be sure if it worked or not at this point, but we do see further output, beginning with On branch .... That definitely doesn't come from git add, so presumably git add succeeded, which would let us move on to the fifth command, git commit -m [message]. This command does print things, on both success and failure: on success we get a message showing the new commit's abbreviated hash ID, and on failure, we get git status output:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
$ git commit -m test
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
This is, in fact, a failure of sorts: there is nothing to commit, so Git does not make a new commit. Why is there nothing to commit? Because Git's index matches the current (HEAD) commit. That is, git add -f public/ updated no files. Either public/ is empty, or the files inside public/ match those in the HEAD commit.
If we check the actual exit status from a git commit that fails in this way, it is 1:
$ echo $?
1
So the git commit command is the one that failed, and it failed because there was nothing new to commit.
You have multiple choices for how to proceed:
Figure out why there was nothing to commit, when you clearly expected there to be something to commit.
Check whether there is anything to commit, and if not, commit nothing.
Use git commit --allow-empty to instruct Git to make a new commit even if there's no need for a new commit. (This has the advantage of being extremely simple.)
Forcibly assume that the git commit succeeds even when it fails, by using the (cmd || true) construct, just as you did here:
(git push) || true
I put these in approximate order of increasing badness, though some of this is a matter of opinion / judgment.
Note that when diagnosing some script's failure, there are several approaches that can help if it's not immediately obvious which command within the script failed. For instance, here, it was clear that git commit failed, because only git commit winds up acting like git status, and it does that precisely when it's going to fail with a "nothing to commit" message. But what if it were some other, more-ambiguous failure? One can narrow down these failures by adding echo commands, so that we know which part(s) of the script are running. Or, if it doesn't interfere too much with other things, we can set -x in a bash script: this causes the shell to print out, to standard error output, a + line for each command it actually runs, just before running it. This would immediately pin the exit status to the command that produced it.

push to Azure DevOps git repo: GCM: NullReferenceException

I installed GCM (Git Credential Manager) on my Windows OS. Using it I can push to GitLab and Bitbucket repositories, successfully. But about Azure DevOps:
>git push Azure master
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
Then prompt for username (independent of GCM).
With trace:
>SET GIT_TRACE=1
>SET GCM_TRACE=1
>git push Azure master
17:34:02.362309 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
17:34:02.364307 git.c:415 trace: built-in: git push Azure master
17:34:02.370303 run-command.c:637 trace: run_command: GIT_DIR=.git git remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.382598 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:02.383601 git.c:671 trace: exec: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.384601 run-command.c:637 trace: run_command: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.399961 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.391539 run-command.c:637 trace: run_command: 'git credential-manager get'
17:34:03.613232 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.615233 git.c:671 trace: exec: git-credential-manager get
17:34:03.615233 run-command.c:637 trace: run_command: git-credential-manager get
17:34:03.698676 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.18.0) 'get'
17:34:03.793588 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s).
17:34:03.802579 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 38 entries.
17:34:03.809873 ...\Common.cs:543 trace: [LoadOperationArguments] useHttpPath = ''.
17:34:03.879804 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://mirismaili.visualstudio.com/OpenLib/_git/Android'.
17:34:04.749863 ...uthentication.cs:229 trace: [DetectAuthority] detected 'https://mirismaili.visualstudio.com/' as Azure DevOps from GET response.
17:34:04.757022 ...\Program.cs:601 trace: [Run] ! error: 'Object reference not set to an instance of an object.'.
17:34:04.760018 ...\Common.cs:709 trace: [LogEvent] System.NullReferenceException: Object reference not set to an instance of an object.
at AzureDevOps.Authentication.Authentication.<DetectAuthority>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AzureDevOps.Authentication.Authentication.<GetAuthentication>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<CreateAuthentication>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<QueryCredentials>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<<Get>b__24_0>d.MoveNext()
17:34:04.769048 ...\Program.cs:601 trace: [Run] fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
17:34:04.793392 run-command.c:637 trace: run_command: bash -c 'test "a$SHELL" '\!'= "a${SHELL%.exe}" || exit 127; cat >/dev/tty && read -r line </dev/tty && echo "$line"'
Other useful information:
>git remote -v
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (fetch)
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (push)
BitBucket https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git (fetch)
BitBucket https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git (push)
GitLab https://mirismaili#gitlab.com/OpenLib/android.git (fetch)
GitLab https://mirismaili#gitlab.com/OpenLib/android.git (push)
>git version
git version 2.19.1.windows.1
>git credential-manager version
Git Credential Manager for Windows version 1.18.0
>git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslbackend=schannel
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.editor='C:\Program Files\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin
user.name=S. Mahdi Mir-Ismaili
user.email=s.m.mirismaili#gmail.com
gui.recentrepo=D:/I/Documents/CryptoCurrenciesSimulator
credential.usehttppath=true
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.Azure.url=https://mirismaili.visualstudio.com/OpenLib/_git/Android
remote.Azure.fetch=+refs/heads/*:refs/remotes/Azure/*
branch.master.remote=BitBucket
branch.master.merge=refs/heads/master
remote.BitBucket.url=https://mirismaili#bitbucket.org/mirismaili/androidopenlib.git
remote.BitBucket.fetch=+refs/heads/*:refs/remotes/BitBucket/*
remote.GitLab.url=https://mirismaili#gitlab.com/OpenLib/android.git
remote.GitLab.fetch=+refs/heads/*:refs/remotes/GitLab/*
Another note is that I can push to Azure remote, with Visual Studio Team Services plugin for IntelliJ IDEs.
I updated GCM from v1.18.0 to v1.18.2 and the problem solved:
I think it was relevant to this BugFix on v1.18.1:
Fixes Null Reference exceptions when parameters or contentType are not populated
Hy
I had the same problem with all of my Azure-DevOps-Repos since today.
I believe this refers to the change from Visual Studio Team Services to DevOps.
My workaround was following:
I reconfigured GIT to save credentials:
git config --global credential.helper store
I signed in my DevOps-Account and created a new personal access token
I opened one of my repos and executed another fetch
After the NullReferenceException prompt, I entered my username and pasted the created access token inside the password prompt.
Now, on each interaction with the remote i get two NullReferenceException-Prompts but it works now for all of my Azure-DevOps-Repos...
I don't know how this will behave with other Repo-Services like GitHub and so on. I do only use Azure...
This is only a quik and dirty workaround. So I would appreciate if someone could share a better solution.
Thanks

Unable to install package

Initially posted this on the Ethereum forum but feel that there might be more knowledge of the issue here as it is a Golang/git package installation issue
I am trying to compile smart contracts using the go-ethereum client.
I have go installed on my pc and installed ran the following commands:
go get -u github.com/ethereum/go-ethereum
cd $GOPATH/src/github.com/ethereum/go-ethereum/
make
Which all work fine.
When I run
make devtools
I get the following error:
Pros-MacBook-Pro:go-ethereum Santi$ make devtools
env GOBIN= go get -u golang.org/x/tools/cmd/stringer
# cd /Users/pro/go/src/golang.org/x/tools; git pull --ff-only
error: Your local changes to the following files would be overwritten by merge:
CONTRIBUTING.md
blog/blog.go
cmd/godoc/autocert.go
cmd/godoc/blog.go
cmd/godoc/godoc_test.go
cmd/godoc/handlers.go
cmd/godoc/main.go
cmd/godoc/x.go
cmd/goimports/goimports.go
cmd/gomvpkg/main.go
cmd/goyacc/yacc.go
cmd/guru/guru.go
cmd/guru/guru_test.go
cmd/guru/main.go
cmd/guru/referrers.go
cmd/guru/testdata/src/referrers/int_test.go
cmd/guru/testdata/src/referrers/main.go
cmd/guru/testdata/src/referrers/main.golden
cmd/present/static/styles.css
cmd/present/templates/slides.tmpl
cmd/stringer/endtoend_test.go
cmd/stringer/stringer.go
cmd/tip/tip.go
go/ast/astutil/imports.go
go/ast/astutil/imports_test.go
go/buildutil/allpackages_test.go
go/buildutil/fakecontext.go
go/buildutil/util_test.go
go/gcexportdata/example_test.go
go/gcexportdata/gcexportdata.go
go/gcexportdata/main.go
go/gcimporter15/bexport.go
go/gcimporter15/bexport19_test.go
go/gcimporter15/bexport_test.go
go/gcimporter15/bimport.go
go/gcimporter15/exportdata.go
go/gcimporter15/gcimporter.go
go/gcimporter15/gcimporter_test.go
go/gcimporter15/isAlias18.go
go/gcimporter15/isAlias19.go
go/gcimporter15/testdata/a.go
go/gcimporter15/testdata/b.go
go/gcimporter15/testdata/exports.go
go/gcimporter15/testdata/issue15920.go
go/gcimporter15/testdata/issue20046.go
go/gcimporter15/testdata/p.go
go/gcimporter15/testdata/versions/test.go
go/gcimporter15/testdata/versions/test_go1.7_0.a
go/gcimporter15/testdata/versions/test_go1.7_1.a
go/internal/gccgoimporter/gccgoinstallation_test.go
go/internal/gccgoimporter/importer_test.go
go/internal/gccgoimporter/parser.go
go/loader/loader_test.go
go/ssa/interp/external.go
go/ssa/ssa.go
go/vcs/vcs.go
go/vcs/vcs_test.go
godoc/cmdline.go
godoc/cmdline_test.go
godoc/dirtrees.go
godoc/dl/dl.go
godoc/godoc.go
godoc/index.go
godoc/pres.go
godoc/server.go
godoc/spec.go
godoc/static/gen.go
godoc/static/godoc.html
godoc/static/godocs.js
godoc/static/makestatic.go
godoc/static/package.html
godoc/static/playground.js
godoc/static/static.go
godoc/static/style.css
godoc/template.go
godoc/vfs/emptyvfs.go
godoc/vfs/gatefs/gatefs.go
godoc/vfs/mapfs/mapfs.go
godoc/vfs/namespace.go
godoc/vfs/os.go
godoc/vfs/vfs.go
godoc/vfs/zipfs/zipfs.go
imports/fastwalk.go
imports/fastwalk_dirent_fileno.go
imports/fastwalk_dirent_ino.go
imports/fastwalk_portable.go
imports/fastwalk_test.go
imports/fastwalk_unix.go
imports/fix.go
imports/fix_test.go
imports/imports.go
imports/sortimports.go
present/parse.go
refactor/eg/eg.go
refactor/eg/eg_test.go
refactor/eg/rewrite.go
refactor/eg/testdata/no_after_return.template
refactor/rename/rename.go
Please commit your changes or stash them before you merge.
Aborting
Updating 73e16cff..d74aaa1f
package golang.org/x/tools/cmd/stringer: exit status 1
make: *** [devtools] Error 1
Hoping that this wasnt too serious, I tries creating my go file with the following line:
abigen -abi=Store.abi --pkg=store --out=Store.go
bash: abigen: command not found
I suspect this has to do with my failed install and will appreciate any pointers on this
I was able to solve this by doing the following:
cd /Users/pro/go/src/golang.org/x/tools (This is the repo that had the issues)
Run git stash save && git merge origin/master && git stash pop
Run make devtools (The make file contains the instructions for installing abigen and placing it in usr/bin
I got help from this answer:
How do I ignore an error on 'git pull' about my local changes would be overwritten by merge?

Git for windows: fatal: early EOF

Yesterday I installed a new Git windows server 2.6.4 that was working fine with a Mac git client (git protocol)
Today I am struggling to get a 2nd client (Windows 7) to work. In the process of trying to make it work I have upgraded both the Windows server and client to the recently released git 2.7.0
I have tried disabling compression...I have tried both wireless and wired networks (the Windows client and server are sitting on the same desk). I have disabled AV on the client. I have tried tweaking the memory settings as suggested here
Here is the client output:
bash> git clone git://server.fqdn/repo.git
Cloning into 'repo'...
remote: 08:56:10.972997 git.c:348 trace: built-in: git 'pack-objects' '--revs' '--thin' '--stdout' '--progress' '--delta-base-offset'
remote: Counting objects: 76, done.
remote: Compressing objects: 100% (38/38), done.
Receiving objects: 100% (76/76), 8.31 KiB | 0 bytes/s, done.
fatal: read error: Invalid argument
fatal: early EOF
fatal: index-pack failed
bash>
Here is the server output:
bash> ./gitd.bat
D:\tools\gitd>set GIT_TRACE=1
D:\tools\gitd>D:\tools\Git\bin\git.exe daemon --reuseaddr --verbose --base-path=D:\git --export-all --enable=receive-pack
08:59:49.023778 git.c:561 trace: exec: 'git-daemon' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
08:59:49.023778 run-command.c:343 trace: run_command: 'git-daemon' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
[7376] Ready to rumble
09:00:03.056268 run-command.c:343 trace: run_command: 'D:\tools\Git\mingw64\libexec\git-core\git-daemon.exe' '--serve' '--reuseaddr' '--verbose' '--base-path=D:\git' '--export-all' '--enable=receive-pack'
[6492] Connection from 10...:54729
[6492] Extended attributes (27 bytes) exist
[6492] Request upload-pack for '/repo.git'
09:00:03.087469 run-command.c:343 trace: run_command: 'upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.134269 git.c:561 trace: exec: 'git-upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.134269 run-command.c:343 trace: run_command: 'git-upload-pack' '--strict' '--timeout=0' '.'
[6492] 09:00:03.617872 run-command.c:343 trace: run_command: 'pack-objects' '--revs' '--thin' '--stdout' '--progress' '--delta-base-offset'
What else can I try?
Git daemon is known to work on Windows only when some text is selected
in git daemon's console window (e.g., see
git clone fails with "index-pack" failed?).
This text selection delays daemon's output, which somehow helps (!). As
soon as text selection is cleared (with Escape key), cloning/fetching
fails most of the time. Select text again, and cloning/fetching resumes
to work. The problem can be easily reproduced on Windows 10 using git
2.11.0.windows.1 by cloning locally via
git clone git://127.0.0.1/my-repo.
I have found another solution, only start the **git-daemon.exe directly** e.g.
For the 64bit git:
"C:\Program Files\Git\mingw64\libexec\git-core\git-daemon.exe"
--> with the same paramters as git.exe.
Then it works without the selection text.

Resources