{"thread":{"id":"50543","subject":"Feature Request git clone shallow-include","startedAt":"2019-02-20T00:06:07Z","lastAt":"2019-03-30T11:39:02Z","messageCount":6,"participants":["Joe Enzminger","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"369683","messageId":"CAApa7v-F7Y_WR11V-3jc-R4Y1qSv5PPof6GWvJuF_XMeTcC2zw@mail.gmail.com","threadId":"50543","inReplyTo":null,"subject":"Feature Request git clone shallow-include","fromName":"Joe Enzminger","fromEmail":"joe.enzminger@exactasystems.com","sentAt":"2019-02-20T00:05:30Z","receivedAt":"2019-02-20T00:06:07Z","isPatch":false,"sender":{"key":"joe.enzminger@exactasystems.com","avatar":null},"body":"Currently, git clone supports shallow-exclude=<tag-name>.  The client\nwill clone up to, but not including, the commit with the tag.\n\nIt would be useful to have the ability to include the commit with the\ntag.  The suggestion would be to add a \"shallow-include\" options to\nclone to support this behavior.\n\nI have tried to use shallow-exclude with a follow on git fetch\n--deepen=1, but it always returns \"fatal: error in object; unshallow\n<sha1>\"\n"},{"id":"369687","messageId":"CACsJy8AS5eNO6gACGtRZq=qdQGkQ3jmQPVivPG+=du9u9hKYcg@mail.gmail.com","threadId":"50543","inReplyTo":"CAApa7v-F7Y_WR11V-3jc-R4Y1qSv5PPof6GWvJuF_XMeTcC2zw@mail.gmail.com","subject":"Re: Feature Request git clone shallow-include","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-02-20T01:22:23Z","receivedAt":"2019-02-20T01:22:51Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Feb 20, 2019 at 7:07 AM Joe Enzminger\n<joe.enzminger@exactasystems.com> wrote:\n>\n> Currently, git clone supports shallow-exclude=<tag-name>.  The client\n> will clone up to, but not including, the commit with the tag.\n>\n> It would be useful to have the ability to include the commit with the\n> tag.  The suggestion would be to add a \"shallow-include\" options to\n> clone to support this behavior.\n\nSo exclude the tag's parents and everything before, but keep the tag, correct?\n\nI think if we support --shallow-exclude=<tag>^ then it should work the\nway you want (if the tag is a normal merge you may need to add\n--shallow-exclude=<tag>^2 as well). And you can do even fancier thing\nlike --shallow-exclude=<tag>~3 (i.e. exclude the  grand grand parent\nof the tag, but keep the tag and grand parents). We will need to\nrestrict extended SHA-1 syntax to a safe subset of course.\n\n> I have tried to use shallow-exclude with a follow on git fetch\n> --deepen=1, but it always returns \"fatal: error in object; unshallow\n> <sha1>\"\n-- \nDuy\n"},{"id":"369730","messageId":"CAApa7v_noujdWcogGNJUS7ZJRzPRxK5PPv53tST-0JoEk8+9Mw@mail.gmail.com","threadId":"50543","inReplyTo":"CACsJy8AS5eNO6gACGtRZq=qdQGkQ3jmQPVivPG+=du9u9hKYcg@mail.gmail.com","subject":"Re: Feature Request git clone shallow-include","fromName":"Joe Enzminger","fromEmail":"joe.enzminger@exactasystems.com","sentAt":"2019-02-20T18:06:49Z","receivedAt":"2019-02-20T18:07:02Z","isPatch":false,"sender":{"key":"joe.enzminger@exactasystems.com","avatar":null},"body":"That is correct.  What you suggest is actually what I tried (using\nsha-1 syntax).  For my purposes, excluding the tag's parent's but\nincluding the tag is sufficient, but if is fairly straightforward to\nextend support to the other use cases I'm sure someone would find is\nuseful.\n\nJoe\n\n\nOn Tue, Feb 19, 2019 at 7:22 PM Duy Nguyen <pclouds@gmail.com> wrote:\n>\n> On Wed, Feb 20, 2019 at 7:07 AM Joe Enzminger\n> <joe.enzminger@exactasystems.com> wrote:\n> >\n> > Currently, git clone supports shallow-exclude=<tag-name>.  The client\n> > will clone up to, but not including, the commit with the tag.\n> >\n> > It would be useful to have the ability to include the commit with the\n> > tag.  The suggestion would be to add a \"shallow-include\" options to\n> > clone to support this behavior.\n>\n> So exclude the tag's parents and everything before, but keep the tag, correct?\n>\n> I think if we support --shallow-exclude=<tag>^ then it should work the\n> way you want (if the tag is a normal merge you may need to add\n> --shallow-exclude=<tag>^2 as well). And you can do even fancier thing\n> like --shallow-exclude=<tag>~3 (i.e. exclude the  grand grand parent\n> of the tag, but keep the tag and grand parents). We will need to\n> restrict extended SHA-1 syntax to a safe subset of course.\n>\n> > I have tried to use shallow-exclude with a follow on git fetch\n> > --deepen=1, but it always returns \"fatal: error in object; unshallow\n> > <sha1>\"\n> --\n> Duy\n"},{"id":"369802","messageId":"CACsJy8D9h2yT18V6pH+TKOaFPNQUf=Gd6YtgVkqUW_hvS1ZFaA@mail.gmail.com","threadId":"50543","inReplyTo":"CAApa7v_noujdWcogGNJUS7ZJRzPRxK5PPv53tST-0JoEk8+9Mw@mail.gmail.com","subject":"Re: Feature Request git clone shallow-include","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-02-21T13:06:29Z","receivedAt":"2019-02-21T13:06:58Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Feb 21, 2019 at 1:07 AM Joe Enzminger\n<joe.enzminger@exactasystems.com> wrote:\n>\n> That is correct.  What you suggest is actually what I tried (using\n> sha-1 syntax).  For my purposes, excluding the tag's parent's but\n> including the tag is sufficient, but if is fairly straightforward to\n> extend support to the other use cases I'm sure someone would find is\n> useful.\n\nIt's not hard to do. I hope I will find some time to do it soon. My\nonly concern is whether reuse the current code or write new. The\nformer makes it easy to accidentally accept some extended sha-1 syntax\nthat should not run on the server side. On the other hand, the latter\nwill not be as thoroughly tested because it only runs by shallow code.\nThat's my problem though. I think I might be able to find a third\noption somewhere in between.\n\n>\n> Joe\n>\n>\n> On Tue, Feb 19, 2019 at 7:22 PM Duy Nguyen <pclouds@gmail.com> wrote:\n> >\n> > On Wed, Feb 20, 2019 at 7:07 AM Joe Enzminger\n> > <joe.enzminger@exactasystems.com> wrote:\n> > >\n> > > Currently, git clone supports shallow-exclude=<tag-name>.  The client\n> > > will clone up to, but not including, the commit with the tag.\n> > >\n> > > It would be useful to have the ability to include the commit with the\n> > > tag.  The suggestion would be to add a \"shallow-include\" options to\n> > > clone to support this behavior.\n> >\n> > So exclude the tag's parents and everything before, but keep the tag, correct?\n> >\n> > I think if we support --shallow-exclude=<tag>^ then it should work the\n> > way you want (if the tag is a normal merge you may need to add\n> > --shallow-exclude=<tag>^2 as well). And you can do even fancier thing\n> > like --shallow-exclude=<tag>~3 (i.e. exclude the  grand grand parent\n> > of the tag, but keep the tag and grand parents). We will need to\n> > restrict extended SHA-1 syntax to a safe subset of course.\n> >\n> > > I have tried to use shallow-exclude with a follow on git fetch\n> > > --deepen=1, but it always returns \"fatal: error in object; unshallow\n> > > <sha1>\"\n> > --\n> > Duy\n\n\n\n-- \nDuy\n"},{"id":"372734","messageId":"CAApa7v9-2BhTQgt_Vd1mLACsrR2ZhYRBRrNTx2HDrEKXuHVSXw@mail.gmail.com","threadId":"50543","inReplyTo":"CACsJy8D9h2yT18V6pH+TKOaFPNQUf=Gd6YtgVkqUW_hvS1ZFaA@mail.gmail.com","subject":"Re: Feature Request git clone shallow-include","fromName":"Joe Enzminger","fromEmail":"joe.enzminger@exactasystems.com","sentAt":"2019-03-29T22:02:08Z","receivedAt":"2019-03-29T22:02:23Z","isPatch":false,"sender":{"key":"joe.enzminger@exactasystems.com","avatar":null},"body":"Duy -\n\nAny updates on this feature request?\n\nJoe\n\nOn Thu, Feb 21, 2019 at 7:06 AM Duy Nguyen <pclouds@gmail.com> wrote:\n>\n> On Thu, Feb 21, 2019 at 1:07 AM Joe Enzminger\n> <joe.enzminger@exactasystems.com> wrote:\n> >\n> > That is correct.  What you suggest is actually what I tried (using\n> > sha-1 syntax).  For my purposes, excluding the tag's parent's but\n> > including the tag is sufficient, but if is fairly straightforward to\n> > extend support to the other use cases I'm sure someone would find is\n> > useful.\n>\n> It's not hard to do. I hope I will find some time to do it soon. My\n> only concern is whether reuse the current code or write new. The\n> former makes it easy to accidentally accept some extended sha-1 syntax\n> that should not run on the server side. On the other hand, the latter\n> will not be as thoroughly tested because it only runs by shallow code.\n> That's my problem though. I think I might be able to find a third\n> option somewhere in between.\n>\n> >\n> > Joe\n> >\n> >\n> > On Tue, Feb 19, 2019 at 7:22 PM Duy Nguyen <pclouds@gmail.com> wrote:\n> > >\n> > > On Wed, Feb 20, 2019 at 7:07 AM Joe Enzminger\n> > > <joe.enzminger@exactasystems.com> wrote:\n> > > >\n> > > > Currently, git clone supports shallow-exclude=<tag-name>.  The client\n> > > > will clone up to, but not including, the commit with the tag.\n> > > >\n> > > > It would be useful to have the ability to include the commit with the\n> > > > tag.  The suggestion would be to add a \"shallow-include\" options to\n> > > > clone to support this behavior.\n> > >\n> > > So exclude the tag's parents and everything before, but keep the tag, correct?\n> > >\n> > > I think if we support --shallow-exclude=<tag>^ then it should work the\n> > > way you want (if the tag is a normal merge you may need to add\n> > > --shallow-exclude=<tag>^2 as well). And you can do even fancier thing\n> > > like --shallow-exclude=<tag>~3 (i.e. exclude the  grand grand parent\n> > > of the tag, but keep the tag and grand parents). We will need to\n> > > restrict extended SHA-1 syntax to a safe subset of course.\n> > >\n> > > > I have tried to use shallow-exclude with a follow on git fetch\n> > > > --deepen=1, but it always returns \"fatal: error in object; unshallow\n> > > > <sha1>\"\n> > > --\n> > > Duy\n>\n>\n>\n> --\n> Duy\n"},{"id":"372797","messageId":"CACsJy8BQStYZrTi6Pfrq+TDy-1d74cpS=+8QTr3DDJwgb3ZB9A@mail.gmail.com","threadId":"50543","inReplyTo":"CAApa7v9-2BhTQgt_Vd1mLACsrR2ZhYRBRrNTx2HDrEKXuHVSXw@mail.gmail.com","subject":"Re: Feature Request git clone shallow-include","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-03-30T11:38:34Z","receivedAt":"2019-03-30T11:39:02Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Mar 30, 2019 at 5:02 AM Joe Enzminger\n<joe.enzminger@exactasystems.com> wrote:\n>\n> Duy -\n>\n> Any updates on this feature request?\n\nNope. I've been busy with other stuff. I did have a look at the\npossibility of reusing code in sha1-name.c and concluded that it's not\nquite safe.\n\n> Joe\n>\n> On Thu, Feb 21, 2019 at 7:06 AM Duy Nguyen <pclouds@gmail.com> wrote:\n> >\n> > On Thu, Feb 21, 2019 at 1:07 AM Joe Enzminger\n> > <joe.enzminger@exactasystems.com> wrote:\n> > >\n> > > That is correct.  What you suggest is actually what I tried (using\n> > > sha-1 syntax).  For my purposes, excluding the tag's parent's but\n> > > including the tag is sufficient, but if is fairly straightforward to\n> > > extend support to the other use cases I'm sure someone would find is\n> > > useful.\n> >\n> > It's not hard to do. I hope I will find some time to do it soon. My\n> > only concern is whether reuse the current code or write new. The\n> > former makes it easy to accidentally accept some extended sha-1 syntax\n> > that should not run on the server side. On the other hand, the latter\n> > will not be as thoroughly tested because it only runs by shallow code.\n> > That's my problem though. I think I might be able to find a third\n> > option somewhere in between.\n> >\n> > >\n> > > Joe\n> > >\n> > >\n> > > On Tue, Feb 19, 2019 at 7:22 PM Duy Nguyen <pclouds@gmail.com> wrote:\n> > > >\n> > > > On Wed, Feb 20, 2019 at 7:07 AM Joe Enzminger\n> > > > <joe.enzminger@exactasystems.com> wrote:\n> > > > >\n> > > > > Currently, git clone supports shallow-exclude=<tag-name>.  The client\n> > > > > will clone up to, but not including, the commit with the tag.\n> > > > >\n> > > > > It would be useful to have the ability to include the commit with the\n> > > > > tag.  The suggestion would be to add a \"shallow-include\" options to\n> > > > > clone to support this behavior.\n> > > >\n> > > > So exclude the tag's parents and everything before, but keep the tag, correct?\n> > > >\n> > > > I think if we support --shallow-exclude=<tag>^ then it should work the\n> > > > way you want (if the tag is a normal merge you may need to add\n> > > > --shallow-exclude=<tag>^2 as well). And you can do even fancier thing\n> > > > like --shallow-exclude=<tag>~3 (i.e. exclude the  grand grand parent\n> > > > of the tag, but keep the tag and grand parents). We will need to\n> > > > restrict extended SHA-1 syntax to a safe subset of course.\n> > > >\n> > > > > I have tried to use shallow-exclude with a follow on git fetch\n> > > > > --deepen=1, but it always returns \"fatal: error in object; unshallow\n> > > > > <sha1>\"\n> > > > --\n> > > > Duy\n> >\n> >\n> >\n> > --\n> > Duy\n\n\n\n-- \nDuy\n"}]}