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

Re: "git clone --depth <depth>" producing history with <depth + 1> commits?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 2, 2009, 11:00 UTC
Message-ID
<alpine.DEB.1.00.0904021248080.7464@intel-tinevez-2-302>
In-Reply-To
<7veiwbokd7.fsf@gitster.siamese.dyndns.org>
Hi,
On Wed, 1 Apr 2009, Junio C Hamano wrote:
Show 17 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Wed, 1 Apr 2009, Sebastian Pipping wrote:
> >
> >> Sebastian Pipping wrote:
> >> > Is "git clone --depth 1 <ropository>" expected to give a history 
> >> > with 2 commits?  "--depth 2" gives 3 commits, "--depth 0" all.
> >> > 
> >> > Is that by design or a bug?
> >> 
> >> Anyone?  Is "git clone --depth 1 <ropository>" really supposed to 
> >> produce a history holding _two_ commits?  Why so?
> >
> > Because storing _no_ commit (according to you, that should happen with 
> > --depth=0) would make no sense?
> 
> But then you can error out upon such a request.
Right.  Or disable the shallow cloning, as is the case now.
Show 5 quoted lines
> > After all, if you want to clone, you want to clone at least 
> > _something_.
> 
> I am a bit puzzled by your logic.  If one is requested, shouldn't you 
> give only one and not two?

Reading the OP again, I have to apologize: I missed the fact that there is no way to have _just_ one commit.

And that is very obviously a bug.
If nobody beats me to it, I will take care of it this weekend.

Ciao, Dscho

Previous: Junio C Hamano
Message 6 of 6 in “"git clone --depth <depth>" producing history with <depth + 1> commits?”
  1. Sebastian PippingMar 26, 2009
  2. Sebastian PippingApr 1, 2009
  3. Johannes SchindelinApr 2, 2009
  4. Sebastian PippingApr 2, 2009
  5. Junio C HamanoApr 2, 2009
  6. Johannes SchindelinApr 2, 2009

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.