Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update on Windows #1087

Open
Dominiquini opened this issue Oct 14, 2023 · 9 comments
Open

Unable to update on Windows #1087

Dominiquini opened this issue Oct 14, 2023 · 9 comments

Comments

@Dominiquini
Copy link

Dominiquini commented Oct 14, 2023

I'm unable to update git-extras using the command "git extras update" on Windows 10:

>>> sudo git extras update
Setting up 'git-extras'....
'C:\Users\Rafael' is not recognized as an internal or external command,
operable program or batch file.

My home folder is: "C:\Users\Rafael Dominiquini"
My git is installed on: "C:\Program Files\Git"

  • In the git-extras file, I debug this variables:
  local bin="$(command -v git-extras)"
  local prefix=${bin%/*/*}
  • Value:
BIN: /mingw64/bin/git-extras 
PREFIX: /mingw64

I was able to update the program using the installation method:

  • Cloning the repository
  • Running "sudo install.cmd"

Thanks

@spacewander
Copy link
Collaborator

Interesting. I am not familiar with mingw environment. Maybe you can add set -x in the script, and run the displayed command manually to see which part is broken?

@hyperupcall
Copy link
Collaborator

It looks like an issue with word splitting.

@Dominiquini
Copy link
Author

Interesting. I am not familiar with mingw environment. Maybe you can add set -x in the script, and run the displayed command manually to see which part is broken?

This is the output:

>>>git extras update
+ unset -v GREP_OPTIONS
+ VERSION=7.0.0
+ INSTALL_SCRIPT=https://raw.githubusercontent.com/tj/git-extras/master/install.sh
+ case "$1" in
++ uname -s
+ platform=MINGW64_NT-10.0-19045
+ '[' MINGW64_N = CYGWIN_NT ']'
+ '[' MINGW = MINGW ']'
+ updateForWindows
++ command -v git-extras
+ local bin=/mingw64/bin/git-extras
+ local prefix=/mingw64
+ local 'orig=/f/Videos/ZZZ - Others'
+ cd /tmp
+ rm -rf ./git-extras
+ echo 'Setting up '\''git-extras'\''....'
Setting up 'git-extras'....
+ git clone https://github.com/tj/git-extras.git
+ cd git-extras
+++ git rev-list --tags --max-count=1
++ git describe --tags d7f0fcc5460af875dd919a06c170503f83bf57d3
+ git checkout 7.0.0
+ ./install.cmd /mingw64
'C:\Users\Rafael' is not recognized as an internal or external command,
operable program or batch file.
+ rm -rf /tmp/git-extras

@Dominiquini
Copy link
Author

If I remove the "$prefix" from the "./install.cmd" command line (I don't need specify anything when I manually installed git-extras), this is the output:

>>>git extras update
+ unset -v GREP_OPTIONS
+ VERSION=7.0.0
+ INSTALL_SCRIPT=https://raw.githubusercontent.com/tj/git-extras/master/install.sh
+ case "$1" in
++ uname -s
+ platform=MINGW64_NT-10.0-19045
+ '[' MINGW64_N = CYGWIN_NT ']'
+ '[' MINGW = MINGW ']'
+ updateForWindows
++ command -v git-extras
+ local bin=/mingw64/bin/git-extras
+ local prefix=/mingw64
+ local 'orig=/f/Videos/ZZZ - Others'
+ cd /tmp
+ rm -rf ./git-extras
+ echo 'Setting up '\''git-extras'\''....'
Setting up 'git-extras'....
+ git clone https://github.com/tj/git-extras.git
+ cd git-extras
+++ git rev-list --tags --max-count=1
++ git describe --tags d7f0fcc5460af875dd919a06c170503f83bf57d3
+ git checkout 7.0.0
+ ./install.cmd
No mingw64 folder found in C:\Program Files\Git\mingw64\libexec.

Please supply a proper "Git for Windows 2.x" install path:
"install.cmd c:\[git-install-path]"
+ cd '/f/Videos/ZZZ - Others'
++ git extras --version
+ unset -v GREP_OPTIONS
+ VERSION=7.0.0
+ INSTALL_SCRIPT=https://raw.githubusercontent.com/tj/git-extras/master/install.sh
+ case "$1" in
+ echo 7.0.0
+ exit 0
+ echo '... updated git-extras 7.0.0 -> 7.0.0'
... updated git-extras 7.0.0 -> 7.0.0
+ rm -rf /tmp/git-extras

@Dominiquini
Copy link
Author

This is the directory that the script needed to copy the files: "C:\Program Files\Git\mingw64\bin"!

Running the "install.cmd" on the powershell, it works fine! But running using "git extras update" not!

Thanks.

@Dominiquini
Copy link
Author

I noticed another thing:

Running the install script manually, it try to copy the files on the path "C:\Program Files\Git\mingw64\bin"
But using the update method, it try to copy the files on the path "C:\Program Files\Git\mingw64\libexec"

Thanks

@spacewander
Copy link
Collaborator

So the problem is inside the cmd script.
I am not familiar with the cmd syntax. As @hyperupcall suggested, maybe there is a space after 'C:\Users\Rafael'? And the powershell environment can handle word splitting smartly.

@Dominiquini
Copy link
Author

So the problem is inside the cmd script. I am not familiar with the cmd syntax. As @hyperupcall suggested, maybe there is a space after 'C:\Users\Rafael'?

Yes, my username is "Rafael Dominiquini"

And the powershell environment can handle word splitting smartly.

Probably! Running this script (install.cmd) on Powershell installs the application correctly!

Thanks

@hyperupcall
Copy link
Collaborator

I was able to reproduce it, but after fiddling trying to fix it, I get a different error:

C:\Program Files\Git\mingw64\bin\git-extras: line 23: ::::::::::::::: command not found
C:\Program Files\Git\mingw64\bin\git-extras: line 24: C:cygwin64tmpgit-extras\bingit-extras: No such file or directory
C:\Program Files\Git\mingw64\bin\git-extras: line 25: ::::::::::::::: command not found
Setting up 'git-extras'....
Using git install path "C:/Program Files/Git/mingw64" as PREFIX, please make sure it's really a
path to the mingw64 directory...

Installing to C:/Program Files/Git/mingw64

Directory for binaries ["C:/Program Files/Git/mingw64\bin"] is not writeable by install.cmd.

You probably need to run install.cmd from an admin prompt.
C:\Program Files\Git\mingw64\bin\git-extras: line 23: ::::::::::::::: command not found
C:\Program Files\Git\mingw64\bin\git-extras: line 24: C:cygwin64tmpgit-extras\bingit-extras: No such file or directory
C:\Program Files\Git\mingw64\bin\git-extras: line 25: ::::::::::::::: command not found
... updated git-extras 7.1.0 -> 7.1.0

I ran this in Windows with both PowerShell and cmd, and both worked. But, the issue only popped up when I was using Cygwin. So I think the issue might be Cygwin-related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants