From: Junio C Hamano <gitster@pobox.com>
To: "Jayati Shrivastava via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Hariom verma <hariom18599@gmail.com>,
Christian Couder <christian.couder@gmail.com>,
Jayati Shrivastava <gaurijove@gmail.com>
Subject: Re: [PATCH v3] sequencer.c: use reverse_commit_list() helper
Date: Wed, 16 Mar 2022 12:44:27 -0700 [thread overview]
Message-ID: <xmqqee31lm1w.fsf@gitster.g> (raw)
In-Reply-To: pull.1177.v3.git.1647429623830.gitgitgadget@gmail.com
"Jayati Shrivastava via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> From: Jayati Shrivastava <gaurijove@gmail.com>
>
> Instead of creating a new allocation, reverse the
> original list in-place by calling the
> reverse_commit_list() helper.
OK. I recall that v2 wrapped with longer lines that was easier to
read.
> The original code
> discards the list "bases" after storing its
> reverse copy in a newly created list "reversed".
> If the code that followed from here used both
> "bases" and "reversed", the modification would not
> have worked, but since the original list "bases"
> gets discarded, we can simply reverse "bases"
> in-place with the reverse_commit_list() helper and
> reuse the same variable in the code that follows.
I am 30% surprised to see this in the log message ;-). There is
nothing incorrect in the description per-se, but it is something I
would expect in a review that reads a patch and follows along
thinking aloud to see if the code makes sense, or below "---", but
it does explain why the patch chose to lose the extra variable, so
probably it is OK.
> builtin/merge.c has been left unmodified, since in its case, the
> original list is needed separately from its reverse copy by the
> code.
Good.
The patch text looks good, too.
Thanks.
prev parent reply other threads:[~2022-03-16 19:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 19:41 [PATCH] Use reverse_commit_list helper function for in-place list reversal Jayati Shrivastava via GitGitGadget
2022-03-15 22:53 ` Junio C Hamano
2022-03-16 10:42 ` [PATCH v2] sequencer.c: use reverse_commit_list() helper Jayati Shrivastava via GitGitGadget
2022-03-16 11:20 ` [PATCH v3] " Jayati Shrivastava via GitGitGadget
2022-03-16 19:44 ` Junio C Hamano [this message]
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=xmqqee31lm1w.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=gaurijove@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=hariom18599@gmail.com \
--cc=johannes.schindelin@gmx.de \
/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).