git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: pclouds@gmail.com
Cc: avarab@gmail.com, git@vger.kernel.org, gitster@pobox.com,
	sunshine@sunshineco.com, szeder.dev@gmail.com,
	phillip.wood@talktalk.net
Subject: [PATCH v2 0/4] nd/parseopt-completion fixups
Date: Wed,  7 Mar 2018 08:05:00 +0700	[thread overview]
Message-ID: <20180307010504.9289-1-pclouds@gmail.com> (raw)
In-Reply-To: <20180303092307.3796-1-pclouds@gmail.com>

v2 fixes the comments from v1 and adds to new patches to improve
_git_notes() (sorry I couldn't resist)

Interdiff with what's on 'pu'

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 5f7495cda3..2e30950299 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1815,7 +1815,7 @@ _git_name_rev ()
 
 _git_notes ()
 {
-	local subcommands='add append copy edit list prune remove show'
+	local subcommands='add append copy edit get-ref list merge prune remove show'
 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 
 	case "$subcommand,$cur" in
@@ -1832,18 +1832,15 @@ _git_notes ()
 			;;
 		esac
 		;;
-	add,--reuse-message=*|append,--reuse-message=*|\
-	add,--reedit-message=*|append,--reedit-message=*)
+	*,--reuse-message=*|*,--reedit-message=*)
 		__git_complete_refs --cur="${cur#*=}"
 		;;
-	prune,--*)
-		__gitcomp_builtin notes_prune
-		;;
-	prune,*)
-		;;
 	*,--*)
 		__gitcomp_builtin notes_$subcommand
 		;;
+	prune,*|get-ref,*)
+		# this command does not take a ref, do not complete it
+		;;
 	*)
 		case "$prev" in
 		-m|-F)
@@ -1956,6 +1953,7 @@ _git_rebase ()
 			--autostash --no-autostash
 			--verify --no-verify
 			--keep-empty --root --force-rebase --no-ff
+			--rerere-autoupdate
 			--exec
 			"
 

Nguyễn Thái Ngọc Duy (4):
  completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate
  completion: simplify _git_notes
  completion: complete --{reuse,reedit}-message= for all notes subcmds
  completion: more subcommands in _git_notes()

 contrib/completion/git-completion.bash | 25 ++++++++-----------------
 parse-options.h                        |  4 ++--
 rerere.h                               |  3 +--
 3 files changed, 11 insertions(+), 21 deletions(-)

-- 
2.16.2.785.g429c04a1b9


  parent reply	other threads:[~2018-03-07  1:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03  9:23 [PATCH 0/2] nd/parseopt-completion fixups Nguyễn Thái Ngọc Duy
2018-03-03  9:23 ` [PATCH 1/2] completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate Nguyễn Thái Ngọc Duy
2018-03-03  9:34   ` Eric Sunshine
2018-03-06 10:22   ` Phillip Wood
2018-03-03  9:23 ` [PATCH 2/2] completion: simplify _git_notes Nguyễn Thái Ngọc Duy
2018-03-03 12:32   ` SZEDER Gábor
2018-03-03 13:09   ` SZEDER Gábor
2018-03-06 22:42     ` Junio C Hamano
2018-03-07  1:08       ` SZEDER Gábor
2018-03-07 18:51         ` Junio C Hamano
2018-03-07  1:05 ` Nguyễn Thái Ngọc Duy [this message]
2018-03-07  1:05   ` [PATCH v2 1/4] completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate Nguyễn Thái Ngọc Duy
2018-03-07  1:05   ` [PATCH v2 2/4] completion: simplify _git_notes Nguyễn Thái Ngọc Duy
2018-03-07  1:05   ` [PATCH v2 3/4] completion: complete --{reuse,reedit}-message= for all notes subcmds Nguyễn Thái Ngọc Duy
2018-03-07  1:05   ` [PATCH v2 4/4] completion: more subcommands in _git_notes() Nguyễn Thái Ngọc Duy

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

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

  git send-email \
    --in-reply-to=20180307010504.9289-1-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood@talktalk.net \
    --cc=sunshine@sunshineco.com \
    --cc=szeder.dev@gmail.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.
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).