git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCHv2 1/8] Doc: Bundle file usage
@ 2012-09-18 23:25 Philip Oakley
  2012-09-18 23:55 ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Oakley @ 2012-09-18 23:25 UTC (permalink / raw)
  To: gitList

Git URLs can accept bundle files for fetch, pull and clone, include
in that section. Include git clone in the bundle usage description.
Correct the quoting of <git-rev-list-args>.
Detail the <git-rev-list-args> '--all' option for cloning.

Signed-off-by: Philip Oakley <philipoakley@iee.org>

diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 16a6b0a..be6a5f1 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -21,12 +21,12 @@ Some workflows require that one or more branches of development on one
 machine be replicated on another machine, but the two machines cannot
 be directly connected, and therefore the interactive git protocols (git,
 ssh, rsync, http) cannot be used.  This command provides support for
-'git fetch' and 'git pull' to operate by packaging objects and references
-in an archive at the originating machine, then importing those into
-another repository using 'git fetch' and 'git pull'
-after moving the archive by some means (e.g., by sneakernet).  As no
-direct connection between the repositories exists, the user must specify a
-basis for the bundle that is held by the destination repository: the
+'git fetch', 'git pull' and 'git clone', to operate by packaging
+objects and references in an archive at the originating machine, then
+importing those into another repository using 'git fetch', 'git pull',
+or 'git clone', after moving the archive by some means (e.g., by sneakernet).
+As no direct connection between the repositories exists, the user must
+specify a basis for the bundle that is held by the destination repository: the
 bundle assumes that all objects in the basis are already in the
 destination repository.
 
@@ -35,7 +35,7 @@ OPTIONS
 
 create <file>::
 	Used to create a bundle named 'file'.  This requires the
-	'git-rev-list-args' arguments to define the bundle contents.
+	<git-rev-list-args> arguments to define the bundle contents.
 
 verify <file>::
 	Used to check that a bundle file is valid and will apply
@@ -92,6 +92,8 @@ It is okay to err on the side of caution, causing the bundle file
 to contain objects already in the destination, as these are ignored
 when unpacking at the destination.
 
+To create a bundle for 'git clone', use `--all` for the <git-rev-list-args>.
+
 EXAMPLE
 -------
 
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index 2890194..2d75cce 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -42,6 +42,9 @@ These two syntaxes are mostly equivalent, except the former implies
 --local option.
 endif::git-clone[]
 
+'git clone', 'git fetch' and 'git pull', but not 'git push', will also
+accept a suitable bundle file. See linkgit:git-bundle[1].
+
 When git doesn't know how to handle a certain transport protocol, it
 attempts to use the 'remote-<transport>' remote helper, if one
 exists. To explicitly request a remote helper, the following syntax
-- 
1.7.8.msysgit.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCHv2 1/8] Doc: Bundle file usage
  2012-09-18 23:25 [PATCHv2 1/8] Doc: Bundle file usage Philip Oakley
@ 2012-09-18 23:55 ` Junio C Hamano
  2019-10-16  9:57   ` [PATCH v2] " Philip Oakley
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2012-09-18 23:55 UTC (permalink / raw)
  To: Philip Oakley; +Cc: gitList

Philip Oakley <philipoakley@iee.org> writes:

> Git URLs can accept bundle files for fetch, pull and clone, include
> in that section. Include git clone in the bundle usage description.
> Correct the quoting of <git-rev-list-args>.
> Detail the <git-rev-list-args> '--all' option for cloning.
>
> Signed-off-by: Philip Oakley <philipoakley@iee.org>
>
> diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
> index 16a6b0a..be6a5f1 100644
> --- a/Documentation/git-bundle.txt
> +++ b/Documentation/git-bundle.txt
> @@ -21,12 +21,12 @@ Some workflows require that one or more branches of development on one
>  machine be replicated on another machine, but the two machines cannot
>  be directly connected, and therefore the interactive git protocols (git,
>  ssh, rsync, http) cannot be used.  This command provides support for
> -'git fetch' and 'git pull' to operate by packaging objects and references
> -in an archive at the originating machine, then importing those into
> -another repository using 'git fetch' and 'git pull'
> -after moving the archive by some means (e.g., by sneakernet).  As no
> -direct connection between the repositories exists, the user must specify a
> -basis for the bundle that is held by the destination repository: the
> +'git fetch', 'git pull' and 'git clone', to operate by packaging
> +objects and references in an archive at the originating machine, then
> +importing those into another repository using 'git fetch', 'git pull',
> +or 'git clone', after moving the archive by some means (e.g., by sneakernet).
> +As no direct connection between the repositories exists, the user must
> +specify a basis for the bundle that is held by the destination repository: the
>  bundle assumes that all objects in the basis are already in the
>  destination repository.
>  
> @@ -35,7 +35,7 @@ OPTIONS
>  
>  create <file>::
>  	Used to create a bundle named 'file'.  This requires the
> -	'git-rev-list-args' arguments to define the bundle contents.
> +	<git-rev-list-args> arguments to define the bundle contents.
>  
>  verify <file>::
>  	Used to check that a bundle file is valid and will apply
> @@ -92,6 +92,8 @@ It is okay to err on the side of caution, causing the bundle file
>  to contain objects already in the destination, as these are ignored
>  when unpacking at the destination.
>  
> +To create a bundle for 'git clone', use `--all` for the <git-rev-list-args>.
> +

