threads / discuss / 18574

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

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

## tl;dr

6 messages between Mar 26, 2009 and Apr 2, 2009.

replies: 5people: 3as markdown or json

Sebastian Pipping· Apr 1, 2009, 19:39 UTC · re: Sebastian Pipping · lore

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

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?

Sebastian
Johannes Schindelin· Apr 2, 2009, 01:04 UTC · re: Sebastian Pipping · lore

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

Hi,
On Wed, 1 Apr 2009, Sebastian Pipping wrote:
Show 8 quoted lines
> 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?

After all, if you want to clone, you want to clone at least _something_.

Ciao, Dscho

Sebastian Pipping· Apr 2, 2009, 01:19 UTC · re: Johannes Schindelin · lore

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

Johannes Schindelin wrote:
Show 7 quoted lines
>> 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?
> 
> After all, if you want to clone, you want to clone at least _something_.
I'm aware you need one commit at least.

I didn't think of several branches before. I guess that's resolving the core of my question.

Sebastian
Junio C Hamano· Apr 2, 2009, 02:33 UTC · re: Johannes Schindelin · lore

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

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 13 quoted lines
> 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.
> 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?

Johannes Schindelin· Apr 2, 2009, 11:00 UTC · re: Junio C Hamano · lore

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

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

← back to recent threads