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

[PATCH v2 0/1] completion: complete dir-type option args to am, format_patch

From
Britton Leo Kerin <britton.kerin@gmail.com>
Date
Jan 9, 2024, 00:53 UTC
Message-ID
<feae3401-b3cb-4bae-926b-4844b0b0986c@smtp-relay.sendinblue.com>
In-Reply-To
<4714b88d-df5b-4e37-a5d7-af5033cfb861@smtp-relay.sendinblue.com>

This revision adds missing double quotes to improve the completion situation for paths with spaces in them, and adds some comments.

Britton Leo Kerin (1):
  completion: dir-type optargs for am, format-patch
 contrib/completion/git-completion.bash | 37 ++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
Range-diff against v1:
1:  2d788b0b18 ! 1:  5161304a92 completion: dir-type optargs for am, format-patch
    @@ contrib/completion/git-completion.bash: __git_count_arguments ()
      	printf "%d" $c
      }
    -+
     +# Complete actual dir (not pathspec), respecting any -C options.
     +#
     +# Usage: __git_complete_refs [<option>]...
    @@ contrib/completion/git-completion.bash: __git_count_arguments ()
     +		shift
     +	done
     +
    ++        # This rev-parse invocation amounts to a pwd which respects -C options
     +	local context_dir=$(__git rev-parse --show-toplevel --show-prefix 2>/dev/null | paste -s -d '/' 2>/dev/null)
    -+	[ -d "$context_dir" ] || return
    ++	[ -d "$context_dir" ] || return 1
     +
    -+	COMPREPLY=$(cd $context_dir 2>/dev/null && compgen -d -- "$cur_")
    ++	COMPREPLY=$(cd "$context_dir" 2>/dev/null && compgen -d -- "$cur_")
     +}
    -+
     +
      __git_whitespacelist="nowarn warn error error-all fix"
      __git_patchformat="mbox stgit stgit-series hg mboxrd"
--
2.43.0
Previous: Britton Leo KerinNext: Britton Leo Kerin
Message 2 of 6 in “completion: complete dir-type option args to am, format_patch”
  1. 0/1 completion: complete dir-type option args to am, format_patchBritton Leo Kerin, Jan 7, 2024
  2. 0/1 completion: complete dir-type option args to am, format_patchBritton Leo Kerin, Jan 9, 2024
  3. 1/1 completion: dir-type optargs for am, format-patchBritton Leo Kerin, Jan 9, 2024
  4. Rubén JustoFeb 3, 2024
  5. Britton KerinFeb 13, 2024
  6. Rubén JustoFeb 29, 2024

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.