{"thread":{"id":"28893","subject":"[PATCH] completion: don't leak variable from the prompt into environment","startedAt":"2011-11-09T10:02:50Z","lastAt":"2011-11-09T13:26:49Z","messageCount":3,"participants":["SZEDER Gábor","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"179198","messageId":"1320832970-26239-1-git-send-email-szeder@ira.uka.de","threadId":"28893","inReplyTo":null,"subject":"[PATCH] completion: don't leak variable from the prompt into environment","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2011-11-09T10:02:50Z","receivedAt":"2011-11-09T10:02:50Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Commit e5b8eebc (completion: fix issue with process substitution not\nworking on Git for Windows, 2011-10-26) introduced a new variable in\n__git_ps1_show_upstream(), but didn't declare it as local to prevent\nit from leaking into the environment.\n---\n contrib/completion/git-completion.bash |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex b3571ab4..d18895b1 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -110,7 +110,7 @@ __git_ps1_show_upstream ()\n \tlocal upstream=git legacy=\"\" verbose=\"\"\n \n \t# get some config options from git-config\n-\toutput=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n+\tlocal output=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n \twhile read key value; do\n \t\tcase \"$key\" in\n \t\tbash.showupstream)\n-- \n1.7.8.rc0.107.g695cb\n"},{"id":"179205","messageId":"7vd3d1widd.fsf@alter.siamese.dyndns.org","threadId":"28893","inReplyTo":"1320832970-26239-1-git-send-email-szeder@ira.uka.de","subject":"Re: [PATCH] completion: don't leak variable from the prompt into environment","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-11-09T13:11:26Z","receivedAt":"2011-11-09T13:11:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SZEDER Gábor <szeder@ira.uka.de> writes:\n\n> Commit e5b8eebc (completion: fix issue with process substitution not\n> working on Git for Windows, 2011-10-26) introduced a new variable in\n> __git_ps1_show_upstream(), but didn't declare it as local to prevent\n> it from leaking into the environment.\n> ---\n\nThanks; I'd consider this signed-off?\n\n>  contrib/completion/git-completion.bash |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index b3571ab4..d18895b1 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -110,7 +110,7 @@ __git_ps1_show_upstream ()\n>  \tlocal upstream=git legacy=\"\" verbose=\"\"\n>  \n>  \t# get some config options from git-config\n> -\toutput=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n> +\tlocal output=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n>  \twhile read key value; do\n>  \t\tcase \"$key\" in\n>  \t\tbash.showupstream)\n"},{"id":"179207","messageId":"20111109132649.GB2135@goldbirke","threadId":"28893","inReplyTo":"7vd3d1widd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] completion: don't leak variable from the prompt into environment","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2011-11-09T13:26:49Z","receivedAt":"2011-11-09T13:26:49Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nOn Wed, Nov 09, 2011 at 05:11:26AM -0800, Junio C Hamano wrote:\n> SZEDER Gábor <szeder@ira.uka.de> writes:\n> \n> > Commit e5b8eebc (completion: fix issue with process substitution not\n> > working on Git for Windows, 2011-10-26) introduced a new variable in\n> > __git_ps1_show_upstream(), but didn't declare it as local to prevent\n> > it from leaking into the environment.\n> > ---\n> \n> Thanks; I'd consider this signed-off?\n\nOops, yeah, sorry.\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n\n\nJust for the record:  I pointed this out when the patch was discussed\non the list, and proposed a better solution:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/184229/focus=184290\n\nbut apparently only after that patch was already merged.  Since we are\nin -rc phase, this patch below chooses the less intrusive solution\n(i.e. it declares the variable as local instead of eliminating it by\nusing the command substitution as here string).\n\n\nGábor\n\n\n> \n> >  contrib/completion/git-completion.bash |    2 +-\n> >  1 files changed, 1 insertions(+), 1 deletions(-)\n> >\n> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> > index b3571ab4..d18895b1 100755\n> > --- a/contrib/completion/git-completion.bash\n> > +++ b/contrib/completion/git-completion.bash\n> > @@ -110,7 +110,7 @@ __git_ps1_show_upstream ()\n> >  \tlocal upstream=git legacy=\"\" verbose=\"\"\n> >  \n> >  \t# get some config options from git-config\n> > -\toutput=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n> > +\tlocal output=\"$(git config -z --get-regexp '^(svn-remote\\..*\\.url|bash\\.showupstream)$' 2>/dev/null | tr '\\0\\n' '\\n ')\"\n> >  \twhile read key value; do\n> >  \t\tcase \"$key\" in\n> >  \t\tbash.showupstream)\n"}]}