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

git-gui: correctly restore GIT_DIR after invoking commands #1032

Merged
merged 1 commit into from
Jan 19, 2017

Conversation

max630
Copy link

@max630 max630 commented Jan 17, 2017

git-gui tries to temporary set GIT_DIR for running commands
and restore it back after it started. But in case of GIT_DIR which was
not set prior to invocation it is not unset after it.

Fix it.

Signed-off-by: Max Kirillov [email protected]

@max630 max630 force-pushed the gitgui_GIT_GIT_unset branch from 0742cc2 to 66e912a Compare January 17, 2017 18:33
@PhilipOakley
Copy link

looks sensible to me.
Should this PR also go to https://github.com/patthoyts/git-gui ?

@max630
Copy link
Author

max630 commented Jan 18, 2017

Should this PR also go to https://github.com/patthoyts/git-gui ?

The patch is not directly applicable to that repository, as well as to the main git's one. Though they would also have the issue that they leak the environment to shell. But is should be fixed in other place.

@@ -2203,6 +2203,8 @@ proc do_gitk {revs {is_submodule false}} {

if {$old_GIT_DIR ne {}} {
set env(GIT_DIR) $old_GIT_DIR
} else {
unset env(GIT_DIR)

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -2239,6 +2241,8 @@ proc do_git_gui {} {

if {$old_GIT_DIR ne {}} {
set env(GIT_DIR) $old_GIT_DIR
} else {
unset env(GIT_DIR)

This comment was marked as off-topic.

This comment was marked as off-topic.

git-gui tries to temporary set GIT_DIR for starting gitk and restore
it back after they are started. But in case of GIT_DIR which was not set
prior to invocation it is not unset after it. This affects commands
which can be later started from that git gui, for example "Git Bash".

Fix it.

Signed-off-by: Max Kirillov <[email protected]>
@max630 max630 force-pushed the gitgui_GIT_GIT_unset branch from 66e912a to 5bd3bbf Compare January 18, 2017 19:01
@dscho dscho merged commit 86d49cc into git-for-windows:master Jan 19, 2017
@dscho
Copy link
Member

dscho commented Jan 19, 2017

Thank you!

@dscho dscho added this to the v2.11.1 milestone Jan 19, 2017
dscho added a commit that referenced this pull request Jan 24, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Jan 24, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit to git-for-windows/build-extra that referenced this pull request Jan 24, 2017
Git GUI will [no longer set `GIT_DIR` when
calling Git Bash after visualizing the commit
history](git-for-windows/git#1032).

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Jan 25, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Jan 25, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Jan 25, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Jan 25, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit to dscho/git that referenced this pull request Feb 1, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 2, 2017
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Feb 2, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 2, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 2, 2017
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Feb 2, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 3, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 4, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 4, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 4, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit to dscho/git that referenced this pull request Feb 4, 2017
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Feb 21, 2017
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 11, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 13, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 13, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 13, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 14, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 16, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 16, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 16, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 18, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 18, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 21, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 21, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 24, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 25, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 26, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 26, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit to dscho/git that referenced this pull request Dec 26, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 29, 2019
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit that referenced this pull request Dec 29, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 30, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Dec 30, 2019
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Jan 2, 2020
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Jan 2, 2020
git-gui: correctly restore GIT_DIR after invoking commands
git-for-windows-ci pushed a commit that referenced this pull request Jan 2, 2020
git-gui: correctly restore GIT_DIR after invoking commands
dscho added a commit to dscho/git that referenced this pull request Jan 3, 2020
git-gui: correctly restore GIT_DIR after invoking commands
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.

3 participants