From: "Miriam R." <mirucam@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH v6 06/13] bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C
Date: Mon, 31 Aug 2020 12:50:33 +0200 [thread overview]
Message-ID: <CAN7CjDBd=41PQ5qfqazdtx4uoRcfcc6cUWf5u0cNiooSo24ENg@mail.gmail.com> (raw)
In-Reply-To: <xmqq8sdxi70a.fsf@gitster.c.googlers.com>
El sáb., 29 ago. 2020 a las 21:31, Junio C Hamano
(<gitster@pobox.com>) escribió:
>
> Miriam Rubio <mirucam@gmail.com> writes:
>
> > diff --git a/bisect.c b/bisect.c
> > index c6aba2b9f2..f0fca5c6f3 100644
> > --- a/bisect.c
> > +++ b/bisect.c
> > @@ -988,6 +988,12 @@ void read_bisect_terms(const char **read_bad, const char **read_good)
> > * the bisection process finished successfully.
> > * In this case the calling function or command should not turn a
> > * BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND return code into an error or a non zero exit code.
> > + *
> > + * Checking BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND
> > + * in bisect_helper::bisect_next() and only transforming it to 0 at
> > + * the end of bisect_helper::cmd_bisect__helper() helps bypassing
> > + * all the code related to finding a commit to test.
> > + *
> > * If no_checkout is non-zero, the bisection process does not
> > * checkout the trial commit but instead simply updates BISECT_HEAD.
> > */
>
> Not a problem introduced by this step, but the above description on
> no_checkout describes a parameter that no longer exists.
>
> The comments before a function is to guide the developers how to
> call the function correctly, so it should have been removed, moved
> to where no_checkout is used in the function, or moved to where
> BISECT_HEAD ref gets created, as necessary, but by mistake be5fe200
> (cmd_bisect__helper: defer parsing no-checkout flag, 2020-08-07),
> forgot to do any of the three.
>
>
> > +static enum bisect_error bisect_next(struct bisect_terms *terms, const char *prefix)
> > +{
> > + int no_checkout;
> > + enum bisect_error res;
> > +
> > + bisect_autostart(terms);
> > + if (bisect_next_check(terms, terms->term_good))
> > + return BISECT_FAILED;
> > +
> > + no_checkout = ref_exists("BISECT_HEAD");
> > +
> > + /* Perform all bisection computation */
> > + res = bisect_next_all(the_repository, prefix);
> > +
> > + if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {
> > + res = bisect_successful(terms);
> > + return res ? res : BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND;
> > + } else if (res == BISECT_ONLY_SKIPPED_LEFT) {
> > + res = bisect_skipped_commits(terms);
> > + return res ? res : BISECT_ONLY_SKIPPED_LEFT;
> > + }
> > + return res;
> > +}
> > +
>
> The no_checkout local variable is assigned but never used. It is
> understandable if a variable that used to be used becomes unused
> when some part (i.e. the part that used to use the variable) of a
> function is factored out, but it is rather unusual how a brand new
> function has such an unused code and stay to be that way throughout
> a topic. Makes a reviewer suspect that there may be a code missing,
> that has to use the variable to decide to do things differently, in
> this function. It seems to break -Werror builds.
Ok, I will send a new version with this local variable removed.
I don't know if it is something related to my compiler but my -Werror
build does not break. Something similar happened with a previous patch
series version and a warning related with missing-prototypes.
I always compile with : make -j 16 DEVELOPER=1 CFLAGS="-O0 -g3" install;
and I have also tested adding the -Werror flag and commits always
compile without problems.
Maybe someone in the community knows what my problem is, because it
could avoid extra patch series versions and reviewers work.
Thank you.
>
> Thanks.
>
>
next prev parent reply other threads:[~2020-08-31 10:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-28 12:46 [PATCH v6 00/13] Finish converting git bisect to C part 2 Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 01/13] bisect--helper: BUG() in cmd_*() on invalid subcommand Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 02/13] bisect--helper: use '-res' in 'cmd_bisect__helper' return Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 03/13] bisect--helper: introduce new `write_in_file()` function Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 04/13] bisect--helper: reimplement `bisect_autostart` shell function in C Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 05/13] bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()' Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 06/13] bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C Miriam Rubio
2020-08-29 19:31 ` Junio C Hamano
2020-08-31 10:50 ` Miriam R. [this message]
2020-08-31 17:09 ` Junio C Hamano
2020-08-28 12:46 ` [PATCH v6 07/13] bisect--helper: finish porting `bisect_start()` to C Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 08/13] bisect--helper: retire `--bisect-clean-state` subcommand Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 09/13] bisect--helper: retire `--next-all` subcommand Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 10/13] bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 11/13] bisect--helper: retire `--check-expected-revs` subcommand Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 12/13] bisect--helper: retire `--write-terms` subcommand Miriam Rubio
2020-08-28 12:46 ` [PATCH v6 13/13] bisect--helper: retire `--bisect-autostart` subcommand Miriam Rubio
2020-08-29 19:31 ` [PATCH v6 00/13] Finish converting git bisect to C part 2 Junio C Hamano
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='CAN7CjDBd=41PQ5qfqazdtx4uoRcfcc6cUWf5u0cNiooSo24ENg@mail.gmail.com' \
--to=mirucam@gmail.com \
--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).