Skip to contentSkip to conversation

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

DISCUSSION Sebastian Pipping 3 participants 6 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello!

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?

Sebastian

#1 lore raw
Quoted 4 lines · Sebastian Pipping

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

#2 lore raw

Hi,

Quoted 8 lines · Sebastian Pipping
Quoted 4 lines · Sebastian Pipping

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

#3 lore raw
Quoted 7 lines · Johannes Schindelin
Quoted 2 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

#4 lore raw
In reply to Johannes Schindelin
Quoted 6 lines · Johannes Schindelin
Quoted 4 lines · Sebastian Pipping
Quoted 3 lines · Sebastian Pipping

Is "git clone --depth 1 <ropository>" expected to give a history with 2 commits? "--depth 2" gives 3 commits, "--depth 0" all.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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.

Quoted 1 line

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?

#5 lore raw

Hi,

Quoted 10 lines · Junio C Hamano
Quoted 8 lines · Johannes Schindelin
Quoted 6 lines · Sebastian Pipping
Quoted 4 lines · Sebastian Pipping

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?

Quoted 7 lines
Quoted 5 lines
Quoted 2 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?

But then you can error out upon such a request.

Right. Or disable the shallow cloning, as is the case now.

Quoted 5 lines
Quoted 2 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