Skip to contentSkip to conversation

git-clone: Sync documentation to usage note.

PATCH In review Christian Schlotter 2 participants 2 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-clone: Sync documentation to usage note.

Documentation advertises the new --depth <n>' parameter with an equal sign, while the usage notes (shown after git-clone --help') do not. If I understood git-clone's source code correctly, the version without the equal sign is correct, which is why this patch syncs documentation to the usage note.

Please note that I was not able to test the new shallow clone feature, as both

    git clone --depth=5 git://git2.kernel.org/pub/scm/git/git.git
and
    git clone --depth 5 git://git2.kernel.org/pub/scm/git/git.git

do not seem to work. The former correctly produces the usage note, while the latter prints

Initialized empty Git repository in /home/cs/tmp2/git/.git/
fatal: read error (Connection reset by peer)
fetch-pack from 'git://git2.kernel.org/pub/scm/git/git.git' failed.

Is this a problem on my end?

---
 Documentation/RelNotes-1.5.0.txt |    2 +-
 Documentation/git-clone.txt      |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/RelNotes-1.5.0.txt +1 -1
index 599efb8..daf4bdb 100644
@@ -448,7 +448,7 @@ Updates in v1.5.0 since v1.4.4 series
  - There is a partial support for 'shallow' repositories that
    keeps only recent history.  A 'shallow clone' is created by
    specifying how deep that truncated history should be
-   (e.g. "git clone --depth=5 git://some.where/repo.git").
+   (e.g. "git clone --depth 5 git://some.where/repo.git").
 
    Currently a shallow repository has number of limitations:
 
Documentation/git-clone.txt +2 -2
index 707376f..6d32c49 100644
@@ -11,7 +11,7 @@ SYNOPSIS
 [verse]
 'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
 	  [-o <name>] [-u <upload-pack>] [--reference <repository>]
-	  [--depth=<depth>] <repository> [<directory>]
+	  [--depth <depth>] <repository> [<directory>]
 
 DESCRIPTION
 -----------
@@ -96,7 +96,7 @@ OPTIONS
 	if unset the templates are taken from the installation
 	defined default, typically `/usr/share/git-core/templates`.
 
---depth=<depth>::
+--depth <depth>::
 	Create a 'shallow' clone with a history truncated to the
 	specified number of revs.  A shallow repository has
 	number of limitations (you cannot clone or fetch from
Signature · 1 line
1.5.0
#1 lore raw
Quoted 5 lines · Christian Schlotter

Please note that I was not able to test the new shallow clone feature, as both

    git clone --depth=5 git://git2.kernel.org/pub/scm/git/git.git
and
    git clone --depth 5 git://git2.kernel.org/pub/scm/git/git.git
Quoted 8 lines

do not seem to work. The former correctly produces the usage note, while the latter prints

Initialized empty Git repository in /home/cs/tmp2/git/.git/
fatal: read error (Connection reset by peer)
fetch-pack from 'git://git2.kernel.org/pub/scm/git/git.git' failed.

Is this a problem on my end?

Sort of. ;-)

The server side must also support shallow clone. I don't think the server on kernel.org has been upgraded yet to a version which supports that feature, so you cannot shallow clone from there.

Signature · 1 line
Shawn.