git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] push: don't guess at qualifying remote refs on deletion

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 3, 2012, 19:38 UTC
Message-ID
<7vipe4vdnh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120703180439.GC3294@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> Instead, we can just be more succinct and say "we can't
> delete this because we couldn't find it". So before:
>
>   $ git push origin :bogus
>   error: unable to push to unqualified destination: bogus
>   The destination refspec neither matches an existing ref on the remote nor
>   begins with refs/, and we are unable to guess a prefix based on the source ref.
>   error: failed to push some refs to '$URL'
>
> and now:
>
>   $ git push origin :bogus
>   error: unable to delete 'bogus': remote ref does not exist
>   error: failed to push some refs to '$URL'

This is telling a truth ($GIT_DIR/refs/bogus does not exist) but not the whole truth; while I tend to agree that it is better than the original (especially with ", and we are unable to guess..." part), given that the above request would delete refs/tags/bogus or refs/heads/bogus if they existed on the "origin", I am a bit worried that it may send an incorrect message to novice users.

    unable to delete 'bogus': no branch or tag with that name

might allay my worries, but I am not extremely happy with that wording, either.

Show 6 quoted lines
> I think this would help. I used "remote ref does not exist"
> because that is the simplest explanation for the user.
> However, given that we will try to push a fully qualified
> ref that does not exist, a more accurate message might
> "destination refspec did not match" or something similar.  I
> prefer the former, though, as it less arcane.
Yeah, I do understand why you phrased that way, but still..
Previous: Carlos Martín NietoNext: Jeff King
Message 10 of 17 in “How do I delete a remote branch with a period in the name?”
  1. jonsmirl@gmail.comJul 3, 2012
  2. Junio C HamanoJul 3, 2012
  3. jonsmirl@gmail.comJul 3, 2012
  4. push: don't guess at qualifying remote refs on deletionJeff King, Jul 3, 2012
  5. jonsmirl@gmail.comJul 3, 2012
  6. Jeff KingJul 3, 2012
  7. jonsmirl@gmail.comJul 3, 2012
  8. Jeff KingJul 3, 2012
  9. Carlos Martín NietoJul 4, 2012
  10. Junio C HamanoJul 3, 2012
  11. Jeff KingJul 4, 2012
  12. Andreas SchwabJul 3, 2012
  13. Junio C HamanoJul 3, 2012
  14. Carlos Martín NietoJul 5, 2012
  15. Phil HordJul 5, 2012
  16. Carlos Martín NietoJul 5, 2012
  17. Junio C HamanoJul 5, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.