From: "Ghanshyam Thakkar" <shyamthakkar001@gmail.com>
To: "Christian Couder" <christian.couder@gmail.com>
Cc: <git@vger.kernel.org>,
"Christian Couder" <chriscool@tuxfamily.org>,
"Kaartic Sivaraam" <kaartic.sivaraam@gmail.com>,
"Phillip Wood" <phillip.wood123@gmail.com>
Subject: Re: [GSoC][PATCH v3] t: port helper/test-oid-array.c to unit-tests/t-oid-array.c
Date: Sun, 25 Aug 2024 16:15:27 +0530 [thread overview]
Message-ID: <D3OXJZTMW1BP.1EYWBW4CTQVES@gmail.com> (raw)
In-Reply-To: <CAP8UFD3mq+k8QXDrFAp5bfoCN+sNgm3vJvuhryxVYDaj-SZU0g@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> wrote:
> On Sat, Aug 24, 2024 at 7:02 PM Ghanshyam Thakkar
> <shyamthakkar001@gmail.com> wrote:
> >
> > helper/test-oid-array.c along with t0064-oid-array.sh test the
> > oid-array.h API, which provides storage and processing
> > efficiency over large lists of object identifiers.
> >
> > Migrate them to the unit testing framework for better runtime
> > performance and efficiency. Also 'the_hash_algo' is used internally in
> > oid_array_lookup(), but we do not initialize a repository directory,
> > therefore initialize the_hash_algo manually.
>
> Even if 'the_hash_algo' is used internally in oid_array_lookup()
> through oid_pos(), this patch initializes the hash algo for the repo
> using repo_set_hash_algo(), which contains the following single
> instruction:
>
> repo->hash_algo = &hash_algos[hash_algo];
>
> So "therefore initialize the_hash_algo manually" is not quite true, as
> it doesn't look like 'the_hash_algo' is even used.
the_hash_algo is just:
define the_hash_algo the_repository->hash_algo
and we do initialize the_repository->hash_algo manually.
>
> Also I think it's not clear how initializing a repository directory is
> related to the hash algo.
That is mentioned because the old code in helper/test-oid-array.c used
to call setup_git_directory_gently() to setup a git directory, which
would also initialize the_repository->hash_algo.
>
> So maybe something like the following would be better:
>
> "As we don't initialize a repository in these tests, the hash algo
> that functions like oid_array_lookup() use is not initialized,
> therefore call repo_set_hash_algo() to initialize it."
Will change.
>
> > And
> > init_hash_algo():lib-oid.c can aid in this process, so make it public.
> >
> > Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> > Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
> > Helped-by: Phillip Wood <phillip.wood123@gmail.com>
> > Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
> > ---
> > Changes in v3:
> > - changed commmit message and comments for more accurate description
> > - removed test_min() and return early when actual.nr and expect.nr
> > don't match
> > - rename result to expect for more accurate description
> > - removed a redundant check in t_enumeration()
> > - add check_int() around one of calls of get_oid_arbitrary_hex()
>
> This looks good.
>
> > - rebased to latest master
>
> It's nice to say it was rebased, but it's better to tell the reason
> why it was rebased.
No particular reason other than the fact that v2 was posted 20 days ago.
And it is not merged into 'seen' or 'next', so it shouldn't be a
problem.
Thanks.
next prev parent reply other threads:[~2024-08-25 10:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 3:46 [GSoC][PATCH] t: port helper/test-oid-array.c to unit-tests/t-oid-array.c Ghanshyam Thakkar
2024-07-04 16:33 ` Phillip Wood
2024-08-03 13:31 ` Ghanshyam Thakkar
2024-08-03 13:21 ` [GSoC][PATCH v2] " Ghanshyam Thakkar
2024-08-19 16:55 ` Christian Couder
2024-08-24 17:00 ` Ghanshyam Thakkar
2024-08-24 17:02 ` [GSoC][PATCH v3] " Ghanshyam Thakkar
2024-08-25 6:38 ` Christian Couder
2024-08-25 10:45 ` Ghanshyam Thakkar [this message]
2024-09-01 21:26 ` [PATCH v4] " Ghanshyam Thakkar
2024-09-04 7:42 ` Christian Couder
2024-09-04 15:01 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D3OXJZTMW1BP.1EYWBW4CTQVES@gmail.com \
--to=shyamthakkar001@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=kaartic.sivaraam@gmail.com \
--cc=phillip.wood123@gmail.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.
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).