From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Philip Oakley" <philipoakley@iee.email>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 3/7] sequencer.[ch]: pass "struct strvec *" instead of int/char ** pair
Date: Sun, 12 Sep 2021 02:15:51 +0200 [thread overview]
Message-ID: <patch-v2-3.7-c35cfb9c9c5-20210912T001420Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-v2-0.7-00000000000-20210912T001420Z-avarab@gmail.com>
As in the preceding commit, prepare for the "nr" member of "struct
strvec" changing from an "int" to a "size_t". These are the same sorts
of changes to pass a "struct strvec *" further down instead of passing
args->nr and args->v.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
builtin/rebase.c | 3 +--
sequencer.c | 6 +++---
sequencer.h | 4 ++--
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/builtin/rebase.c b/builtin/rebase.c
index eb01f4d790b..27669880918 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -363,8 +363,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
oid_to_hex(&opts->restrict_revision->object.oid));
ret = sequencer_make_script(the_repository, &todo_list.buf,
- make_script_args.nr, make_script_args.v,
- flags);
+ &make_script_args, flags);
if (ret)
error(_("could not generate todo list"));
diff --git a/sequencer.c b/sequencer.c
index 68316636921..a4ba434f173 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -5355,8 +5355,8 @@ static int make_script_with_merges(struct pretty_print_context *pp,
return 0;
}
-int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
- const char **argv, unsigned flags)
+int sequencer_make_script(struct repository *r, struct strbuf *out,
+ struct strvec *args, unsigned flags)
{
char *format = NULL;
struct pretty_print_context pp = {0};
@@ -5390,7 +5390,7 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
pp.fmt = revs.commit_format;
pp.output_encoding = get_log_output_encoding();
- if (setup_revisions(argc, argv, &revs, NULL) > 1)
+ if (setup_revisions(args->nr, args->v, &revs, NULL) > 1)
return error(_("make_script: unhandled options"));
if (prepare_revision_walk(&revs) < 0)
diff --git a/sequencer.h b/sequencer.h
index 2088344cb37..36f67164f86 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -158,8 +158,8 @@ int sequencer_remove_state(struct replay_opts *opts);
#define TODO_LIST_REAPPLY_CHERRY_PICKS (1U << 7)
#define TODO_LIST_WARN_SKIPPED_CHERRY_PICKS (1U << 8)
-int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
- const char **argv, unsigned flags);
+int sequencer_make_script(struct repository *r, struct strbuf *out,
+ struct strvec *args, unsigned flags);
void todo_list_add_exec_commands(struct todo_list *todo_list,
struct string_list *commands);
--
2.33.0.998.ga4d44345d43
next prev parent reply other threads:[~2021-09-12 0:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-11 15:01 [PATCH] strvec: use size_t to store nr and alloc Jeff King
2021-09-11 16:13 ` Ævar Arnfjörð Bjarmason
2021-09-11 22:48 ` Philip Oakley
2021-09-12 0:15 ` [PATCH v2 0/7] " Ævar Arnfjörð Bjarmason
2021-09-12 0:15 ` [PATCH v2 1/7] remote-curl: pass "struct strvec *" instead of int/char ** pair Ævar Arnfjörð Bjarmason
2021-09-12 0:36 ` Carlo Arenas
2021-09-13 3:56 ` Ævar Arnfjörð Bjarmason
2021-09-12 0:15 ` [PATCH v2 2/7] pack-objects: " Ævar Arnfjörð Bjarmason
2021-09-12 0:15 ` Ævar Arnfjörð Bjarmason [this message]
2021-09-12 0:15 ` [PATCH v2 4/7] upload-pack.c: " Ævar Arnfjörð Bjarmason
2021-09-12 0:15 ` [PATCH v2 5/7] rebase: don't have loop over "struct strvec" depend on signed "nr" Ævar Arnfjörð Bjarmason
2021-09-12 2:57 ` Eric Sunshine
2021-09-12 0:15 ` [PATCH v2 6/7] strvec: use size_t to store nr and alloc Ævar Arnfjörð Bjarmason
2021-09-12 0:15 ` [PATCH v2 7/7] strvec API users: change some "int" tracking "nr" to "size_t" Ævar Arnfjörð Bjarmason
2021-09-12 3:00 ` Eric Sunshine
2021-09-12 22:19 ` [PATCH v2 0/7] strvec: use size_t to store nr and alloc Jeff King
2021-09-13 5:38 ` Junio C Hamano
2021-09-13 12:29 ` Ævar Arnfjörð Bjarmason
2021-09-13 17:20 ` Jeff King
2021-09-13 10:47 ` Philip Oakley
2021-09-12 22:00 ` [PATCH] " Jeff King
2021-09-13 11:42 ` Philip Oakley
2021-09-12 21:58 ` Jeff King
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=patch-v2-3.7-c35cfb9c9c5-20210912T001420Z-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=philipoakley@iee.email \
/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).