git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: conflict resolution of pd/bash-4-completion [Re: What's cooking in git.git (Dec 2010, #05; Thu, 16)]
Date: Fri, 17 Dec 2010 12:18:56 +0100	[thread overview]
Message-ID: <20101217111856.GA9304@neumann> (raw)
In-Reply-To: <7vk4j8kfwy.fsf@alter.siamese.dyndns.org>

Hi,


On Thu, Dec 16, 2010 at 11:38:21PM -0800, Junio C Hamano wrote:
> * pd/bash-4-completion (2010-12-15) 3 commits
>  - Merge branch 'master' (early part) into pd/bash-4-completion
>  - bash: simple reimplementation of _get_comp_words_by_ref
>  - bash: get --pretty=m<tab> completion to work with bash v4
> 
> Updated by Jonathan; this still has some conflicts around "notes"
> completion I tried to resolve near the tip of 'pu'.

The resolution of that conflict is not quite correct.  I'm not sure
how I should send a proper conflict resolution...  but I'll try
anyway.

So the patch below applies to today's pu (i.e. db92f24) and fixes the
current merge conflict resolution in the completion function for 'git
notes'.

I also have a few comments to the patches in this topic, but it's
quite hard to find the time to think them through and sum them up
properly in this pre-Xmas frenzy...


Best,
Gábor


diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index bd5b322..e0c40c3 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1707,20 +1707,15 @@ _git_notes ()
 {
 	local subcommands='add append copy edit list prune remove show'
 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
-	local words cword
-	_get_comp_words_by_ref -n =: words cword
-	local cur=${words[cword-1]}
-	if [ -z "$subcommand" ]; then
-		__gitcomp "$subcommands"
-		return
-	fi
+	local cur words cword
+	_get_comp_words_by_ref -n =: cur words cword
 
 	case "$subcommand,$cur" in
 	,--*)
 		__gitcomp '--ref'
 		;;
 	,*)
-		case "${COMP_WORDS[COMP_CWORD-1]}" in
+		case "${words[cword-1]}" in
 		--ref)
 			__gitcomp "$(__git_refs)"
 			;;
@@ -1748,7 +1743,7 @@ _git_notes ()
 	prune,*)
 		;;
 	*)
-		case "${COMP_WORDS[COMP_CWORD-1]}" in
+		case "${words[cword-1]}" in
 		-m|-F)
 			;;
 		*)
-- 
1.7.3.4.547.g524288

  reply	other threads:[~2010-12-17 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17  7:38 What's cooking in git.git (Dec 2010, #05; Thu, 16) Junio C Hamano
2010-12-17 11:18 ` SZEDER Gábor [this message]
2010-12-17 19:24   ` conflict resolution of pd/bash-4-completion [Re: What's cooking in git.git (Dec 2010, #05; Thu, 16)] Junio C Hamano
2010-12-18 22:00 ` What's cooking in git.git (Dec 2010, #05; Thu, 16) Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101217111856.GA9304@neumann \
    --to=szeder@ira.uka.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).