Skip to contentSkip to conversation

Enhancements to the bundle documentation

PATCH New Santi Béjar 1 participant 4 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

cover Enhancements to the bundle documentation

At the end the most convenient way to work with bundles (at least for me) is just:

$ git bundle create mybundle HEAD --since=2.weeks.ago

or:

[alias]

	bpush = bundle create bundle --since=2.weeks.ago
$ git bpush HEAD

The bundles are bigger than strictly necessary, but not that much.

Santi

Santi Béjar (3):
urls.txt: Add bundles to the list of local urls. git-bundle.txt: Bundles as [remote ""] is a feature, not an example git-bundle.txt: Add different strategies to create the bundle

 Documentation/git-bundle.txt |   66 +++++++++++++++++++++++++++++------------
 Documentation/urls.txt       |    5 ++-
 2 files changed, 49 insertions(+), 22 deletions(-)
#1 lore raw

PATCH 1/3 urls.txt: Add bundles to the list of local urls.

---
 Documentation/urls.txt |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
Documentation/urls.txt +3 -2
index 81ac17f..894bb46 100644
@@ -34,13 +34,14 @@ To sync with a local directory, you can use:
 ===============================================================
 - /path/to/repo.git/
 - file:///path/to/repo.git/
+- /path/to/bundle
 ===============================================================
 
 ifndef::git-clone[]
-They are mostly equivalent, except when cloning.  See
+The first two are mostly equivalent, except when cloning.  See
 linkgit:git-clone[1] for details.
 endif::git-clone[]
 
 ifdef::git-clone[]
-They are equivalent, except the former implies --local option.
+The first two are equivalent, except the former implies --local option.
 endif::git-clone[]
Signature · 1 line
1.5.4.3.293.gac81
#2 lore raw

PATCH 2/3 git-bundle.txt: Bundles as [remote ""] is a feature, not an example

In reply to Santi Béjar
---
 Documentation/git-bundle.txt |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)
Documentation/git-bundle.txt +20 -18
index 72f080a..1143cdc 100644
@@ -92,6 +92,26 @@ It is okay to err on the side of conservatism, causing the bundle file
 to contain objects already in the destination as these are ignored
 when unpacking at the destination.
 
+REMOTES
+-------
+
+With something like this in your config:
+
+[remote "bundle"]
+    url = /path/to/file.bdl
+    fetch = refs/heads/*:refs/remotes/bundle/*
+
+You can place a bundle in /path/to/file.bdl and then these commands:
+
+------------
+$ git ls-remote bundle
+$ git fetch bundle
+$ git pull bundle
+------------
+
+would treat it as if it is talking with a remote side over the
+network.
+
 EXAMPLE
 -------
 
@@ -121,24 +141,6 @@ $ git-fetch mybundle  refspec
 where refspec is refInBundle:localRef
 
 
-Also, with something like this in your config:
-
-[remote "bundle"]
-    url = /home/me/tmp/file.bdl
-    fetch = refs/heads/*:refs/remotes/origin/*
-
-You can first sneakernet the bundle file to ~/tmp/file.bdl and
-then these commands:
-
-------------
-$ git ls-remote bundle
-$ git fetch bundle
-$ git pull bundle
-------------
-
-would treat it as if it is talking with a remote side over the
-network.
-
 Author
 ------
 Written by Mark Levedahl <[email protected]>
Signature · 1 line
1.5.4.3.293.gac81
#3 lore raw

PATCH 3/3 git-bundle.txt: Add different strategies to create the bundle

In reply to Santi Béjar
---
 Documentation/git-bundle.txt |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 deletions(-)
Documentation/git-bundle.txt +31 -7
index 1143cdc..be6c7d9 100644
@@ -119,27 +119,51 @@ Assume two repositories exist as R1 on machine A, and R2 on machine B.
 For whatever reason, direct connection between A and B is not allowed,
 but we can move data from A to B via some mechanism (CD, email, etc).
 We want to update R2 with developments made on branch master in R1.
+
+To create the bundle you have to specify the basis. You have some options:
+
+- Without basis.
++
+This is usefull to send the whole history.
+
+------------
+$ git bundle create mybundle master
+------------
+
+- Using temporally tags.
++
 We set a tag in R1 (lastR2bundle) after the previous such transport,
 and move it afterwards to help build the bundle.
 
-in R1 on A:
-
 ------------
 $ git-bundle create mybundle master ^lastR2bundle
 $ git tag -f lastR2bundle master
 ------------
 
-(move mybundle from A to B by some mechanism)
+- Using a tag present in both repositories
+
+------------
+$ git bundle create mybundle master ^v1.0.0
+------------
+
+- A basis based on time.
+
+------------
+$ git bundle create mybundle master --since=10.days.ago
+------------
 
-in R2 on B:
+- With a limit on the number of commits
 
 ------------
-$ git-bundle verify mybundle
-$ git-fetch mybundle  refspec
+$ git bundle create mybundle master -n 10
 ------------
 
-where refspec is refInBundle:localRef
+Then you move mybundle from A to B, and in R2 on B:
 
+------------
+$ git-bundle verify mybundle
+$ git-fetch mybundle master:localRef
+------------
 
 Author
 ------
Signature · 1 line
1.5.4.3.293.gac81