git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Bug in shallow clone?
@ 2014-05-28 14:02 Thomas Kieffer
  2014-05-28 14:16 ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Kieffer @ 2014-05-28 14:02 UTC (permalink / raw
  To: git

Hi there Git developers,

I'm not sure if I found a bug in the command

git clone repo.git cloned_repo --depth 1

I follow these steps:

git init
echo "First commit" >> test.txt
git add -A
git commit -am "First commit"

echo "Second commit" >> test.txt
git commit -am "Second commit"

echo "Third commit" >> test.txt
git commit -am "Third commit"

git clone --bare . ./bare.git

I then clone the bare repository with --depth 1.

git clone file:///path/to/bare.git ./clone --depth 1

It always returns the last two commits. If I specify --depth 2 it 
returns the last 3 commits.

If I use --depth 1 on a Github repository it works as expected.

Am I doing something wrong or is it really a bug?

Kind Regards,

Thomas Kieffer


BTW.: Git is amazing and I love it :)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in shallow clone?
  2014-05-28 14:02 Bug in shallow clone? Thomas Kieffer
@ 2014-05-28 14:16 ` Duy Nguyen
  2014-05-28 14:29   ` Dennis Kaarsemaker
  0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2014-05-28 14:16 UTC (permalink / raw
  To: Thomas Kieffer; +Cc: Git Mailing List

On Wed, May 28, 2014 at 9:02 PM, Thomas Kieffer <ThomasKieffer@web.de> wrote:
> I then clone the bare repository with --depth 1.
>
> git clone file:///path/to/bare.git ./clone --depth 1
>
> It always returns the last two commits. If I specify --depth 2 it returns
> the last 3 commits.
>
> If I use --depth 1 on a Github repository it works as expected.
>
> Am I doing something wrong or is it really a bug?

Depth calculation has been corrected lately. It depends on your
version, maybe it's older than 1.8.2? If it's the latest, we screwed
something up again..
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in shallow clone?
  2014-05-28 14:16 ` Duy Nguyen
@ 2014-05-28 14:29   ` Dennis Kaarsemaker
  0 siblings, 0 replies; 3+ messages in thread
From: Dennis Kaarsemaker @ 2014-05-28 14:29 UTC (permalink / raw
  To: Duy Nguyen; +Cc: Thomas Kieffer, Git Mailing List

On wo, 2014-05-28 at 21:16 +0700, Duy Nguyen wrote:
> On Wed, May 28, 2014 at 9:02 PM, Thomas Kieffer <ThomasKieffer@web.de> wrote:
> > I then clone the bare repository with --depth 1.
> >
> > git clone file:///path/to/bare.git ./clone --depth 1
> >
> > It always returns the last two commits. If I specify --depth 2 it returns
> > the last 3 commits.
> >
> > If I use --depth 1 on a Github repository it works as expected.
> >
> > Am I doing something wrong or is it really a bug?
> 
> Depth calculation has been corrected lately. It depends on your
> version, maybe it's older than 1.8.2? If it's the latest, we screwed
> something up again..

2.0.0-rc4 does this correctly.
-- 
Dennis Kaarsemaker
http://www.kaarsemaker.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-28 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-28 14:02 Bug in shallow clone? Thomas Kieffer
2014-05-28 14:16 ` Duy Nguyen
2014-05-28 14:29   ` Dennis Kaarsemaker

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).