Skip to content

Pinned Git Bash shortcut does not execute .profile #167

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
fracz opened this issue May 28, 2015 · 9 comments
Closed

Pinned Git Bash shortcut does not execute .profile #167

fracz opened this issue May 28, 2015 · 9 comments

Comments

@fracz
Copy link

fracz commented May 28, 2015

I have configured few items in my ~/.profile file (like ssh-agent, aliases, $PS1 etc). Running Windows 7.

When I open new Git Bash, on taskbar it is visible with nice color git bash icon (like this: https://git-for-windows.github.io/favicon.ico).

When I right click it and select "Pin to taskbar", it seems to be pinned correctly but the icon is changed to console-like (sth like http://mricons.com/uploads/icon_sets/67/icons/111545/thumb/64x64.png).

When I close Git Bash and open it again from the pinned taskbar shortcut, it does not execute my ~/.profile and the command line looks like

bash-4.3$

I have to go back to Start Menu -> Git Bash to have my settings executed.\

EDIT:

After executing

bash --login -i

in the "pinned command line" I get my environment set.

How to execute it automatically?

@dscho
Copy link
Member

dscho commented May 29, 2015

Hmm. Essentially the problem is that what you try to pin to the dock is not the Git Bash executable, but the mintty executable. The Git Bash executable calls that mintty executable, but with a bunch of command-line options, and after setting up some environment variables.

Quite honestly, I have no idea how to pin the git-bash.exe to the dock when the program that is actually running is mintty.exe... Maybe you have some ideas?

@linquize
Copy link

because git-bash.exe is just a wrapper.
Can we modify mintty.exe in order to achieve this, if no other method?

@dscho
Copy link
Member

dscho commented May 29, 2015

Can we modify mintty.exe in order to achieve this, if no other method?

No, we cannot abduct mintty to do what it was never intended to do. mintty is a terminal emulator.

@fracz I wonder whether pinning works if you choose the ConHost instead of the MinTTY option in the installer?

@michaelprager
Copy link

why not drag&drop git-bash.exe onto the taskbar? This will pin the wrapper correctly instead of the executed shell.

@fracz
Copy link
Author

fracz commented Jun 3, 2015

Yes, but you will have two items in taskbar after launching it (the first one for the shortcut and the second for running process).

@albertosantini
Copy link

Here I have the same environment (windows 7 SP1 - 64 bit), but it works nice.

When I select pin to taskbar for git-bash.exe executable, the executable is pinned and the icon is ok, like favicon, not the terminal one.

Clicking on it the terminal (mintty) is started correctly executing ~/.profile.

I suppose you gave a look at Shortcut tab in Git for Windows properties (the properties of the executable you pinned). Maybe there is something misconfigured: icon, executable and so on.

Finally I suggest to use CCleaner utility, cleaning an old setup.

@fracz
Copy link
Author

fracz commented Jun 7, 2015

I have resolved this isse as follows:

  1. Run git-bash.exe from any location.
  2. Right click its icon in taskbar and select "Pin to taskbar". The icon on taskbar changes to the mintty's.
  3. Close git bash window.
  4. Go to %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar. Find the Terminal shortcut with mintty's icon. Right click it and choose Properties.
  5. In the Target field, add the following parameters to the terminal program: --exec /usr/bin/bash --login -i. As a results, it should looks like "C:\Program Files\Git\usr\bin\mintty.exe" --exec /usr/bin/bash --login -i. Click OK.
  6. Click the pinned terminal in the taskbar - it should login automatically.
  7. If this results in two terminal icons in taskbar, unpin the old one and pin the new one.

@fracz fracz closed this as completed Jun 7, 2015
@dscho
Copy link
Member

dscho commented Jun 7, 2015

For future record: I could imagine that setting the System.AppUserModel.RelaunchCommand property from the Git wrapper might help (as hinted in this blog).

@dscho
Copy link
Member

dscho commented Jun 19, 2015

@rcdailey feel free to work on the RelaunchCommand solution I described broadly.

jeffhostetler pushed a commit to jeffhostetler/git that referenced this issue Aug 13, 2019
…g around octopus merges

The commit message below describes the bug. This has been sent upstream
hopefully in time for v2.23.0. If we are taking 2.23.0 soon, then we would not
need this fix.

The question for @jrbriggs and others is: do we rush this fix to the version
of microsoft/vfsforgit in EA? There are possible reasons that this is an
edge-case enough to ignore:

1. It only affects the split commit-graph when a non-base file has an
octopus merge commit. Only one octopus merge exists in the OS repo
right now.

2. It will not _break_ users, but will cause "warning: commit-graph chain
does not match" warnings and cause increasing performance issues as
the base commit-graph files far further and further behind.

I'm open to all options here.

Thanks,
-Stolee

---

In 1771be9 "commit-graph: merge commit-graph chains" (2019-06-18),
the method sort_and_scan_merged_commits() was added to merge the
commit lists of two commit-graph files in the incremental format.
Unfortunately, there was an off-by-one error in that method around
incrementing num_extra_edges, which leads to an incorrect offset
for the base graph chunk.

When we store an octopus merge in the commit-graph file, we store
the first parent in the normal place, but use the second parent
position to point into the "extra edges" chunk where the remaining
parents exist. This means we should be adding "num_parents - 1"
edges to this list, not "num_parents - 2". That is the basic error.

The reason this was not caught in the test suite is more subtle.
In 5324-split-commit-graph.sh, we test creating an octopus merge
and adding it to the tip of a commit-graph chain, then verify the
result. This _should_ have caught the problem, except that when
we load the commit-graph files we were overly careful to not fail
when the commit-graph chain does not match. This care was on
purpose to avoid race conditions as one process reads the chain
and another process modifies it. In such a case, the reading
process outputs the following message to stderr:

	warning: commit-graph chain does not match

These warnings are output in the test suite, but ignored. By
checking the stderr of `git commit-graph verify` to include
the expected progress output, it will now catch this error.

Signed-off-by: Derrick Stolee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants