From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Jeff King" <peff@peff.net>,
jacob.keller@gmail.com,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 3/5] revision.c: allow to change pseudo opt parsing function
Date: Wed, 25 Jan 2017 19:50:52 +0700 [thread overview]
Message-ID: <20170125125054.7422-4-pclouds@gmail.com> (raw)
In-Reply-To: <20170125125054.7422-1-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
revision.c | 11 ++++++++---
revision.h | 4 ++++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/revision.c b/revision.c
index 6ebd38d1c8..cda2606c66 100644
--- a/revision.c
+++ b/revision.c
@@ -2273,10 +2273,15 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
const char *arg = argv[i];
if (*arg == '-') {
int opts;
+ handle_pseudo_opt_cb handle_pseudo_opt =
+ handle_revision_pseudo_opt;
- opts = handle_revision_pseudo_opt(submodule,
- revs, argc - i, argv + i,
- &flags);
+ if (revs->handle_pseudo_opt)
+ handle_pseudo_opt = revs->handle_pseudo_opt;
+
+ opts = handle_pseudo_opt(submodule,
+ revs, argc - i, argv + i,
+ &flags);
if (opts > 0) {
i += opts - 1;
continue;
diff --git a/revision.h b/revision.h
index 9fac1a607d..9080eaf381 100644
--- a/revision.h
+++ b/revision.h
@@ -52,6 +52,8 @@ struct rev_cmdline_info {
#define REVISION_WALK_NO_WALK_SORTED 1
#define REVISION_WALK_NO_WALK_UNSORTED 2
+typedef int (*handle_pseudo_opt_cb)(const char *, struct rev_info *, int, const char **, int *);
+
struct rev_info {
/* Starting list */
struct commit_list *commits;
@@ -213,6 +215,8 @@ struct rev_info {
struct commit_list *previous_parents;
const char *break_bar;
+
+ handle_pseudo_opt_cb handle_pseudo_opt;
};
extern int ref_excluded(struct string_list *, const char *path);
--
2.11.0.157.gd943d85
next prev parent reply other threads:[~2017-01-25 12:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 12:26 [PATCH] log: new option decorate reflog of remote refs Nguyễn Thái Ngọc Duy
2017-01-19 17:23 ` Jeff King
2017-01-20 10:55 ` Duy Nguyen
2017-01-20 14:30 ` Jeff King
2017-01-20 22:00 ` Jacob Keller
2017-01-21 12:48 ` Duy Nguyen
2017-01-21 14:08 ` Jeff King
2017-01-25 12:50 ` [PATCH 0/5] Prep steps for --decorate-reflog Nguyễn Thái Ngọc Duy
2017-01-25 12:50 ` [PATCH 1/5] rev-list-options.txt: delete an empty line Nguyễn Thái Ngọc Duy
2017-01-25 12:50 ` [PATCH 2/5] revision.c: group ref selection options together Nguyễn Thái Ngọc Duy
2017-01-25 20:50 ` Jeff King
2017-01-26 9:18 ` Duy Nguyen
2017-01-26 14:19 ` Jeff King
2017-01-25 21:11 ` Junio C Hamano
2017-01-26 9:12 ` Duy Nguyen
2017-01-25 12:50 ` Nguyễn Thái Ngọc Duy [this message]
2017-01-25 12:50 ` [PATCH 4/5] revision.c: refactor ref selection handler after --exclude Nguyễn Thái Ngọc Duy
2017-01-25 17:41 ` Jacob Keller
2017-01-25 20:57 ` Jeff King
2017-01-25 21:27 ` Jeff King
2017-01-25 21:30 ` Jacob Keller
2017-01-25 23:25 ` Junio C Hamano
2017-01-26 9:28 ` Duy Nguyen
2017-01-26 14:24 ` Jeff King
2017-01-26 18:43 ` Junio C Hamano
2017-01-25 21:15 ` Junio C Hamano
2017-01-25 12:50 ` [PATCH 5/5] revision.c: add --decorate-reflog 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=20170125125054.7422-4-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=jacob.keller@gmail.com \
--cc=peff@peff.net \
/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).