mirror of
https://github.com/git/git.git
synced 2026-02-18 05:39:11 +00:00
304d2974633a9da9da701fc1fd66d126c41051f4
To allow the Git wrapper to replace the `git-bash.bat` script (which would always open the Win32 console, even if the user wants to use a different terminal emulator), we need to offer a way to configure *which* command-line to run. We need to recompile the git-wrapper with the `-mwindows` flag to declare that this is a GUI program (not a console program). Having to recompile it anyway, let's put the new code in a conditionally compiled section so that the builtins (for which we use the git-wrapper, too) do not need to carry around that code. To configure the command-line, we use a way that is very typical for Windows: resources. Windows resources are data that are stored inside .exe files, but can be changed *after* compilation. Therefore, this facility is *exactly* what we want: we can easily copy the .exe to the new name `git-bash.exe`, configure that executable to run the Bash, and then copy it again to the new name `git-cmd.exe` and configure that executable to run `cmd.exe` instead. For even more flexibility, we expand environment variables specified as `@@<VARIABLE-NAME>@@`, and for convenience `@@EXEPATH@@` expands into the directory in which the executable resides. Sadly, an executable cannot configure itself: the `.exe` file is locked while the process is running. This means we have to have a separate executable to edit the resources anyway, so let's just enhance the Git wrapper *itself*: when copied to the new name `edit-res.exe`, it can edit other copies of the Git wrapper like so: edit-res.exe git-cmd.exe command '@@COMSPEC@@ /K' Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
Git for Windows
This is the source code of Git for Windows, forked from Git.
If you encounter problems, you can report them as GitHub issues, discuss them on Git for Windows' Google Group, and contribute bug fixes.
Description
Languages
C
50.5%
Shell
38.8%
Perl
4.4%
Tcl
3.2%
Python
0.8%
Other
2.1%