git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] work around zsh comment in __git_complete_worktree_paths

From
Junio C Hamano <gitster@pobox.com>
Date
May 4, 2021, 03:18 UTC
Message-ID
<xmqqlf8v6vbi.fsf@gitster.g>
In-Reply-To
<pull.943.v2.git.1620059347674.gitgitgadget@gmail.com>

"Sardorbek Imomaliev via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 16 quoted lines
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 49e76e9d08cd..73f9fcf493c4 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -3268,9 +3268,10 @@ _git_whatchanged ()
>  __git_complete_worktree_paths ()
>  {
>  	local IFS=$'\n'
> +	# Generate completion reply from worktree list skipping the first
> +	# entry: it's the path of the main worktree, which can't be moved,
> +	# removed, locked, etc.
>  	__gitcomp_nl "$(git worktree list --porcelain |
> -		# Skip the first entry: it's the path of the main worktree,
> -		# which can't be moved, removed, locked, etc.
>  		sed -n -e '2,$ s/^worktree //p')"
>  }
Makes sense.  Thanks, will queue.
Previous: Sardorbek Imomaliev via GitGitGadget
Message 4 of 4 in “Fix: fix comment for __git_complete_worktree_paths”
  1. Fix: fix comment for __git_complete_worktree_pathsSardorbek Imomaliev via GitGitGadget, Apr 29, 2021
  2. Junio C HamanoApr 30, 2021
  3. work around zsh comment in __git_complete_worktree_pathsSardorbek Imomaliev via GitGitGadget, May 3, 2021
  4. Junio C HamanoMay 4, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.