Hmm, what does this mean?  Specifically, it is not clear what "for
'git clone'" exactly means.  It is not "for use of 'git clone'",
because you should be able to create a bundle that has 'master'
branch without 'maint', 'next', and 'pu' and clone from it, no?

	git checkout maint
        git bundle create /var/tmp/1.bndl HEAD refs/heads/maint
        cd /var/tmp && git clone 1.bndl xprm

I also think "--all" is a bad advice for another reason.  Doesn't it
shove refs from refs/remotes/* hierarchy in the resulting bundle?
It is fine for archiving purposes, but it does not seem to be a good
advice to create a bundle to clone from.

>  EXAMPLE
>  -------
>  
> diff --git a/Documentation/urls.txt b/Documentation/urls.txt
> index 2890194..2d75cce 100644
> --- a/Documentation/urls.txt
> +++ b/Documentation/urls.txt
> @@ -42,6 +42,9 @@ These two syntaxes are mostly equivalent, except the former implies
>  --local option.
>  endif::git-clone[]
>  
> +'git clone', 'git fetch' and 'git pull', but not 'git push', will also
> +accept a suitable bundle file. See linkgit:git-bundle[1].
> +
>  When git doesn't know how to handle a certain transport protocol, it
>  attempts to use the 'remote-<transport>' remote helper, if one
>  exists. To explicitly request a remote helper, the following syntax

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2] Doc: Bundle file usage
  2012-09-18 23:55 ` Junio C Hamano
@ 2019-10-16  9:57   ` Philip Oakley
  2019-10-16 10:15     ` Philip Oakley
  2019-10-16 21:09     ` Jeff King
  0 siblings, 2 replies; 15+ messages in thread
From: Philip Oakley @ 2019-10-16  9:57 UTC (permalink / raw)
  To: GitList, Junio C Hamano, Jeff King; +Cc: Philip Oakley, Philip Oakley

From: Philip Oakley <philipoakley@iee.org>

Git URLs can accept bundle files for fetch, pull and clone, include
in that section. Include git clone in the bundle usage description.
Correct the quoting of <git-rev-list-args>.
Detail the <git-rev-list-args> options for cloning a complete repo.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
---

This takes up the advice from peff in 
https://public-inbox.org/git/20191011161112.GA19741@sigill.intra.peff.net/
from the original v1 in 2012(!)
https://public-inbox.org/git/1348010734-664-2-git-send-email-philipoakley@iee.org/

Hopefully this covers Junio's concerns from that time.
-- 
Philip

---
 Documentation/git-bundle.txt | 10 +++++++---
 Documentation/urls.txt       |  3 +++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 7d6c9dcd17..0498e4895d 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -21,9 +21,9 @@ Some workflows require that one or more branches of development on one
 machine be replicated on another machine, but the two machines cannot
 be directly connected, and therefore the interactive Git protocols (git,
 ssh, http) cannot be used.  This command provides support for
-'git fetch' and 'git pull' to operate by packaging objects and references
+'git fetch' and 'git pull' and 'git clone', to operate by packaging objects and references
 in an archive at the originating machine, then importing those into
-another repository using 'git fetch' and 'git pull'
+another repository using 'git fetch' and 'git pull' or 'git clone',
 after moving the archive by some means (e.g., by sneakernet).  As no
 direct connection between the repositories exists, the user must specify a
 basis for the bundle that is held by the destination repository: the
@@ -35,7 +35,7 @@ OPTIONS
 
 create <file>::
 	Used to create a bundle named 'file'.  This requires the
-	'git-rev-list-args' arguments to define the bundle contents.
+	'<git-rev-list-args>' arguments to define the bundle contents.
 
 verify <file>::
 	Used to check that a bundle file is valid and will apply
@@ -92,6 +92,10 @@ It is okay to err on the side of caution, causing the bundle file
 to contain objects already in the destination, as these are ignored
 when unpacking at the destination.
 
+To create a bundle for 'git clone', use `--branches --tags` for
+the <git-rev-list-args>. The (inappropriate) use of `--all` would include
+refs from refs/remotes/* hierarchy in the resulting bundle.
+
 EXAMPLES
 --------
 
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index bc354fe2dc..1c229d7581 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies
 --local option.
 endif::git-clone[]
 
+'git clone', 'git fetch' and 'git pull', but not 'git push', will also
+accept a suitable bundle file. See linkgit:git-bundle[1].
+
 When Git doesn't know how to handle a certain transport protocol, it
 attempts to use the 'remote-<transport>' remote helper, if one
 exists. To explicitly request a remote helper, the following syntax
-- 
2.23.0.windows.1.21.g947f504ebe8.dirty


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] Doc: Bundle file usage
  2019-10-16  9:57   ` [PATCH v2] " Philip Oakley
@ 2019-10-16 10:15     ` Philip Oakley
  2019-10-16 21:09     ` Jeff King
  1 sibling, 0 replies; 15+ messages in thread
From: Philip Oakley @ 2019-10-16 10:15 UTC (permalink / raw)
  To: GitList, Junio C Hamano, Jeff King

On 16/10/2019 10:57, Philip Oakley wrote:
> From: Philip Oakley <philipoakley@iee.org>
Oops - the From: line still has my old email address. Is a resend 
preferred, or can it be fixed locally?

P.
> Git URLs can accept bundle files for fetch, pull and clone, include
> in that section. Include git clone in the bundle usage description.
> Correct the quoting of <git-rev-list-args>.
> Detail the <git-rev-list-args> options for cloning a complete repo.
>
> Signed-off-by: Philip Oakley <philipoakley@iee.email>
> ---
>
> This takes up the advice from peff in
> https://public-inbox.org/git/20191011161112.GA19741@sigill.intra.peff.net/
> from the original v1 in 2012(!)
> https://public-inbox.org/git/1348010734-664-2-git-send-email-philipoakley@iee.org/
>
> Hopefully this covers Junio's concerns from that time.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] Doc: Bundle file usage
  2019-10-16  9:57   ` [PATCH v2] " Philip Oakley
  2019-10-16 10:15     ` Philip Oakley
@ 2019-10-16 21:09     ` Jeff King
  2019-10-17  2:54       ` Junio C Hamano
  2019-10-18 15:15       ` [PATCH v3] " Philip Oakley
  1 sibling, 2 replies; 15+ messages in thread
From: Jeff King @ 2019-10-16 21:09 UTC (permalink / raw)
  To: Philip Oakley; +Cc: GitList, Junio C Hamano, Philip Oakley

On Wed, Oct 16, 2019 at 10:57:37AM +0100, Philip Oakley wrote:

> From: Philip Oakley <philipoakley@iee.org>
> 
> Git URLs can accept bundle files for fetch, pull and clone, include
> in that section. Include git clone in the bundle usage description.
> Correct the quoting of <git-rev-list-args>.
> Detail the <git-rev-list-args> options for cloning a complete repo.

Thanks for picking this up again. :)

A few minor comments:

> diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
> index 7d6c9dcd17..0498e4895d 100644
> --- a/Documentation/git-bundle.txt
> +++ b/Documentation/git-bundle.txt
> @@ -21,9 +21,9 @@ Some workflows require that one or more branches of development on one
>  machine be replicated on another machine, but the two machines cannot
>  be directly connected, and therefore the interactive Git protocols (git,
>  ssh, http) cannot be used.  This command provides support for
> -'git fetch' and 'git pull' to operate by packaging objects and references
> +'git fetch' and 'git pull' and 'git clone', to operate by packaging objects and references

Maybe:

  'git fetch', 'git pull', and 'git clone'

? Given the repetition below, though:

>  in an archive at the originating machine, then importing those into
> -another repository using 'git fetch' and 'git pull'
> +another repository using 'git fetch' and 'git pull' or 'git clone',

I wonder if we could rephrase this in a less awkward way. Perhaps:

  The 'git bundle' command packages objects and references in an archive
  at the originating machine, which can then be imported into another
  repository using 'git fetch', 'git pull', or 'git clone'.

> @@ -35,7 +35,7 @@ OPTIONS
>  
>  create <file>::
>  	Used to create a bundle named 'file'.  This requires the
> -	'git-rev-list-args' arguments to define the bundle contents.
> +	'<git-rev-list-args>' arguments to define the bundle contents.

This hunk makes sense. I'd probably use backticks here instead of
single-quotes, but I think we're pretty inconsistent across the
documentation about this. It probably makes sense to match the
existing text.

> @@ -92,6 +92,10 @@ It is okay to err on the side of caution, causing the bundle file
>  to contain objects already in the destination, as these are ignored
>  when unpacking at the destination.
>  
> +To create a bundle for 'git clone', use `--branches --tags` for
> +the <git-rev-list-args>. The (inappropriate) use of `--all` would include
> +refs from refs/remotes/* hierarchy in the resulting bundle.

Should <git-rev-list-args> be in quotes or backticks?

Any bundle created without a negative revision would be appropriate for
a clone. Maybe we could spell that out in more detail, like:

  Any bundle created without negative refspecs (e.g., `new` but not
  `old..new`) can be used on the receiving side with `git clone`. If you
  want to provide the same set of refs that a clone directly from the
  source repository would get, use `--branches --tags`. If you want to
  match `git clone --mirror`, which would clone other refs such as
  `refs/remotes/*`, use `--all`.

> diff --git a/Documentation/urls.txt b/Documentation/urls.txt
> index bc354fe2dc..1c229d7581 100644
> --- a/Documentation/urls.txt
> +++ b/Documentation/urls.txt
> @@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies
>  --local option.
>  endif::git-clone[]
>  
> +'git clone', 'git fetch' and 'git pull', but not 'git push', will also
> +accept a suitable bundle file. See linkgit:git-bundle[1].

This makes sense to mention here. It's a little funny because the user
would see this included in "man git-clone" or whatever, but I don't
think it hurts to just be exhaustive rather than trying to tailor it to
each individual manpage.

-Peff

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] Doc: Bundle file usage
  2019-10-16 21:09     ` Jeff King
@ 2019-10-17  2:54       ` Junio C Hamano
  2019-10-18 15:15       ` [PATCH v3] " Philip Oakley
  1 sibling, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2019-10-17  2:54 UTC (permalink / raw)
  To: Jeff King; +Cc: Philip Oakley, GitList, Philip Oakley

Jeff King <peff@peff.net> writes:

> Maybe:
>
>   'git fetch', 'git pull', and 'git clone'
>
> ? Given the repetition below, though:

... including this one, I think you covered everything I wanted to
say on the patch already.  Thanks.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v3] Doc: Bundle file usage
  2019-10-16 21:09     ` Jeff King
  2019-10-17  2:54       ` Junio C Hamano
@ 2019-10-18 15:15       ` Philip Oakley
  2019-10-18 18:15         ` Pratyush Yadav
  1 sibling, 1 reply; 15+ messages in thread
From: Philip Oakley @ 2019-10-18 15:15 UTC (permalink / raw)
  To: GitList, Jeff King, Junio C Hamano; +Cc: Philip Oakley, Philip Oakley

From: Philip Oakley <philipoakley@iee.org>

Improve the command description, including paragraph spacing.

Git URLs can accept bundle files for fetch, pull and clone, include
in that section. Include git clone in the bundle usage description.
Correct the quoting of <git-rev-list-args>.

Detail the <git-rev-list-args> options for cloning a complete repo.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
---
The new paragraph uses the more modern back-ticks while elsewhere
the quote style is matched locally.

Includes peff's suggestions.
---
 Documentation/git-bundle.txt | 23 +++++++++++++++++------
 Documentation/urls.txt       |  3 +++
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 7d6c9dcd17..a441a13d58 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -20,11 +20,14 @@ DESCRIPTION
 Some workflows require that one or more branches of development on one
 machine be replicated on another machine, but the two machines cannot
 be directly connected, and therefore the interactive Git protocols (git,
-ssh, http) cannot be used.  This command provides support for
-'git fetch' and 'git pull' to operate by packaging objects and references
-in an archive at the originating machine, then importing those into
-another repository using 'git fetch' and 'git pull'
-after moving the archive by some means (e.g., by sneakernet).  As no
+ssh, http) cannot be used.
+
+The 'git bundle' command packages objects and references in an archive
+at the originating machine, which can then be imported into another
+repository using 'git fetch', 'git pull', or 'git clone',
+after moving the archive by some means (e.g., by sneakernet).
+
+As no
 direct connection between the repositories exists, the user must specify a
 basis for the bundle that is held by the destination repository: the
 bundle assumes that all objects in the basis are already in the
@@ -35,7 +38,7 @@ OPTIONS
 
 create <file>::
 	Used to create a bundle named 'file'.  This requires the
-	'git-rev-list-args' arguments to define the bundle contents.
+	'<git-rev-list-args>' arguments to define the bundle contents.
 
 verify <file>::
 	Used to check that a bundle file is valid and will apply
@@ -92,6 +95,14 @@ It is okay to err on the side of caution, causing the bundle file
 to contain objects already in the destination, as these are ignored
 when unpacking at the destination.
 
+`git clone` can use any bundle created without negative refspecs
+(e.g., `new`, but not `old..new`).
+If you want to match `git clone --mirror`, which would clone other
+refs such as `refs/remotes/*`, use `--all`.
+If you want to provide the same set of refs that a clone directly
+from the source repository would get, use `--branches --tags` for
+the `<git-rev-list-args>`.
+
 EXAMPLES
 --------
 
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index bc354fe2dc..1c229d7581 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies
 --local option.
 endif::git-clone[]
 
+'git clone', 'git fetch' and 'git pull', but not 'git push', will also
+accept a suitable bundle file. See linkgit:git-bundle[1].
+
 When Git doesn't know how to handle a certain transport protocol, it
 attempts to use the 'remote-<transport>' remote helper, if one
 exists. To explicitly request a remote helper, the following syntax
-- 
2.23.0.windows.1.21.g947f504ebe8.dirty


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] Doc: Bundle file usage
  2019-10-18 15:15       ` [PATCH v3] " Philip Oakley
@ 2019-10-18 18:15         ` Pratyush Yadav
  2019-10-18 19:58           ` Philip Oakley
  0 siblings, 1 reply; 15+ messages in thread
From: Pratyush Yadav @ 2019-10-18 18:15 UTC (permalink / raw)
  To: Philip Oakley; +Cc: GitList, Jeff King, Junio C Hamano, Philip Oakley

On 18/10/19 04:15PM, Philip Oakley wrote:
> From: Philip Oakley <philipoakley@iee.org>
> 
> Improve the command description, including paragraph spacing.
> 
> Git URLs can accept bundle files for fetch, pull and clone, include
> in that section. Include git clone in the bundle usage description.
> Correct the quoting of <git-rev-list-args>.
> 
> Detail the <git-rev-list-args> options for cloning a complete repo.
> 
> Signed-off-by: Philip Oakley <philipoakley@iee.email>

Reminder: The email in your signoff and From are different [0].

[0] https://public-inbox.org/git/59958c50-cbcb-ae9b-614f-ba28221f41ed@iee.email/

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] Doc: Bundle file usage
  2019-10-18 18:15         ` Pratyush Yadav
@ 2019-10-18 19:58           ` Philip Oakley
  2019-10-18 20:30             ` [PATCH v4] " Philip Oakley
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Oakley @ 2019-10-18 19:58 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: GitList, Jeff King, Junio C Hamano, Philip Oakley

On 18/10/2019 19:15, Pratyush Yadav wrote:
> On 18/10/19 04:15PM, Philip Oakley wrote:
>> From: Philip Oakley <philipoakley@iee.org>
>>
>> Improve the command description, including paragraph spacing.
>>
>> Git URLs can accept bundle files for fetch, pull and clone, include
>> in that section. Include git clone in the bundle usage description.
>> Correct the quoting of <git-rev-list-args>.
>>
>> Detail the <git-rev-list-args> options for cloning a complete repo.
>>
>> Signed-off-by: Philip Oakley <philipoakley@iee.email>
> Reminder: The email in your signoff and From are different [0].
>
> [0] https://public-inbox.org/git/59958c50-cbcb-ae9b-614f-ba28221f41ed@iee.email/
>
Yes, sigh.
I was going to complain it was all the git-gui's fault ;-) because it 
doesn't show the current author, but then `git log` and `git show` don't 
either.

I just need to revisit the man page for --amend with some form of 
--reset-author to my new email.

Philip
[1] note to self: add a 'todo' to get git gui to show (somewhere) the 
author/committer that is in use for a commit or amend

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4] Doc: Bundle file usage
  2019-10-18 19:58           ` Philip Oakley
@ 2019-10-18 20:30             ` Philip Oakley
  2019-10-20  1:10               ` Jeff King
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Oakley @ 2019-10-18 20:30 UTC (permalink / raw)
  To: GitList, Jeff King, Pratyush Yadav, Junio C Hamano; +Cc: Philip Oakley

Improve the command description, including paragraph spacing.

Git URLs can accept bundle files for fetch, pull and clone, include
in that section. Include git clone in the bundle usage description.
Correct the quoting of <git-rev-list-args>.

Detail the <git-rev-list-args> options for cloning a complete repo.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
---
The new paragraph uses the more modern back-ticks while elsewhere
the quote style is matched locally.

Author email address corrected. Thanks to Pratyush for the reminder.
---
 Documentation/git-bundle.txt | 23 +++++++++++++++++------
 Documentation/urls.txt       |  3 +++
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 7d6c9dcd17..a441a13d58 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -20,11 +20,14 @@ DESCRIPTION
 Some workflows require that one or more branches of development on one
 machine be replicated on another machine, but the two machines cannot
 be directly connected, and therefore the interactive Git protocols (git,
-ssh, http) cannot be used.  This command provides support for
-'git fetch' and 'git pull' to operate by packaging objects and references
-in an archive at the originating machine, then importing those into
-another repository using 'git fetch' and 'git pull'
-after moving the archive by some means (e.g., by sneakernet).  As no
+ssh, http) cannot be used.
+
+The 'git bundle' command packages objects and references in an archive
+at the originating machine, which can then be imported into another
+repository using 'git fetch', 'git pull', or 'git clone',
+after moving the archive by some means (e.g., by sneakernet).
+
+As no
 direct connection between the repositories exists, the user must specify a
 basis for the bundle that is held by the destination repository: the
 bundle assumes that all objects in the basis are already in the
@@ -35,7 +38,7 @@ OPTIONS
 
 create <file>::
 	Used to create a bundle named 'file'.  This requires the
-	'git-rev-list-args' arguments to define the bundle contents.
+	'<git-rev-list-args>' arguments to define the bundle contents.
 
 verify <file>::
 	Used to check that a bundle file is valid and will apply
@@ -92,6 +95,14 @@ It is okay to err on the side of caution, causing the bundle file
 to contain objects already in the destination, as these are ignored
 when unpacking at the destination.
 
+`git clone` can use any bundle created without negative refspecs
+(e.g., `new`, but not `old..new`).
+If you want to match `git clone --mirror`, which would clone other
+refs such as `refs/remotes/*`, use `--all`.
+If you want to provide the same set of refs that a clone directly
+from the source repository would get, use `--branches --tags` for
+the `<git-rev-list-args>`.
+
 EXAMPLES
 --------
 
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index bc354fe2dc..1c229d7581 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies
 --local option.
 endif::git-clone[]
 
+'git clone', 'git fetch' and 'git pull', but not 'git push', will also
+accept a suitable bundle file. See linkgit:git-bundle[1].
+
 When Git doesn't know how to handle a certain transport protocol, it
 attempts to use the 'remote-<transport>' remote helper, if one
 exists. To explicitly request a remote helper, the following syntax
-- 
2.23.0.windows.1.21.g947f504ebe8.dirty


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v4] Doc: Bundle file usage
  2019-10-18 20:30             ` [PATCH v4] " Philip Oakley
@ 2019-10-20  1:10               ` Jeff King
  2019-10-20 10:49                 ` Philip Oakley
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff King @ 2019-10-20  1:10 UTC (permalink / raw)
  To: Philip Oakley; +Cc: GitList, Pratyush Yadav, Junio C Hamano

On Fri, Oct 18, 2019 at 09:30:52PM +0100, Philip Oakley wrote:

> +`git clone` can use any bundle created without negative refspecs
> +(e.g., `new`, but not `old..new`).
> +If you want to match `git clone --mirror`, which would clone other
> +refs such as `refs/remotes/*`, use `--all`.
> +If you want to provide the same set of refs that a clone directly
> +from the source repository would get, use `--branches --tags` for
> +the `<git-rev-list-args>`.

Since you swapped the order here of "--mirror" versus non-mirror, saying
"other refs such as..." in the first part is confusing. We haven't
introduced the thing they're "other" from.

Maybe say "clone all refs (including ones which would be omitted by a
non-mirror clone, like refs/remotes/*)" or something?

Other than that, this version looks OK to me.

-Peff

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4] Doc: Bundle file usage
  2019-10-20  1:10               ` Jeff King
@ 2019-10-20 10:49                 ` Philip Oakley
  2019-10-20 11:03                   ` [PATCH v5] " Philip Oakley
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Oakley @ 2019-10-20 10:49 UTC (permalink / raw)
  To: Jeff King; +Cc: GitList, Pratyush Yadav, Junio C Hamano

On 20/10/2019 02:10, Jeff King wrote:
> On Fri, Oct 18, 2019 at 09:30:52PM +0100, Philip Oakley wrote:
>
>> +`git clone` can use any bundle created without negative refspecs
>> +(e.g., `new`, but not `old..new`).
>> +If you want to match `git clone --mirror`, which would clone other
>> +refs such as `refs/remotes/*`, use `--all`.
>> +If you want to provide the same set of refs that a clone directly
>> +from the source repository would get, use `--branches --tags` for
>> +the `<git-rev-list-args>`.
> Since you swapped the order here of "--mirror" versus non-mirror, saying
> "other refs such as..." in the first part is confusing. We haven't
> introduced the thing they're "other" from.
>
> Maybe say "clone all refs (including ones which would be omitted by a
> non-mirror clone, like refs/remotes/*)" or something?
>
> Other than that, this version looks OK to me.
>
I had deliberately swapped the order because of the classic human 
fallibility of only remembering the beginning and end parts, so I'd 
buried' the --mirror/--all option, leaving that important bit to the end.

I'll probably simply just drop the word "other" (or maybe "include cloning")

Philip

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v5] Doc: Bundle file usage
  2019-10-20 10:49                 ` Philip Oakley
@ 2019-10-20 11:03                   ` Philip Oakley
  2019-10-21  2:48                     ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Philip Oakley @ 2019-10-20 11:03 UTC (permalink / raw)
  To: GitList, Jeff King, Pratyush Yadav, Junio C Hamano; +Cc: Philip Oakley

Improve the command description, including paragraph spacing.

Git URLs can accept bundle files for fetch, pull and clone, include
in that section. Include git clone in the bundle usage description.
Correct the quoting of <git-rev-list-args>.

Detail the <git-rev-list-args> options for cloning a complete repo.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
---
The new paragraph uses the more modern back-ticks while elsewhere
the quote style is matched locally.

I finally chose the `would include your refs ..` to clarify the
--mirror option.

---
 Documentation/git-bundle.txt | 23 +++++++++++++++++------
 Documentation/urls.txt       |  3 +++
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 7d6c9dcd17..545940022b 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -20,11 +20,14 @@ DESCRIPTION
 Some workflows require that one or more branches of development on one
 machine be replicated on another machine, but the two machines cannot
 be directly connected, and therefore the interactive Git protocols (git,
-ssh, http) cannot be used.  This command provides support for
-'git fetch' and 'git pull' to operate by packaging objects and references
-in an archive at the originating machine, then importing those into
-another repository using 'git fetch' and 'git pull'
-after moving the archive by some means (e.g., by sneakernet).  As no
+ssh, http) cannot be used.
+
+The 'git bundle' command packages objects and references in an archive
+at the originating machine, which can then be imported into another
+repository using 'git fetch', 'git pull', or 'git clone',
+after moving the archive by some means (e.g., by sneakernet).
+
+As no
 direct connection between the repositories exists, the user must specify a
 basis for the bundle that is held by the destination repository: the
 bundle assumes that all objects in the basis are already in the
@@ -35,7 +38,7 @@ OPTIONS
 
 create <file>::
 	Used to create a bundle named 'file'.  This requires the
-	'git-rev-list-args' arguments to define the bundle contents.
+	'<git-rev-list-args>' arguments to define the bundle contents.
 
 verify <file>::
 	Used to check that a bundle file is valid and will apply
@@ -92,6 +95,14 @@ It is okay to err on the side of caution, causing the bundle file
 to contain objects already in the destination, as these are ignored
 when unpacking at the destination.
 
+`git clone` can use any bundle created without negative refspecs
+(e.g., `new`, but not `old..new`).
+If you want to match `git clone --mirror`, which would include your
+refs such as `refs/remotes/*`, use `--all`.
+If you want to provide the same set of refs that a clone directly
+from the source repository would get, use `--branches --tags` for
+the `<git-rev-list-args>`.
+
 EXAMPLES
 --------
 
diff --git a/Documentation/urls.txt b/Documentation/urls.txt
index bc354fe2dc..1c229d7581 100644
--- a/Documentation/urls.txt
+++ b/Documentation/urls.txt
@@ -53,6 +53,9 @@ These two syntaxes are mostly equivalent, except the former implies
 --local option.
 endif::git-clone[]
 
+'git clone', 'git fetch' and 'git pull', but not 'git push', will also
+accept a suitable bundle file. See linkgit:git-bundle[1].
+
 When Git doesn't know how to handle a certain transport protocol, it
 attempts to use the 'remote-<transport>' remote helper, if one
 exists. To explicitly request a remote helper, the following syntax
-- 
2.23.0.windows.1.21.g947f504ebe8.dirty


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v5] Doc: Bundle file usage
  2019-10-20 11:03                   ` [PATCH v5] " Philip Oakley
@ 2019-10-21  2:48                     ` Junio C Hamano
  2019-10-21  3:16                       ` Jeff King
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2019-10-21  2:48 UTC (permalink / raw)
  To: Philip Oakley; +Cc: GitList, Jeff King, Pratyush Yadav

Philip Oakley <philipoakley@iee.email> writes:

> @@ -20,11 +20,14 @@ DESCRIPTION
>  Some workflows require that one or more branches of development on one
>  machine be replicated on another machine, but the two machines cannot
>  be directly connected, and therefore the interactive Git protocols (git,
> +ssh, http) cannot be used.
> +
> +The 'git bundle' command packages objects and references in an archive
> +at the originating machine, which can then be imported into another
> +repository using 'git fetch', 'git pull', or 'git clone',
> +after moving the archive by some means (e.g., by sneakernet).
> +
> +As no
>  direct connection between the repositories exists, the user must specify a
>  basis for the bundle that is held by the destination repository: the
>  bundle assumes that all objects in the basis are already in the

Notice that we use the term `basis` here.  It is referring to the
bottom end(s) of the commit graph.

> +`git clone` can use any bundle created without negative refspecs
> +(e.g., `new`, but not `old..new`).

To be consistent with the phrasing of this particular document we
saw earlier, you would have said "without basis", but I think the
use of `basis` did not spread beyond "git bundle" documentation.  

If we were writing "git bundle" and its documentation from scratch
using more modern lingo, we probably would say "negative revisions"
here.  Note that the word `refspec` has no place in the context of
this sentence; they are to specify the mapping of refs between the
repository in which transferred objects originate and the repository
that accept the objects.  Also note that `basis` discussed in 'git
bundle' is a bit wider concept than `negative revisions`, so mere
mechanical replacements would not be sufficient as a preliminary
modernization/prepation step for this patch.

> +If you want to match `git clone --mirror`, which would include your
> +refs such as `refs/remotes/*`, use `--all`.
> +If you want to provide the same set of refs that a clone directly
> +from the source repository would get, use `--branches --tags` for
> +the `<git-rev-list-args>`.

This is not wrong per-se, but may lead to confusion.  The readers
must be able to learn:

 - "git clone --mirror full.bndl dst/" from a full bundle created
   with "git bundle create full.bndl --all" can mimic creation of a
   full mirror of the original.

 - "git clone full.bndl dst/" from such a bundle does *not* result
   in creation of a mirror.

 - "git clone slim.bndl dst/" from a minimum bundle created wth "git
   bundle create slim.bndl --branches --tags" would be sufficient to
   obtain the same result as the above.

 - "git clone --mirror slim.bndl dst/" from such a minimum bundle
   cannot mimic creation of a full mirror of the original.

I am not sure the second point is conveyed well with the new
paragraph.  That is, "--all" must be used if the resulting bundle is
meant to be usable to "--mirror" clone from, but it can still be
used to clone normally.  If you do not intend to mirror-clone from,
there is not much point in using "--all" to record extra refs.

Not having the new paragraph does not convey anything at all, so it
definitely is an improvement, though ;-)

Thanks.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v5] Doc: Bundle file usage
  2019-10-21  2:48                     ` Junio C Hamano
@ 2019-10-21  3:16                       ` Jeff King
  0 siblings, 0 replies; 15+ messages in thread
From: Jeff King @ 2019-10-21  3:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Philip Oakley, GitList, Pratyush Yadav

On Mon, Oct 21, 2019 at 11:48:40AM +0900, Junio C Hamano wrote:

> > +`git clone` can use any bundle created without negative refspecs
> > +(e.g., `new`, but not `old..new`).
> 
> To be consistent with the phrasing of this particular document we
> saw earlier, you would have said "without basis", but I think the
> use of `basis` did not spread beyond "git bundle" documentation.  
> 
> If we were writing "git bundle" and its documentation from scratch
> using more modern lingo, we probably would say "negative revisions"
> here.  Note that the word `refspec` has no place in the context of
> this sentence; they are to specify the mapping of refs between the
> repository in which transferred objects originate and the repository
> that accept the objects.  Also note that `basis` discussed in 'git
> bundle' is a bit wider concept than `negative revisions`, so mere
> mechanical replacements would not be sufficient as a preliminary
> modernization/prepation step for this patch.

Sorry, this one is my fault. I said "negative revisions" in my earlier
mail[1], but somehow while writing example text my brain turned into
"refspecs", which is obviously nonsense. It should be "revisions".

I don't mind using "basis" either; it's not commonly used outside of
this page, but I think it does succinctly represent what we're trying to
say here.

[1] https://public-inbox.org/git/20191016210957.GA28981@sigill.intra.peff.net/

> > +If you want to match `git clone --mirror`, which would include your
> > +refs such as `refs/remotes/*`, use `--all`.
> > +If you want to provide the same set of refs that a clone directly
> > +from the source repository would get, use `--branches --tags` for
> > +the `<git-rev-list-args>`.
> 
> This is not wrong per-se, but may lead to confusion.  The readers
> must be able to learn:
> 
>  - "git clone --mirror full.bndl dst/" from a full bundle created
>    with "git bundle create full.bndl --all" can mimic creation of a
>    full mirror of the original.
> 
>  - "git clone full.bndl dst/" from such a bundle does *not* result
>    in creation of a mirror.
> 
>  - "git clone slim.bndl dst/" from a minimum bundle created wth "git
>    bundle create slim.bndl --branches --tags" would be sufficient to
>    obtain the same result as the above.
> 
>  - "git clone --mirror slim.bndl dst/" from such a minimum bundle
>    cannot mimic creation of a full mirror of the original.
> 
> I am not sure the second point is conveyed well with the new
> paragraph.  That is, "--all" must be used if the resulting bundle is
> meant to be usable to "--mirror" clone from, but it can still be
> used to clone normally.  If you do not intend to mirror-clone from,
> there is not much point in using "--all" to record extra refs.

I hoped maybe it would be obvious how the second and fourth cases would
behave, but maybe it is better to spell it out. Maybe it would be better
to talk about what the sender does, and then what the receiver can do
with the result. Something like:

  If you create a bundle using `--all` for `<git-rev-list-args>`, a
  recipient can clone the result using `git clone` or `git clone
  --mirror` and get the same result they would by cloning directly from
  the source repository. If you instead create it with `--branches
  --tags`, the resulting bundle may be smaller, and a non-mirror clone
  will behave the same (but a `clone --mirror` will obviously not
  receive any refs outside of the branches and tags).

That could probably be tightened up a bit.

-Peff

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-10-21  3:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-18 23:25 [PATCHv2 1/8] Doc: Bundle file usage Philip Oakley
2012-09-18 23:55 ` Junio C Hamano
2019-10-16  9:57   ` [PATCH v2] " Philip Oakley
2019-10-16 10:15     ` Philip Oakley
2019-10-16 21:09     ` Jeff King
2019-10-17  2:54       ` Junio C Hamano
2019-10-18 15:15       ` [PATCH v3] " Philip Oakley
2019-10-18 18:15         ` Pratyush Yadav
2019-10-18 19:58           ` Philip Oakley
2019-10-18 20:30             ` [PATCH v4] " Philip Oakley
2019-10-20  1:10               ` Jeff King
2019-10-20 10:49                 ` Philip Oakley
2019-10-20 11:03                   ` [PATCH v5] " Philip Oakley
2019-10-21  2:48                     ` Junio C Hamano
2019-10-21  3:16                       ` Jeff King

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).