pushing from a shallow repo allowed?

7 messages, 5 authors, 2016-06-15 · open the first message on its own page

pushing from a shallow repo allowed?

From: Joey Hess <hidden>
Date: 2016-06-15 22:46:12

git-clone(1):
	A shallow repository has a number of
        limitations (you cannot clone or fetch from it, nor push from nor
        into it)

This and other documentation (shallow.txt, RelNotes-1.5.0.txt) says you
can't push from a shallow repo. But in a simple test of making a commit
to a shallow repo and pushing it out, it seems to work. AFAICS, git only
guards against pushes *into* a shallow repo, and fetching/cloning from a
shallow repository.

Are the docs out of date, or is there really still some problem
with pushing from a shallow repo?


BTW, --depth seems to be ignored when making a local clone.
This seems to have been fixed in the old shell git-clone in
d4110a9726c7cd5cda35b7dd03dc8f85fe3dff0c, was it accidentially lost
in the C version?

joey@gnu:~/src/other> git clone --depth 2 git git.shallow
Initialized empty Git repository in /home/joey/src/other/git.shallow/.git/
joey@gnu:~/src/other> cd git.shallow 
joey@gnu:~/src/other/git.shallow> git-log --pretty=oneline|wc -l
17009

git version 1.5.6.5

-- 
see shy jo

Re: pushing from a shallow repo allowed?

From: Mikael Magnusson <hidden>
Date: 2016-06-15 22:46:12

2009/2/12 Joey Hess [off-list ref]:
git-clone(1):
       A shallow repository has a number of
       limitations (you cannot clone or fetch from it, nor push from nor
       into it)

This and other documentation (shallow.txt, RelNotes-1.5.0.txt) says you
can't push from a shallow repo. But in a simple test of making a commit
to a shallow repo and pushing it out, it seems to work. AFAICS, git only
guards against pushes *into* a shallow repo, and fetching/cloning from a
shallow repository.

Are the docs out of date, or is there really still some problem
with pushing from a shallow repo?
AFAIK, it will work in simple cases, but isn't guaranteed to work.
BTW, --depth seems to be ignored when making a local clone.
This seems to have been fixed in the old shell git-clone in
d4110a9726c7cd5cda35b7dd03dc8f85fe3dff0c, was it accidentially lost
in the C version?

joey@gnu:~/src/other> git clone --depth 2 git git.shallow
Initialized empty Git repository in /home/joey/src/other/git.shallow/.git/
joey@gnu:~/src/other> cd git.shallow
joey@gnu:~/src/other/git.shallow> git-log --pretty=oneline|wc -l
17009

git version 1.5.6.5
You most likely need to use the file:// syntax for this to work,
otherwise git will just hardlink/copy the whole objects dir without
looking at it.

-- 
Mikael Magnusson

[PATCH] git-clone.txt: document that pushing from a shallow clone may work

From: Adeodato Simó <hidden>
Date: 2016-06-15 22:46:19

The documentation used to say that pushing from a shallow clone is not
supported; this is true, though it may work in some simple cases. If a
user notices this fact, such a mismatch between documentation and reality
may leave them assuming the documentation is wrong and that pushing from
a shallow clone is supported.

This commit updates the documentation to say that pushing from a shallow
clone may work in some cases, but that it's not guaranteed to always do.

Signed-off-by: Adeodato Simó <redacted>
---
Hello,

this is about http://thread.gmane.org/gmane.comp.version-control.git/110100,
which got a single reply from Mikael Magnusson stating:
AFAIK, it will work in simple cases, but isn't guaranteed to work.
If that's the case, I think it should be documented, for the reasons
explained in the commit message.

Thanks!

 Documentation/git-clone.txt |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 95f08b9..1b4f864 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -133,8 +133,10 @@ then the cloned repository will become corrupt.
 --depth <depth>::
 	Create a 'shallow' clone with a history truncated to the
 	specified number of revisions.  A shallow repository has a
-	number of limitations (you cannot clone or fetch from
-	it, nor push from nor into it), but is adequate if you
+	number of limitations: you cannot clone or fetch from it,
+	nor push into it; pushing from it into a regular repository
+	may work correctly in some cases, but it is not guaranteed to
+	always work.  However, a shallow repository is adequate if you
 	are only interested in the recent history of a large project
 	with a long history, and would want to send in fixes
 	as patches.
