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

Re: [PATCH v3 2/2] completion: add git status

From
Thomas Braun <thomas.braun@virtuell-zuhause.de>
Date
Jun 3, 2016, 15:41 UTC
Message-ID
<8f5e515b-8efc-0160-820e-d81885fc6c36@virtuell-zuhause.de>
In-Reply-To
<xmqqtwhbtq46.fsf@gitster.mtv.corp.google.com>
Am 02.06.2016 um 20:14 schrieb Junio C Hamano:
Show 14 quoted lines
> Thomas Braun <thomas.braun@virtuell-zuhause.de> writes:
> 
>> +	untracked_state="$(__git_find_on_cmdline "--untracked-files=no\
>> +		--untracked-files=normal --untracked-files=all")"
> 
> Just wondering but does this help my use of the command like
> 
> 	$ git status -uno <TAB>
> 
> or do I now have to spell it out like
> 
> 	$ git status --untracked-files=no <TAB>
> 
> to take advantage of it?

I was unsure if I should support the short option (-u) as well. On thinking about it again there is little use of only doing it for the long option. Will be handled in a reroll.

Show 18 quoted lines
>> +	untracked_state=${untracked_state##--untracked-files=}
>> +
>> +	if [ -z "$untracked_state" ]; then
>> +		untracked_state="$(git --git-dir="$(__gitdir)" config "status.showUntrackedFiles")"
>> +	fi
>> +
>> +	case "$untracked_state" in
>> +		no)
>> +			# --ignored option does not matter
> 
> Style.  I see existing case/esac statements that use this style, but
> our preference is not to indent case arms like this; rather:
> 
> 	case "$untracked_state" in
>         no)
>         	# --ignored ...
> 
> which saves the indentation one level overall.
thanks, will be fixed.
Show 8 quoted lines
>> +			complete_opt=
>> +			;;
>> +		all|normal|*)
>> +			complete_opt="--cached --directory --no-empty-directory --others"
>> +
>> +			if [ -n "$(__git_find_on_cmdline "--ignored")" ]; then
> 
> Same question as the "--untracked-files=no vs -uno" applies here.

Is there a short version of --ignored? I could not find one in the help, and from a look into cmd_status in commit.c I would say there is none.

Previous: Junio C HamanoNext: Junio C Hamano
Message 14 of 33 in “completion: create variable for untracked file modes”
  1. 1/2 completion: create variable for untracked file modesThomas Braun, May 31, 2016
  2. Jeff KingJun 1, 2016
  3. Junio C HamanoJun 1, 2016
  4. Thomas BraunJun 1, 2016
  5. 1/2 completion: create variable for untracked file modesThomas Braun, Jun 1, 2016
  6. SZEDER GáborJun 1, 2016
  7. Thomas BraunJun 2, 2016
  8. 2/2 completion: add git statusThomas Braun, Jun 1, 2016
  9. SZEDER GáborJun 1, 2016
  10. Thomas BraunJun 2, 2016
  11. 1/2 completion: factor out untracked file modes into a variableThomas Braun, Jun 2, 2016
  12. 2/2 completion: add git statusThomas Braun, Jun 2, 2016
  13. Junio C HamanoJun 2, 2016
  14. Thomas BraunJun 3, 2016
  15. Junio C HamanoJun 3, 2016
  16. Jeff KingJun 3, 2016
  17. Junio C HamanoJun 3, 2016
  18. Thomas BraunJun 3, 2016
  19. 0/3 support completion for git statusThomas Braun, Jun 3, 2016
  20. 1/3 completion: factor out untracked file modes into a variableThomas Braun, Jun 3, 2016
  21. 2/3 completion: add __git_get_option_value helperThomas Braun, Jun 3, 2016
  22. SZEDER GáborJun 10, 2016
  23. Thomas BraunJun 25, 2016
  24. 3/3 completion: add git statusThomas Braun, Jun 3, 2016
  25. Junio C HamanoJun 6, 2016
  26. Thomas BraunJun 7, 2016
  27. Junio C HamanoJun 6, 2016
  28. 0/3 completion: add git statusThomas Braun, Jun 10, 2016
  29. 2/3 completion: add __git_get_option_value helperThomas Braun, Jun 10, 2016
  30. 1/3 completion: factor out untracked file modes into a variableThomas Braun, Jun 10, 2016
  31. 3/3 completion: add git statusThomas Braun, Jun 10, 2016
  32. 1/3 completion: factor out untracked file modes into a variableThomas Braun, Jun 10, 2016
  33. 3/3 completion: add git statusThomas Braun, Jun 10, 2016

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.