git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] clone-pack: new option --keep to keep the pack unexploded.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 13, 2005, 01:23 UTC
Message-ID
<7vmzleb46y.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vslv6b86l.fsf_-_@assigned-by-dhcp.cox.net>

With new option --keep, or a configuration item clone.keeppack (we need a better name, or start allowing dash,"clone.keep-pack"), the packed data downloaded while cloning is saved as a pack in .git/objects/pack/ locally, with index generated for it with git-index-pack.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * Here is how to use it.
    $ mkdir test
    $ cd test
    $ git-init-db
    defaulting to local storage area
    $ git-clone-pack --keep ../other/repo/sito/ry/.git
    Packing 9044 objects
    $ git-checkout
   After cloning, you would notice there is no individual
   objects; instead you will find a single packfile in
   .git/objects/pack/ directory.
 Documentation/git-clone-pack.txt |    7 ++++++-
 clone-pack.c                     |    3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

applies-to: fa5213875bff7fdb8c7d05f35a047eedf3cb3af2 b64a46c81d8347e59285584e830e1ad99ad387e0

diff --git a/Documentation/git-clone-pack.txt b/Documentation/git-clone-pack.txt
index 87c0e46..b58165a 100644
--- a/Documentation/git-clone-pack.txt
+++ b/Documentation/git-clone-pack.txt
@@ -8,7 +8,7 @@ git-clone-pack - Clones a repository by 
 
 SYNOPSIS
 --------
-'git-clone-pack' [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<head>...]
+'git-clone-pack' [-q] [--keep] [--exec=<git-upload-pack>] [<host>:]<directory> [<head>...]
 
 DESCRIPTION
 -----------
@@ -23,6 +23,11 @@ OPTIONS
 	Pass '-q' flag to 'git-unpack-objects'; this makes the
 	cloning process less verbose.
 
+--keep::
+	Do not invoke 'git-unpack-objects' on received data, but
+	create a single packfile out of it instead, and store it
+	in the object database.
+
 --exec=<git-upload-pack>::
 	Use this to specify the path to 'git-upload-pack' on the
 	remote side, if it is not found on your $PATH.
diff --git a/clone-pack.c b/clone-pack.c
index 9567900..2f09df0 100644
--- a/clone-pack.c
+++ b/clone-pack.c
@@ -5,7 +5,8 @@
 
 static int quiet;
 static int keep_pack;
-static const char clone_pack_usage[] = "git-clone-pack [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>]*";
+static const char clone_pack_usage[] =
+"git-clone-pack [-q] [--keep] [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>]*";
 static const char *exec = "git-upload-pack";
 
 static void clone_handshake(int fd[2], struct ref *ref)
---
0.99.8.GIT
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 12 in “Add '--create-index' to git-unpack-objects”
  1. Add '--create-index' to git-unpack-objectsJohannes Schindelin, Oct 12, 2005
  2. Sergey VlasovOct 12, 2005
  3. Add git-index-pack utilitySergey Vlasov, Oct 12, 2005
  4. Johannes SchindelinOct 12, 2005
  5. Sergey VlasovOct 12, 2005
  6. Fix packname hash generation.Junio C Hamano, Oct 12, 2005
  7. clone-pack: new option --keep to keep the pack unexploded.Junio C Hamano, Oct 13, 2005
  8. Junio C HamanoOct 13, 2005
  9. Johannes SchindelinOct 12, 2005
  10. Sergey VlasovOct 12, 2005
  11. Johannes SchindelinOct 12, 2005
  12. Linus TorvaldsOct 12, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.