-- 
1.6.2.rc2.271.ge939

Re: [PATCH] git-clone.txt: document that pushing from a shallow clone may work

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:46:19

Adeodato Simó schrieb:
quoted hunk
@@ -133,8 +133,10 @@ then the cloned repository will become corrupt.
 --depth <depth>::
 	Create a 'shallow' clone with a history truncated to the
 	specified number of revisions.  A shallow repository has a
-	number of limitations (you cannot clone or fetch from
-	it, nor push from nor into it), but is adequate if you
+	number of limitations: you cannot clone or fetch from it,
+	nor push into it; pushing from it into a regular repository
+	may work correctly in some cases, but it is not guaranteed to
+	always work.  However, a shallow repository is adequate if you
Consider a reader who wants to decide whether --depth should or can be
used in a git clone invocation. Is the new wording helpful? If you don't
describe those "some cases" in more detail, then we better keep the
current wording.

-- Hannes

Re: [PATCH] git-clone.txt: document that pushing from a shallow clone may work

From: Adeodato Simó <hidden>
Date: 2016-06-15 22:46:19

* Johannes Sixt [Tue, 03 Mar 2009 12:57:22 +0100]:
Adeodato Simó schrieb:
quoted
@@ -133,8 +133,10 @@ then the cloned repository will become corrupt.
 --depth <depth>::
 	Create a 'shallow' clone with a history truncated to the
 	specified number of revisions.  A shallow repository has a
-	number of limitations (you cannot clone or fetch from
-	it, nor push from nor into it), but is adequate if you
+	number of limitations: you cannot clone or fetch from it,
+	nor push into it; pushing from it into a regular repository
+	may work correctly in some cases, but it is not guaranteed to
+	always work.  However, a shallow repository is adequate if you
Consider a reader who wants to decide whether --depth should or can be
used in a git clone invocation. Is the new wording helpful? If you don't
describe those "some cases" in more detail, then we better keep the
current wording.
Well, I don't know if the set of cases where it'll work can be defined
in detail to a point where it is useful. If it is, then sure, let's do
it.

My point is that if it will work in some cases, then the documentation
should *acknowledge that fact*, because else people will assume the
documentation is wrong, and believe it is intended to work, which is not
the case.

I think doing that is very important, and I hope I'm explaining myself
clearly.

Thanks,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
«Ara que ets la meva dona, te la fotré fins a la melsa, bacona!»
                -- Terenci Moix, “Chulas y famosas”

Re: [PATCH] git-clone.txt: document that pushing from a shallow clone may work

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:19

On Tue, Mar 3, 2009 at 7:08 AM, Adeodato Simó [off-list ref] wrote:
Well, I don't know if the set of cases where it'll work can be defined
in detail to a point where it is useful. If it is, then sure, let's do
it.

My point is that if it will work in some cases, then the documentation
should *acknowledge that fact*, because else people will assume the
documentation is wrong, and believe it is intended to work, which is not
the case.
Wy not just say "pushing into a shallow repository is not supported"
instead of "pushing into a shallow repository won't work."

j.

Re: [PATCH] git-clone.txt: document that pushing from a shallow clone may work

From: Adeodato Simó <hidden>
Date: 2016-06-15 22:46:19

* Jay Soffian [Tue, 03 Mar 2009 14:27:29 -0500]:
On Tue, Mar 3, 2009 at 7:08 AM, Adeodato Simó [off-list ref] wrote:
quoted
Well, I don't know if the set of cases where it'll work can be defined
in detail to a point where it is useful. If it is, then sure, let's do
it.
quoted
My point is that if it will work in some cases, then the documentation
should *acknowledge that fact*, because else people will assume the
documentation is wrong, and believe it is intended to work, which is not
the case.
Wy not just say "pushing into a shallow repository is not supported"
instead of "pushing into a shallow repository won't work."
I don't think such a wording is enough (adjusted, of course, to be about
pushing from, not to, which is the case at hand).

But I'll try to stay silent, and see if Junio has an opinion on the
matter.

Thanks,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
- Oh my God, you're pimping me out for a new roof?
- And windows!
                -- Andrew and Bree Van De Kamp
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help