-
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
Associate with .sh files no longer works properly #396
Comments
A little more precision would not hurt: And that is indeed what it does here, after a regular installation. And that is indeed what the installer is told to do. So feel free to rebuild the installer, possibly after fiddling with the |
Yes, the installer did indeed place that command there for us as well. The problem is the command itself doesn't work - it results in that brief flash of a command window. So it's not the installer (and rebuilding the installer wouldn't help), so much as the command being added here. It does appear this command has changed over time, so it would seem one of these changes resulted in this regression; for example when it was originally introduced it used: "(msysgit)\bin\sh.exe" "--login" "%1" %* And in fact if I replace the command the Installer placed here with the above, the .sh association works. |
But you reported that it places |
Neither, on some machines we use a custom install path. Wherever we installed git is reflected in the path in the command. Take another look at my comment above - I edited it to clarify this. The install path isn't the issue - the command is the problem. It's pointing to git-bash.exe in the right location, but the way it's calling git-bash.exe is failing. Rolling it back to the old command, that calls bin\sh.exe, fixes it, as I mention above. |
Why not clarify in a new comment? That way I can follow you easier.
Then you did a good job leading me astray from the issue by putting something different than the verbatim value in your initial comment. Not so nice.
And this is positively wrong. There is no Msysgit, and not even an msysGit (the latter was the correct spelling). The project called msysGit was retired. In any case, I re-tested the echo "Test" $1
(cd / && pwd -W)
read x then double-clicked that file in the Windows Explorer and it does exactly what I think it should do: open a window, print a line reading "Test", printing another line corresponding to the installation path and then waiting for my input. When I hit the Return key, the script exits and the window closes. Our guide lines indicate pretty clearly that complete examples are preferred to incomplete ones. May I suggest to provide that? Maybe a complete, minimal Shell script, together with a description that says what you expected to happen and what happened instead? By now we spent so much time hashing things out, and we are still not done yet, that it is unfortunately so late that my answer will have to wait until tomorrow. |
Sounds like maybe you were just reading the first version of the comment in email. You focused in on the path and that lead you astray. So, path: irrelevant. I don't think the name of this project matters much as it's also irrelevant, but as a reminder this code is in fact a fork of msysgit. "git-for-windows/git We have 3 machines with this same issue so while your 1 machine has it working, I think you've still got a problem on your hands here. The idea that the scripts are the problem doesn't fit because as mentioned 1) The scripts work if you call them from Git Bash 2) They work if we roll back the command to the old format. For now we've resolved this across these machines by manually replacing the Registry command. When we have to attack it again on a 4th machine, I'll include a nonsense script for testing. But I suspect you'll have other users with this same issue in the meantime. |
My The |
Do you want to solve your problems or do you want to turn this into a mud fight?
So what is the issue? Instead of rambling on and on and confusing me even more, why don't you just come up with that simple example. Just like I did. My example works. I am still waiting for some example that demonstrates that it does, in fact, not work, as the title of this ticket claims. Seriously, if you really want to solve your problem, let's focus on that problem. Like, really focus on it. So: MCVE, please. Or close the ticket if you are no longer interested in solving this problem. |
I can confirm the issue. Using the following
I get a console window popping up (and closing almost immediately) saying:
Registry entry:
Replacing
|
@Lunatrius thanks for bringing some sanity back into this conversation. However, when I try the same thing as you, it does work correctly. FWIW I saved the I also tried with a fresh Explorer window (not started from Git Bash). Same thing. I even ran So something must be different between your setup and mine. FWIW when I export the same registry, it looks different:
In other words, my Git is installed into So: may I get more details, please? Ideally precise enough that I can replicate as similar a setup as possible so I have a prayer of reproducing the issue. |
I upgraded from The options picked during the install/update were:
I get the same error message, even if I run the following via the run dialog
|
I performed a few tests in a Win7 x64 VM using the 32 bit installer. Error 1: Test 1: double click
I also tested using the syntax from test 2 on my normal install (the one previously mentioned) and it worked. Looks like a double quotes issue with the windows command prompt? |
Thanks for the detailed analysis! I will have a look tomorrow trying to reproduce the error. Right now I cannot because I am on a phone... ☺ |
Just used ProcessMonitor to check how exactly the process is created. These were generated by double clicking the batch/bash files:
Running the following command from the run dialog started up the bash script as expected (added the "missing" double quotes):
|
I think I completely forgot to ask whether the script actually ran, the flashing window notwithstanding? I could actually understand if it did that; the current idea is that shell scripts might want to interact with the user, so they have to have a console window, but if they do not interact -- and finish fast -- the user would only see a flashing glimpse of the console window... |
BTW I can finally reproduce, thanks to the crucial information that this bug affects only the |
The script doesn't run when this bug occurs - you just get the error message in a flash of a window and it's gone. In our case the scripts were files that do basic things like pull git submodules: #!/bin/bash -v If it ran we'd see the effects of this running - pulled submodules. No dice. |
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix git-for-windows#396 Signed-off-by: Johannes Schindelin <[email protected]>
Due to `cmd.exe`'s quirky quoting rules, we need to make use of the `/S` option -- and use the `APPEND_QUOTE` option introduced into the Git wrapper for this very purpose. This is (2/3) to fix git-for-windows/git#396 Signed-off-by: Johannes Schindelin <[email protected]>
In order for `Git Bash` to accept parameters correctly -- as is the case with `.sh` file associations -- we need to adjust the way `cmd.exe`'s arguments are quoted. Because the previous way simply was not working. This is (3/3) to fix git-for-windows/git#396 Signed-off-by: Johannes Schindelin <[email protected]>
@b9chris hopefully you understand that my comment:
was intended to elicit crucial information such as your decision to deviate from the default options in the installer by choosing the Windows console instead of the mintty one? That omission cost both of us quite a bit of time. Happily, @Lunatrius filled in the missing link and everything is groovy now. Well, not everything. Every bug report is concluded successfully only when the original poster can confirm that the proposed fix is actually working for her. So here is your chance to bring this ticket to a successful conclusion: install the tentatively-fixed version from this temporary installer: and test again, then report back whether it fixes the bug or not. |
I really hate it when I spend hours and hours to fix problems that are not even mine and then those whose problem it is cannot even be bothered to test my fix. So I have to merge it untested. Grmbl. No brownies from me. |
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix #396 Signed-off-by: Johannes Schindelin <[email protected]>
…ions ``` 6e74958 p2000: add 'git checkout -' test and decrease depth 3e1d03c p2000: compress repo names cd94f82 commit: integrate with sparse-index 65e79b8 sparse-index: recompute cache-tree e9a9981 checkout: stop expanding sparse indexes 4b801c8 t1092: document bad 'git checkout' behavior 71e3015 unpack-trees: resolve sparse-directory/file conflicts 5e96df4 t1092: test merge conflicts outside cone defab1b add: allow operating on a sparse-only index 9fc4313 pathspec: stop calling ensure_full_index 0ec03ab add: ignore outside the sparse-checkout in refresh() adf5b15 add: remove ensure_full_index() with --renormalize ``` These commits are equivalent to those already in `next` via gitgitgadget#999. ``` 80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add ``` This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`. ``` c407b2c t7519: rewrite sparse index test 9dad0d2 sparse-index: silently return when not using cone-mode patterns 2974920 sparse-index: silently return when cache tree fails e7cdaa0 unpack-trees: fix nested sparse-dir search 347410c sparse-checkout: create helper methods 4537233 attr: be careful about sparse directories 5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag 3a2f316 sparse-checkout: clear tracked sparse dirs fb47b56 sparse-checkout: add config to disable deleting dirs ``` These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git-for-windows#396. > Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found). ``` 080b02c diff: ignore sparse paths in diffstat d91a647 merge: make sparse-aware with ORT df49b5f merge-ort: expand only for out-of-cone conflicts cdecb85 t1092: add cherry-pick, rebase tests 0c1ecfb sequencer: ensure full index if not ORT strategy 406dfbe sparse-index: integrate with cherry-pick and rebase ``` These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb). ``` cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0 acb8623 t7524: test no longer fails ``` Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken. Cc: @vdye and @ldennington to get a (possibly overwhelming?) taste of sparse-index stuff. If you focus solely on the `git merge` commits you'll get a feel for what a sparse index integration looks like.
…ions ``` 6e74958 p2000: add 'git checkout -' test and decrease depth 3e1d03c p2000: compress repo names cd94f82 commit: integrate with sparse-index 65e79b8 sparse-index: recompute cache-tree e9a9981 checkout: stop expanding sparse indexes 4b801c8 t1092: document bad 'git checkout' behavior 71e3015 unpack-trees: resolve sparse-directory/file conflicts 5e96df4 t1092: test merge conflicts outside cone defab1b add: allow operating on a sparse-only index 9fc4313 pathspec: stop calling ensure_full_index 0ec03ab add: ignore outside the sparse-checkout in refresh() adf5b15 add: remove ensure_full_index() with --renormalize ``` These commits are equivalent to those already in `next` via gitgitgadget#999. ``` 80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add ``` This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`. ``` c407b2c t7519: rewrite sparse index test 9dad0d2 sparse-index: silently return when not using cone-mode patterns 2974920 sparse-index: silently return when cache tree fails e7cdaa0 unpack-trees: fix nested sparse-dir search 347410c sparse-checkout: create helper methods 4537233 attr: be careful about sparse directories 5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag 3a2f316 sparse-checkout: clear tracked sparse dirs fb47b56 sparse-checkout: add config to disable deleting dirs ``` These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git-for-windows#396. > Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found). ``` 080b02c diff: ignore sparse paths in diffstat d91a647 merge: make sparse-aware with ORT df49b5f merge-ort: expand only for out-of-cone conflicts cdecb85 t1092: add cherry-pick, rebase tests 0c1ecfb sequencer: ensure full index if not ORT strategy 406dfbe sparse-index: integrate with cherry-pick and rebase ``` These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb). ``` cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0 acb8623 t7524: test no longer fails ``` Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
…ions ``` 6e74958 p2000: add 'git checkout -' test and decrease depth 3e1d03c p2000: compress repo names cd94f82 commit: integrate with sparse-index 65e79b8 sparse-index: recompute cache-tree e9a9981 checkout: stop expanding sparse indexes 4b801c8 t1092: document bad 'git checkout' behavior 71e3015 unpack-trees: resolve sparse-directory/file conflicts 5e96df4 t1092: test merge conflicts outside cone defab1b add: allow operating on a sparse-only index 9fc4313 pathspec: stop calling ensure_full_index 0ec03ab add: ignore outside the sparse-checkout in refresh() adf5b15 add: remove ensure_full_index() with --renormalize ``` These commits are equivalent to those already in `next` via gitgitgadget#999. ``` 80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add ``` This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`. ``` c407b2c t7519: rewrite sparse index test 9dad0d2 sparse-index: silently return when not using cone-mode patterns 2974920 sparse-index: silently return when cache tree fails e7cdaa0 unpack-trees: fix nested sparse-dir search 347410c sparse-checkout: create helper methods 4537233 attr: be careful about sparse directories 5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag 3a2f316 sparse-checkout: clear tracked sparse dirs fb47b56 sparse-checkout: add config to disable deleting dirs ``` These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git-for-windows#396. > Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found). ``` 080b02c diff: ignore sparse paths in diffstat d91a647 merge: make sparse-aware with ORT df49b5f merge-ort: expand only for out-of-cone conflicts cdecb85 t1092: add cherry-pick, rebase tests 0c1ecfb sequencer: ensure full index if not ORT strategy 406dfbe sparse-index: integrate with cherry-pick and rebase ``` These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb). ``` cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0 acb8623 t7524: test no longer fails ``` Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
We've updated from msysgit/Git for Windows 32-bit to 64-bit on 3 machines now. We're late to switch so 2.5.2.2 is our first 64-bit version. Beforehand we had the .sh file associate working properly - double-click a .sh file, runs in Git Bash.
Now, there is a .sh association in the Registry, but what it fires off fails. Double-clicking a .sh file, you simply see a command prompt window flash. Nothing more occurs and the script does not run.
The .sh extension points to the sh_auto_file file type in HKEY_CLASSES_ROOT. That then holds the command,
"(msysgit)\git-bash.exe" --no-cd "%L" %*
Where (msysgit) is the Msysgit install path. It would seem there's something wrong with this command.
We can however run these same .sh scripts by typing them out - for example open Git Bash from the context menu and type ./scriptname.sh - runs fine.
Because we're late to switch it isn't clear when exactly this regression occurred.
The text was updated successfully, but these errors were encountered: