{"thread":{"id":"28467","subject":"deleting non-existent ref via push","startedAt":"2011-09-23T05:04:26Z","lastAt":"2011-09-24T03:11:28Z","messageCount":3,"participants":["Sitaram Chamarty","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"176041","messageId":"CAMK1S_gksrR800yJHSnQWDNeDvD75+3Rp+qRWCuUrQyWmNDMsA@mail.gmail.com","threadId":"28467","inReplyTo":null,"subject":"deleting non-existent ref via push","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2011-09-23T05:04:26Z","receivedAt":"2011-09-23T05:04:26Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"Hello,\n\nPushing to delete a non-existent ref (git push origin :refs/heads/foo)\nworks without error, except for a warning that the remote is \"Allowing\ndeletion of corrupt ref\".  By \"works\" I mean all hooks are also\nexecuted.\n\nIs this expected/supported behaviour?  Can I rely on it continuing to\nwork, especially in terms of executing hooks.\n\nSeem like a great way to \"poke\" a remote repo into executing hooks\nwithout having to make a dummy change and push :-)\n\n-- \nSitaram\n"},{"id":"176083","messageId":"7vmxdvunto.fsf@alter.siamese.dyndns.org","threadId":"28467","inReplyTo":"CAMK1S_gksrR800yJHSnQWDNeDvD75+3Rp+qRWCuUrQyWmNDMsA@mail.gmail.com","subject":"Re: deleting non-existent ref via push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-23T18:16:03Z","receivedAt":"2011-09-23T18:16:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n> Pushing to delete a non-existent ref (git push origin :refs/heads/foo)\n> works without error, except for a warning that the remote is \"Allowing\n> deletion of corrupt ref\".  By \"works\" I mean all hooks are also\n> executed.\n>\n> Is this expected/supported behaviour?  Can I rely on it continuing to\n> work, especially in terms of executing hooks.\n\nThis most definitely is just \"we didn't bother checking the error too\ncarefully, especially because the result of deleting something that did\nnot exist in the first place is a no-op; anybody who tries to delete a\nnon-existing thing is a moron and deserves whatever random result he\ngets\".\n\nIt would be a good idea to tighten it.\n"},{"id":"176114","messageId":"CAMK1S_jjr5Lr1_N1aeTxRiaebdxu5b6Y6LiryMSq6NmfArc=0g@mail.gmail.com","threadId":"28467","inReplyTo":"7vmxdvunto.fsf@alter.siamese.dyndns.org","subject":"Re: deleting non-existent ref via push","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2011-09-24T03:11:28Z","receivedAt":"2011-09-24T03:11:28Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Fri, Sep 23, 2011 at 11:46 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Sitaram Chamarty <sitaramc@gmail.com> writes:\n>\n>> Pushing to delete a non-existent ref (git push origin :refs/heads/foo)\n>> works without error, except for a warning that the remote is \"Allowing\n>> deletion of corrupt ref\".  By \"works\" I mean all hooks are also\n>> executed.\n>>\n>> Is this expected/supported behaviour?  Can I rely on it continuing to\n>> work, especially in terms of executing hooks.\n>\n> This most definitely is just \"we didn't bother checking the error too\n> carefully, especially because the result of deleting something that did\n> not exist in the first place is a no-op; anybody who tries to delete a\n> non-existing thing is a moron and deserves whatever random result he\n\nI'd better hide behind the fact that I am only doing it for the\nside-effect then ;-)\n\n> gets\".\n>\n> It would be a good idea to tighten it.\n\nThanks.  I just needed to know if I could rely on it long-term or not.\n I'll find some other way to \"poke\" a remote repo to run the hooks.\n"}]}