git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Scott Chacon via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Derrick Stolee <stolee@gmail.com>,
	Scott Chacon <schacon@gmail.com>,
	Scott Chacon <schacon@gmail.com>
Subject: [PATCH v2 1/3] bundle-uri: copy all bundle references ino the refs/bundle space
Date: Sat, 01 Mar 2025 10:33:56 +0000	[thread overview]
Message-ID: <b36bc876fe1facbb278de0a58262843e5c88738c.1740825238.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1897.v2.git.git.1740825238.gitgitgadget@gmail.com>

From: Scott Chacon <schacon@gmail.com>

When downloading bundles via the bundle-uri functionality, we only copy the
references from refs/heads into the refs/bundle space. I'm not sure why this
refspec is hardcoded to be so limited, but it makes the ref negotiation on
the subsequent fetch suboptimal, since it won't use objects that are
referenced outside of the current heads of the bundled repository.

This change to copy everything in refs/ in the bundle to refs/bundles/
significantly helps the subsequent fetch, since nearly all the references
are now included in the negotiation.

Signed-off-by: Scott Chacon <schacon@gmail.com>
---
 bundle-uri.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bundle-uri.c b/bundle-uri.c
index 744257c49c1..3371d56f4ce 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -403,7 +403,7 @@ static int unbundle_from_file(struct repository *r, const char *file)
 		const char *branch_name;
 		int has_old;
 
-		if (!skip_prefix(refname->string, "refs/heads/", &branch_name))
+		if (!skip_prefix(refname->string, "refs/", &branch_name))
 			continue;
 
 		strbuf_setlen(&bundle_ref, bundle_prefix_len);
-- 
gitgitgadget


  reply	other threads:[~2025-03-01 10:34 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 13:19 [PATCH] bundle-uri: copy all bundle references ino the refs/bundle space Scott Chacon via GitGitGadget
2025-02-25 18:14 ` Junio C Hamano
2025-02-25 23:36   ` Derrick Stolee
2025-03-01 10:23     ` Scott Chacon
2025-03-03 17:12       ` Junio C Hamano
2025-03-03 18:46         ` Derrick Stolee
2025-03-01 10:33 ` [PATCH v2 0/3] " Scott Chacon via GitGitGadget
2025-03-01 10:33   ` Scott Chacon via GitGitGadget [this message]
2025-03-01 10:33   ` [PATCH v2 2/3] bundle-uri: update bundle clone tests with new refspec path Scott Chacon via GitGitGadget
2025-03-01 10:33   ` [PATCH v2 3/3] bundle-uri: add test for bundle-uri clones with tags Scott Chacon via GitGitGadget
2025-03-03 18:49   ` [PATCH v2 0/3] bundle-uri: copy all bundle references ino the refs/bundle space Derrick Stolee
2025-03-18 15:36   ` [PATCH v3 0/2] " Scott Chacon via GitGitGadget
2025-03-18 15:36     ` [PATCH v3 1/2] " Scott Chacon via GitGitGadget
2025-03-19 10:24       ` Phillip Wood
2025-03-18 15:36     ` [PATCH v3 2/2] bundle-uri: add test for bundle-uri clones with tags Scott Chacon via GitGitGadget
2025-03-19 10:33       ` Phillip Wood
2025-03-19 17:50         ` Taylor Blau
2025-04-14 12:19           ` Toon Claes
2025-04-25 13:14             ` Scott Chacon
2025-03-21  6:31         ` Junio C Hamano
2025-04-25 13:17     ` [PATCH v4 0/2] bundle-uri: copy all bundle references ino the refs/bundle space Scott Chacon via GitGitGadget
2025-04-25 13:17       ` [PATCH v4 1/2] " Scott Chacon via GitGitGadget
2025-04-25 13:17       ` [PATCH v4 2/2] bundle-uri: add test for bundle-uri clones with tags Scott Chacon via GitGitGadget
2025-04-25 16:32         ` Scott Chacon
2025-04-25 13:53       ` [PATCH v4 0/2] bundle-uri: copy all bundle references ino the refs/bundle space Phillip Wood
2025-04-25 16:53         ` Junio C Hamano
2025-04-25 19:06       ` [PATCH v5 " Scott Chacon via GitGitGadget
2025-04-25 19:06         ` [PATCH v5 1/2] " Scott Chacon via GitGitGadget
2025-04-25 19:06         ` [PATCH v5 2/2] bundle-uri: add test for bundle-uri clones with tags Scott Chacon via GitGitGadget
2025-04-25 19:27         ` [PATCH v6 0/2] bundle-uri: copy all bundle references ino the refs/bundle space Scott Chacon via GitGitGadget
2025-04-25 19:27           ` [PATCH v6 1/2] " Scott Chacon via GitGitGadget
2025-04-25 19:27           ` [PATCH v6 2/2] bundle-uri: add test for bundle-uri clones with tags Scott Chacon via GitGitGadget
2025-04-25 19:33           ` [PATCH v7 0/2] bundle-uri: copy all bundle references ino the refs/bundle space Scott Chacon via GitGitGadget
2025-04-25 19:33             ` [PATCH v7 1/2] " Scott Chacon via GitGitGadget
2025-04-25 19:33             ` [PATCH v7 2/2] bundle-uri: add test for bundle-uri clones with tags Scott Chacon via GitGitGadget
2025-04-25 20:42             ` [PATCH v7 0/2] bundle-uri: copy all bundle references ino the refs/bundle space Junio C Hamano
2025-04-29  9:00             ` Phillip Wood

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=b36bc876fe1facbb278de0a58262843e5c88738c.1740825238.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=schacon@gmail.com \
    --cc=stolee@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).