{"thread":{"id":"33766","subject":"git clone --depth and git describe","startedAt":"2013-05-09T23:07:58Z","lastAt":"2013-05-10T10:48:16Z","messageCount":4,"participants":["Ruediger Meier","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"216832","messageId":"201305100107.59115.sweet_f_a@gmx.de","threadId":"33766","inReplyTo":null,"subject":"git clone --depth and git describe","fromName":"Ruediger Meier","fromEmail":"sweet_f_a@gmx.de","sentAt":"2013-05-09T23:07:58Z","receivedAt":"2013-05-09T23:07:58Z","isPatch":false,"sender":{"key":"sweet_f_a@gmx.de","avatar":"https://gravatar.com/avatar/843ae6d0a3ff0889760b87e753113a42ce58ef8001934294ad375a1d2e9f451e?d=mp&s=160"},"body":"Hi,\n\nI have a use case where I'd like to improve performance using \"git \nclone --depth\". But I also need \"git describe\" working on that clone.\n\nSo something like\n git clone --depth=describable\nwould be nice to have.\n\nWould it be possible to add such feature?\n\ncu,\nRudi\n"},{"id":"216844","messageId":"CACsJy8D=getgkDV9A57=_N+u-XPPy8Cxdx5W+QADnCiGZxFRWQ@mail.gmail.com","threadId":"33766","inReplyTo":"201305100107.59115.sweet_f_a@gmx.de","subject":"Re: git clone --depth and git describe","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2013-05-10T01:36:35Z","receivedAt":"2013-05-10T01:36:35Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, May 10, 2013 at 6:07 AM, Ruediger Meier <sweet_f_a@gmx.de> wrote:\n> Hi,\n>\n> I have a use case where I'd like to improve performance using \"git\n> clone --depth\". But I also need \"git describe\" working on that clone.\n>\n> So something like\n>  git clone --depth=describable\n> would be nice to have.\n\nWhat does --depth=describable do?\n\n>\n> Would it be possible to add such feature?\n--\nDuy\n"},{"id":"216859","messageId":"201305101042.04232.sweet_f_a@gmx.de","threadId":"33766","inReplyTo":"CACsJy8D=getgkDV9A57=_N+u-XPPy8Cxdx5W+QADnCiGZxFRWQ@mail.gmail.com","subject":"Re: git clone --depth and git describe","fromName":"Ruediger Meier","fromEmail":"sweet_f_a@gmx.de","sentAt":"2013-05-10T08:42:03Z","receivedAt":"2013-05-10T08:42:03Z","isPatch":false,"sender":{"key":"sweet_f_a@gmx.de","avatar":"https://gravatar.com/avatar/843ae6d0a3ff0889760b87e753113a42ce58ef8001934294ad375a1d2e9f451e?d=mp&s=160"},"body":"On Friday 10 May 2013, Duy Nguyen wrote:\n> On Fri, May 10, 2013 at 6:07 AM, Ruediger Meier <sweet_f_a@gmx.de> \nwrote:\n> > Hi,\n> >\n> > I have a use case where I'd like to improve performance using \"git\n> > clone --depth\". But I also need \"git describe\" working on that\n> > clone.\n> >\n> > So something like\n> >  git clone --depth=describable\n> > would be nice to have.\n>\n> What does --depth=describable do?\n\nI mean automatically getting the minimum depth which gives us the \nhistory back to the last (annotated) tag. So that \"git describe\" and \npossibly other project specific administrative scripts (like \ngit-version-gen or gitlog-to-changelog) would work safely on that \nshallow clone.\n\nOr maybe --depth could just generally accept a revspec as argument \ninstead of number only. This would be more useful anyway IMO. Then \nperhaps something like \"last_tag\" could be a general magic revspec, \nprobably useful for many other git commands too.\n\n\n> > Would it be possible to add such feature?\n>\n\ncu,\nRudi\n"},{"id":"216866","messageId":"CACsJy8CsB06LTzGsEyM7FGeazq9BiYsbA4_JyiMa_SwPSMHV_Q@mail.gmail.com","threadId":"33766","inReplyTo":"201305101042.04232.sweet_f_a@gmx.de","subject":"Re: git clone --depth and git describe","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2013-05-10T10:48:16Z","receivedAt":"2013-05-10T10:48:16Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, May 10, 2013 at 3:42 PM, Ruediger Meier <sweet_f_a@gmx.de> wrote:\n> On Friday 10 May 2013, Duy Nguyen wrote:\n>> On Fri, May 10, 2013 at 6:07 AM, Ruediger Meier <sweet_f_a@gmx.de>\n> wrote:\n>> > Hi,\n>> >\n>> > I have a use case where I'd like to improve performance using \"git\n>> > clone --depth\". But I also need \"git describe\" working on that\n>> > clone.\n>> >\n>> > So something like\n>> >  git clone --depth=describable\n>> > would be nice to have.\n>>\n>> What does --depth=describable do?\n>\n> I mean automatically getting the minimum depth which gives us the\n> history back to the last (annotated) tag. So that \"git describe\" and\n> possibly other project specific administrative scripts (like\n> git-version-gen or gitlog-to-changelog) would work safely on that\n> shallow clone.\n\nThat should be possible to do. But you need to define it more clearly\nif you start working on it. If you set --depth=v1.7.0, but another\nbranch in the source repo does not cross v1.7.0, what should we get?\nFull history of that branch?\n\nJust thinking out loud. We could make git-describe work with fixed\ndepth (e.g. --depth=12). The server could be made to send the client\nsome extended sha-1 syntax to get to related tags from the cut points,\ne.g. v1.7.0 = <cut point>~12^2~14^1~20. And git-describe could be\nmodified to make use of that information when it traverses down to the\ncut point. But I'm not sure if it's worth doing.\n\n> Or maybe --depth could just generally accept a revspec as argument\n> instead of number only. This would be more useful anyway IMO. Then\n> perhaps something like \"last_tag\" could be a general magic revspec,\n> probably useful for many other git commands too.\n\nrevspec is probably overkill. Take a look at\nshallow.c:get_shallow_commits(). \"cut at the first found tag\" should\nbe easy to do, I think.\n--\nDuy\n"}]}