🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.git
4 messages
4 total messages Started by Okhuomon Ajayi Wed, 28 Oct 2026 09:34
[Outreachy PATCH] bundle-uri: use the passed repository for refs and tracing
#1708
Author: Okhuomon Ajayi
Date: Wed, 28 Oct 2026 09:34
55 lines
12489 bytes
unbundle_from_file() receives r and unbundles the objects into
it, but reads and writes the refs in the_repository.
fetch_bundle_uri() also has r, but uses the_repository for its
trace2 region.

Use r for both.

Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
---
unbundle_from_file() still depends on the_repository through
fetch_pack_fsck_objects(), which reads fetch.fsckObjects and
transfer.fsckObjects from the_repository's config. I left that out.

 bundle-uri.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bundle-uri.c b/bundle-uri.c
index 2bb2eb99e4..0d612d92fe 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -448,9 +448,9 @@ static int unbundle_from_file(struct repository *r, const char *file)
 		strbuf_setlen(&bundle_ref, bundle_prefix_len);
 		strbuf_addstr(&bundle_ref, branch_name);
 
-		has_old = !refs_read_ref(get_main_ref_store(the_repository),
+		has_old = !refs_read_ref(get_main_ref_store(r),
 					 bundle_ref.buf, &old_oid);
-		refs_update_ref(get_main_ref_store(the_repository),
+		refs_update_ref(get_main_ref_store(r),
 				"fetched bundle", bundle_ref.buf, oid,
 				has_old ? &old_oid : NULL,
 				0, UPDATE_REFS_MSG_ON_ERR);
@@ -859,7 +859,7 @@ int fetch_bundle_uri(struct repository *r, const char *uri,
 		.id = xstrdup(""),
 	};
 
-	trace2_region_enter("fetch", "fetch-bundle-uri", the_repository);
+	trace2_region_enter("fetch", "fetch-bundle-uri", r);
 
 	init_bundle_list(&list);
 
@@ -886,7 +886,7 @@ int fetch_bundle_uri(struct repository *r, const char *uri,
 	for_all_bundles_in_list(&list, unlink_bundle, NULL);
 	clear_bundle_list(&list);
 	clear_remote_bundle_info(&bundle, NULL);
-	trace2_region_leave("fetch", "fetch-bundle-uri", the_repository);
+	trace2_region_leave("fetch", "fetch-bundle-uri", r);
 	return result;
 }
 

base-commit: 37b3475fb530c14109211faca33716a173db61ed
-- 
2.56.0
Re: [Outreachy PATCH] bundle-uri: use the passed repository for refs and tracing
#1715
Author: Okhuomon Ajayi
Date: Wed, 28 Oct 2026 11:18
9 lines
12240 bytes
On Wed, Oct 28, 2026 at 12:05 PM Karthik Nayak <karthik.188@gmail.com> wrote:
> Looking at the callers of `unbundle_from_file()` I don't see there is a
> reason for divergence. i.e. both `r` and `the_repository` should point
> to the same repository. So this does make sense to me.


Thanks for checking, Karthik!
Re: [Outreachy PATCH] bundle-uri: use the passed repository for refs and tracing
#1752
Author: Junio C Hamano
Date: Wed, 28 Oct 2026 16:36
18 lines
13258 bytes
Karthik Nayak <karthik.188@gmail.com> writes:

> Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:
>
>> unbundle_from_file() receives r and unbundles the objects into
>> it, but reads and writes the refs in the_repository.
>> fetch_bundle_uri() also has r, but uses the_repository for its
>> trace2 region.
>>
>
> Looking at the callers of `unbundle_from_file()` I don't see there is a
> reason for divergence. i.e. both `r` and `the_repository` should point
> to the same repository. So this does make sense to me.
>
> Thanks

Thanks.  Will queue and mark it ready for 'next'.
Re: [Outreachy PATCH] bundle-uri: use the passed repository for refs and tracing
#1816
Author: Okhuomon Ajayi
Date: Thu, 29 Oct 2026 12:47
13 lines
12281 bytes
On Thu, Oct 29, 2026 at 1:07 PM Patrick Steinhardt <ps@pks.im> wrote:
> So shouldn't we maybe also fix those cases while already at it and then
> drop the define?


Thanks, Patrick. Yes, that makes sense. I applied your diff and
bundle-uri.c builds
without USE_THE_REPOSITORY_VARIABLE. I'll send a v2 that converts
find_temp_filename() and copy_uri_to_file() too and drops the define.

Junio, please hold v1 from 'next'; v2 will replace it.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads