-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
git-gui: fix GIT_DIR handling for submodules. #2452
Conversation
This PR looks good to me, but in the meantime Git GUI has an active maintainer again, so may I ask you to rebase this and open a GitGitGadget PR? I.e.
|
Oh, that's a good point!
Right. I did stumble over it a couple times, and once I tried to figure out what was the rationale, but also failed. Maybe we should just revert the revert instead, i.e. drop it from Git for Windows' patches? |
I found the reason for ca2f932! Look at https://groups.google.com/d/msg/msysgit/FkdTopndAes/RXF_h8eAgW4J |
Apparently, this failed (in a worktree with an initialized submodule):
@oldium you probably have a worktree with initialized submodule(s), right? Could you try whether the indicated bug is still there after reverting a9af64e and ca2f932? |
Yes, I do. I will play with this a little bit. |
@oldium thank you. I dug a little further, and it seems that https://groups.google.com/d/msg/msysgit/FkdTopndAes/BRVBc95idk8J was intended to (quote:) "fix this properly", and that patch made it into Git's So yes, it should be possible for us to just drop those two commits. If your testing confirms this, would you terribly mind updating this here PR accordingly? It is unfortunately too late for v2.25.0-rc1 (which is already in the process of being released), but it will make it into -rc2 at least. |
I tried the following which I found in the mailing list: git clone git://repo.or.cz/msysgit.git
cd msysgit
git submodule update --init
git gui
# the following instructions are for clicking
* Tools->Add...
Enter Name: submodule update
Enter Command: git submodule update
* Add
* Tools->submodule update |
Perfect! So we can drop this revert after slightly less than 10 years ;-) |
Updated PR. |
Git GUI [can now deal with uninitialized submodules](git-for-windows/git#2452) (this was a Windows-specific bug). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Thank you @oldium! |
You are welcome, @dscho! |
When dealing with submodule, the GIT_DIR might not be set. If it is not set
before, it cannot be unset and the execution ends with error:
can't unset "env(GIT_DIR)": no such element in array
Fix this by checking if GIT_DIR can be unset.