git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 2/8] pack-objects: produce a stable pack when --skip is given
Date: Fri,  5 Feb 2016 15:57:51 +0700	[thread overview]
Message-ID: <1454662677-15137-3-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1454662677-15137-1-git-send-email-pclouds@gmail.com>

Parallel delta search does not produce a stable pack so it's disabled
when --skip is used. zlib compression algorithm is stable. Ref
negotiation should be stable (at least on smart http). Ref changes
will be addressed separately.

So unless configuration files or git binary is changed, we should be
able to produce a stable pack. And if config or binaries are changed,
it's ok to abort and fetch a new (resumable) pack again.

Alternatively (and not implemented), pack-objects can be taught to
save the output pack when --skip=0 is passed in, then somehow find the
cached version and send the remaining when --skip=<non-zero> is
given. This saves processing power at the cost of disk and cache
management.

The key thing for caching though, is "find the cached version". We do
not provide any way for pack-objects to send a "key", like http
cookies, to the client, so that the client can pass it back on the
next fetch. Regardless, the input from client must be identical
between fetches, the server should be able to extract a signature from
that and use it to associate with a cached pack. So no need for
sending keys from the server side.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/pack-objects.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 417c830..c58a9cb 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2709,6 +2709,11 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 			if (get_oid_hex(skip_hash_hex, &skip_hash))
 				die(_("%s is not SHA-1"), skip_hash_hex);
 		}
+
+		/*
+		 * Parallel delta search can't produce stable packs.
+		 */
+		delta_search_threads = 1;
 	}
 
 	argv_array_push(&rp, "pack-objects");
-- 
2.7.0.377.g4cd97dd

  parent reply	other threads:[~2016-02-05  8:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05  8:57 [PATCH 0/8] Resumable clone revisited, proof of concept Nguyễn Thái Ngọc Duy
2016-02-05  8:57 ` [PATCH 1/8] pack-objects: add --skip and --skip-hash Nguyễn Thái Ngọc Duy
2016-02-05  9:20   ` Johannes Schindelin
2016-02-05  8:57 ` Nguyễn Thái Ngọc Duy [this message]
2016-02-05 18:43   ` [PATCH 2/8] pack-objects: produce a stable pack when --skip is given Junio C Hamano
2016-02-05 23:25     ` Duy Nguyen
2016-02-06  0:48       ` Junio C Hamano
2016-02-08  5:23         ` Duy Nguyen
2016-02-05  8:57 ` [PATCH 3/8] index-pack: add --append-pack=<path> Nguyễn Thái Ngọc Duy
2016-02-05  8:57 ` [PATCH 4/8] upload-pack: new capability to pass --skip* to pack-objects Nguyễn Thái Ngọc Duy
2016-02-05  9:18   ` Johannes Schindelin
2016-02-05  8:57 ` [PATCH 5/8] fetch-pack.c: send "skip" line " Nguyễn Thái Ngọc Duy
2016-02-07  8:57   ` Eric Sunshine
2016-02-05  8:57 ` [PATCH 6/8] fetch: add --resume-pack=<path> Nguyễn Thái Ngọc Duy
2016-02-05  8:57 ` [PATCH 7/8] index-pack: --append-pack implies --strict Nguyễn Thái Ngọc Duy
2016-02-07  9:02   ` Eric Sunshine
2016-02-05  8:57 ` [PATCH 8/8] one ugly test to verify basic functionality Nguyễn Thái Ngọc Duy
2016-02-05 11:57   ` Elia Pinto
2016-02-05 13:02     ` Duy Nguyen
2016-02-05 13:33       ` Elia Pinto
2016-02-05 13:20     ` Johannes Schindelin
2016-02-05 13:38       ` Elia Pinto

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=1454662677-15137-3-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    /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).