git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] git-completion.bash: use correct Bash/Zsh array length syntax
@ 2013-08-21 20:49 Brandon Casey
  2013-08-21 20:49 ` [PATCH 2/3] t9902-completion.sh: old Bash still does not support array+=('') notation Brandon Casey
  2013-08-21 20:49 ` [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring" Brandon Casey
  0 siblings, 2 replies; 10+ messages in thread
From: Brandon Casey @ 2013-08-21 20:49 UTC (permalink / raw)
  To: gitster; +Cc: git, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

The syntax for retrieving the number of elements in an array is:

   ${#name[@]}

Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 5da920e..e1b7313 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2580,7 +2580,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then
 				--*=*|*.) ;;
 				*) c="$c " ;;
 				esac
-				array[$#array+1]="$c"
+				array[${#array[@]}+1]="$c"
 			done
 			compset -P '*[=:]'
 			compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
-- 
1.8.4.rc0.2.g6cf5c31


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-08-22  1:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21 20:49 [PATCH 1/3] git-completion.bash: use correct Bash/Zsh array length syntax Brandon Casey
2013-08-21 20:49 ` [PATCH 2/3] t9902-completion.sh: old Bash still does not support array+=('') notation Brandon Casey
2013-08-21 20:49 ` [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring" Brandon Casey
2013-08-21 21:47   ` Junio C Hamano
2013-08-21 22:08     ` Brandon Casey
2013-08-22  0:22       ` Junio C Hamano
2013-08-22  0:33         ` Brandon Casey
2013-08-22  1:17           ` [PATCH] contrib/git-prompt.sh: handle missing 'printf -v' more gracefully Brandon Casey
2013-08-22  1:39             ` Brandon Casey
2013-08-22  1:27           ` [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring" Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).