Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 07/19] completion: make __gitdir() store repository path in $__git_dir

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:47

SZEDER Gábor [off-list ref] writes:
Also declare $__git_dir as local in __git_ps1() and _gitk() to prevent
the variable from leaking into the environment when they call
__gitdir() (that would break completion and bash prompt when the user
moves to a different git repository).
Good; this was actually the only major thing I worried about when I saw
the tail part of the series.  So $__git_dir is global across the call
chain of a single invocation to show __git_ps1, but it always is reset
once __git_ps1 is called again, so that it will always know where the
then-current git repository is, right?

Looks quite a sane and valid optimization to me.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help