Skip to content

BusyBox-based MinGit: git-core commands broken since 2.36.1 #4007

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

Closed
1 task done
shinfd opened this issue Sep 4, 2022 · 8 comments
Closed
1 task done

BusyBox-based MinGit: git-core commands broken since 2.36.1 #4007

shinfd opened this issue Sep 4, 2022 · 8 comments
Milestone

Comments

@shinfd
Copy link

shinfd commented Sep 4, 2022

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.37.3.windows.1
cpu: x86_64
built from commit: c4992d4fecabd7d111726ecb37e33a3ccb51d6f1
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19044.1949]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Not Applicable (See next)
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Using Busybox-based MinGit extracted from zip. Added extracted_git_zip/cmd to environment path.
Running in Japanese locale.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD

git submodule
  • What did you expect to occur after running these commands?

The status of existing submodules in the repository are shown, or fatal: not a git repository (or any of the parent directories): .git if used outside of a repository.

  • What actually happened instead?

Below error is displayed, regardless of the existence of a repository in working directory.

C:/MinGit-2.36.1-busybox-64-bit/mingw64/libexec/git-core\git-submodule: line 7: basename: command not found
C:/MinGit-2.36.1-busybox-64-bit/mingw64/libexec/git-core\git-submodule: line 7: sed: command not found
/mingw64/libexec/git-core/git-sh-setup: line 86: basename: command not found
/mingw64/libexec/git-core/git-sh-setup: line 86: sed: command not found
/mingw64/libexec/git-core/git-sh-setup: line 308: uname: command not found
C:/MinGit-2.36.1-busybox-64-bit/mingw64/libexec/git-core\git-submodule: line 637: sed: command not found
C:/MinGit-2.36.1-busybox-64-bit/mingw64/libexec/git-core\git-submodule: line 637: cmd_: command not found
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Not applicable

Further Details

Other commands found in git-core e.g. git subtree results in error as well.

Trying older releases, I confirmed that the command worked up to release 2.36.0. All releases since 2.36.1 results in the above error.

MSYS2-based MinGit does not exhibit this problem.

@dscho
Copy link
Member

dscho commented Sep 5, 2022

I can confirm the behavior. An MCVE is:

git init with-sub
cd with-sub
git init sub
git submodule add sub

FWIW The BusyBox shipped even in the most recent version is relatively outdated, and testament to #1439 still being very much relevant. I work on this from time to time, with no clear idea how much more work there is left.

@shinfd
Copy link
Author

shinfd commented Sep 5, 2022

Thank you for looking at the issue.

Regarding MCVE, I should have explained that I chose single line git submodule, since the command (as well as git subtree) failed with equivalent error message regardless of existence of a repository in the working directory. If functioning, running it outside of a git repository should print fatal: not a git repository (or any of the parent directories): .git . Updated the original post.

FWIW The BusyBox shipped even in the most recent version is relatively outdated, and testament to #1439 still being very much relevant. I work on this from time to time, with no clear idea how much more work there is left.

Understood. This was my first attempt at using MinGit and its BusyBox variant, so the issue is definitely not urgent. I understand that BusyBox MinGit is still not production-ready (I had read the mentioned issue), and I can work with MSYS2 based one in the meantime. Nevertheless, I found it interesting that the function worked up to 2.36.0 and broke at 2.36.1, which seemingly did not include changes to git-core or included BusyBox.

@Nice7118

This comment was marked as spam.

@Nice7118

This comment was marked as spam.

@dscho
Copy link
Member

dscho commented Dec 21, 2022

Oh wow, I totally forgot about this issue. I think I have fixed this in git-for-windows/git-sdk-64@321d5fa which was shipped as part of v2.38.0.

@dscho dscho closed this as completed Dec 21, 2022
@dscho dscho added this to the v2.38.0 milestone Dec 21, 2022
@shinfd
Copy link
Author

shinfd commented Dec 21, 2022

Thank you for an update!

Unfortunately I tried running your MCVE and got the below result:

git init with-sub && cd with-sub && git init sub && git submodule add sub

E:/Work/mingit/mingw64/libexec/git-core\git-submodule: line 7: basename: command not found
E:/Work/mingit/mingw64/libexec/git-core\git-submodule: line 7: sed: command not found
/mingw64/libexec/git-core/git-sh-setup: line 77: basename: command not found
/mingw64/libexec/git-core/git-sh-setup: line 77: sed: command not found
/mingw64/libexec/git-core/git-sh-setup: line 292: uname: command not found
E:/Work/mingit/mingw64/libexec/git-core\git-submodule: line 610: sed: command not found
E:/Work/mingit/mingw64/libexec/git-core\git-submodule: line 610: cmd_: command not found

or simply git subtree in any directory and got the following.

E:/Work/mingit/mingw64/libexec/git-core\git-subtree: line 119: cat: command not found

In addition to cmd, I tried adding mingw64/bin, usr/bin and various subfolder to environment path but to no avail. Currently using the following version. Again running in Japanese locale.

git version 2.39.0.windows.1
cpu: x86_64
built from commit: de9501c66f93785f7eaf10d02ef08d231eb11688
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon

@landstander668
Copy link

landstander668 commented Dec 21, 2022

@shinfd Version 2.39.0.windows.2 was released around 2 hours ago, which is presumably where the fix actually landed. Can you update and re-test?

https://github.com/git-for-windows/git/releases/latest

@shinfd
Copy link
Author

shinfd commented Dec 23, 2022

@landstander668 Thank you for heads up but still unchanged at 2.39.0.windows.2 when I tested.

Oh wow, I totally forgot about this issue. I think I have fixed this in git-for-windows/git-sdk-64@321d5fa which was shipped as part of v2.38.0.

As commented by dscho earlier the change to BusyBox was actually put in earlier version, so this minor update should not be relevant. Does the same error not occur for you with MinGit-2.39.0.2-busybox?

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

4 participants