From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH 1/2] completion: merge options for cherry-pick and revert
Date: Sat, 24 Aug 2019 05:04:49 -0400 [thread overview]
Message-ID: <cdcac975548502a58234f7537a5fe11dcdb538ea.1566637431.git.liu.denton@gmail.com> (raw)
In-Reply-To: <cover.1566637431.git.liu.denton@gmail.com>
Since revert and cherry-pick share the same sequencer code, they should
both accept the same command-line options. Merge the
`__git_cherry_pick_inprogress_options` and
`__git_revert_inprogress_options` variables together into
`__git_cherry_pick_revert_inprogress_options` so that the options aren't
unnecessarily duplicated twice.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
contrib/completion/git-completion.bash | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e087c4bf00..62f8ef600d 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1361,13 +1361,13 @@ _git_checkout ()
esac
}
-__git_cherry_pick_inprogress_options="--continue --quit --abort"
+__git_cherry_pick_revert_inprogress_options="--continue --quit --abort"
_git_cherry_pick ()
{
__git_find_repo_path
if [ -f "$__git_repo_path"/CHERRY_PICK_HEAD ]; then
- __gitcomp "$__git_cherry_pick_inprogress_options"
+ __gitcomp "$__git_cherry_pick_revert_inprogress_options"
return
fi
@@ -1376,7 +1376,7 @@ _git_cherry_pick ()
case "$cur" in
--*)
__gitcomp_builtin cherry-pick "" \
- "$__git_cherry_pick_inprogress_options"
+ "$__git_cherry_pick_revert_inprogress_options"
;;
*)
__git_complete_refs
@@ -2512,20 +2512,18 @@ _git_restore ()
esac
}
-__git_revert_inprogress_options="--continue --quit --abort"
-
_git_revert ()
{
__git_find_repo_path
if [ -f "$__git_repo_path"/REVERT_HEAD ]; then
- __gitcomp "$__git_revert_inprogress_options"
+ __gitcomp "$__git_cherry_pick_revert_inprogress_options"
return
fi
__git_complete_strategy && return
case "$cur" in
--*)
__gitcomp_builtin revert "" \
- "$__git_revert_inprogress_options"
+ "$__git_cherry_pick_revert_inprogress_options"
return
;;
esac
--
2.23.0.248.g3a9dd8fb08
next prev parent reply other threads:[~2019-08-24 9:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-24 9:04 [PATCH 0/2] completion: complete --skip for cherry-pick and revert Denton Liu
2019-08-24 9:04 ` Denton Liu [this message]
2019-08-26 16:59 ` [PATCH 1/2] completion: merge options " Junio C Hamano
2019-08-24 9:04 ` [PATCH 2/2] completion: add --skip " Denton Liu
2019-08-27 4:45 ` [PATCH v2 0/3] advertise --skip for cherry-pick and revert better Denton Liu
2019-08-27 4:45 ` [PATCH v2 1/3] completion: merge options for cherry-pick and revert Denton Liu
2019-08-27 4:45 ` [PATCH v2 2/3] completion: add --skip " Denton Liu
2019-08-27 4:45 ` [PATCH v2 3/3] status: mention --skip for revert and cherry-pick Denton Liu
2019-08-27 21:56 ` Junio C Hamano
2019-08-27 23:18 ` Denton Liu
2019-08-28 2:47 ` Junio C Hamano
2019-08-28 6:45 ` Denton Liu
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=cdcac975548502a58234f7537a5fe11dcdb538ea.1566637431.git.liu.denton@gmail.com \
--to=liu.denton@gmail.com \
--cc=git@vger.kernel.org \
/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).