gitgitgadget / git

GitGitGadget's Git fork. Open Pull Requests here to submit them to the Git mailing list
https://gitgitgadget.github.io/
Other
208 stars 135 forks source link

completion: zsh: stop leaking local cache variable #1725

Closed benknoble closed 4 months ago

benknoble commented 4 months ago

Prevent leaking a local variable used to cache the repo path, which breaks future completions in different repositories using the shell, when using contributed Zsh completion.


I made a few attempts at starting a test script for this based on https://unix.stackexchange.com/a/668827/301073, but that code doesn't work and it was all becoming precariously complicated (sh starting zsh to start zsh in a pty which would receive keystrokes and check specific outputs: I couldn't make certain pieces work in a normal way locally, let alone as part of Git's test suite). Suffice to say I have tested this myself?

CC: Felipe Contreras felipe.contreras@gmail.com

benknoble commented 4 months ago

/preview

gitgitgadget[bot] commented 4 months ago

Preview email sent as pull.1725.git.1714512880997.gitgitgadget@gmail.com

benknoble commented 4 months ago

/submit

gitgitgadget[bot] commented 4 months ago

Submitted as pull.1725.git.1714513995564.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1725/benknoble/fix-zsh-completion-repo-cache-v1

To fetch this version to local tag pr-1725/benknoble/fix-zsh-completion-repo-cache-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1725/benknoble/fix-zsh-completion-repo-cache-v1
gitgitgadget[bot] commented 4 months ago

On the Git mailing list, Junio C Hamano wrote (reply to this):

"D. Ben Knoble via GitGitGadget" <gitgitgadget@gmail.com> writes:

> Commit beb6ee7163 (completion: extract repository discovery from
> __gitdir(), 2017-02-03) anticipated this problem by marking
> __git_repo_path as local in __git_main and __gitk_main for Bash
> completion but did not give the same mark to _git for Zsh completion.
> Thus make __git_repo_path local for Zsh completion, too.

Will queue.  The explanation makes tons of sense.

Thanks.
gitgitgadget[bot] commented 4 months ago

This branch is now known as dk/zsh-git-repo-path-fix.

gitgitgadget[bot] commented 4 months ago

This patch series was integrated into seen via https://github.com/git/git/commit/140d03799610a6ee55346e15114b88eadc018479.

gitgitgadget[bot] commented 4 months ago

There was a status update in the "New Topics" section about the branch dk/zsh-git-repo-path-fix on the Git mailing list:

Command line completion support for zsh (in contrib/) has been
updated to stop exposing internal state to end-user shell
interaction.

Will merge to 'next'.
source: <pull.1725.git.1714513995564.gitgitgadget@gmail.com>
gitgitgadget[bot] commented 4 months ago

This patch series was integrated into seen via https://github.com/git/git/commit/b0a23d7029f94e8372e8fddc6ce051b215c138d6.

gitgitgadget[bot] commented 4 months ago

This patch series was integrated into next via https://github.com/git/git/commit/0446d8e63ab4a041136f96586975ba821f501bb3.

gitgitgadget[bot] commented 4 months ago

There was a status update in the "Cooking" section about the branch dk/zsh-git-repo-path-fix on the Git mailing list:

Command line completion support for zsh (in contrib/) has been
updated to stop exposing internal state to end-user shell
interaction.

Will merge to 'master'.
source: <pull.1725.git.1714513995564.gitgitgadget@gmail.com>
gitgitgadget[bot] commented 4 months ago

There was a status update in the "Cooking" section about the branch dk/zsh-git-repo-path-fix on the Git mailing list:

Command line completion support for zsh (in contrib/) has been
updated to stop exposing internal state to end-user shell
interaction.

Will merge to 'master'.
source: <pull.1725.git.1714513995564.gitgitgadget@gmail.com>
gitgitgadget[bot] commented 4 months ago

This patch series was integrated into seen via https://github.com/git/git/commit/cc15e855f3be9c82c4723b1d8a5223bb05f7c978.

gitgitgadget[bot] commented 4 months ago

This patch series was integrated into seen via https://github.com/git/git/commit/1ae0d15bc5321e1d09007cd23f5055a6a0b98f28.

gitgitgadget[bot] commented 4 months ago

This patch series was integrated into seen via https://github.com/git/git/commit/97673bdea7918488b3ce0a4591221ecdef299975.

gitgitgadget[bot] commented 4 months ago

This patch series was integrated into master via https://github.com/git/git/commit/97673bdea7918488b3ce0a4591221ecdef299975.

gitgitgadget[bot] commented 4 months ago

This patch series was integrated into next via https://github.com/git/git/commit/97673bdea7918488b3ce0a4591221ecdef299975.

gitgitgadget[bot] commented 4 months ago

Closed via 97673bdea7918488b3ce0a4591221ecdef299975.