git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* deleting non-existent ref via push
@ 2011-09-23  5:04 Sitaram Chamarty
  2011-09-23 18:16 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Sitaram Chamarty @ 2011-09-23  5:04 UTC (permalink / raw)
  To: Git Mailing List

Hello,

Pushing to delete a non-existent ref (git push origin :refs/heads/foo)
works without error, except for a warning that the remote is "Allowing
deletion of corrupt ref".  By "works" I mean all hooks are also
executed.

Is this expected/supported behaviour?  Can I rely on it continuing to
work, especially in terms of executing hooks.

Seem like a great way to "poke" a remote repo into executing hooks
without having to make a dummy change and push :-)

-- 
Sitaram

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

* Re: deleting non-existent ref via push
  2011-09-23  5:04 deleting non-existent ref via push Sitaram Chamarty
@ 2011-09-23 18:16 ` Junio C Hamano
  2011-09-24  3:11   ` Sitaram Chamarty
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2011-09-23 18:16 UTC (permalink / raw)
  To: Sitaram Chamarty; +Cc: Git Mailing List

Sitaram Chamarty <sitaramc@gmail.com> writes:

> Pushing to delete a non-existent ref (git push origin :refs/heads/foo)
> works without error, except for a warning that the remote is "Allowing
> deletion of corrupt ref".  By "works" I mean all hooks are also
> executed.
>
> Is this expected/supported behaviour?  Can I rely on it continuing to
> work, especially in terms of executing hooks.

This most definitely is just "we didn't bother checking the error too
carefully, especially because the result of deleting something that did
not exist in the first place is a no-op; anybody who tries to delete a
non-existing thing is a moron and deserves whatever random result he
gets".

It would be a good idea to tighten it.

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

* Re: deleting non-existent ref via push
  2011-09-23 18:16 ` Junio C Hamano
@ 2011-09-24  3:11   ` Sitaram Chamarty
  0 siblings, 0 replies; 3+ messages in thread
From: Sitaram Chamarty @ 2011-09-24  3:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

On Fri, Sep 23, 2011 at 11:46 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Sitaram Chamarty <sitaramc@gmail.com> writes:
>
>> Pushing to delete a non-existent ref (git push origin :refs/heads/foo)
>> works without error, except for a warning that the remote is "Allowing
>> deletion of corrupt ref".  By "works" I mean all hooks are also
>> executed.
>>
>> Is this expected/supported behaviour?  Can I rely on it continuing to
>> work, especially in terms of executing hooks.
>
> This most definitely is just "we didn't bother checking the error too
> carefully, especially because the result of deleting something that did
> not exist in the first place is a no-op; anybody who tries to delete a
> non-existing thing is a moron and deserves whatever random result he

I'd better hide behind the fact that I am only doing it for the
side-effect then ;-)

> gets".
>
> It would be a good idea to tighten it.

Thanks.  I just needed to know if I could rely on it long-term or not.
 I'll find some other way to "poke" a remote repo to run the hooks.

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

end of thread, other threads:[~2011-09-24  3:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-23  5:04 deleting non-existent ref via push Sitaram Chamarty
2011-09-23 18:16 ` Junio C Hamano
2011-09-24  3:11   ` Sitaram Chamarty

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 NNTP newsgroup(s).