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

mingw-w64-git: adjust git-bash to official mintty #19

Merged
merged 1 commit into from
Aug 28, 2016

Conversation

kgybels
Copy link

@kgybels kgybels commented Aug 27, 2016

Currently git-bash relies on mintty options that were proposed in a pull
request. A mintty package was also build with these changes. However, the
proposed options were changed slightly when merged into the official
mintty.

Offical mintty uses AppLaunchCmd instead of RelaunchCommand, AppName
instead of RelaunchDisplayName and requires an additional option
--store-taskbar-properties for the options to take effect.

In addition to these changes, specifying the path for the icon as
/mingw64/share/git/git-for-windows.ico no longer works. Using
"@@EXEPATH@@\mingw64\share\git\git-for-windows.ico" works, however,
instead of relying on a separate file we can just as well get the icon
from our git-bash executable.

Currently git-bash relies on mintty options that were proposed in a pull
request. A mintty package was also build with these changes. However, the
proposed options were changed slightly when merged into the official
mintty.

Offical mintty uses AppLaunchCmd instead of RelaunchCommand, AppName
instead of RelaunchDisplayName and requires an additional option
--store-taskbar-properties for the options to take effect.

In addition to these changes, specifying the path for the icon as
/mingw64/share/git/git-for-windows.ico no longer works. Using
"@@EXEPATH@@\\mingw64\\share\\git\\git-for-windows.ico" works, however,
instead of relying on a separate file we can just as well get the icon
from our git-bash executable.
@kgybels
Copy link
Author

kgybels commented Aug 27, 2016

@dscho As requested in git-for-windows/git#842.

I tested this using the Git for Windows SDK on my Microsoft Windows 10 Home (10.0.10586 Build 10586). I installed the newer version of mintty using pacman -S "mintty>=1~2.2.1", which installed mintty-1~2.4.2-1. I tested by directly editing the string table in git-bash.exe, this way I could iterate quickly. I also changed the AppID by appending a number, e.g. GitForWindows.Bash.1, when testing different versions I incremented this number. I inspected the shortcuts created in C:\Users\<user>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts. I noticed the following:

  • AppID is reflected in the hash that is used as a folder in ImplicitAppShortcuts.
  • AppName is used as the name of the shortcut, e.g. Git Bash.lnk.
  • AppLaunchCmd becomes the target of the shortcut.
  • Path to icon gets stored in shortcut.

After this testing I knew what value would work for the string table in git-bash.exe. After creating the commit with the changes, I did the following final test:

  • build and install new mingw-win64-git package
  • unpin any previous tests and clean up ImplicitAppShortcuts
  • reboot
  • start git-bash.exe from SDK by double-clicking in explorer
  • pin to taskbar
  • close mintty
  • start again from taskbar
  • inspect shortcut in ImplicitAppShortcuts

@kgybels
Copy link
Author

kgybels commented Aug 27, 2016

@dscho I noticed that mingw-w64-git does not have a dependency on mintty. Is this intentional?

@dscho
Copy link
Member

dscho commented Aug 28, 2016

This is great, thank you so much! I will check it out as soon as I can, to provide additional verification.

I noticed that mingw-w64-git does not have a dependency on mintty. Is this intentional?

Yes, this is intentional. Git should not depend on mintty.exe's presence, but fall back to using conhost if MinTTY is not installed.

Having said that, I guess that we should add an optdepends entry. I will do that, and work a bit more on the mingw-w64-git package: I want to move the source code of the git-wrapper.exe (which is the basis of git-bash.exe and other nice things) out of the Git source code and into MINGW-packages. That will make it substantially easier to maintain.

Will keep you posted!

@dscho dscho merged commit 7f8433c into git-for-windows:master Aug 28, 2016
@dscho
Copy link
Member

dscho commented Aug 28, 2016

Tested and verified! Thank you so much!

@kgybels kgybels deleted the mintty branch August 28, 2016 14:13
@kgybels
Copy link
Author

kgybels commented Aug 28, 2016

Great!

@@ -187,7 +187,6 @@ package_git () {

# Git Bash, Git CMD
install -d -m755 $pkgdir$SHAREDIR
install -m755 ../git-for-windows.ico $pkgdir$SHAREDIR

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

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

Successfully merging this pull request may close these issues.

2 participants